use of com.sun.ejb.containers.RemoteBusinessWrapperBase in project Payara by payara.
the class EJBUtils method resolveEjbRefObject.
public static Object resolveEjbRefObject(EjbReferenceDescriptor refDesc, Object jndiObj) throws NamingException {
Object returnObject = jndiObj;
if (refDesc.isLocal()) {
EjbDescriptor target = refDesc.getEjbDescriptor();
BaseContainer container = EjbContainerUtilImpl.getInstance().getContainer(target.getUniqueId());
if (refDesc.isEJB30ClientView()) {
GenericEJBLocalHome genericLocalHome = container.getEJBLocalBusinessHome(refDesc.getEjbInterface());
returnObject = genericLocalHome.create(refDesc.getEjbInterface());
} else {
returnObject = container.getEJBLocalHome();
}
} else {
if (refDesc.isEJB30ClientView() && !(jndiObj instanceof RemoteBusinessWrapperBase)) {
returnObject = EJBUtils.lookupRemote30BusinessObject(jndiObj, refDesc.getEjbInterface());
}
}
return returnObject;
}
use of com.sun.ejb.containers.RemoteBusinessWrapperBase in project Payara by payara.
the class EJBUtils method createRemoteBusinessObject.
public static RemoteBusinessWrapperBase createRemoteBusinessObject(ClassLoader loader, String businessInterface, java.rmi.Remote delegate) throws Exception {
String wrapperClassName = EJBUtils.getGeneratedRemoteWrapperName(businessInterface);
Class clientWrapperClass = loader.loadClass(wrapperClassName);
Constructor[] ctors = clientWrapperClass.getConstructors();
Constructor ctor = null;
for (Constructor next : ctors) {
if (next.getParameterTypes().length > 0) {
ctor = next;
break;
}
}
Object obj = ctor.newInstance(new Object[] { delegate, businessInterface });
return (RemoteBusinessWrapperBase) obj;
}
use of com.sun.ejb.containers.RemoteBusinessWrapperBase in project Payara by payara.
the class SerializableS1ASEJBObjectReference method replaceObject.
/**
* This code is needed to serialize non-Serializable objects that
* can be part of a bean's state. See EJB2.0 section 7.4.1.
*/
public Object replaceObject(Object obj) throws IOException {
Object result = obj;
// Until we've identified a remote object, we can't assume the orb is
// available in the container. If the orb is not present, this will be null.
ProtocolManager protocolMgr = getProtocolManager();
if (obj instanceof RemoteBusinessWrapperBase) {
result = getRemoteBusinessObjectFactory((RemoteBusinessWrapperBase) obj);
} else if ((protocolMgr != null) && protocolMgr.isStub(obj) && protocolMgr.isLocal(obj)) {
org.omg.CORBA.Object target = (org.omg.CORBA.Object) obj;
// If we're here, it's always for the 2.x RemoteHome view.
// There is no remote business wrapper class.
result = getSerializableEJBReference(target, protocolMgr, null);
}
return result;
}
Aggregations