com.javageeks.gjas
Class RMIServerManagerServer
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--com.javageeks.gjas.RMIServerManagerServer
- All Implemented Interfaces:
- IRemoteServerManager, java.rmi.Remote, java.io.Serializable
- public class RMIServerManagerServer
- extends java.rmi.server.UnicastRemoteObject
- implements IRemoteServerManager
- See Also:
- Serialized Form
Fields inherited from class java.rmi.server.RemoteObject |
ref |
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 |
RMIServerManagerServer
public RMIServerManagerServer(IServerManager svrMgr)
throws java.rmi.RemoteException
remoteShutdown
public void remoteShutdown()
throws java.rmi.RemoteException
- Shut the entire system down, usually in preparation for terminating
this VM (or perhaps for doing a complete shutdown/restart cycling).
Effectively, this is the same as calling
getServices
to get all
Servers' instanceIDs, then calling removeService
on each one.
- Specified by:
remoteShutdown
in interface IRemoteServerManager
remoteDeployService
public void remoteDeployService(java.lang.String serviceName,
ClassLoaderStrategy strategy)
throws java.rmi.RemoteException
- "Deploy" this Service to the ServerManager
- Specified by:
remoteDeployService
in interface IRemoteServerManager
remoteLoadService
public IServer remoteLoadService(java.lang.String svcName)
throws java.rmi.RemoteException
- Add this Service from the deployed Services
- Specified by:
remoteLoadService
in interface IRemoteServerManager
remoteLoadService
public IServer remoteLoadService(Service svc)
throws java.rmi.RemoteException
- Add the loaded Service to the list of Servers and start it. We throw away
the return value from the LocalServerManager call (the LocalServer instance)
because we need to construct an RMIServer instance to give back to the
RMI caller.
- Specified by:
remoteLoadService
in interface IRemoteServerManager
remoteAddService
public IServer remoteAddService(java.lang.String svcName,
ConfigProperties args)
throws java.rmi.RemoteException
- Add this Service from the deployed Services
- Specified by:
remoteAddService
in interface IRemoteServerManager
remoteAddService
public IServer remoteAddService(Service svc,
ConfigProperties args)
throws java.rmi.RemoteException
- Add the loaded Service to the list of Servers and start it. We throw away
the return value from the LocalServerManager call (the LocalServer instance)
because we need to construct an RMIServer instance to give back to the
RMI caller.
- Specified by:
remoteAddService
in interface IRemoteServerManager
remoteRemoveService
public void remoteRemoveService(java.lang.String instanceID)
throws java.rmi.RemoteException
- Attempt to stop (if necessary) and remove an instance of a Server.
Because it's possible that multiple Servers of a given type can be
running simultaneously (for example, sockets-based Services listening
on multiple ports), we need to have the user identify which Server
they wish shut down by using the Server instance's instanceID.
- Specified by:
remoteRemoveService
in interface IRemoteServerManager
remoteKillService
public void remoteKillService(java.lang.String instanceID)
throws java.rmi.RemoteException
- Try to kill the Service--don't try to stop() it
- Specified by:
remoteKillService
in interface IRemoteServerManager
remoteGetServices
public java.lang.String[] remoteGetServices()
throws java.rmi.RemoteException
- Obtain a list of every Server instance running in the system.
- Specified by:
remoteGetServices
in interface IRemoteServerManager
remoteGetService
public IServer remoteGetService(java.lang.String instanceID)
throws java.rmi.RemoteException
- Obtain a reference to a Server instance by ID. If it can't be found
(perhaps it's shut down since the user obtained the ID?), then return
a null instance.
- Specified by:
remoteGetService
in interface IRemoteServerManager
remoteLog
public void remoteLog(java.lang.String msg)
throws java.rmi.RemoteException
- Specified by:
remoteLog
in interface IRemoteServerManager
remoteLog
public void remoteLog(java.lang.Exception ex)
throws java.rmi.RemoteException
- Specified by:
remoteLog
in interface IRemoteServerManager
remoteError
public void remoteError(java.lang.String msg)
throws java.rmi.RemoteException
- Specified by:
remoteError
in interface IRemoteServerManager
remoteError
public void remoteError(java.lang.Exception ex)
throws java.rmi.RemoteException
- Specified by:
remoteError
in interface IRemoteServerManager
start
public boolean start(long ID)
throws java.rmi.RemoteException
- Specified by:
start
in interface IRemoteServerManager
stop
public boolean stop(long ID)
throws java.rmi.RemoteException
- Specified by:
stop
in interface IRemoteServerManager
pause
public boolean pause(long ID)
throws java.rmi.RemoteException
- Specified by:
pause
in interface IRemoteServerManager
resume
public boolean resume(long ID)
throws java.rmi.RemoteException
- Specified by:
resume
in interface IRemoteServerManager
kill
public void kill(long ID)
throws java.rmi.RemoteException
- Specified by:
kill
in interface IRemoteServerManager
getState
public java.lang.String getState(long ID)
throws java.rmi.RemoteException
- Specified by:
getState
in interface IRemoteServerManager
getInstanceID
public java.lang.String getInstanceID(long ID)
throws java.rmi.RemoteException
- Specified by:
getInstanceID
in interface IRemoteServerManager
getLastError
public java.lang.Exception getLastError(long ID)
throws java.rmi.RemoteException
- Specified by:
getLastError
in interface IRemoteServerManager
getConfigInfo
public ConfigProperties getConfigInfo(long ID)
throws java.rmi.RemoteException
- Specified by:
getConfigInfo
in interface IRemoteServerManager
setConfigInfo
public void setConfigInfo(long ID,
ConfigProperties info)
throws java.rmi.RemoteException
- Specified by:
setConfigInfo
in interface IRemoteServerManager
main
public static void main(java.lang.String[] args)
throws java.lang.Exception