public final class WuicFacadeBuilder.ContextBuilderFacade extends ContextBuilder
This class gives a chance to directly define settings for the final ContextBuilder
of the built
WuicFacade
.
Modifier and Type | Class and Description |
---|---|
class |
WuicFacadeBuilder.ContextBuilderFacade.ContextEngineBuilderFacade
|
class |
WuicFacadeBuilder.ContextBuilderFacade.ContextNutDaoBuilderFacade
|
class |
WuicFacadeBuilder.ContextBuilderFacade.ContextNutFilterBuilderFacade
|
ContextBuilder.ContextEngineBuilder, ContextBuilder.ContextGenericBuilder, ContextBuilder.ContextNutDaoBuilder, ContextBuilder.ContextNutFilterBuilder
Constructor and Description |
---|
WuicFacadeBuilder.ContextBuilderFacade() |
build, cloneContextNutDaoBuilder, contextEngineBuilder, contextNutDaoBuilder, contextNutFilterBuilder, disposableHeap, engineBuilder, getDefaultBuilderId, getDefaultBuilderId, getDefaultBuilderId, getFilters, newNutDaoBuilder, nutFilter
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public WuicFacadeBuilder.ContextBuilderFacade()
public WuicFacadeBuilder toFacade()
Backs to the facade builder API.
public WuicFacadeBuilder.ContextBuilderFacade configureDefault() throws IOException
Configures for each type provided by the engine builder factory and nut dao builder factory a
default instance identified with an id starting by ContextBuilder.BUILDER_ID_PREFIX
and followed by the type
name itself.
configureDefault
in class ContextBuilder
IOException
- if configuration failspublic WuicFacadeBuilder.ContextBuilderFacade tag(Object tag)
Decorates the current builder with a new builder associated to a specified tag. Tagging the context allows to
isolate a set of configurations that could be erased by calling ContextBuilder.clearTag(Object)
.
This way, this feature is convenient when you need to poll the configurations to reload it.
All configurations will be associated to the tag until the ContextBuilder.releaseTag()
method is called. If tag is currently set, then it is released when this method is called with a new tag.
tag
in class ContextBuilder
tag
- an arbitrary object which represents the current tagContextBuilder.clearTag(Object)
,
ContextBuilder.releaseTag()
public WuicFacadeBuilder.ContextBuilderFacade clearTag(Object tag)
Clears all configurations associated to the given tag.
clearTag
in class ContextBuilder
tag
- the tagContextBuilder
public WuicFacadeBuilder.ContextBuilderFacade releaseTag()
Releases the current tag of this context. When the configurations associated to a tag are finished, it could be released by calling this method to not tag next configurations.
releaseTag
in class ContextBuilder
public WuicFacadeBuilder.ContextBuilderFacade processContext(ProcessContext processContext)
Sets the process context for the setting associated to the current tag.
processContext
in class ContextBuilder
processContext
- the ProcessContext
public WuicFacadeBuilder.ContextBuilderFacade.ContextNutDaoBuilderFacade contextNutDaoBuilder(String id, String type)
Returns a new context DAO builder.
contextNutDaoBuilder
in class ContextBuilder
id
- the final builder's ID, default ID if null
type
- the final builder's typepublic WuicFacadeBuilder.ContextBuilderFacade.ContextNutDaoBuilderFacade contextNutDaoBuilder(Class<?> type)
Returns a new default context DAO builder.
contextNutDaoBuilder
in class ContextBuilder
type
- the component to buildpublic WuicFacadeBuilder.ContextBuilderFacade.ContextNutFilterBuilderFacade contextNutFilterBuilder(String id, String type)
Returns a new context filter builder.
contextNutFilterBuilder
in class ContextBuilder
id
- the final builder's IDtype
- the final builder's typepublic WuicFacadeBuilder.ContextBuilderFacade.ContextEngineBuilderFacade contextEngineBuilder(String id, String type)
Returns a new context engine builder.
contextEngineBuilder
in class ContextBuilder
id
- the final builder's IDtype
- the final builder's typepublic WuicFacadeBuilder.ContextBuilderFacade.ContextEngineBuilderFacade contextEngineBuilder(Class<?> type)
Returns a new context default engine builder.
contextEngineBuilder
in class ContextBuilder
type
- the component to buildpublic WuicFacadeBuilder.ContextBuilderFacade interceptor(ContextInterceptor interceptor)
Adds a ContextInterceptor
to the builder.
interceptor
in class ContextBuilder
interceptor
- the interceptorContextBuilder
public WuicFacadeBuilder.ContextBuilderFacade heap(String id, String ndbId, String[] path, HeapListener... listeners) throws IOException
Creates a new heap as specified by ContextBuilder.heap(boolean, String, String, String[], String[], HeapListener...)
without any composition and which is not disposable.
heap
in class ContextBuilder
id
- the heap IDndbId
- the NutDao
builder the heap is based onpath
- the pathlisteners
- some listeners for this heapContextBuilder
IOException
- if the HEAP could not be createdpublic WuicFacadeBuilder.ContextBuilderFacade heap(boolean disposable, String id, String ndbId, String[] heapIds, String[] path, HeapListener... listeners) throws IOException
Defines a new heap
in this context. A heap is always identified
by an ID and is associated to NutDao
builder to use to convert paths into
Nut
. A list of paths needs also to be specified to know which underlying
nuts compose the heap.
The heap could be composed in part or totally of other heaps.
If the ObjectBuilder
ID is not known, a IllegalArgumentException
will be thrown.
heap
in class ContextBuilder
disposable
- if the heap is disposable or not (see NutDaoListener.isDisposable()
id
- the heap IDndbId
- the NutDao
builder the heap is based on, default is used if null
heapIds
- the heaps compositionpath
- the pathlisteners
- some listeners for this heapContextBuilder
IOException
- if the HEAP could not be createdpublic WuicFacadeBuilder.ContextBuilderFacade template(String id, String[] ebIds, String... daos) throws IOException
Builds a new template with no exclusion and default engine usages.
template
in class ContextBuilder
id
- the template's idebIds
- the set of Engine
builder to usedaos
- the DAOContextBuilder
IOException
- if an I/O error occursContextBuilder.template(String, String[], String[], Boolean, String...)
public WuicFacadeBuilder.ContextBuilderFacade template(String id, String[] ebIds, String[] ebIdsExclusion, Boolean includeDefaultEngines, String... ndbIds) throws IOException
Creates a new workflow template.
The template consists to chain a set of engines produced by the specified Engine
builders.
There is a chain for each possible NutType
. A chain that processes a particular NutType
of
Nut
is composed of engines
ordered by type. All engines specified in
parameter as array are simply organized following those two criteria to create the chains. Moreover, default engines
could be injected in the chain to perform common operations to be done on nuts. If an Engine
builder
is specified in a chain while it is injected by default, then the configuration of the given builder will overrides
the default one.
A set of NutDao
builder could be specified to store processed nuts. When the client
will retrieve the nuts, it will access it through a proxy URI configured in the protocol. This URI corresponds
to a server in front of the location where nuts have been stored. For that reason the NutDao
must
support NutDao.save(com.github.wuic.nut.Nut)
operation.
If the context builder should include engines by default, then a set of default engine to be excluded could be specified.
An IllegalStateException
will be thrown if the context is not correctly configured. Bad settings are :
ObjectBuilder
IDNutDao
does not supports NutDao.save(com.github.wuic.nut.Nut)
methodtemplate
in class ContextBuilder
id
- the template's idebIds
- the set of Engine
builder to useebIdsExclusion
- some default builder to be excluded in the chainincludeDefaultEngines
- include or not default enginesndbIds
- the set of NutDao
builder where to eventually upload processed nutsContextBuilder
IOException
- if an I/O error occurspublic WuicFacadeBuilder.ContextBuilderFacade workflow(String identifier, Boolean forEachHeap, String heapIdPattern, String workflowTemplateId) throws IOException, WorkflowTemplateNotFoundException
Creates a new workflow. Any nut processing will be done through an existing workflow.
A workflow is based on a WorkflowTemplate
with a specified ID.
The heap
to be used is represented by a regex. The forEachHeap parameter indicates if only one
workflow should be created having as heap
a composition of all heaps matching the pattern. If the
parameter is false
, then a workflow is created for each matching NutsHeap
. In this case, the workflow
ID will be the concatenation if the given identifier and the heap's ID.
An IllegalStateException
will be thrown if the context is not correctly configured. Bad settings are :
NutsHeap
IDworkflow
in class ContextBuilder
identifier
- the identifier used to build the workflow ID, is the prefix if create one for each heapforEachHeap
- true
if a dedicated workflow must be created for each matching heap, false
for a compositionheapIdPattern
- the regex matching the heap IDs that needs to be processedworkflowTemplateId
- a template ID to initialize the workflowContextBuilder
IOException
- if an I/O error occursWorkflowTemplateNotFoundException
- if the specified template ID does not existspublic WuicFacadeBuilder.ContextBuilderFacade mergeSettings(ContextBuilder other)
Merges all the settings
of the given ContextBuilder
to the current setting of
this object.
mergeSettings
in class ContextBuilder
other
- the object to mergeCopyright © 2012-2015. All Rights Reserved.