|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.danet.an.workflow.api.WorkflowServiceFactory
This class provides a factory API that enables clients to obtain a workflow service facility.
Constructor Summary | |
protected |
WorkflowServiceFactory()
Constructor. |
Method Summary | |
protected java.util.Map |
getProperties()
Used by derived classes to access the properties. |
static WorkflowServiceFactory |
newInstance()
Obtain a new instance of a WorkflowServiceFactory . |
abstract WorkflowService |
newWorkflowService()
Creates a new instance of a . |
void |
setProperties(java.util.Map props)
A convenience method that sets all properties in the Map. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets a property which is passed to the WorkflowService produced by this factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected WorkflowServiceFactory()
Method Detail |
public static WorkflowServiceFactory newInstance() throws FactoryConfigurationError
WorkflowServiceFactory
. This static method
creates a new factory instance. The method uses the following
ordered lookup procedure to determine the
WorkflowServiceFactory
implementation class
to load:
initial naming context
is available, look for a a classname in
java:comp/env/de.danet.an.workflow.api.WorkflowServiceFactory
.
The configuration for a class as workflow service factory
thus looks like:
<env-entry> <description>Configure the workflow service factory</description> <env-entry-name>de.danet.an.workflow.api.WorkflowServiceFactory</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>FactoryImplementationClass</env-entry-value> </env-entry>Note that this environment entry must be inserted in the
ejb-jar.xml
or web.xml
for every EJB
resp. servlet that calls the
newInstance
method of
WorkflowServiceFactory
.META-INF/services/de.danet.an.workflow.api.WorkflowServiceFactory
.
in jars available to the runtime.
WorkflowServiceFactory
.
FactoryConfigurationError
- if a factory instance can't be
created.public void setProperty(java.lang.String name, java.lang.Object value)
WorkflowService
produced by this factory. Valid properties generally depend on the underlying implementation. There are, however, a few exceptions.
If the workflow service implementation is based on the J2EE
environment, clients derive the connection to a server from an
. There are cases when the user
wants or needs to override the initial context used by the
workflow service implementation. It is therefore defined that
setting the property "InitialContext
javax.naming.InitialContext
"
to a value of type
overrides any default method used by the
workflow service implementation to obtain the initial context.Context
As an alternative, the property
"javax.naming.InitialContext.Environment
" may be
set to a Hashtable
that contains the environment
to be used when creating an InitialContext
.
Subsequent versions of this interface may define additional common properties. We therefore recommended to use "fully qulified" (i.e. package style) names for properties that are specific to a workflow service implementation.
name
- the name of the propertyvalue
- the value of the propertypublic void setProperties(java.util.Map props)
props
- the properties to be setprotected java.util.Map getProperties()
public abstract WorkflowService newWorkflowService() throws FactoryConfigurationError
WorkflowService
.This API does not specify how a workflow service factory or workflow service should be implemented. If, however, the implementation is J2EE/EJB based, the following additional rules apply to achieve common bahaviour for J2EE based implementations.
In the J2EE environment, clients usually obtain the connection to a
server from a directory service represented by an
instance. This instance need not be the default initial context
available to the client (think of a servlet running in a servlet
container that wants to access the workflow engine running in an
application server on a different machine).InitialContext
In an environment that uses an
to obtain the connection to the server
(as described above), the following ordered lookup procedure must
be implemented to determine this initial context.
InitialContext
javax.naming.InitialContext
"
has been set, use it as initial context. if property
"javax.naming.InitialContext.Environment
" has been
set, use it to obtain the initial context
(see setProperty
.
InitialContext
is available during the
execution of newInstance
(i.e. "new InitialContext()
succeeds), and entries
java:comp/env/de.danet.an.workflow.api.WorkflowService.NAMING_CONTEXT_FACTORY
and
java:comp/env/de.danet.an.workflow.api.WorkflowService.NAMING_CONTEXT_URL
exist, use them to obtain the initial context.
InitialContext
is available during the
execution of newInstance
use it (i.e. do not try
to obtain another initial context (this is the common situation
where a servlet based client and the workflow engine run in one
application server).
FactoryConfigurationError
- if not all required resources
can be obtained.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |