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

        if (deploymentId == null) {
            throw new NamingException("ejb-ref deploymentId is null");
        }

        // get and verify interface type
        InterfaceType type = InterfaceType.BUSINESS_REMOTE;
        String interfaceType = NamingUtil.getProperty(reference, NamingUtil.REMOTE);

        if (interfaceType == null) {
            type = InterfaceType.LOCALBEAN;
            interfaceType = NamingUtil.getProperty(reference, NamingUtil.LOCALBEAN);
View Full Code Here

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

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

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

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

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

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

    public Object getBusinessObject(Class interfce) {
        ThreadContext threadContext = ThreadContext.getThreadContext();
        DeploymentInfo di = threadContext.getDeploymentInfo();

        InterfaceType interfaceType;
        if (di.getBusinessLocalInterface() != null && di.getBusinessLocalInterface().getName().equals(interfce.getName())) {
            interfaceType = InterfaceType.BUSINESS_LOCAL;
        } else if (di.getBusinessRemoteInterface() != null && di.getBusinessRemoteInterface().getName().equals(interfce.getName())) {
            interfaceType = InterfaceType.BUSINESS_REMOTE;
        } else {
View Full Code Here

            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

            CoreDeploymentInfo deploymentInfo = threadContext.getDeploymentInfo();

            String ejbName = deploymentInfo.getEjbName();

            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null)? null: type.getSpecName();

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            if (permission != null) securityContext.acc.checkPermission(permission);
View Full Code Here

        txPolicy.beforeInvoke(instance, txContext);

        Object returnValue = null;
        try {
            InterfaceType type = deploymentInfo.getInterfaceType(callInterface);
            if (type == InterfaceType.SERVICE_ENDPOINT){
                callContext.setCurrentOperation(Operation.BUSINESS_WS);
                returnValue = invokeWebService(args, deploymentInfo, runMethod, instance, returnValue);
            } else {
                List<InterceptorData> interceptors = deploymentInfo.getMethodInterceptors(runMethod);
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.