Class DynamicPollingTemplate
- java.lang.Object
-
- com.adaptris.core.DynamicPollingTemplate
-
- All Implemented Interfaces:
ComponentLifecycle
,PollingTrigger.MessageProvider
public class DynamicPollingTemplate extends java.lang.Object implements PollingTrigger.MessageProvider
Provides a template forPollingTrigger
.This
PollingTrigger.MessageProvider
implementation allows you to use an implementation ofDynamicPollingTemplate.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
orHttpRequestService
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 someResultSetTranslator
implementations (most notablySplittingXmlPayloadTranslator
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DynamicPollingTemplate.TemplateProvider
Marker interface so that not all services can be configured.
-
Constructor Summary
Constructors Constructor Description DynamicPollingTemplate()
DynamicPollingTemplate(DynamicPollingTemplate.TemplateProvider s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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
-
-
-
Constructor Detail
-
DynamicPollingTemplate
public DynamicPollingTemplate()
-
DynamicPollingTemplate
public DynamicPollingTemplate(DynamicPollingTemplate.TemplateProvider s)
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- Specified by:
close
in interfaceComponentLifecycle
-
getTemplate
public DynamicPollingTemplate.TemplateProvider getTemplate()
-
setTemplate
public void setTemplate(DynamicPollingTemplate.TemplateProvider provider)
-
createMessage
public AdaptrisMessage createMessage(AdaptrisMessageFactory fac) throws CoreException
- Specified by:
createMessage
in interfacePollingTrigger.MessageProvider
- Throws:
CoreException
-
-