use of com.sun.ejb.spi.container.OptionalLocalInterfaceProvider in project Payara by payara.
the class JavaEEInterceptorBuilderImpl method createInvoker.
public InterceptorInvoker createInvoker(Object instance) throws Exception {
interceptorInfo.setTargetObjectInstance(instance);
// Proxy invocation handler. Also implements InterceptorInvoker.
InterceptorInvocationHandler invoker = new InterceptorInvocationHandler();
Proxy proxy = (Proxy) Proxy.newProxyInstance(subClass.getClassLoader(), new Class[] { subClassIntf }, invoker);
// Object passed back to the caller.
OptionalLocalInterfaceProvider provider = (OptionalLocalInterfaceProvider) subClass.newInstance();
provider.setOptionalLocalIntfProxy(proxy);
invoker.init(instance, interceptorManager.createInterceptorInstances(), provider, interceptorManager);
return invoker;
}
use of com.sun.ejb.spi.container.OptionalLocalInterfaceProvider in project Payara by payara.
the class MessageBeanContainer method createMessageBeanProxy.
/**
* Generates the appropriate Proxy based on the message listener type.
*
* @param handler InvocationHandler responsible for calls on the proxy
* @return an object implementing MessageEndpoint and the appropriate MDB view
* @throws Exception
*/
@Override
public Object createMessageBeanProxy(InvocationHandler handler) throws Exception {
if (isNoMethodsListenerInterface(messageListenerType_)) {
// EJB 3.2 No-interface MDB View
Proxy proxy = (Proxy) Proxy.newProxyInstance(loader, new Class[] { messageBeanInterface_ }, handler);
OptionalLocalInterfaceProvider provider = (OptionalLocalInterfaceProvider) messageBeanSubClass_.newInstance();
provider.setOptionalLocalIntfProxy(proxy);
return provider;
} else {
// EJB 3.1 - 2.0 Interface View
return Proxy.newProxyInstance(loader, new Class[] { messageListenerType_, MessageEndpoint.class }, handler);
}
}
use of com.sun.ejb.spi.container.OptionalLocalInterfaceProvider in project Payara by payara.
the class SafeProperties method instantiateOptionalEJBLocalBusinessObjectImpl.
protected EJBLocalObjectImpl instantiateOptionalEJBLocalBusinessObjectImpl() throws Exception {
EJBLocalObjectInvocationHandler handler = new EJBLocalObjectInvocationHandler(proxyInvocationInfoMap, true);
EJBLocalObjectImpl localBusinessObjImpl = handler;
ejbOptionalLocalBusinessObjectProxyCtor.newInstance(new Object[] { handler });
localBusinessObjImpl.setContainer(this);
Class businessIntfClass = ejbGeneratedOptionalLocalBusinessIntfClass;
EJBLocalObjectInvocationHandlerDelegate delegate = new EJBLocalObjectInvocationHandlerDelegate(businessIntfClass, getContainerId(), handler);
Proxy proxy = (Proxy) Proxy.newProxyInstance(loader, new Class[] { IndirectlySerializable.class, businessIntfClass }, delegate);
String beanSubClassName = ejbGeneratedOptionalLocalBusinessIntfClass.getName() + "__Bean__";
((EjbOptionalIntfGenerator) optIntfClassLoader).generateOptionalLocalInterfaceSubClass(ejbClass, beanSubClassName, ejbGeneratedOptionalLocalBusinessIntfClass);
optIntfClassLoader.loadClass(ejbGeneratedOptionalLocalBusinessIntfClass.getName());
Class subClass = optIntfClassLoader.loadClass(beanSubClassName);
OptionalLocalInterfaceProvider provider = (OptionalLocalInterfaceProvider) subClass.newInstance();
provider.setOptionalLocalIntfProxy(proxy);
localBusinessObjImpl.mapClientObject(ejbClass.getName(), provider);
return localBusinessObjImpl;
}
Aggregations