Package org.apache.openejb

Examples of org.apache.openejb.InterfaceType


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

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

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

                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

        DeploymentInfo deploymentInfo = this.getDeploymentInfo();
        try
        {
            if(iface != null)
            {
                InterfaceType type = deploymentInfo.getInterfaceType(iface);
                if(!type.equals(InterfaceType.BUSINESS_LOCAL))
                {
                    throw new IllegalArgumentException("Interface type is not legal business local interface for session bean class : " + getReturnType().getName());
                }  
            }   
            else
View Full Code Here

                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

        if (beanContext == null) {
            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: type = InterfaceType.BUSINESS_REMOTE; break;
        }
View Full Code Here

                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

            DeploymentInfo deploymentInfo = this.getDeploymentInfo();
            try
            {
                if(iface != null)
                {
                    InterfaceType type = deploymentInfo.getInterfaceType(iface);
                    if(!type.equals(InterfaceType.BUSINESS_LOCAL))
                    {
                        throw new IllegalArgumentException("Interface type is not legal business local interface for session bean class : " + getReturnType().getName());
                    }  
                }   
                else
View Full Code Here

    public Object resolve(EJBHomeHandler handler) {
        try {
            EJBMetaDataImpl ejb = handler.getEjb();

            InterfaceType interfaceType = (ejb.getRemoteInterfaceClass() == null)? InterfaceType.BUSINESS_REMOTE_HOME : InterfaceType.EJB_HOME;

            ArrayList<Class> interfaces = new ArrayList<Class>();
            if (interfaceType.isBusiness()){
                interfaces.addAll(ejb.getBusinessClasses());
            } else {
                interfaces.add(ejb.getRemoteInterfaceClass());
            }
View Full Code Here

    public Object resolve(EJBObjectHandler handler) {
        try {
            EJBMetaDataImpl ejb = handler.getEjb();

            InterfaceType interfaceType = (ejb.getRemoteInterfaceClass() == null)? InterfaceType.BUSINESS_REMOTE_HOME : InterfaceType.EJB_HOME;

            ArrayList<Class> interfaces = new ArrayList<Class>();
            if (interfaceType.isBusiness()){
                interfaces.addAll(ejb.getBusinessClasses());
            } else {
                interfaces.add(ejb.getRemoteInterfaceClass());
            }
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.