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

## org.jbpm.services.cdi.impl.manager
Class InjectableRegisterableItemsFactory

    java.lang.Object
      org.jbpm.runtime.manager.impl.SimpleRegisterableItemsFactory
          org.jbpm.runtime.manager.impl.DefaultRegisterableItemsFactory
              org.jbpm.services.cdi.impl.manager.InjectableRegisterableItemsFactory

All Implemented Interfaces:
  RegisterableItemsFactory, org.kie.internal.runtime.manager.InternalRegisterableItemsFactory

    public class InjectableRegisterableItemsFactory

extends DefaultRegisterableItemsFactory

Implementation of `RegisterableItemsFactory` dedicated to CDI environments that allows to get injections of following components:

- `ExternalTaskEventListener` - required bean
- `WorkItemHandlerProducer` - optional bean (0 or more)
- `EventListenerProducer>` - optional bean (0 or more)
- `EventListenerProducer>` - optional bean (0 or more)
- `EventListenerProducer>` - optional bean (0 or more)
- `RuntimeFinder` - optional required only when single CDI bean is going to manage many `RuntimeManager` instances

In addition to that, `AbstractAuditLogger` can be set after bean has been injected if the default is not sufficient. Although this factory extends `DefaultRegisterableItemsFactory` it will not use any of the listeners and handlers that comes from the super class. It mainly relies on CDI injections where the only exception from this rule is `AbstractAuditLogger`
Even though this is fully qualified bean for injection it provides helper methods to build its instances using `BeanManager` in case more independent instances are required.

- getFactory(BeanManager, AbstractAuditLogger)
- getFactory(BeanManager, AbstractAuditLogger, KieContainer, String)

Field Summary

Fields inherited from class org.jbpm.runtime.manager.impl.SimpleRegisterableItemsFactory
`runtimeManager`

Constructor Summary
`InjectableRegisterableItemsFactory()`

Method Summary
`List<AgendaEventListener>` | `getAgendaEventListeners(RuntimeEngine runtime)` Returns new instances of `AgendaEventListener` that will be registered on `RuntimeEngine`
`AbstractAuditLogger` | `getAuditlogger()`
`protected AbstractAuditLogger` | `getAuditLoggerInstance(RuntimeEngine engine)` Provides AuditLogger implementation, JPA or JMS.
`static RegisterableItemsFactory` | `getFactory(javax.enterprise.inject.spi.BeanManager beanManager, AbstractAuditLogger auditlogger)` Allows to create instance of this class dynamically via `BeanManager`.
`static RegisterableItemsFactory` | `getFactory(javax.enterprise.inject.spi.BeanManager beanManager, AbstractAuditLogger auditlogger, KieContainer kieContainer, String ksessionName)` Allows to create instance of this class dynamically via `BeanManager`.
`static RegisterableItemsFactory` | `getFactory(javax.enterprise.inject.spi.BeanManager beanManager, AuditEventBuilder eventBuilder)` Allows to create instance of this class dynamically via `BeanManager`.
`static RegisterableItemsFactory` | `getFactory(javax.enterprise.inject.spi.BeanManager beanManager, AuditEventBuilder eventBuilder, KieContainer kieContainer, String ksessionName)` Allows to create instance of this class dynamically via `BeanManager`.
`Map<String,Object>` | `getGlobals(RuntimeEngine runtime)` Returns globals that shall be registered on `KieSession`.
`protected static
`<T> T`
` | `getInstanceByType(javax.enterprise.inject.spi.BeanManager manager, Class<T> type, Annotation... bindings)`
`KieContainer` | `getKieContainer()`
`String` | `getKsessionName()`
`List<ProcessEventListener>` | `getProcessEventListeners(RuntimeEngine runtime)` Returns new instances of `ProcessEventListener` that will be registered on `RuntimeEngine`
`List<RuleRuntimeEventListener>` | `getRuleRuntimeEventListeners(RuntimeEngine runtime)` Returns new instances of `RuleRuntimeEventListener` that will be registered on `RuntimeEngine`
`List<TaskLifeCycleEventListener>` | `getTaskListeners()` Return new instances of `TaskLifeCycleEventListener` that will be registered on `RuntimeEngine`.
`Map<String,WorkItemHandler>` | `getWorkItemHandlers(RuntimeEngine runtime)` Returns new instances of `WorkItemHandler` that will be registered on `RuntimeEngine`
`void` | `setAuditlogger(AbstractAuditLogger auditlogger)`
`void` | `setKieContainer(KieContainer kieContainer)`
`void` | `setKsessionName(String ksessionName)`

Methods inherited from class org.jbpm.runtime.manager.impl.DefaultRegisterableItemsFactory
`getAuditBuilder, getAuditBuilder, getEventListenerFromDescriptor, getGlobalsFromDescriptor, getHTWorkItemHandler, getInstanceFromModel, getParametersMap, getTaskListenersFromDescriptor, getWorkItemHandlersFromDescriptor, setAuditBuilder`

Methods inherited from class org.jbpm.runtime.manager.impl.SimpleRegisterableItemsFactory
`addAgendaListener, addGlobal, addProcessListener, addTaskListener, addWorkingMemoryListener, addWorkItemHandler, createInstance, getRuntimeManager, setRuntimeManager`

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

Constructor Detail

### InjectableRegisterableItemsFactory

    public InjectableRegisterableItemsFactory()

Method Detail

### getWorkItemHandlers

    public Map<String,WorkItemHandler> getWorkItemHandlers(RuntimeEngine runtime)

  Description copied from interface: `RegisterableItemsFactory`
  Returns new instances of `WorkItemHandler` that will be registered on `RuntimeEngine`

  Specified by:
    `getWorkItemHandlers` in interface `RegisterableItemsFactory`
  Overrides:
    `getWorkItemHandlers` in class `DefaultRegisterableItemsFactory`
  Parameters:
    `runtime` - provides `RuntimeEngine` in case handler need to make use of it internally
  Returns:
    map of handlers to be registered - in case of no handlers empty map shall be returned.

### getProcessEventListeners

    public List<ProcessEventListener> getProcessEventListeners(RuntimeEngine runtime)

  Description copied from interface: `RegisterableItemsFactory`
  Returns new instances of `ProcessEventListener` that will be registered on `RuntimeEngine`

  Specified by:
    `getProcessEventListeners` in interface `RegisterableItemsFactory`
  Overrides:
    `getProcessEventListeners` in class `DefaultRegisterableItemsFactory`
  Parameters:
    `runtime` - provides `RuntimeEngine` in case listeners need to make use of it internally
  Returns:
    list of listeners to be registered - in case of no listeners empty list shall be returned.

### getRuleRuntimeEventListeners

    public List<RuleRuntimeEventListener> getRuleRuntimeEventListeners(RuntimeEngine runtime)

  Description copied from interface: `RegisterableItemsFactory`
  Returns new instances of `RuleRuntimeEventListener` that will be registered on `RuntimeEngine`

  Specified by:
    `getRuleRuntimeEventListeners` in interface `RegisterableItemsFactory`
  Overrides:
    `getRuleRuntimeEventListeners` in class `DefaultRegisterableItemsFactory`
  Parameters:
    `runtime` - provides `RuntimeEngine` in case listeners need to make use of it internally
  Returns:
    list of listeners to be registered - in case of no listeners empty list shall be returned.

### getAgendaEventListeners

    public List<AgendaEventListener> getAgendaEventListeners(RuntimeEngine runtime)

  Description copied from interface: `RegisterableItemsFactory`
  Returns new instances of `AgendaEventListener` that will be registered on `RuntimeEngine`

  Specified by:
    `getAgendaEventListeners` in interface `RegisterableItemsFactory`
  Overrides:
    `getAgendaEventListeners` in class `DefaultRegisterableItemsFactory`
  Parameters:
    `runtime` - provides `RuntimeEngine` in case listeners need to make use of it internally
  Returns:
    list of listeners to be registered - in case of no listeners empty list shall be returned.

### getTaskListeners

    public List<TaskLifeCycleEventListener> getTaskListeners()

  Description copied from interface: `RegisterableItemsFactory`
  Return new instances of `TaskLifeCycleEventListener` that will be registered on `RuntimeEngine`.

  Specified by:
    `getTaskListeners` in interface `RegisterableItemsFactory`
  Overrides:
    `getTaskListeners` in class `DefaultRegisterableItemsFactory`
  Returns:

### getGlobals

    public Map<String,Object> getGlobals(RuntimeEngine runtime)

  Description copied from interface: `RegisterableItemsFactory`
  Returns globals that shall be registered on `KieSession`.

  Specified by:
    `getGlobals` in interface `RegisterableItemsFactory`
  Overrides:
    `getGlobals` in class `DefaultRegisterableItemsFactory`
  Parameters:
    `runtime` - provides `RuntimeEngine` in case globals need to make use of it internally
  Returns:
    map of globals to be registered - in case of no globals empty map shall be returned.

### getFactory

    public static RegisterableItemsFactory getFactory(javax.enterprise.inject.spi.BeanManager beanManager,
                                                      AbstractAuditLogger auditlogger)

  Allows to create instance of this class dynamically via `BeanManager`. This is useful in case multiple independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.

  Parameters:
    `beanManager` - - bean manager instance of the container
    `auditlogger` - - `AbstractAuditLogger` logger instance to be used, might be null
  Returns:
    new instance of the factory

### getFactory

    public static RegisterableItemsFactory getFactory(javax.enterprise.inject.spi.BeanManager beanManager,
                                                      AbstractAuditLogger auditlogger,
                                                      KieContainer kieContainer,
                                                      String ksessionName)

  Allows to create instance of this class dynamically via `BeanManager`. This is useful in case multiple independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.

  Parameters:
    `beanManager` - - bean manager instance of the container
    `auditlogger` - - `AbstractAuditLogger` logger instance to be used, might be null
    `kieContainer` - - `KieContainer` that the factory is built for
    `ksessionName` - - name of the ksession defined in kmodule to be used, if not given default ksession from kmodule will be used.
  Returns:

### getFactory

    public static RegisterableItemsFactory getFactory(javax.enterprise.inject.spi.BeanManager beanManager,
                                                      AuditEventBuilder eventBuilder)

  Allows to create instance of this class dynamically via `BeanManager`. This is useful in case multiple independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.

  Parameters:
    `beanManager` - - bean manager instance of the container
    `eventBuilder` - - `AuditEventBuilder` logger builder instance to be used, might be null
  Returns:
    new instance of the factory

### getFactory

    public static RegisterableItemsFactory getFactory(javax.enterprise.inject.spi.BeanManager beanManager,
                                                      AuditEventBuilder eventBuilder,
                                                      KieContainer kieContainer,
                                                      String ksessionName)

  Allows to create instance of this class dynamically via `BeanManager`. This is useful in case multiple independent instances are required on runtime and that need cannot be satisfied with regular CDI practices.

  Parameters:
    `beanManager` - - bean manager instance of the container
    `eventBuilder` - - `AbstractAuditLogger` logger builder instance to be used, might be null
    `kieContainer` - - `KieContainer` that the factory is built for
    `ksessionName` - - name of the ksession defined in kmodule to be used, if not given default ksession from kmodule will be used.
  Returns:

### getInstanceByType

    protected static <T> T getInstanceByType(javax.enterprise.inject.spi.BeanManager manager,
                                             Class<T> type,
                                             Annotation... bindings)

### getAuditlogger

    public AbstractAuditLogger getAuditlogger()

### setAuditlogger

    public void setAuditlogger(AbstractAuditLogger auditlogger)

### getKieContainer

    public KieContainer getKieContainer()

### setKieContainer

    public void setKieContainer(KieContainer kieContainer)

### getKsessionName

    public String getKsessionName()

### setKsessionName

    public void setKsessionName(String ksessionName)

### getAuditLoggerInstance

    protected AbstractAuditLogger getAuditLoggerInstance(RuntimeEngine engine)

  Provides AuditLogger implementation, JPA or JMS. JPA is the default one and JMS requires to have configuration file (.properties) to be available on classpath under 'jbpm.audit.jms.properties' name. This file must have following properties defined:
  - jbpm.audit.jms.connection.factory.jndi - JNDI name of the connection factory to look up - type String
  - jbpm.audit.jms.queue.jndi - JNDI name of the queue to look up - type String

  Returns:
    instance of the audit logger

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| jBPM distribution 6.2.0.Beta1
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.