Search in sources :

Example 6 with ClientMetaData

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

the class ClientObjectFactory method getBusinessObject.

@Override
public Object getBusinessObject(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) {
        e.printStackTrace();
    }
    final ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
    final EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(null, null, beanContext.getPrimaryKeyClass(), beanContext.getComponentType().toString(), beanContext.getDeploymentID().toString(), idCode, convert(info.getInterfaceType()), info.getInterfaces(), beanContext.getAsynchronousMethodSignatures());
    eMetaData.loadProperties(beanContext.getProperties());
    final Object primKey = info.getPrimaryKey();
    final EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(JNDIContext.globalExecutor(), eMetaData, getServerMetaData(), cMetaData, primKey, null);
    return hanlder.createEJBObjectProxy();
}
Also used : BeanContext(org.apache.openejb.BeanContext) EJBMetaDataImpl(org.apache.openejb.client.EJBMetaDataImpl) EJBObjectHandler(org.apache.openejb.client.EJBObjectHandler) ClientMetaData(org.apache.openejb.client.ClientMetaData)

Aggregations

ClientMetaData (org.apache.openejb.client.ClientMetaData)6 BeanContext (org.apache.openejb.BeanContext)5 EJBMetaDataImpl (org.apache.openejb.client.EJBMetaDataImpl)5 EJBObjectHandler (org.apache.openejb.client.EJBObjectHandler)3 EJBHomeHandler (org.apache.openejb.client.EJBHomeHandler)2 AuthenticationRequest (org.apache.openejb.client.AuthenticationRequest)1 AuthenticationResponse (org.apache.openejb.client.AuthenticationResponse)1 EJBHomeHandle (org.apache.openejb.client.EJBHomeHandle)1 EJBObjectHandle (org.apache.openejb.client.EJBObjectHandle)1 SecurityService (org.apache.openejb.spi.SecurityService)1