ikrs.httpd
Class ModuleCommandFactory

java.lang.Object
  extended by ikrs.util.AbstractCommandFactory<Command>
      extended by ikrs.util.DefaultCommandFactory
          extended by ikrs.httpd.ModuleCommandFactory
All Implemented Interfaces:
CommandFactory<Command>

public class ModuleCommandFactory
extends DefaultCommandFactory

Problem: the ModuleCommand/~Factory would require an HTTPHandler instance to be passed on system start. But the system instantiates the HTTPHandler at a later point by added a new handler to the yucca server. So the factory requires the handler on instantiation and vice versa. To solve this problem the handler stores the first instance that was created in a static attribute. When called the ModuleCommand tries to access this field. Warning: this only works if HTTP config uses a shared instance for _all_ listening ports. See the 'sharedHandlerInstance' attribute in the ikrs.httpd.conf file (server node). If the 'sharedHandlerInstance' is not set Yucca will create different handler instances for each 'server' tag. In this case the command will only work for the first handler instance created.


Constructor Summary
ModuleCommandFactory()
           
 
Method Summary
 ModuleCommand make(java.lang.String name, BasicType[] params)
          Make a new Command with the given name and params.
 
Methods inherited from class ikrs.util.DefaultCommandFactory
addSupportedCommand, getSupportedCommands
 
Methods inherited from class ikrs.util.AbstractCommandFactory
getParentFactory, make, make, parse, setParentFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ikrs.util.CommandFactory
getParentFactory, make, parse, setParentFactory
 

Constructor Detail

ModuleCommandFactory

public ModuleCommandFactory()
Method Detail

make

public ModuleCommand make(java.lang.String name,
                          BasicType[] params)
                   throws UnknownCommandException,
                          CommandStringIncompleteException
Make a new Command with the given name and params.

Specified by:
make in interface CommandFactory<Command>
Overrides:
make in class DefaultCommandFactory
Parameters:
name - The command's name.
params - The command's params - in BasicType representation.
Returns:
The new command.
Throws:
UnknownCommandException
CommandStringIncompleteException