|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
isc.util.ServerAdmin
public class ServerAdmin
ServerAdmin is a utility class for managing administration and communication for the daemon.
The client/server communication mechanism is controlled in the config file. Refer to the appropriate communciation documentation for specific details. The rmi class and registered name is specified with the following properties.
Setting local only will block exporting all remote interfaces. Note. in this
mode, the server should be shutdown by a ^c or a kill.
Admin.LOCAL_ONLY=true
Admin.JNDIClass=
Admin.NAMING_ADMIN_NAME=
Uncomment the appropriate lines in the config file to use that mechanism.
!=====================================================================
!
Define the Admin External JNDI interface
!=====================================================================
!
LDAP Directory based interface
!----------------------------------------------------------------
Admin.JNDIClass=isc.util.ServerAdminLDAP
Admin.NAMING_PROVIDER_URL=ldap://localhost:389/o=jndiObjects
Admin.NAMING_INITIAL_CONTEXT_FACTORY=com.sun.jndi.ldap.LdapCtxFactory
Admin.NAMING_URL_PKG_PREFIXES=com.sun.jndi.ldap
Admin.NAMING_USER=cn=Manager,o=jndiObjects
Admin.NAMING_PW=secret
Admin.NAMING_ADMIN_NAME=cn=sensor ! Non-LDAP interfaces
!----------------------------------------------------------------
!Admin.JNDIClass=isc.util.ServerAdmin
!Admin.NAMING_ADMIN_NAME=sensor ! RMI Naming
!----------------------------------------------------------------
!Admin.NAMING_CONTEXT_CLASS=Context
!Admin.NAMING_PROVIDER_URL=rmi://localhost:1090
!Admin.NAMING_INITIAL_CONTEXT_FACTORY=com.sun.jndi.rmi.registry.RegistryContextFactory
!Admin.NAMING_URL_PKG_PREFIXES=com.sun.jndi.ldap ! JBoss Naming
!----------------------------------------------------------------
!Admin.NAMING_CONTEXT_CLASS=Context
!Admin.NAMING_PROVIDER_URL=jnp://localhost:1099
!Admin.NAMING_INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
!Admin.NAMING_URL_PKG_PREFIXES=org.jboss.naming:org.jnp.interfaces
Field Summary | |
---|---|
protected javax.naming.Context |
ctx
|
protected static org.apache.log4j.Logger |
log
log4j |
protected static java.lang.String |
PROP_ADMIN_LOCALONLY
|
protected static java.lang.String |
PROP_NAMING_ADMIN_NAME
|
protected static java.lang.String |
PROP_NAMING_CONTEXT_FACTORY
|
protected static java.lang.String |
PROP_NAMING_URL
|
protected static java.lang.String |
PROP_NAMING_URL_PKG_PREFIXES
|
protected AppProperties |
props
|
protected boolean |
running
|
protected static long |
serialVersionUID
|
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
ServerAdmin()
Create a ServerAdmin service for server. |
|
ServerAdmin(int port)
Create a serverAdmin service using a specific port. |
|
ServerAdmin(int port,
java.rmi.server.RMIClientSocketFactory csf,
java.rmi.server.RMIServerSocketFactory ssf)
|
Method Summary | |
---|---|
protected void |
init()
Initialize this service. |
void |
run()
|
boolean |
ServerRunning()
detect if the server is running |
boolean |
setlogging(java.lang.String property)
set a log4j property and reset the logging to use the new properties. |
int |
shutdown(long time)
Shutdown the server |
protected boolean |
useLocalOnly()
|
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final long serialVersionUID
protected volatile boolean running
protected AppProperties props
protected static org.apache.log4j.Logger log
protected static final java.lang.String PROP_NAMING_URL
protected static final java.lang.String PROP_NAMING_CONTEXT_FACTORY
protected static final java.lang.String PROP_NAMING_URL_PKG_PREFIXES
protected static final java.lang.String PROP_NAMING_ADMIN_NAME
protected static final java.lang.String PROP_ADMIN_LOCALONLY
protected javax.naming.Context ctx
Constructor Detail |
---|
public ServerAdmin() throws java.rmi.RemoteException
java.rmi.RemoteException
- if the remote communications setup failedpublic ServerAdmin(int port) throws java.rmi.RemoteException
port
- Port to listen on
java.rmi.RemoteException
- if the communications setup failspublic ServerAdmin(int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf) throws java.rmi.RemoteException
java.rmi.RemoteException
Method Detail |
---|
protected void init()
public int shutdown(long time) throws java.rmi.RemoteException
ServerAdminIF
shutdown
in interface ServerAdminIF
time
- specified in milliseconds. -1 will force an immediate exit in the process
java.rmi.RemoteException
- if the communications failedpublic boolean setlogging(java.lang.String property) throws java.rmi.RemoteException
ServerAdminIF
setlogging
in interface ServerAdminIF
property
- The log4j property in the form of key=value
java.rmi.RemoteException
- if the communications failedAppProperties
public void run()
run
in interface java.lang.Runnable
public boolean ServerRunning()
protected boolean useLocalOnly()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |