Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.0.0.CR2
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, org.kie.internal.runtime.manager.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 org.kie.internal.runtime.manager.RegisterableItemsFactory` | `registerableItemsFactory`
`protected GlobalSchedulerService` | `schedulerService`
`protected Properties` | `sessionConfigProperties`
`protected boolean` | `usePersistence`
`protected org.kie.internal.task.api.UserGroupCallback` | `userGroupCallback`

Constructor Summary
`SimpleRuntimeEnvironment()`
`SimpleRuntimeEnvironment(org.kie.internal.runtime.manager.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()`
`protected Environment` | `copyEnvironment()`
`ClassLoader` | `getClassLoader()`
`KieSessionConfiguration` | `getConfiguration()`
`javax.persistence.EntityManagerFactory` | `getEmf()`
`Environment` | `getEnvironment()`
`KieBase` | `getKieBase()`
`org.kie.internal.runtime.manager.Mapper` | `getMapper()`
`org.kie.internal.runtime.manager.RegisterableItemsFactory` | `getRegisterableItemsFactory()`
`GlobalSchedulerService` | `getSchedulerService()` Returns fully configured instance of `SchedulerService` ready to be used/
`Properties` | `getSessionConfigProperties()`
`org.kie.internal.task.api.UserGroupCallback` | `getUserGroupCallback()`
`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(org.kie.internal.runtime.manager.RegisterableItemsFactory registerableItemsFactory)`
`void` | `setSchedulerService(GlobalSchedulerService schedulerService)`
`void` | `setSessionConfigProperties(Properties sessionConfigProperties)`
`void` | `setUsePersistence(boolean usePersistence)`
`void` | `setUserGroupCallback(org.kie.internal.task.api.UserGroupCallback userGroupCallback)`
`boolean` | `usePersistence()`

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 org.kie.internal.runtime.manager.RegisterableItemsFactory registerableItemsFactory

### mapper

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

### userGroupCallback

    protected org.kie.internal.task.api.UserGroupCallback userGroupCallback

### schedulerService

    protected GlobalSchedulerService schedulerService

### classLoader

    protected ClassLoader classLoader

### sessionConfigProperties

    protected Properties sessionConfigProperties

Constructor Detail

### SimpleRuntimeEnvironment

    public SimpleRuntimeEnvironment()

### SimpleRuntimeEnvironment

    public SimpleRuntimeEnvironment(org.kie.internal.runtime.manager.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()

  Specified by:
    `getKieBase` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### getEnvironment

    public Environment getEnvironment()

  Specified by:
    `getEnvironment` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### getConfiguration

    public KieSessionConfiguration getConfiguration()

  Specified by:
    `getConfiguration` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### usePersistence

    public boolean usePersistence()

  Specified by:
    `usePersistence` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### getRegisterableItemsFactory

    public org.kie.internal.runtime.manager.RegisterableItemsFactory getRegisterableItemsFactory()

  Specified by:
    `getRegisterableItemsFactory` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### close

    public void close()

  Specified by:
    `close` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### addIfPresent

    protected void addIfPresent(String name,
                                Environment copy)

### copyEnvironment

    protected Environment copyEnvironment()

### getMapper

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

  Specified by:
    `getMapper` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### getUserGroupCallback

    public org.kie.internal.task.api.UserGroupCallback getUserGroupCallback()

  Specified by:
    `getUserGroupCallback` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### setUserGroupCallback

    public void setUserGroupCallback(org.kie.internal.task.api.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(org.kie.internal.runtime.manager.RegisterableItemsFactory registerableItemsFactory)

### getEmf

    public javax.persistence.EntityManagerFactory getEmf()

### setEmf

    public void setEmf(javax.persistence.EntityManagerFactory emf)

### getClassLoader

    public ClassLoader getClassLoader()

  Specified by:
    `getClassLoader` in interface `org.kie.internal.runtime.manager.RuntimeEnvironment`

### setClassLoader

    public void setClassLoader(ClassLoader classLoader)

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

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