Interface IServerModule<OBJECT>
- All Known Implementing Classes:
FileUploadModule, IP2LocationModule, 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
Modifier and TypeMethodDescriptionvoiddispose()Disposes of this server module.Gets the description.Gets the name of the module.initialize(IServer server) Initializes the module end point constructor.voidonServerReady(IServer server) Called when the server is ready.default intprocessServerArg(String[] args, String param, int index) Processes command line arguments for the module in question.
Method Details
processServerArg
Processes command line arguments for the module in question. The launcher offers every option that none of its own switches knows to the modules loaded before it on the command line, in their order; the first module that consumes the option wins and the argument loop goes on after what it consumed. An option no module consumes is refused as "Unknown option".- Parameters:
args- The arguments on the command line.param- The option in lower case, generally starting with "-" or "/".index- The index inargsof the option's first parameter. It is present: like every option of the launcher, a module option takes at least one parameter.- Returns:
- The number of arguments consumed from
indexon (at least one to take the option), zero when the option is not this module's.
getModuleName
String getModuleName()Gets the name of the module.- Returns:
- A name such as "Load Balancer" or "License Manager".
getModuleDescripion
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
Initializes the module end point constructor.- Parameters:
server- The server instance.- Returns:
- The end point constructor.
- Throws:
Exception- For failures: the module will not be used...
onServerReady
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.