public Class getRemoteInterface() { return getDeploymentInfo().getRemoteInterface(); }
public List<Class> getObjectInterface(final Class homeInterface) { if (BusinessLocalHome.class.isAssignableFrom(homeInterface)) { return getBusinessLocalInterfaces(); } else if (BusinessRemoteHome.class.isAssignableFrom(homeInterface)) { return getBusinessRemoteInterfaces(); } else if (EJBLocalHome.class.isAssignableFrom(homeInterface)) { final List<Class> classes = new ArrayList<Class>(); classes.add(getLocalInterface()); return classes; } else if (EJBHome.class.isAssignableFrom(homeInterface)) { final List<Class> classes = new ArrayList<Class>(); classes.add(getRemoteInterface()); return classes; } else { throw new IllegalArgumentException("Cannot determine object interface for " + homeInterface); } }
public List<Class> getObjectInterface(final Class homeInterface) { if (BusinessLocalHome.class.isAssignableFrom(homeInterface)) { return getBusinessLocalInterfaces(); } else if (BusinessRemoteHome.class.isAssignableFrom(homeInterface)) { return getBusinessRemoteInterfaces(); } else if (EJBLocalHome.class.isAssignableFrom(homeInterface)) { final List<Class> classes = new ArrayList<Class>(); classes.add(getLocalInterface()); return classes; } else if (EJBHome.class.isAssignableFrom(homeInterface)) { final List<Class> classes = new ArrayList<Class>(); classes.add(getRemoteInterface()); return classes; } else { throw new IllegalArgumentException("Cannot determine object interface for " + homeInterface); } }
public Object createRemoteProxy(final EntityBean bean, final RpcContainer container) { // The KeyGenerator creates a new primary key and populates its fields with the // primary key fields of the bean instance. Each deployment has its own KeyGenerator. final Object primaryKey = keyGenerator.getPrimaryKey(bean); // create the proxy final Object proxy = remoteHandler.createProxy(primaryKey, beanContext.getRemoteInterface()); return proxy; }
public Object createRemoteProxy(final EntityBean bean, final RpcContainer container) { // The KeyGenerator creates a new primary key and populates its fields with the // primary key fields of the bean instance. Each deployment has its own KeyGenerator. final Object primaryKey = keyGenerator.getPrimaryKey(bean); // create the proxy final Object proxy = remoteHandler.createProxy(primaryKey, beanContext.getRemoteInterface()); return proxy; }
public EJBObject getEJBObject() throws IllegalStateException { check(Call.getEJBObject); final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); if (di.getRemoteInterface() == null) { throw new IllegalStateException("EJB " + di.getDeploymentID() + " does not have a remote interface"); } final EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di.getContainer().getBeanContext(di.getDeploymentID()), threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, new ArrayList<Class>(), di.getRemoteInterface()); try { final Class[] interfaces = new Class[]{di.getRemoteInterface(), IntraVmProxy.class}; return (EJBObject) ProxyManager.newProxyInstance(interfaces, handler); } catch (final IllegalAccessException iae) { throw new InternalErrorException("Could not create IVM proxy for " + di.getRemoteInterface() + " interface", iae); } }
public EJBObject getEJBObject() throws IllegalStateException { doCheck(Call.getEJBObject); final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); if (di.getRemoteInterface() == null) { throw new IllegalStateException("EJB " + di.getDeploymentID() + " does not have a remote interface"); } final EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di.getContainer().getBeanContext(di.getDeploymentID()), threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, new ArrayList<Class>(), di.getRemoteInterface()); try { final Class[] interfaces = new Class[]{di.getRemoteInterface(), IntraVmProxy.class}; return (EJBObject) ProxyManager.newProxyInstance(interfaces, handler); } catch (final IllegalAccessException iae) { throw new InternalErrorException("Could not create IVM proxy for " + di.getRemoteInterface() + " interface", iae); } }
/** * This ManagedBean is added to all EjbModules to effectively * create a sharable "comp" namespace which can be used in * for components with undefined namespace such as CDI */ public static class Comp { public static String openejbCompName(final String module) { return module + "." + Comp.class.getSimpleName(); } }
/** * This ManagedBean is added to all EjbModules to effectively * create a sharable "comp" namespace which can be used in * for components with undefined namespace such as CDI */ public static class Comp { public static String openejbCompName(final String module) { return module + "." + Comp.class.getSimpleName(); } }
public static Object createHomeProxy(final BeanContext beanContext, final InterfaceType interfaceType) { return createHomeProxy(beanContext, interfaceType, null, interfaceType.isRemote() ? beanContext.getRemoteInterface() : beanContext.getLocalInterface()); }
public static Object createHomeProxy(final BeanContext beanContext, final InterfaceType interfaceType) { return createHomeProxy(beanContext, interfaceType, null, interfaceType.isRemote() ? beanContext.getRemoteInterface() : beanContext.getLocalInterface()); }
public EJBObject getEJBObject() throws IllegalStateException { check(Call.getEJBObject); final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); if (di.getHomeInterface() == null) { throw new IllegalStateException("Bean does not have an EJBObject interface: " + di.getDeploymentID()); } return (EJBObject) EjbObjectProxyHandler.createProxy(di, threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, di.getRemoteInterface()); }
public EJBObject getEJBObject() throws IllegalStateException { doCheck(Call.getEJBObject); final ThreadContext threadContext = ThreadContext.getThreadContext(); final BeanContext di = threadContext.getBeanContext(); if (di.getHomeInterface() == null) { throw new IllegalStateException("Bean does not have an EJBObject interface: " + di.getDeploymentID()); } return (EJBObject) EjbObjectProxyHandler.createProxy(di, threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, di.getRemoteInterface()); }
public EJBMetaData getEJBMetaData(final ProxyInfo pi) { final BeanContext beanContext = pi.getBeanContext(); final IntraVmMetaData metaData = new IntraVmMetaData(beanContext.getHomeInterface(), beanContext.getRemoteInterface(), beanContext.getComponentType()); metaData.setEJBHome(getEJBHome(pi)); return metaData; }
public EJBMetaData getEJBMetaData(final ProxyInfo pi) { final BeanContext beanContext = pi.getBeanContext(); final IntraVmMetaData metaData = new IntraVmMetaData(beanContext.getHomeInterface(), beanContext.getRemoteInterface(), beanContext.getComponentType()); metaData.setEJBHome(getEJBHome(pi)); return metaData; }
public ProxyFactory(final BeanContext beanContext) { this.beanContext = beanContext; keyGenerator = beanContext.getKeyGenerator(); remoteInterface = beanContext.getRemoteInterface(); if (remoteInterface != null) { final EJBHome homeProxy = beanContext.getEJBHome(); remoteHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(homeProxy); } else { remoteHandler = null; } localInterface = beanContext.getLocalInterface(); if (localInterface != null) { final EJBLocalHome localHomeProxy = beanContext.getEJBLocalHome(); localHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(localHomeProxy); } else { localHandler = null; } }
public ProxyFactory(final BeanContext beanContext) { this.beanContext = beanContext; keyGenerator = beanContext.getKeyGenerator(); remoteInterface = beanContext.getRemoteInterface(); if (remoteInterface != null) { final EJBHome homeProxy = beanContext.getEJBHome(); remoteHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(homeProxy); } else { remoteHandler = null; } localInterface = beanContext.getLocalInterface(); if (localInterface != null) { final EJBLocalHome localHomeProxy = beanContext.getEJBLocalHome(); localHandler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(localHomeProxy); } else { localHandler = null; } }
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; } }
protected Object getEJBMetaData(final Method method, final Object[] args, final Object proxy) throws Throwable { checkAuthorization(method); final IntraVmMetaData metaData = new IntraVmMetaData(getBeanContext().getHomeInterface(), getBeanContext().getRemoteInterface(), getBeanContext().getPrimaryKeyClass(), getBeanContext().getComponentType()); metaData.setEJBHome((EJBHome) proxy); return metaData; }
protected Object getEJBMetaData(final Method method, final Object[] args, final Object proxy) throws Throwable { checkAuthorization(method); final IntraVmMetaData metaData = new IntraVmMetaData(getBeanContext().getHomeInterface(), getBeanContext().getRemoteInterface(), getBeanContext().getPrimaryKeyClass(), getBeanContext().getComponentType()); metaData.setEJBHome((EJBHome) proxy); return metaData; }