public List<Class> getInterfaces() { final Set<Class> classes = interfaces.keySet(); final List<Class> list = new ArrayList<Class>(); final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); for (final Class<?> clazz : classes) { // convert interfaces with current classloader -> relevant for remote interfaces if (clazz.isInterface() && getBeanContext().getInterfaceType(clazz) == InterfaceType.BUSINESS_REMOTE) { try { list.add(contextClassLoader.loadClass(clazz.getName())); } catch (final ClassNotFoundException | NoClassDefFoundError e) { list.add(clazz); } } else { list.add(clazz); } } return list; }
public List<Class> getInterfaces() { final Set<Class> classes = interfaces.keySet(); final List<Class> list = new ArrayList<Class>(); final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); for (final Class<?> clazz : classes) { // convert interfaces with current classloader -> relevant for remote interfaces if (clazz.isInterface() && getBeanContext().getInterfaceType(clazz) == InterfaceType.BUSINESS_REMOTE) { try { list.add(contextClassLoader.loadClass(clazz.getName())); } catch (final ClassNotFoundException e) { list.add(clazz); } catch (final NoClassDefFoundError e) { list.add(clazz); } } else { list.add(clazz); } } return list; }
private void isValidReference(final Method method) throws NoSuchObjectException { if (isInvalidReference) { if (interfaceType.isComponent() && interfaceType.isLocal()) { throw new NoSuchObjectLocalException("reference is invalid"); } else if (interfaceType.isComponent() || Remote.class.isAssignableFrom(method.getDeclaringClass())) { throw new NoSuchObjectException("reference is invalid"); } else { throw new NoSuchEJBException("reference is invalid for " + deploymentID); } } if (!(Object.class.equals(method.getDeclaringClass()) && method.getName().equals("finalize") && method.getExceptionTypes().length == 1 && Throwable.class.equals(method.getExceptionTypes()[0]))) { getBeanContext(); // will throw an exception if app has been undeployed. } }
private void isValidReference(final Method method) throws NoSuchObjectException { if (isInvalidReference) { if (interfaceType.isComponent() && interfaceType.isLocal()) { throw new NoSuchObjectLocalException("reference is invalid"); } else if (interfaceType.isComponent() || Remote.class.isAssignableFrom(method.getDeclaringClass())) { throw new NoSuchObjectException("reference is invalid"); } else { throw new NoSuchEJBException("reference is invalid for " + deploymentID); } } if (!(Object.class.equals(method.getDeclaringClass()) && method.getName().equals("finalize") && method.getExceptionTypes().length == 1 && Throwable.class.equals(method.getExceptionTypes()[0]))) { getBeanContext(); // will throw an exception if app has been undeployed. } }
public ConcurrentMap getLiveHandleRegistry() { final BeanContext beanContext = getBeanContext(); ProxyRegistry proxyRegistry = beanContext.get(ProxyRegistry.class); if (proxyRegistry == null) { proxyRegistry = new ProxyRegistry(); beanContext.set(ProxyRegistry.class, proxyRegistry); } return proxyRegistry.liveHandleRegistry; }
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); setBeanContext(containerSystem.getBeanContext(deploymentID)); container = (RpcContainer) getBeanContext().getContainer(); if (IntraVmCopyMonitor.isCrossClassLoaderOperation()) { setDoCrossClassLoaderCopy(true); } setInterfaces((List<Class>) in.readObject()); setMainInterface((Class) in.readObject()); }
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class); if(null == containerSystem){ throw new OpenEJBRuntimeException("ContainerSystem has not been initialized"); } setBeanContext(containerSystem.getBeanContext(deploymentID)); container = (RpcContainer) getBeanContext().getContainer(); if (IntraVmCopyMonitor.isCrossClassLoaderOperation()) { setDoCrossClassLoaderCopy(true); } setInterfaces((List<Class>) in.readObject()); setMainInterface((Class) in.readObject()); }
securityService.associate(localClientIdentity); if (strategy == CLASSLOADER_COPY || getBeanContext().getInterfaceType(interfce) == InterfaceType.BUSINESS_REMOTE) { Thread.currentThread().setContextClassLoader(getBeanContext().getClassLoader()); try { args = copyArgs(args); if (getBeanContext().isAsynchronous(method) || getBeanContext().getComponentType().equals(BeanType.MANAGED)) { strategy = IntraVmCopyMonitor.State.NONE;
if (strategy == CLASSLOADER_COPY || getBeanContext().getInterfaceType(interfce) == InterfaceType.BUSINESS_REMOTE) { Thread.currentThread().setContextClassLoader(getBeanContext().getClassLoader()); try { args = copyArgs(args); if (getBeanContext().isAsynchronous(method) || getBeanContext().getComponentType().equals(BeanType.MANAGED)) { strategy = NONE;
public ConcurrentMap getLiveHandleRegistry() { final BeanContext beanContext = getBeanContext();