org.apache.openejb.core.cmp
Class CmpContainer

java.lang.Object
  extended by org.apache.openejb.core.cmp.CmpContainer
All Implemented Interfaces:
Container, RpcContainer

public class CmpContainer
extends Object
implements RpcContainer


Field Summary
protected  Map<Class,BeanContext> beansByClass
          When events are fired from the CMP engine only an entity bean instance is returned.
protected  CmpEngine cmpEngine
          The CmpEngine which performs the actual persistence operations
protected  Object containerID
           
protected  Map<Object,BeanContext> deploymentsById
          Index used for getDeployments() and getDeploymentInfo(deploymentId).
protected  EntrancyTracker entrancyTracker
          Tracks entity instances that have been "entered" so we can throw reentrancy exceptions.
protected  SecurityService securityService
           
protected  TransactionSynchronizationRegistry synchronizationRegistry
           
 
Constructor Summary
CmpContainer(Object id, TransactionManager transactionManager, SecurityService securityService, String cmpEngineFactory)
           
 
Method Summary
 void deploy(BeanContext beanContext)
           
 BeanContext getBeanContext(Object deploymentID)
           
 BeanContext[] getBeanContexts()
           
 Object getContainerID()
           
 ContainerType getContainerType()
           
 Object getEjbInstance(BeanContext beanContext, Object primaryKey)
           
 Object invoke(Object deployID, InterfaceType type, Class callInterface, Method callMethod, Object[] args, Object primKey)
           
 Object select(BeanContext beanContext, String methodSignature, String returnType, Object... args)
           
 void start(BeanContext beanContext)
           
 void stop(BeanContext beanContext)
           
 void undeploy(BeanContext beanContext)
           
 int update(BeanContext beanContext, String methodSignature, Object... args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

containerID

protected final Object containerID

securityService

protected final SecurityService securityService

deploymentsById

protected final Map<Object,BeanContext> deploymentsById
Index used for getDeployments() and getDeploymentInfo(deploymentId).


beansByClass

protected final Map<Class,BeanContext> beansByClass
When events are fired from the CMP engine only an entity bean instance is returned. The type of the bean is used to find the deployment info. This means that when the same type is used multiple ejb deployments a random deployment will be selected to handle the ejb callback.


cmpEngine

protected final CmpEngine cmpEngine
The CmpEngine which performs the actual persistence operations


entrancyTracker

protected EntrancyTracker entrancyTracker
Tracks entity instances that have been "entered" so we can throw reentrancy exceptions.


synchronizationRegistry

protected TransactionSynchronizationRegistry synchronizationRegistry
Constructor Detail

CmpContainer

public CmpContainer(Object id,
                    TransactionManager transactionManager,
                    SecurityService securityService,
                    String cmpEngineFactory)
             throws OpenEJBException
Throws:
OpenEJBException
Method Detail

getContainerID

public Object getContainerID()
Specified by:
getContainerID in interface Container

getContainerType

public ContainerType getContainerType()
Specified by:
getContainerType in interface Container

getBeanContexts

public BeanContext[] getBeanContexts()
Specified by:
getBeanContexts in interface Container

getBeanContext

public BeanContext getBeanContext(Object deploymentID)
Specified by:
getBeanContext in interface Container

deploy

public void deploy(BeanContext beanContext)
            throws OpenEJBException
Specified by:
deploy in interface Container
Throws:
OpenEJBException

start

public void start(BeanContext beanContext)
           throws OpenEJBException
Specified by:
start in interface Container
Throws:
OpenEJBException

stop

public void stop(BeanContext beanContext)
          throws OpenEJBException
Specified by:
stop in interface Container
Throws:
OpenEJBException

undeploy

public void undeploy(BeanContext beanContext)
              throws OpenEJBException
Specified by:
undeploy in interface Container
Throws:
OpenEJBException

getEjbInstance

public Object getEjbInstance(BeanContext beanContext,
                             Object primaryKey)

invoke

public Object invoke(Object deployID,
                     InterfaceType type,
                     Class callInterface,
                     Method callMethod,
                     Object[] args,
                     Object primKey)
              throws OpenEJBException
Specified by:
invoke in interface RpcContainer
Throws:
OpenEJBException

select

public Object select(BeanContext beanContext,
                     String methodSignature,
                     String returnType,
                     Object... args)
              throws javax.ejb.FinderException
Throws:
javax.ejb.FinderException

update

public int update(BeanContext beanContext,
                  String methodSignature,
                  Object... args)
           throws javax.ejb.FinderException
Throws:
javax.ejb.FinderException


Copyright © 1999–2015 The Apache Software Foundation. All rights reserved.