Package org.apache.openejb

Examples of org.apache.openejb.InterfaceType


                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();
View Full Code Here


            return interfaces;
        }
    }

    public InterfaceType getInterfaceType(Class clazz) {
        InterfaceType type = interfaces.get(clazz);
        if (type != null) return type;

        if (javax.ejb.EJBLocalHome.class.isAssignableFrom(clazz)) return InterfaceType.EJB_LOCAL_HOME;
        if (javax.ejb.EJBLocalObject.class.isAssignableFrom(clazz)) return InterfaceType.EJB_LOCAL;
        if (javax.ejb.EJBHome.class.isAssignableFrom(clazz)) return InterfaceType.EJB_HOME;
View Full Code Here

            if (interfce == null) throw new IllegalStateException("Interface argument cannot me null.");

            ThreadContext threadContext = ThreadContext.getThreadContext();
            DeploymentInfo di = threadContext.getDeploymentInfo();

            InterfaceType interfaceType = di.getInterfaceType(interfce);

            if (interfaceType == null){
                throw new IllegalStateException("Component has no such interface: " + interfce.getName());
            }

            if (!interfaceType.isBusiness()) {
                throw new IllegalStateException("Interface is not a business interface for this bean: " + interfce.getName());
            }

            try {
                EjbObjectProxyHandler handler;
View Full Code Here

        }

        public Class getInvokedBusinessInterface() {
            ThreadContext threadContext = ThreadContext.getThreadContext();
            Class invokedInterface = threadContext.getInvokedInterface();
            InterfaceType type = threadContext.getDeploymentInfo().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;
View Full Code Here

    }

    public Object createProxy(Object primaryKey) {
        try {

            InterfaceType objectInterfaceType = this.interfaceType.getCounterpart();

            EjbObjectProxyHandler handler = newEjbObjectHandler(getDeploymentInfo(), primaryKey, objectInterfaceType, this.getInterfaces());

            List<Class> proxyInterfaces = new ArrayList<Class>(handler.getInterfaces().size() + 1);
View Full Code Here

        this.interfaceType = interfaceType;
        this.primaryKey = pk;
        this.setDeploymentInfo(deploymentInfo);

        if (interfaces == null || interfaces.size() == 0) {
            InterfaceType objectInterfaceType = (interfaceType.isHome()) ? interfaceType.getCounterpart() : interfaceType;
            interfaces = new ArrayList<Class>(deploymentInfo.getInterfaces(objectInterfaceType));
        }

        this.setDoIntraVmCopy(!interfaceType.isLocal() && !interfaceType.isLocalBean());
View Full Code Here

                final BeanContext beanContext = cdiEjbBean.getBeanContext();
                final Provider provider = webBeansContext.getNormalScopeProxyFactory().getInstanceProvider(beanContext.getClassLoader(), cdiEjbBean);

                if (!beanContext.isLocalbean()) {
                    final List<Class> interfaces = new ArrayList<Class>();
                    final InterfaceType type = beanContext.getInterfaceType(interfce);
                    if (type != null) {
                        interfaces.addAll(beanContext.getInterfaces(type));
                    } else { // can happen when looked up from impl instead of API in OWB -> default to business local
                        interfaces.addAll(beanContext.getInterfaces(InterfaceType.BUSINESS_LOCAL));
                    }
View Full Code Here

        if (beanContext == null) {
            final String message = messages.format("deploymentNotFound", info.getName(), deploymentId);
            throw new NameNotFoundException(message);
        }

        InterfaceType type = null;
        switch (info.getRefType()) {
            case LOCAL:
                type = InterfaceType.BUSINESS_LOCAL;
                break;
            case REMOTE:
View Full Code Here

        }

        final ThreadContext threadContext = ThreadContext.getThreadContext();
        final BeanContext di = threadContext.getBeanContext();

        final InterfaceType interfaceType = di.getInterfaceType(interfce);
        final BeanType type = di.getComponentType();

        if (interfaceType == null) {
            throw new IllegalStateException("Component has no such interface: " + interfce.getName());
        }

        if (!interfaceType.isBusiness()) {
            throw new IllegalStateException("Interface is not a business interface for this bean: " + interfce.getName());
        }

        try {
            final EjbObjectProxyHandler handler;
View Full Code Here

    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.");
View Full Code Here

TOP

Related Classes of org.apache.openejb.InterfaceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.