Inbound integration handlers for file and JMS integrations
Whether you write your own integration or use the integrations that the base configuration provides, you must write code that handles one chunk of data. In both cases, the interface implementation that you use depends on whether you are using messaging.
To write a custom integration that supports
data other than files or JMS messages, your code primarily implements
the interface InboundIntegrationMessageReply
or InboundIntegrationStartablePlugin.
If you use the file or JMS inbound integrations that the base configuration provides, you
register an existing plugin implementation of
InboundIntegrationMessageReply or
InboundIntegrationStartablePlugin. PolicyCenter includes plugin implementations of those
interfaces to process files or JMS data.
You can implement your handler plugin code using either Gosu, Java with no OSGi, or Java as an OSGi bundle. If you use Java or if you require third-party libraries, Guidewire recommends implementing your code as an OSGi plugin.
For file or JMS inbound integrations, you must write a handler class that processes one chunk of
data. PolicyCenter defines a handler plugin interface
called InboundIntegrationHandlerPlugin that contains one method called
process. The file or JMS integration process calls the method to
process one chunk of data. The method has no return value. PolicyCenter passes the chunk of data to the method as a
parameter of type java.lang.Object. In your implementation of the
handler class, you write the process method. Downcast the
Object to the necessary type before using it.
- For file handling, the data type depends on the value you set for the
processingmodeparameter.- If you set the processingmode parameter to
line, downcast theObjecttoString. - If you set the processingmode parameter to
file, downcast theObjecttojava.nio.file.Path.
- If you set the processingmode parameter to
- For JMS handling, downcast the
Objectto a JMS message of typejavax.jms.Message.
Register the plugin in the Studio Plugins Registry. You must add one plugin parameter called
integrationservice. That plugin parameter links your plugin
implementation to one XML element within the
inbound-integration-config.xml file.
If you use either the file or the JMS variant of the startable plugin, your class must
implement the InboundIntegrationHandlerPlugin interface. This interface
specifies only the process method.
If you use either the file or the JMS variant of the message reply plugin, your class must
implement the InboundIntegrationMessageReplyHandler interface, which is
a subinterface of InboundIntegrationHandlerPlugin. Implement the
process method and all methods of the
MessageReply plugin, which are initTools,
suspend, shutdown, resume, and
setDestinationID. Save the parameters to your
initTools method into private variables. Use those private
variables during your process method to find and acknowledge the
original Message object.
See also
