Package org.apache.openejb.core.ivm

Examples of org.apache.openejb.core.ivm.BaseEjbProxyHandler


                res.setResult(e);
                return;
            }


            BaseEjbProxyHandler handler = null;
            try {
                handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
            } catch (Exception e) {
                // Not a proxy.  See if it's serializable and send it
                if (object instanceof java.io.Serializable){
                    res.setResponseCode(ResponseCodes.JNDI_OK);
                    res.setResult(object);
                    return;
                } else {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    res.setResult(new NamingException("Expected an ejb proxy, found unknown object: type="+object.getClass().getName() + ", toString="+object));
                    return;
                }
            }

            ProxyInfo proxyInfo = handler.getProxyInfo();
            DeploymentInfo deployment = proxyInfo.getDeploymentInfo();
            String deploymentID = deployment.getDeploymentID().toString();

            switch(proxyInfo.getInterfaceType()){
                case EJB_HOME: {
View Full Code Here


            res.setResult(new ThrowableArtifact(e));
            return;
        }


        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (Exception e) {
            try {
                Field field = object.getClass().getDeclaredField("invocationHandler");
                field.setAccessible(true);
                handler = (BaseEjbProxyHandler) field.get(object);
            } catch (Exception e1) {
                // Not a proxy.  See if it's serializable and send it
                if (object instanceof java.io.Serializable) {
                    res.setResponseCode(ResponseCodes.JNDI_OK);
                    res.setResult(object);
                    return;
                } else {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" + object.getClass().getName() + ", toString=" + object);
                    res.setResult(new ThrowableArtifact(namingException));
                    return;
                }
            }
        }

        ProxyInfo proxyInfo = handler.getProxyInfo();
        BeanContext beanContext = proxyInfo.getBeanContext();
        String deploymentID = beanContext.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);
View Full Code Here

            res.setResult(new ThrowableArtifact(e));
            return;
        }


        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (Exception e) {
            // Not a proxy.  See if it's serializable and send it
            if (object instanceof java.io.Serializable){
                res.setResponseCode(ResponseCodes.JNDI_OK);
                res.setResult(object);
                return;
            } else {
                res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" + object.getClass().getName() + ", toString=" + object);
                res.setResult(new ThrowableArtifact(namingException));
                return;
            }
        }

        ProxyInfo proxyInfo = handler.getProxyInfo();
        DeploymentInfo deployment = proxyInfo.getDeploymentInfo();
        String deploymentID = deployment.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);
View Full Code Here

        InvocationHandler invocationHandler = Proxy.getInvocationHandler(proxy);
        if (!(invocationHandler instanceof BaseEjbProxyHandler)) {
            return proxy;
        }

        BaseEjbProxyHandler ejbProxyHandler = (BaseEjbProxyHandler) invocationHandler;
        CoreDeploymentInfo deploymentInfo = ejbProxyHandler.getDeploymentInfo();
        String deploymentId = (String) deploymentInfo.getDeploymentID();
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
            if (refGenerator == null) {
                throw new MARSHAL("Could not find RefGenerator for deployment id: " +deploymentId);
View Full Code Here

        InvocationHandler invocationHandler = Proxy.getInvocationHandler(proxy);
        if (!(invocationHandler instanceof BaseEjbProxyHandler)) {
            return proxy;
        }

        BaseEjbProxyHandler ejbProxyHandler = (BaseEjbProxyHandler) invocationHandler;
        DeploymentInfo deploymentInfo = ejbProxyHandler.getDeploymentInfo();
        String deploymentId = (String) deploymentInfo.getDeploymentID();
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
            if (refGenerator == null) {
                throw new MARSHAL("Could not find RefGenerator for deployment id: " +deploymentId);
View Full Code Here

        InvocationHandler invocationHandler = Proxy.getInvocationHandler(proxy);
        if (!(invocationHandler instanceof BaseEjbProxyHandler)) {
            return proxy;
        }

        BaseEjbProxyHandler ejbProxyHandler = (BaseEjbProxyHandler) invocationHandler;
        BeanContext beanContext = ejbProxyHandler.getBeanContext();
        String deploymentId = (String) beanContext.getDeploymentID();
        try {
            RefGenerator refGenerator = AdapterWrapper.getRefGenerator(deploymentId);
            if (refGenerator == null) {
                throw new MARSHAL("Could not find RefGenerator for deployment id: " +deploymentId);
View Full Code Here

            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            res.setResult(new ThrowableArtifact(e));
            return;
        }

        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (Exception e) {
            try {
                final Field field = object.getClass().getDeclaredField("invocationHandler");
                field.setAccessible(true);
                handler = (BaseEjbProxyHandler) field.get(object);
            } catch (Exception e1) {
                // Not a proxy.  See if it's serializable and send it
                if (object instanceof java.io.Serializable) {
                    res.setResponseCode(ResponseCodes.JNDI_OK);
                    res.setResult(object);
                    return;
                } else {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    final NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" +
                        object.getClass().getName() +
                        ", toString=" +
                        object);
                    res.setResult(new ThrowableArtifact(namingException));
                    return;
                }
            }
        }

        final ProxyInfo proxyInfo = handler.getProxyInfo();
        final BeanContext beanContext = proxyInfo.getBeanContext();
        final String deploymentID = beanContext.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);
View Full Code Here

            res.setResult(new ThrowableArtifact(e));
            return;
        }


        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (Exception e) {
            try {
                Field field = object.getClass().getDeclaredField("invocationHandler");
                field.setAccessible(true);
                handler = (BaseEjbProxyHandler) field.get(object);
            } catch (Exception e1) {
                // Not a proxy.  See if it's serializable and send it
                if (object instanceof java.io.Serializable){
                    res.setResponseCode(ResponseCodes.JNDI_OK);
                    res.setResult(object);
                    return;
                } else {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" + object.getClass().getName() + ", toString=" + object);
                    res.setResult(new ThrowableArtifact(namingException));
                    return;
                }
            }
        }

        ProxyInfo proxyInfo = handler.getProxyInfo();
        BeanContext beanContext = proxyInfo.getBeanContext();
        String deploymentID = beanContext.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);
View Full Code Here

            res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
            res.setResult(new ThrowableArtifact(e));
            return;
        }

        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (final Exception e) {
            try {
                final Field field = object.getClass().getDeclaredField("invocationHandler");
                field.setAccessible(true);
                handler = (BaseEjbProxyHandler) field.get(object);
            } catch (final Exception e1) {
                // Not a proxy.  See if it's serializable and send it
                if (object instanceof java.io.Serializable) {
                    res.setResponseCode(ResponseCodes.JNDI_OK);
                    res.setResult(object);
                    return;
                } else {
                    res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                    final NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" +
                        object.getClass().getName() +
                        ", toString=" +
                        object);
                    res.setResult(new ThrowableArtifact(namingException));
                    return;
                }
            }
        }

        final ProxyInfo proxyInfo = handler.getProxyInfo();
        final BeanContext beanContext = proxyInfo.getBeanContext();
        final String deploymentID = beanContext.getDeploymentID().toString();

        updateServer(req, res, proxyInfo);
View Full Code Here

            res.setResult(new ThrowableArtifact(e));
            return;
        }


        BaseEjbProxyHandler handler;
        try {
            handler = (BaseEjbProxyHandler) ProxyManager.getInvocationHandler(object);
        } catch (Exception e) {
            // Not a proxy.  See if it's serializable and send it
            if (object instanceof java.io.Serializable){
                res.setResponseCode(ResponseCodes.JNDI_OK);
                res.setResult(object);
                return;
            } else {
                res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                NamingException namingException = new NamingException("Expected an ejb proxy, found unknown object: type=" + object.getClass().getName() + ", toString=" + object);
                res.setResult(new ThrowableArtifact(namingException));
                return;
            }
        }

        ProxyInfo proxyInfo = handler.getProxyInfo();
        DeploymentInfo deployment = proxyInfo.getDeploymentInfo();
        String deploymentID = deployment.getDeploymentID().toString();

        switch(proxyInfo.getInterfaceType()){
            case EJB_HOME: {
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.ivm.BaseEjbProxyHandler

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.