public abstract class XmlContextBuilderConfigurator extends ContextBuilderConfigurator
This configurator implements XML supports for WUIC. It abstracts the way the XML is read and unmarshal with JAXB.
PollingScheduler.Polling
Constructor and Description |
---|
XmlContextBuilderConfigurator(Boolean multiple,
ProcessContext pc)
Creates a new instance.
|
XmlContextBuilderConfigurator(ProcessContext processContext)
Builds a new instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
configureHeap(ContextBuilder ctxBuilder,
XmlHeapBean heap)
Configures the heap described in the given bean.
|
static void |
configureTemplates(XmlWuicBean xml,
ContextBuilder ctxBuilder)
Configures the given builder with the template in the specified bean.
|
static void |
configureWorkflow(XmlWuicBean xml,
ContextBuilder ctxBuilder)
Configures the given builder with the specified bean.
|
ProcessContext |
getProcessContext()
Gets the process context associated to the tag while configuring.
|
int |
internalConfigure(ContextBuilder ctxBuilder)
Configures the given context internally.
|
protected abstract XmlWuicBean |
unmarshal(Unmarshaller unmarshaller)
Unmashal the
XmlWuicBean with the given unmarhalled. |
configure, getTag, run, setMultipleConfigurations
getLastUpdateTimestampFor, getNutObservers, getPollingInterval, observe, setPollingInterval
public XmlContextBuilderConfigurator(ProcessContext processContext) throws JAXBException
Builds a new instance.
processContext
- the process contextJAXBException
- if an context can't be initializedpublic XmlContextBuilderConfigurator(Boolean multiple, ProcessContext pc) throws JAXBException
Creates a new instance.
pc
- the process contextmultiple
- true
if multiple configurations with the same tag could be executed, false
otherwiseJAXBException
- if an context can't be initializedpublic static void configureHeap(ContextBuilder ctxBuilder, XmlHeapBean heap) throws IOException
Configures the heap described in the given bean.
ctxBuilder
- the builder to configureheap
- the configuration beanIOException
- if any I/O error occurspublic static void configureTemplates(XmlWuicBean xml, ContextBuilder ctxBuilder) throws WorkflowTemplateNotFoundException, IOException
Configures the given builder with the template in the specified bean.
An IllegalArgumentException
is thrown if the workflow is badly defined.
xml
- the beanctxBuilder
- the builderWorkflowTemplateNotFoundException
- if a workflow-template-id reference a non existing templateIOException
- if any I/O error occurspublic static void configureWorkflow(XmlWuicBean xml, ContextBuilder ctxBuilder) throws WorkflowTemplateNotFoundException, IOException
Configures the given builder with the specified bean.
An IllegalArgumentException
is thrown if the workflow is badly defined.
xml
- the beanctxBuilder
- the builderWorkflowTemplateNotFoundException
- if a workflow-template-id reference a non existing templateIOException
- if any I/O error occurspublic ProcessContext getProcessContext()
Gets the process context associated to the tag while configuring.
getProcessContext
in class ContextBuilderConfigurator
public int internalConfigure(ContextBuilder ctxBuilder)
Configures the given context internally. This method is called just after the ContextBuilder
has been
tagged with the value returned by ContextBuilderConfigurator.getTag()
method. Once the
execution of this method is terminated, the tag is released.
To activate polling on this configurator, this method should returns a positive integer representing the polling interval in seconds.
internalConfigure
in class ContextBuilderConfigurator
ctxBuilder
- the builderprotected abstract XmlWuicBean unmarshal(Unmarshaller unmarshaller) throws JAXBException
Unmashal the XmlWuicBean
with the given unmarhalled.
unmarshaller
- the unmarshallerJAXBException
- if the XML can't be readCopyright © 2012-2015. All Rights Reserved.