Package org.openas2.processor.receiver
Class NetModule
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.processor.BaseProcessorModule
-
- org.openas2.processor.BaseActiveModule
-
- org.openas2.processor.receiver.BaseReceiverModule
-
- org.openas2.processor.receiver.NetModule
-
- All Implemented Interfaces:
Component
,ActiveModule
,ProcessorModule
,ReceiverModule
- Direct Known Subclasses:
AS2MDNReceiverModule
,AS2ReceiverModule
,HealthCheckModule
public abstract class NetModule extends BaseReceiverModule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
NetModule.ConnectionHandler
protected class
NetModule.HTTPServerThread
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_ERRORS
private org.apache.commons.logging.Log
logger
private NetModule.HTTPServerThread
mainThread
static java.lang.String
PARAM_ADDRESS
static java.lang.String
PARAM_ERROR_DIRECTORY
static java.lang.String
PARAM_ERRORS
static java.lang.String
PARAM_PORT
static java.lang.String
PARAM_PROTOCOL
static java.lang.String
PARAM_SSL_KEYSTORE
static java.lang.String
PARAM_SSL_KEYSTORE_PASSWORD
static java.lang.String
PARAM_SSL_PROTOCOL
-
Constructor Summary
Constructors Constructor Description NetModule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doStart()
void
doStop()
protected abstract NetModuleHandler
getHandler()
protected void
handleError(Message msg, OpenAS2Exception oae)
boolean
healthcheck(java.util.List<java.lang.String> failures)
When invoked, the module must run a self check to verify it is functioning correctly.void
init(Session session, java.util.Map<java.lang.String,java.lang.String> options)
Component lifecycle hook.-
Methods inherited from class org.openas2.processor.BaseActiveModule
canHandle, forceStop, handle, isRunning, start, stop, toString
-
Methods inherited from class org.openas2.BaseComponent
destroy, getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openas2.processor.ActiveModule
isRunning, start, stop
-
Methods inherited from interface org.openas2.Component
destroy, getName, getParameters, getSession
-
Methods inherited from interface org.openas2.processor.ProcessorModule
canHandle, handle
-
-
-
-
Field Detail
-
PARAM_ADDRESS
public static final java.lang.String PARAM_ADDRESS
- See Also:
- Constant Field Values
-
PARAM_PORT
public static final java.lang.String PARAM_PORT
- See Also:
- Constant Field Values
-
PARAM_PROTOCOL
public static final java.lang.String PARAM_PROTOCOL
- See Also:
- Constant Field Values
-
PARAM_SSL_KEYSTORE
public static final java.lang.String PARAM_SSL_KEYSTORE
- See Also:
- Constant Field Values
-
PARAM_SSL_KEYSTORE_PASSWORD
public static final java.lang.String PARAM_SSL_KEYSTORE_PASSWORD
- See Also:
- Constant Field Values
-
PARAM_SSL_PROTOCOL
public static final java.lang.String PARAM_SSL_PROTOCOL
- See Also:
- Constant Field Values
-
PARAM_ERROR_DIRECTORY
public static final java.lang.String PARAM_ERROR_DIRECTORY
- See Also:
- Constant Field Values
-
PARAM_ERRORS
public static final java.lang.String PARAM_ERRORS
- See Also:
- Constant Field Values
-
DEFAULT_ERRORS
public static final java.lang.String DEFAULT_ERRORS
- See Also:
- Constant Field Values
-
mainThread
private NetModule.HTTPServerThread mainThread
-
logger
private org.apache.commons.logging.Log logger
-
-
Method Detail
-
doStart
public void doStart() throws OpenAS2Exception
- Specified by:
doStart
in classBaseActiveModule
- Throws:
OpenAS2Exception
-
doStop
public void doStop() throws OpenAS2Exception
- Specified by:
doStop
in classBaseActiveModule
- Throws:
OpenAS2Exception
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> options) throws OpenAS2Exception
Description copied from interface:Component
Component 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:
init
in interfaceComponent
- Overrides:
init
in classBaseComponent
- Parameters:
session
- the component uses this object to access other componentsoptions
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
healthcheck
public boolean healthcheck(java.util.List<java.lang.String> failures)
Description copied from interface:ActiveModule
When invoked, the module must run a self check to verify it is functioning correctly. Any failures must be reported in the failures list passed in to the method by the callee- Specified by:
healthcheck
in interfaceActiveModule
- Specified by:
healthcheck
in classBaseActiveModule
- Parameters:
failures
- - a list of failures if any occur- Returns:
- - true if module has no problems otherwise false ith failure messages in passed in List
-
getHandler
protected abstract NetModuleHandler getHandler()
-
handleError
protected void handleError(Message msg, OpenAS2Exception oae)
-
-