org.jbpm
Class JbpmConfiguration
java.lang.Object
org.jbpm.JbpmConfiguration
- All Implemented Interfaces:
- java.io.Serializable
public class JbpmConfiguration
- extends java.lang.Object
- implements java.io.Serializable
configuration of one jBPM instance.
During process execution, jBPM might need to use some services. A JbpmConfiguration contains the
knowledge on how to create those services.
A JbpmConfiguration is a thread safe object and serves as a factory for
JbpmContexts, which means one JbpmConfiguration can be used to create
JbpmContexts for all threads. The single JbpmConfiguration can be maintained in
a static member or in the JNDI tree if that is available.
A JbpmConfiguration can be obtained in following ways:
- from a resource (by default
jbpm.cfg.xml is used):
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
or
String myXmlResource = "...";
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(myXmlResource);
- from an XML string:
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
"<jbpm-configuration>" +
...
"</jbpm-configuration>"
);
- By specifying a custom implementation of an object factory. This can be used to specify a
JbpmConfiguration in other bean-style notations such as used by JBoss Microcontainer or Spring.
ObjectFactory of = new <i>MyCustomObjectFactory</i>();
JbpmConfiguration.Configs.setDefaultObjectFactory(of);
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmConfigurations can be configured using a spring-like XML notation (in relax ng compact
notation):
datatypes xs = "http://www.w3.org/2001/XMLSchema-datatypes"
start = element beans { element object* }
object = {
jbpm-context |
bean |
ref |
map |
list |
string |
int |
long |
float |
double |
char |
bool |
true |
false |
null
}
jbpm-context = element jbpm-context {
( attribute name {xsd:string},
service*,
save-operations?
)
}
service = element service {
( attribute name {xsd:string},
( attribute factory {xsd:string} ) |
( factory )
)
}
factory = element factory {
( bean |
ref
)
}
save-operations = element save-operations {
( save-operation* )
}
save-operation = element save-operation {
( ( attribute class {xsd:string} ) |
( bean |
ref
)
)
}
bean = element bean {
( attribute ref-name {xsd:string} ) |
( attribute name {xsd:string}?,
attribute class {xsd:string}?,
attribute singleton { "true" | "false" }?,
constructor*,
field*,
property*
)
}
ref = element ref {
( attribute bean (xsd:string) )
}
constructor = element constructor {
attribute class {xsd:string}?,
( attribute factory {xsd:string},
attribute method {xsd:string}
)?,
parameter*
}
parameter = element parameter {
attribute class {xsd:string},
object
}
field = element field {
attribute name {xsd:string},
object
}
property = element property {
( attribute name {xsd:string} |
attribute setter {xsd:string}
),
object
}
map = element map {
entry*
}
entry = element entry {
key,
value
}
key = element key {
object
}
value = element value {
object
}
list = element list {
object*
}
string = element string {xsd:string}
int = element integer {xsd:integer}
long = element long {xsd:long}
float = element float {xsd:string}
double = element string {xsd:double}
char = element char {xsd:character}
bool = element bool { "true" | "false" }
true = element true {}
false = element false {}
null = element null {}
Other configuration properties
| jbpm.files.dir |
|
| jbpm.types |
|
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JbpmConfiguration
public JbpmConfiguration(ObjectFactory objectFactory)
getInstance
public static JbpmConfiguration getInstance()
getInstance
public static JbpmConfiguration getInstance(java.lang.String resource)
hasInstance
public static boolean hasInstance(java.lang.String resource)
parseObjectFactory
protected static ObjectFactory parseObjectFactory(java.io.InputStream inputStream)
parseXmlString
public static JbpmConfiguration parseXmlString(java.lang.String xml)
createJbpmConfiguration
protected static JbpmConfiguration createJbpmConfiguration(ObjectFactory objectFactory)
parseInputStream
public static JbpmConfiguration parseInputStream(java.io.InputStream inputStream)
parseResource
public static JbpmConfiguration parseResource(java.lang.String resource)
createJbpmContext
public JbpmContext createJbpmContext()
createJbpmContext
public JbpmContext createJbpmContext(java.lang.String name)
getServiceFactory
public ServiceFactory getServiceFactory(java.lang.String serviceName)
getServiceFactory
public ServiceFactory getServiceFactory(java.lang.String serviceName,
java.lang.String jbpmContextName)
getProcessClassLoader
public static java.lang.ClassLoader getProcessClassLoader(ProcessDefinition processDefinition)
cleanSchema
public void cleanSchema()
cleanSchema
public void cleanSchema(java.lang.String jbpmContextName)
createSchema
public void createSchema()
createSchema
public void createSchema(java.lang.String jbpmContextName)
dropSchema
public void dropSchema()
dropSchema
public void dropSchema(java.lang.String jbpmContextName)
isClosed
public boolean isClosed()
close
public void close()
close
public void close(java.lang.String jbpmContextName)
getCurrentJbpmContext
public JbpmContext getCurrentJbpmContext()
startJobExecutor
public void startJobExecutor()
getJobExecutor
public JobExecutor getJobExecutor()
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.