Package org.openas2.cmd.processor
Class BaseCommandProcessor
- java.lang.Object
-
- org.openas2.cmd.processor.BaseCommandProcessor
-
- All Implemented Interfaces:
CommandProcessor,Component,HasSchedule
- Direct Known Subclasses:
RestCommandProcessor,SocketCommandProcessor,StreamCommandProcessor
public abstract class BaseCommandProcessor extends java.lang.Object implements CommandProcessor, Component, HasSchedule
-
-
Constructor Summary
Constructors Constructor Description BaseCommandProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddCommands(CommandRegistry reg)voiddestroy()Component lifecycle hook.java.util.List<Command>getCommands()java.lang.StringgetName()Returns a name for the component.java.util.Map<java.lang.String,java.lang.String>getParameters()Returns the parameters used to initialize this Component, and can also be used to modify parameters.SessiongetSession()Returns the Session used to initialize this Component.voidinit(Session session, java.util.Map<java.lang.String,java.lang.String> parameters)Component lifecycle hook.abstract voidprocessCommand()voidschedule(java.util.concurrent.ScheduledExecutorService executor)voidterminate()
-
-
-
Method Detail
-
getCommands
public java.util.List<Command> getCommands()
- Specified by:
getCommandsin interfaceCommandProcessor
-
getName
public java.lang.String getName()
Description copied from interface:ComponentReturns a name for the component. These names are not guaranteed to be unique, and are intended for display and logging. Generally this is the class name of the Component object, without package information.
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters) throws OpenAS2Exception
Description copied from interface:ComponentComponent lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
initin interfaceComponent- Parameters:
session- the component uses this object to access other componentsparameters- configuration values for the component- Throws:
OpenAS2Exception- If an error occurs while initializing the component- See Also:
Session
-
getParameters
public java.util.Map<java.lang.String,java.lang.String> getParameters()
Description copied from interface:ComponentReturns the parameters used to initialize this Component, and can also be used to modify parameters.- Specified by:
getParametersin interfaceComponent- Returns:
- map of parameter name to parameter value
-
getSession
public Session getSession()
Description copied from interface:ComponentReturns the Session used to initialize this Component. The returned session is also used to locate other components if needed.- Specified by:
getSessionin interfaceComponent- Returns:
- this component's session
-
processCommand
public abstract void processCommand() throws java.lang.Exception- Specified by:
processCommandin interfaceCommandProcessor- Throws:
java.lang.Exception
-
addCommands
public void addCommands(CommandRegistry reg)
- Specified by:
addCommandsin interfaceCommandProcessor
-
terminate
public void terminate() throws java.lang.Exception- Specified by:
terminatein interfaceCommandProcessor- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.ExceptionDescription copied from interface:ComponentComponent lifecycle hook. If lifecycle ofComponentrequires a destroy function this method can be used.- Specified by:
destroyin interfaceComponent- Throws:
java.lang.Exception- Something went wrong- See Also:
Component.init(Session, Map),Session
-
schedule
public void schedule(java.util.concurrent.ScheduledExecutorService executor) throws OpenAS2Exception- Specified by:
schedulein interfaceHasSchedule- Throws:
OpenAS2Exception
-
-