Package com.iizix.server.modules
Interface IServerModule<OBJECT>
- All Known Implementing Classes:
LoadBalancer
public interface IServerModule<OBJECT>
Interface implemented by a server module that wish to implement an end-point and act as a remote party accepter. Typical use for modules are e.g. load balancing and license manager.- Author:
- Christopher Mindus
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
dispose()
Disposes of this server module.java.lang.String
getModuleDescripion()
Gets the description.java.lang.String
getModuleName()
Gets the name of the module.IEndPointConstructor<OBJECT>
initialize(IServer server)
Initializes the module end point constructor.void
onServerReady(IServer server)
Called when the server is ready.default int
processServerArg(java.lang.String[] args, java.lang.String param, int index)
Processes command line arguments for the module in question.
Method Detail
processServerArg
default int processServerArg(java.lang.String[] args, java.lang.String param, int index)
Processes command line arguments for the module in question.- Parameters:
args
- The arguments on the command line.param
- The parameter is lower case, generally starting with "-" or "/".index
- The next argument to read, might not be presentif ( ii >= args.length )
.- Returns:
- The number of arguments processed, zero for none.
getModuleName
java.lang.String getModuleName()
Gets the name of the module.- Returns:
- A name such as "Load Balancer" or "License Manager".
getModuleDescripion
java.lang.String getModuleDescripion()
Gets the description.- Returns:
- A descriptive text of the module such a "Load Balancer for servers in the co.iizi.* domain" or "Backup License Manager for com.domain.LicMan".
initialize
IEndPointConstructor<OBJECT> initialize(IServer server) throws java.lang.Exception
Initializes the module end point constructor.- Parameters:
server
- The server instance.- Returns:
- The end point constructor.
- Throws:
java.lang.Exception
- For failures: the module will not be used...
onServerReady
void onServerReady(IServer server)
Called when the server is ready. A server module that wishes to listen to when the server is going to be disposed can do so usingIServer.addDisposeListener(com.iizix.server.IServerDisposeListener)
at this stage.- Parameters:
server
- The server instance.
dispose
void dispose()
Disposes of this server module. After dispose is called anddispose()
has been called, the end point constructor is automatically removed and disposed of.