Search in sources :

Example 11 with CmpContainer

use of org.apache.openejb.core.cmp.CmpContainer in project tomee by apache.

the class EjbSelect method execute_boolean.

public static boolean execute_boolean(final Object obj, final String methodSignature, final Object... args) throws FinderException {
    final BeanContext beanContext = (BeanContext) obj;
    final Container container = beanContext.getContainer();
    if (!(container instanceof CmpContainer)) {
        throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
    }
    final CmpContainer cmpContainer = (CmpContainer) container;
    final Boolean result = (Boolean) cmpContainer.select(beanContext, methodSignature, "byte", args);
    return result.booleanValue();
}
Also used : BeanContext(org.apache.openejb.BeanContext) FinderException(javax.ejb.FinderException) CmpContainer(org.apache.openejb.core.cmp.CmpContainer) Container(org.apache.openejb.Container) CmpContainer(org.apache.openejb.core.cmp.CmpContainer)

Example 12 with CmpContainer

use of org.apache.openejb.core.cmp.CmpContainer in project tomee by apache.

the class EjbSelect method execute_int.

public static int execute_int(final Object obj, final String methodSignature, final Object... args) throws FinderException {
    final BeanContext beanContext = (BeanContext) obj;
    final Container container = beanContext.getContainer();
    if (!(container instanceof CmpContainer)) {
        throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
    }
    final CmpContainer cmpContainer = (CmpContainer) container;
    final Number result = (Number) cmpContainer.select(beanContext, methodSignature, "int", args);
    return result.intValue();
}
Also used : BeanContext(org.apache.openejb.BeanContext) FinderException(javax.ejb.FinderException) CmpContainer(org.apache.openejb.core.cmp.CmpContainer) Container(org.apache.openejb.Container) CmpContainer(org.apache.openejb.core.cmp.CmpContainer)

Example 13 with CmpContainer

use of org.apache.openejb.core.cmp.CmpContainer in project tomee by apache.

the class EjbSelect method execute_double.

public static double execute_double(final Object obj, final String methodSignature, final Object... args) throws FinderException {
    final BeanContext beanContext = (BeanContext) obj;
    final Container container = beanContext.getContainer();
    if (!(container instanceof CmpContainer)) {
        throw new FinderException("Deployment is not connected to a CmpContainer " + beanContext.getDeploymentID());
    }
    final CmpContainer cmpContainer = (CmpContainer) container;
    final Number result = (Number) cmpContainer.select(beanContext, methodSignature, "double", args);
    return result.doubleValue();
}
Also used : BeanContext(org.apache.openejb.BeanContext) FinderException(javax.ejb.FinderException) CmpContainer(org.apache.openejb.core.cmp.CmpContainer) Container(org.apache.openejb.Container) CmpContainer(org.apache.openejb.core.cmp.CmpContainer)

Aggregations

CmpContainer (org.apache.openejb.core.cmp.CmpContainer)13 FinderException (javax.ejb.FinderException)10 BeanContext (org.apache.openejb.BeanContext)10 Container (org.apache.openejb.Container)10 EntityBean (javax.ejb.EntityBean)2 EjbObjectProxyHandler (org.apache.openejb.core.ivm.EjbObjectProxyHandler)2 EJBLocalObject (javax.ejb.EJBLocalObject)1 EJBObject (javax.ejb.EJBObject)1