Search in sources :

Example 1 with EJBObjectHandle

use of org.apache.openejb.client.EJBObjectHandle in project tomee by apache.

the class ClientObjectFactory method getHandle.

@Override
public javax.ejb.Handle getHandle(final ProxyInfo info) {
    final CallContext call = CallContext.getCallContext();
    final BeanContext beanContext = info.getBeanContext();
    final int idCode = -1;
    Object securityIdentity = null;
    try {
        securityIdentity = call.getEJBRequest().getClientIdentity();
    } catch (Exception e) {
    // Ignore
    }
    final ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
    final EJBMetaDataImpl eMetaData = buildEjbMetaData(info, beanContext, idCode);
    final Object primKey = info.getPrimaryKey();
    final EJBObjectHandler handler = EJBObjectHandler.createEJBObjectHandler(JNDIContext.globalExecutor(), eMetaData, getServerMetaData(), cMetaData, primKey, null);
    return new EJBObjectHandle(handler.createEJBObjectProxy());
}
Also used : BeanContext(org.apache.openejb.BeanContext) EJBMetaDataImpl(org.apache.openejb.client.EJBMetaDataImpl) EJBObjectHandler(org.apache.openejb.client.EJBObjectHandler) EJBObjectHandle(org.apache.openejb.client.EJBObjectHandle) ClientMetaData(org.apache.openejb.client.ClientMetaData)

Aggregations

BeanContext (org.apache.openejb.BeanContext)1 ClientMetaData (org.apache.openejb.client.ClientMetaData)1 EJBMetaDataImpl (org.apache.openejb.client.EJBMetaDataImpl)1 EJBObjectHandle (org.apache.openejb.client.EJBObjectHandle)1 EJBObjectHandler (org.apache.openejb.client.EJBObjectHandler)1