org.ow2.bonita.pvm.env
Class PvmEnvironmentFactory

java.lang.Object
  extended by org.ow2.bonita.pvm.env.EnvironmentFactory
      extended by org.ow2.bonita.pvm.env.PvmEnvironmentFactory
All Implemented Interfaces:
java.io.Serializable, Context

public class PvmEnvironmentFactory
extends EnvironmentFactory
implements Context

an environment factory that also is the environment-factory context.

This environment factory will produce environments with 2 contexts: the environment-factory context and the block context.

An environment-factory context is build from two wire definitions: the environment-factory wire definition and the environment wire definition.

The environment-factory context itself is build from the environment-factory wire definition. So all objects that are created in this context remain cached for the lifetime of this environment-factory context object.

This environment-factory context is also a environment factory. The produced environments contain 2 contexts: the environment-factory context itself and a new environment context, build from the environment wire definition. For each created environment, a new environment context will be created from the same environment wire definition. Objects in the environment context will live for as long as the environment.

Author:
Tom Baeyens
See Also:
Serialized Form

Field Summary
protected  WireDefinition environmentCtxWireDefinition
           
protected  WireContext environmentFactoryCtxWireContext
           
protected static PvmEnvironmentFactoryParser pvmEnvironmentFactoryParser
           
 
Fields inherited from interface org.ow2.bonita.pvm.env.Context
CONTEXTNAME_ENVIRONMENT, CONTEXTNAME_ENVIRONMENT_FACTORY
 
Constructor Summary
PvmEnvironmentFactory()
           
PvmEnvironmentFactory(java.io.File file)
           
PvmEnvironmentFactory(java.io.InputStream inputStream)
           
PvmEnvironmentFactory(java.lang.String resource)
           
PvmEnvironmentFactory(java.lang.String resource, java.lang.ClassLoader classLoader)
           
PvmEnvironmentFactory(java.net.URL url)
           
 
Method Summary
 void close()
          closes this environment factory and cleans any allocated resources.
<T> T
get(java.lang.Class<T> type)
           
 java.lang.Object get(java.lang.String key)
           
 WireDefinition getEnvironmentCtxWireDefinition()
           
 WireContext getEnvironmentFactoryCtxWireContext()
           
 java.lang.String getName()
           
 boolean has(java.lang.String key)
           
 java.util.Set<java.lang.String> keys()
           
 Environment openEnvironment()
          open a new Environment.
static PvmEnvironmentFactory parseXmlString(java.lang.String xmlString)
           
 java.lang.Object set(java.lang.String key, java.lang.Object value)
           
 void setEnvironmentCtxWireDefinition(WireDefinition blockWireDefinition)
           
 void setEnvironmentFactoryCtxWireContext(WireContext applicationWireContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pvmEnvironmentFactoryParser

protected static PvmEnvironmentFactoryParser pvmEnvironmentFactoryParser

environmentFactoryCtxWireContext

protected WireContext environmentFactoryCtxWireContext

environmentCtxWireDefinition

protected WireDefinition environmentCtxWireDefinition
Constructor Detail

PvmEnvironmentFactory

public PvmEnvironmentFactory()

PvmEnvironmentFactory

public PvmEnvironmentFactory(java.lang.String resource)

PvmEnvironmentFactory

public PvmEnvironmentFactory(java.lang.String resource,
                             java.lang.ClassLoader classLoader)

PvmEnvironmentFactory

public PvmEnvironmentFactory(java.io.File file)

PvmEnvironmentFactory

public PvmEnvironmentFactory(java.net.URL url)

PvmEnvironmentFactory

public PvmEnvironmentFactory(java.io.InputStream inputStream)
Method Detail

parseXmlString

public static PvmEnvironmentFactory parseXmlString(java.lang.String xmlString)

openEnvironment

public Environment openEnvironment()
Description copied from class: EnvironmentFactory
open a new Environment. The client is responsible for closing the environment with Environment.close().

Specified by:
openEnvironment in class EnvironmentFactory

close

public void close()
Description copied from class: EnvironmentFactory
closes this environment factory and cleans any allocated resources.

Specified by:
close in class EnvironmentFactory

get

public java.lang.Object get(java.lang.String key)
Specified by:
get in interface Context

get

public <T> T get(java.lang.Class<T> type)
Specified by:
get in interface Context

getName

public java.lang.String getName()
Specified by:
getName in interface Context

has

public boolean has(java.lang.String key)
Specified by:
has in interface Context

keys

public java.util.Set<java.lang.String> keys()
Specified by:
keys in interface Context

set

public java.lang.Object set(java.lang.String key,
                            java.lang.Object value)
Specified by:
set in interface Context

setEnvironmentCtxWireDefinition

public void setEnvironmentCtxWireDefinition(WireDefinition blockWireDefinition)

getEnvironmentFactoryCtxWireContext

public WireContext getEnvironmentFactoryCtxWireContext()

setEnvironmentFactoryCtxWireContext

public void setEnvironmentFactoryCtxWireContext(WireContext applicationWireContext)

getEnvironmentCtxWireDefinition

public WireDefinition getEnvironmentCtxWireDefinition()


Copyright © 2009 OW2 Consortium. All Rights Reserved.