org.jbpm.env
Class EnvironmentFactory

java.lang.Object
  extended by org.jbpm.env.EnvironmentFactory
All Implemented Interfaces:
java.io.Serializable, Context
Direct Known Subclasses:
DefaultEnvironmentFactory, MicrocontainerEnvironmentFactory, SpringEnvironmentFactory

public abstract class EnvironmentFactory
extends java.lang.Object
implements Context, java.io.Serializable

factory for Environments.

Default implementation is DefaultEnvironmentFactory. EnvironmentFactory is thread safe, you should use one environment factory for all your threads.

Easiest way to obtain an EnvironmentFactory is with

For the default parser's XML schema, see EnvironmentParser.

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected static Parser parser
           
 
Constructor Summary
EnvironmentFactory()
           
 
Method Summary
abstract  void close()
          closes this environment factory and cleans any allocated resources.
static Parser getParser()
          returns an EnvironmentParser unless another parser is explicitely specified with setParser(Parser).
abstract  Environment openEnvironment()
          open a new Environment.
static EnvironmentFactory parse(StreamSource streamSource)
          parses the given stream source with the current parser.
protected static void push(Environment environment)
          after opening of a new environment succeeded, the environment must be pushed in the stack of current environments.
static void setParser(Parser parser)
          overwrites the default parser with a custom parser that will be used in methods #parseResource(String), #parseInputStream(InputStream), #parseInputSource(InputSource) and #parseXmlString(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbpm.env.Context
get, get, getName, has, keys, set, setEnvironment
 

Field Detail

parser

protected static Parser parser
Constructor Detail

EnvironmentFactory

public EnvironmentFactory()
Method Detail

getParser

public static Parser getParser()
returns an EnvironmentParser unless another parser is explicitely specified with setParser(Parser). This method is used to get a parser for methods #parseResource(String), #parseInputStream(InputStream), #parseInputSource(InputSource) and #parseXmlString(String).


setParser

public static void setParser(Parser parser)
overwrites the default parser with a custom parser that will be used in methods #parseResource(String), #parseInputStream(InputStream), #parseInputSource(InputSource) and #parseXmlString(String).


parse

public static EnvironmentFactory parse(StreamSource streamSource)
parses the given stream source with the current parser.


openEnvironment

public abstract Environment openEnvironment()
open a new Environment. The client is responsible for closing the environment with Environment.close().


close

public abstract void close()
closes this environment factory and cleans any allocated resources.


push

protected static void push(Environment environment)
after opening of a new environment succeeded, the environment must be pushed in the stack of current environments.

See Also:
Environment.pop()