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; }
@Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final BeanContext beanContext = getBeanContext(); final RpcContainer container = RpcContainer.class.cast(beanContext.getContainer()); return container.invoke(beanContext.getDeploymentID(), beanContext.getInterfaceType(method.getDeclaringClass()), method.getDeclaringClass(), method, args, null); }
@Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { final BeanContext beanContext = getBeanContext(); final RpcContainer container = RpcContainer.class.cast(beanContext.getContainer()); return container.invoke(beanContext.getDeploymentID(), beanContext.getInterfaceType(method.getDeclaringClass()), method.getDeclaringClass(), method, args, null); }
public Class getInvokedBusinessInterface() { check(Call.getInvokedBusinessInterface); final ThreadContext threadContext = ThreadContext.getThreadContext(); final Class invokedInterface = threadContext.getInvokedInterface(); final InterfaceType type = threadContext.getBeanContext().getInterfaceType(invokedInterface); if (!type.isBusiness()) { throw new IllegalStateException("The EJB spec requires us to cripple the use of this method for anything but business interface proxy. But FYI, your invoked interface is: " + invokedInterface.getName()); } if (invokedInterface == null) { throw new IllegalStateException("Business interface not set into ThreadContext."); } return invokedInterface; } }
public Class getInvokedBusinessInterface() { doCheck(Call.getInvokedBusinessInterface); final ThreadContext threadContext = ThreadContext.getThreadContext(); final Class invokedInterface = threadContext.getInvokedInterface(); final InterfaceType type = threadContext.getBeanContext().getInterfaceType(invokedInterface); if (!type.isBusiness()) { throw new IllegalStateException("The EJB spec requires us to cripple the use of this method for anything but business interface proxy. But FYI, your invoked interface is: " + invokedInterface.getName()); } if (invokedInterface == null) { throw new IllegalStateException("Business interface not set into ThreadContext."); } return invokedInterface; } }
final BeanContext di = threadContext.getBeanContext(); final InterfaceType interfaceType = di.getInterfaceType(interfce); final BeanType type = di.getComponentType();
final BeanContext di = threadContext.getBeanContext(); final InterfaceType interfaceType = di.getInterfaceType(interfce); final BeanType type = di.getComponentType();
type = beanContext.getInterfaceType(callInterface);
type = beanContext.getInterfaceType(callInterface);
type = beanContext.getInterfaceType(callInterface);
public boolean isCallerAuthorized(Method method, InterfaceType typee) { ThreadContext threadContext = ThreadContext.getThreadContext(); try { BeanContext deploymentInfo = threadContext.getBeanContext(); // if security is not enabled we are autorized EjbDeployment ejbDeployment = deploymentInfo.get(EjbDeployment.class); if (ejbDeployment == null || !ejbDeployment.isSecurityEnabled()) { return true; } String ejbName = deploymentInfo.getEjbName(); InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass()); String name = (type == null) ? null : type.getSpecName(); Permission permission = new EJBMethodPermission(ejbName, name, method); AccessControlContext accessContext = ContextManager.getCurrentContext(); if (permission != null) accessContext.checkPermission(permission); } catch (AccessControlException e) { return false; } return true; }
type = beanContext.getInterfaceType(callInterface);
final InterfaceType type = beanContext.getInterfaceType(interfce); if (type != null) { interfaces.addAll(beanContext.getInterfaces(type));
final InterfaceType type = beanContext.getInterfaceType(interfce); if (type != null) { interfaces.addAll(beanContext.getInterfaces(type));
@Override public Object invoke(final Object deployID, InterfaceType type, final Class callInterface, final Method callMethod, final Object[] args, final Object primKey) throws OpenEJBException { final BeanContext beanContext = this.getBeanContext(deployID); if (beanContext == null) { throw new OpenEJBException("Deployment does not exist in this container. Deployment(id='" + deployID + "'), Container(id='" + containerID + "')"); } // Use the backup way to determine call type if null was supplied. if (type == null) { type = beanContext.getInterfaceType(callInterface); } final Data data = (Data) beanContext.getContainerData(); MethodType methodType = data.getMethodIndex().get(callMethod); methodType = methodType != null ? methodType : MethodType.BUSINESS; switch (methodType) { case CREATE: return createEJBObject(beanContext, callMethod, args, type); case REMOVE: return removeEJBObject(beanContext, primKey, callInterface, callMethod, args, type); default: return businessMethod(beanContext, primKey, callInterface, callMethod, args, type); } }
@Override public Object invoke(final Object deployID, InterfaceType type, final Class callInterface, final Method callMethod, final Object[] args, final Object primKey) throws OpenEJBException { final BeanContext beanContext = this.getBeanContext(deployID); if (beanContext == null) { throw new OpenEJBException("Deployment does not exist in this container. Deployment(id='" + deployID + "'), Container(id='" + containerID + "')"); } // Use the backup way to determine call type if null was supplied. if (type == null) { type = beanContext.getInterfaceType(callInterface); } final Data data = (Data) beanContext.getContainerData(); MethodType methodType = data.getMethodIndex().get(callMethod); methodType = methodType != null ? methodType : MethodType.BUSINESS; switch (methodType) { case CREATE: return createEJBObject(beanContext, callMethod, args, type); case REMOVE: return removeEJBObject(beanContext, primKey, callInterface, callMethod, args, type); default: return businessMethod(beanContext, primKey, callInterface, callMethod, args, type); } }
@Override public Object invoke(final Object deployID, InterfaceType type, final Class callInterface, final Method callMethod, final Object[] args, final Object primKey) throws OpenEJBException { final BeanContext beanContext = this.getBeanContext(deployID); if (beanContext == null) { throw new OpenEJBException("Deployment does not exist in this container. Deployment(id='" + deployID + "'), Container(id='" + containerID + "')"); } // Use the backup way to determine call type if null was supplied. if (type == null) { type = beanContext.getInterfaceType(callInterface); } final Data data = (Data) beanContext.getContainerData(); MethodType methodType = data.getMethodIndex().get(callMethod); methodType = methodType != null ? methodType : MethodType.BUSINESS; switch (methodType) { case CREATE: return createEJBObject(beanContext, callMethod, args, type); case REMOVE: return removeEJBObject(beanContext, primKey, callInterface, callMethod, args, type); default: return businessMethod(beanContext, primKey, callInterface, callMethod, args, type); } }
@Override public Object invoke(final Object deployID, InterfaceType type, final Class callInterface, final Method callMethod, final Object[] args, final Object primKey) throws OpenEJBException { final BeanContext beanContext = this.getBeanContext(deployID); if (beanContext == null) { throw new OpenEJBException("Deployment does not exist in this container. Deployment(id='" + deployID + "'), Container(id='" + containerID + "')"); } // Use the backup way to determine call type if null was supplied. if (type == null) { type = beanContext.getInterfaceType(callInterface); } final Data data = (Data) beanContext.getContainerData(); MethodType methodType = data.getMethodIndex().get(callMethod); methodType = methodType != null ? methodType : MethodType.BUSINESS; switch (methodType) { case CREATE: return createEJBObject(beanContext, callMethod, args, type); case REMOVE: return removeEJBObject(beanContext, primKey, callInterface, callMethod, args, type); default: return businessMethod(beanContext, primKey, callInterface, callMethod, args, type); } }
type = beanContext.getInterfaceType(callInterface);