use of org.apache.openejb.client.EJBMetaDataImpl in project tomee by apache.
the class ClientObjectFactory method getEJBObject.
@Override
public javax.ejb.EJBObject getEJBObject(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 = buildEjbMetaData(info, beanContext, idCode);
final Object primKey = info.getPrimaryKey();
final EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(JNDIContext.globalExecutor(), eMetaData, getServerMetaData(), cMetaData, primKey, null);
return (javax.ejb.EJBObject) hanlder.createEJBObjectProxy();
}
use of org.apache.openejb.client.EJBMetaDataImpl 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());
}
use of org.apache.openejb.client.EJBMetaDataImpl in project tomee by apache.
the class DeploymentIndexTest method testGetDeploymentEJBRequestRemoteException.
@Test(expected = RemoteException.class)
public void testGetDeploymentEJBRequestRemoteException() throws RemoteException {
// 0 causes DeploymentIndex to move further
final EJBMetaDataImpl ejbMetadata = new EJBMetaDataImpl(null, null, null, null, null, 0, InterfaceType.BUSINESS_REMOTE, null, null);
final EJBRequest request = new EJBRequest(null, ejbMetadata, method, null, null, null);
deploymentIndex.getDeployment(request);
}
use of org.apache.openejb.client.EJBMetaDataImpl 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();
}
use of org.apache.openejb.client.EJBMetaDataImpl in project tomee by apache.
the class ClientObjectFactory method buildEjbMetaData.
private EJBMetaDataImpl buildEjbMetaData(final ProxyInfo info, final BeanContext beanContext, final int idCode) {
final EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(beanContext.getHomeInterface(), beanContext.getRemoteInterface(), beanContext.getPrimaryKeyClass(), beanContext.getComponentType().toString(), beanContext.getDeploymentID().toString(), idCode, convert(info.getInterfaceType()), info.getInterfaces(), beanContext.getAsynchronousMethodSignatures());
eMetaData.loadProperties(beanContext.getProperties());
return eMetaData;
}
Aggregations