|
BEA Systems, Inc. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.connecterra.util.event.AbstractEventProcessor
com.bea.rfid.edge.toolkit.workflow.AbstractWorkflowModulePlugin
public abstract class AbstractWorkflowModulePlugin
Abstract base class for edge flow modules.
This class uses event handling mechanism used by the edge server to queue up incoming messages. This ensures that messages come into the module only one at a time and hence the module can assume single threaded operation for incoming messages.
This class also provides some utility methods -- to send output to other modules, to create output/input port plugin parameter meta group, to log messages to instance specific logger etc.
| Nested Class Summary | |
|---|---|
class |
AbstractWorkflowModulePlugin.OneWayInputPortImpl
Inner class implementation of OneWayInputPort. |
| Nested classes/interfaces inherited from class com.connecterra.util.event.AbstractEventProcessor |
|---|
AbstractEventProcessor.PeriodicEventHandle |
| Field Summary | |
|---|---|
protected static Port |
ERROR_OUT_PORT
Error output port that could be used by any module with error output port. |
protected static String |
ERROR_OUT_PORT_KEY
Name of the plugin configuration parameter for error output port. |
protected static String |
I18N_INPUT_PORTS_PARAM_GROUP
Internationalized name of the plugin configuration parameter that groups input ports. |
protected static String |
I18N_OUTPUT_PORTS_PARAM_GROUP
Internationalized name of the plugin configuration parameter that groups output ports. |
protected static String |
INPUT_PORTS_PARAM_GROUP
Name of the plugin configuration parameter that groups all input ports together. |
protected static String |
OUTPUT_PORTS_PARAM_GROUP
Name of the plugin configuration parameter that groups all output ports together. |
| Constructor Summary | |
|---|---|
AbstractWorkflowModulePlugin()
|
|
| Method Summary | |
|---|---|
static PluginParameterMeta |
createInputPortsSubConfig(DynamicConfigFactory factory,
List ports)
Utility method to create input ports sub-configuration parameter meta. |
protected abstract ModuleDescriptor |
createModuleDescriptor()
Abstract method that creates the module descriptor for this module. |
protected static PluginParameterMeta |
createOutputPortsSubConfig(DynamicConfigFactory factory,
List ports)
Utility method to create output ports sub-configuration parameter meta. |
protected void |
doStartup()
Any startup operations that need to be done for the module should go into this method. |
ModuleDescriptor |
getModuleDescriptor()
Returns ModuleDescriptor for this module. |
String |
getName()
Returns the name of this module. |
protected static List |
getOutputModulesList(PluginConfig config,
String paramName)
Utility method to get output modules list for a given output port parameter from a pluginconfig. |
static List |
getStringList(PluginConfig config,
String paramName)
Utility method to get a List |
static String |
getStringValue(PluginConfig config,
String paramName)
Utility method to get the string value for a given configuration parameter from the given plugin configuration. |
static String |
getStringValue(PluginConfig config,
String subConfigName,
String paramName)
Utility method to get the string value for a given configuration parameter with in the given sub-configuration from a plugin configuration. |
WorkflowManager |
getWorkflowManager()
Returns a reference to the workflow manager set up during initialization time. |
void |
initialize(String name,
WorkflowManager workflowManager)
Interface method implementation. |
protected void |
log(Level severity,
String errorMsg)
Utility method to log a message from a module. |
protected void |
log(Level severity,
String errorMsg,
Throwable thrown)
Utility method to log an exception from a module. |
void |
receiveMessage(Object msg,
String portName)
Accepts a message to the specified port of this module. |
protected void |
sendErrorOutput(Level severity,
String errorMsg,
Throwable exc)
Utility method to create an ErrorOutput object for an exception within a module and send it to error output modules. |
protected void |
sendToModules(Object msg,
List destList)
Utility method to send a message to a specified list of <module>:<port> strings. |
protected void |
setupErrorOutputs(PluginConfig config)
Extracts error destination configuration parameter values and saves it within the module. |
void |
shutdown()
Interface method implementation. |
void |
startup()
Interface method implementation. |
| Methods inherited from class com.connecterra.util.event.AbstractEventProcessor |
|---|
doASAP, doASAPOrBlock, doASAPOrDrop, doASAPOrThrow, doLater, doPeriodic, getEventReceiver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bea.rfid.edge.api.workflow.WorkflowModulePlugin |
|---|
configure |
| Methods inherited from interface com.connecterra.util.event.EventProcessor |
|---|
handleEvent |
| Field Detail |
|---|
protected static final String INPUT_PORTS_PARAM_GROUP
protected static final String I18N_INPUT_PORTS_PARAM_GROUP
protected static final String OUTPUT_PORTS_PARAM_GROUP
protected static final String I18N_OUTPUT_PORTS_PARAM_GROUP
protected static final String ERROR_OUT_PORT_KEY
protected static final Port ERROR_OUT_PORT
| Constructor Detail |
|---|
public AbstractWorkflowModulePlugin()
| Method Detail |
|---|
public void initialize(String name,
WorkflowManager workflowManager)
WorkflowManager which may
be used by the modules to get to other resources within the edge server.
createModuleDescriptor to set up
this module's ModuleDescriptor.
initialize in interface WorkflowModulePluginname - Name of this module.workflowManager - Reference to WorkflowManager that modules could use to get
to edge server servicespublic String getName()
WorkflowModulePlugin
getName in interface WorkflowModulePluginpublic ModuleDescriptor getModuleDescriptor()
WorkflowModulePluginModuleDescriptor for this module. The module descriptor
contains information about the input and output ports of the module.
getModuleDescriptor in interface WorkflowModulePluginModuleDescriptor for this module.public WorkflowManager getWorkflowManager()
protected abstract ModuleDescriptor createModuleDescriptor()
public void receiveMessage(Object msg,
String portName)
WorkflowModulePlugin
receiveMessage in interface WorkflowModulePluginmsg - The message to this module.portName - Name of the port to which this message is being sent.public void shutdown()
super.shutdown to make sure that this happens.
shutdown in interface WorkflowModulePluginshutdown in class AbstractEventProcessorpublic final void startup()
This method calls the method doStartup using the event
handling mechanism. Edge flow module implementations that extend this class should
implement startup operations in that method.
startup in interface WorkflowModulePlugin
protected void doStartup()
throws Exception
Exception - If an error occurs during startup. Generic exception is defined here
since the exceptions that may occur in different modules are specific to the
module implementation. The default handling of exception in this abstract base
class is to log the error as a startup failure. If a module needs different
handling, it should catch exceptions and handle them appropriately.
protected void setupErrorOutputs(PluginConfig config)
throws PluginException
ERROR_OUT_PORT_KEY with in the sub-configuration parameter
OUTPUT_PORTS_PARAM_GROUP.
config - The PluginConfig with the configuration information.
PluginException
protected void sendToModules(Object msg,
List destList)
msg - The message that is to be sent.destList - List of output <module>:<port> strings.
protected void log(Level severity,
String errorMsg)
severity - The severity level of the error.errorMsg - The error message.
protected void log(Level severity,
String errorMsg,
Throwable thrown)
severity - The severity level of the error.errorMsg - The error message.thrown - The exception that is to be logged.
protected void sendErrorOutput(Level severity,
String errorMsg,
Throwable exc)
ErrorOutput
with the appropriate source name and timestamp.
severity - The severity level of the error.errorMsg - The error message.exc - The exception that is the cause of the error.
protected static List getOutputModulesList(PluginConfig config,
String paramName)
throws PluginException
OUTPUT_PORTS_PARAM_GROUP. This assumption is that output ports are always
grouped under that sub-configuration.
config - The PluginConfig object that contains the output connections configuration
parameter.paramName - The key name of the output connections parameter.
PluginException - If it can be determined that the output module destination
specified is not valid.
public static List getStringList(PluginConfig config,
String paramName)
config - The PluginConfig that contains the configuration values.paramName - The key name of the parameter for which the string list value is to
be found.
ClassCastException - If this parameter does not contain List
public static String getStringValue(PluginConfig config,
String paramName)
NoSuchNameException if the parameter value is not specified.
config - The PluginConfig containing the configuration values.paramName - The name of the configuration parameter whose string value is to be
found.
public static String getStringValue(PluginConfig config,
String subConfigName,
String paramName)
NoSuchNameException if the parameter value is not specified or if the
sub-configuration parameter value is not specified.
config - The PluginConfig containing the configuration values.subConfigName - The name of the sub-configuration.paramName - The name of the configuration parameter whose string value is to be
found.
protected static PluginParameterMeta createOutputPortsSubConfig(DynamicConfigFactory factory,
List ports)
OUTPUT_PORTS_PARAM_GROUP.
factory - DynamicConfigFactory that is to be used to create the
plugin meta objects.ports - The list of ports with the output port information.
public static PluginParameterMeta createInputPortsSubConfig(DynamicConfigFactory factory,
List ports)
INPUT_PORTS_PARAM_GROUP.
factory - DynamicConfigFactory that is to be used to create the
plugin meta objects.ports - The list of ports with the input port information.
|
Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||