Search in sources :

Example 1 with Container

use of org.apache.openejb.Container in project tomee by apache.

the class EjbSelect method execute_void.

/**
     * Perform a select operation when the return value is
     * a void.  This one is slightly different from the
     * rest, as the container operation performed is an
     * update() rather than a select() because there's
     * no value to return.
     *
     * @param obj             The ejb object we're executing on behalf of.
     * @param methodSignature The signature of the selectxxxx method being invoked.
     * @param args            The arguments to the select.  These need to match
     *                        the method signature.
     * @throws FinderException
     */
public static void execute_void(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;
    cmpContainer.update(beanContext, methodSignature, args);
}
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 2 with Container

use of org.apache.openejb.Container in project tomee by apache.

the class EjbSelect method execute_short.

public static short execute_short(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, "short", args);
    return result.shortValue();
}
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 3 with Container

use of org.apache.openejb.Container in project tomee by apache.

the class EjbSelect method execute_char.

public static char execute_char(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 Character result = (Character) cmpContainer.select(beanContext, methodSignature, "char", args);
    return result.charValue();
}
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 4 with Container

use of org.apache.openejb.Container in project tomee by apache.

the class EjbSelect method execute_long.

public static long execute_long(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, "long", args);
    return result.longValue();
}
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 5 with Container

use of org.apache.openejb.Container in project tomee by apache.

the class EjbSelect method execute_float.

public static float execute_float(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, "float", args);
    return result.floatValue();
}
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

Container (org.apache.openejb.Container)16 BeanContext (org.apache.openejb.BeanContext)13 FinderException (javax.ejb.FinderException)10 CmpContainer (org.apache.openejb.core.cmp.CmpContainer)10 OpenEJBException (org.apache.openejb.OpenEJBException)5 JMXContainer (org.apache.openejb.assembler.monitoring.JMXContainer)4 IOException (java.io.IOException)3 InvalidObjectException (java.io.InvalidObjectException)3 ObjectStreamException (java.io.ObjectStreamException)3 MalformedURLException (java.net.MalformedURLException)3 URISyntaxException (java.net.URISyntaxException)3 ArrayList (java.util.ArrayList)3 ExecutionException (java.util.concurrent.ExecutionException)3 TimeoutException (java.util.concurrent.TimeoutException)3 DefinitionException (javax.enterprise.inject.spi.DefinitionException)3 DeploymentException (javax.enterprise.inject.spi.DeploymentException)3 InstanceNotFoundException (javax.management.InstanceNotFoundException)3 MBeanRegistrationException (javax.management.MBeanRegistrationException)3 MalformedObjectNameException (javax.management.MalformedObjectNameException)3 ObjectName (javax.management.ObjectName)3