public class DynamicPollingTemplate extends java.lang.Object implements PollingTrigger.MessageProvider
PollingTrigger
.
This PollingTrigger.MessageProvider
implementation allows you to use an implementation of
DynamicPollingTemplate.TemplateProvider
to dynamically populate the contents of the
message before submitting to a workflow. At the moment only a limited subset of services are
enabled for this provider :
ScriptingServiceImp
JdbcDataQueryService
HttpRequestService
If you opt to use JdbcDataQueryService
or HttpRequestService
then there will be
some types of configuration that will make no sense in this context such as
metadata/xpath driven parameters or use of some ResultSetTranslator
implementations (most notably SplittingXmlPayloadTranslator
In the adapter configuration file this class is aliased as dynamic-polling-trigger-template which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static interface |
DynamicPollingTemplate.TemplateProvider
Marker interface so that not all services can be configured.
|
Constructor and Description |
---|
DynamicPollingTemplate() |
DynamicPollingTemplate(DynamicPollingTemplate.TemplateProvider s) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component.
|
AdaptrisMessage |
createMessage(AdaptrisMessageFactory fac) |
DynamicPollingTemplate.TemplateProvider |
getTemplate() |
void |
init()
Initialises the component.
|
void |
setTemplate(DynamicPollingTemplate.TemplateProvider provider) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
public DynamicPollingTemplate()
public DynamicPollingTemplate(DynamicPollingTemplate.TemplateProvider s)
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
public DynamicPollingTemplate.TemplateProvider getTemplate()
public void setTemplate(DynamicPollingTemplate.TemplateProvider provider)
public AdaptrisMessage createMessage(AdaptrisMessageFactory fac) throws CoreException
createMessage
in interface PollingTrigger.MessageProvider
CoreException