Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.1.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbpm.runtime.manager.impl
Class SimpleRuntimeEnvironment

    java.lang.Object
      org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment

All Implemented Interfaces:
  SchedulerProvider, RuntimeEnvironment

Direct Known Subclasses:
  DefaultRuntimeEnvironment

    public class SimpleRuntimeEnvironment

extends Object
implements org.kie.internal.runtime.manager.RuntimeEnvironment, SchedulerProvider

The most basic implementation of `RuntimeEnvironment` that at the same time serves as base implementation for all extensions. Encapsulates all important configuration that `RuntimeManager` requires for execution.

- EntityManagerFactory - shared for all runtime engine build based on same `RuntimeEnvironment`
- Environment - Drools/jBPM environment object - will be cloned for every `RuntimeEngine`
- KieSessionConfiguration - will be build passed on defined properties - cloned for every `RuntimeEngine`
- KieBase - resulting knowledge base build on given assets or returned if it was preset
- RegisterableItemsFactory - factory used to provide listeners and work item handlers
- Mapper - mapper used to keep context information
- UserGroupCallback - user group callback, if not given null will be returned
- GlobalSchedulerService - since this environment implements `SchedulerProvider` it allows to get `GlobalTimerService` if available

Field Summary
`protected ClassLoader` | `classLoader`
`protected KieSessionConfiguration` | `configuration`
`protected javax.persistence.EntityManagerFactory` | `emf`
`protected Environment` | `environment`
`protected KieBase` | `kbase`
`protected org.kie.internal.builder.KnowledgeBuilder` | `kbuilder`
`protected org.kie.internal.runtime.manager.Mapper` | `mapper`
`protected RegisterableItemsFactory` | `registerableItemsFactory`
`protected GlobalSchedulerService` | `schedulerService`
`protected Properties` | `sessionConfigProperties`
`protected boolean` | `usePersistence`
`protected UserGroupCallback` | `userGroupCallback`

Constructor Summary
`SimpleRuntimeEnvironment()`
`SimpleRuntimeEnvironment(RegisterableItemsFactory registerableItemsFactory)`

Method Summary
`void` | `addAsset(Resource resource, ResourceType type)` Adds given asset to knowledge builder to produce KieBase
`protected void` | `addIfPresent(String name, Environment copy)`
`void` | `addToConfiguration(String name, String value)` Adds configuration property that will be part of `KieSessionConfiguration`
`void` | `addToEnvironment(String name, Object value)` Adds element to the drools/jbpm environment - the value must be thread save as it will be shared between all `RuntimeEngine` instances
`void` | `close()` Closes the environment allowing to close all depending components such as ksession factories, etc
`protected Environment` | `copyEnvironment()`
`ClassLoader` | `getClassLoader()` Delivers custom class loader that shall be used by the process engine and task service instances
`KieSessionConfiguration` | `getConfiguration()` KieSession configuration that shall be used to create instances of `KieSession`
`javax.persistence.EntityManagerFactory` | `getEmf()`
`Environment` | `getEnvironment()` KieSession environment that shall be used to create instances of `KieSession`
`Environment` | `getEnvironmentTemplate()`
`KieBase` | `getKieBase()` Returns `KieBase` that shall be used by the manager
`org.kie.internal.runtime.manager.Mapper` | `getMapper()`
`RegisterableItemsFactory` | `getRegisterableItemsFactory()` Delivers concrete implementation of `RegisterableItemsFactory` to obtain handlers and listeners that shall be registered on instances of `KieSession`
`GlobalSchedulerService` | `getSchedulerService()` Returns fully configured instance of `SchedulerService` ready to be used/
`Properties` | `getSessionConfigProperties()`
`UserGroupCallback` | `getUserGroupCallback()` Delivers concrete implementation of `UserGroupCallback` that shall be registered on instances of `TaskService` for managing users and groups.
`void` | `init()`
`void` | `setClassLoader(ClassLoader classLoader)`
`void` | `setEmf(javax.persistence.EntityManagerFactory emf)`
`void` | `setKieBase(KieBase kbase)`
`void` | `setMapper(org.kie.internal.runtime.manager.Mapper mapper)`
`void` | `setRegisterableItemsFactory(RegisterableItemsFactory registerableItemsFactory)`
`void` | `setSchedulerService(GlobalSchedulerService schedulerService)`
`void` | `setSessionConfigProperties(Properties sessionConfigProperties)`
`void` | `setUsePersistence(boolean usePersistence)`
`void` | `setUserGroupCallback(UserGroupCallback userGroupCallback)`
`boolean` | `usePersistence()` Indicates if persistence shall be used for the KieSession instances

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### usePersistence

    protected boolean usePersistence

### emf

    protected javax.persistence.EntityManagerFactory emf

### environment

    protected Environment environment

### configuration

    protected KieSessionConfiguration configuration

### kbase

    protected KieBase kbase

### kbuilder

    protected org.kie.internal.builder.KnowledgeBuilder kbuilder

### registerableItemsFactory

    protected RegisterableItemsFactory registerableItemsFactory

### mapper

    protected org.kie.internal.runtime.manager.Mapper mapper

### userGroupCallback

    protected UserGroupCallback userGroupCallback

### schedulerService

    protected GlobalSchedulerService schedulerService

### classLoader

    protected ClassLoader classLoader

### sessionConfigProperties

    protected Properties sessionConfigProperties

Constructor Detail

### SimpleRuntimeEnvironment

    public SimpleRuntimeEnvironment()

### SimpleRuntimeEnvironment

    public SimpleRuntimeEnvironment(RegisterableItemsFactory registerableItemsFactory)

Method Detail

### init

    public void init()

### addAsset

    public void addAsset(Resource resource,
                         ResourceType type)

  Adds given asset to knowledge builder to produce KieBase

  Parameters:
    `resource` - asset to be added
    `type` - type of the asset

### addToEnvironment

    public void addToEnvironment(String name,
                                 Object value)

  Adds element to the drools/jbpm environment - the value must be thread save as it will be shared between all `RuntimeEngine` instances

  Parameters:
    `name` - name of the environment entry
    `value` - value of the environment entry

### addToConfiguration

    public void addToConfiguration(String name,
                                   String value)

  Adds configuration property that will be part of `KieSessionConfiguration`

  Parameters:
    `name` - name of the property
    `value` - value of the property

### getKieBase

    public KieBase getKieBase()

  Description copied from interface: `RuntimeEnvironment`
  Returns `KieBase` that shall be used by the manager

  Specified by:
    `getKieBase` in interface `RuntimeEnvironment`
  Returns:

### getEnvironmentTemplate

    public Environment getEnvironmentTemplate()

### getEnvironment

    public Environment getEnvironment()

  Description copied from interface: `RuntimeEnvironment`
  KieSession environment that shall be used to create instances of `KieSession`

  Specified by:
    `getEnvironment` in interface `RuntimeEnvironment`
  Returns:

### getConfiguration

    public KieSessionConfiguration getConfiguration()

  Description copied from interface: `RuntimeEnvironment`
  KieSession configuration that shall be used to create instances of `KieSession`

  Specified by:
    `getConfiguration` in interface `RuntimeEnvironment`
  Returns:

### usePersistence

    public boolean usePersistence()

  Description copied from interface: `RuntimeEnvironment`
  Indicates if persistence shall be used for the KieSession instances

  Specified by:
    `usePersistence` in interface `RuntimeEnvironment`
  Returns:

### getRegisterableItemsFactory

    public RegisterableItemsFactory getRegisterableItemsFactory()

  Description copied from interface: `RuntimeEnvironment`
  Delivers concrete implementation of `RegisterableItemsFactory` to obtain handlers and listeners that shall be registered on instances of `KieSession`

  Specified by:
    `getRegisterableItemsFactory` in interface `RuntimeEnvironment`
  Returns:

### close

    public void close()

  Description copied from interface: `RuntimeEnvironment`
  Closes the environment allowing to close all depending components such as ksession factories, etc

  Specified by:
    `close` in interface `RuntimeEnvironment`

### addIfPresent

    protected void addIfPresent(String name,
                                Environment copy)

### copyEnvironment

    protected Environment copyEnvironment()

### getMapper

    public org.kie.internal.runtime.manager.Mapper getMapper()

### getUserGroupCallback

    public UserGroupCallback getUserGroupCallback()

  Description copied from interface: `RuntimeEnvironment`
  Delivers concrete implementation of `UserGroupCallback` that shall be registered on instances of `TaskService` for managing users and groups.

  Specified by:
    `getUserGroupCallback` in interface `RuntimeEnvironment`
  Returns:

### setUserGroupCallback

    public void setUserGroupCallback(UserGroupCallback userGroupCallback)

### getSessionConfigProperties

    public Properties getSessionConfigProperties()

### setSessionConfigProperties

    public void setSessionConfigProperties(Properties sessionConfigProperties)

### setUsePersistence

    public void setUsePersistence(boolean usePersistence)

### setKieBase

    public void setKieBase(KieBase kbase)

### setMapper

    public void setMapper(org.kie.internal.runtime.manager.Mapper mapper)

### getSchedulerService

    public GlobalSchedulerService getSchedulerService()

  Description copied from interface: `SchedulerProvider`
  Returns fully configured instance of `SchedulerService` ready to be used/

  Specified by:
    `getSchedulerService` in interface `SchedulerProvider`
  Returns:
    `GlobalSchedulerService` instance configured according to environment needs

### setSchedulerService

    public void setSchedulerService(GlobalSchedulerService schedulerService)

### setRegisterableItemsFactory

    public void setRegisterableItemsFactory(RegisterableItemsFactory registerableItemsFactory)

### getEmf

    public javax.persistence.EntityManagerFactory getEmf()

### setEmf

    public void setEmf(javax.persistence.EntityManagerFactory emf)

### getClassLoader

    public ClassLoader getClassLoader()

  Description copied from interface: `RuntimeEnvironment`
  Delivers custom class loader that shall be used by the process engine and task service instances

  Specified by:
    `getClassLoader` in interface `RuntimeEnvironment`
  Returns:

### setClassLoader

    public void setClassLoader(ClassLoader classLoader)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.1.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.