Examples of BeanContext


Examples of org.apache.openejb.BeanContext

    public Method resolveViewMethod(Bean<?> component, Method declaredMethod) {
        if (!(component instanceof CdiEjbBean)) return declaredMethod;

        CdiEjbBean cdiEjbBean = (CdiEjbBean) component;

        final BeanContext beanContext = cdiEjbBean.getBeanContext();

        for (Class intface : beanContext.getBusinessLocalInterfaces()) {
            try {
                return intface.getMethod(declaredMethod.getName(), declaredMethod.getParameterTypes());
            } catch (NoSuchMethodException ignore) {
            }
        }
View Full Code Here

Examples of org.apache.openejb.BeanContext

    public Method resolveBeanMethod(Bean<?> component, Method declaredMethod) {
        if (!(component instanceof CdiEjbBean)) return declaredMethod;

        CdiEjbBean cdiEjbBean = (CdiEjbBean) component;

        final BeanContext beanContext = cdiEjbBean.getBeanContext();

        try {
            return beanContext.getBeanClass().getMethod(declaredMethod.getName(), declaredMethod.getParameterTypes());
        } catch (NoSuchMethodException e) {
            return declaredMethod;
        }
    }
View Full Code Here

Examples of org.apache.openejb.BeanContext

        clusterHandler.processRequest(in, out);
    }

    protected BeanContext getDeployment(EJBRequest req) throws RemoteException {
        String deploymentId = req.getDeploymentId();
        BeanContext beanContext = containerSystem.getBeanContext(deploymentId);
        if (beanContext == null) throw new RemoteException("No deployment: " + deploymentId);
        return beanContext;
    }
View Full Code Here

Examples of org.apache.openejb.BeanContext

            replyWithFatalError(out, t, "Client identity is not valid: " + req);
            return;
        }

        final CallContext call;
        final BeanContext di;

        try {
            di = this.daemon.getDeployment(req);
        } catch (RemoteException e) {
            replyWithFatalError(out, e, "No such deployment");
            return;
            /*
                logger.warn( req + "No such deployment: "+e.getMessage());
                res.setResponse( EJB_SYS_EXCEPTION, e);
                res.writeExternal( out );
                return;
            */
        } catch (Throwable t) {
            replyWithFatalError(out, t, "Unkown error occured while retrieving deployment");
            return;
        }

        //  Need to set this for deserialization of the body
        final ClassLoader classLoader = di.getBeanClass().getClassLoader();
        Thread.currentThread().setContextClassLoader(classLoader);

        try {
            res.start(EJBResponse.Time.DESERIALIZATION);

View Full Code Here

Examples of org.apache.openejb.BeanContext

        }
    }

    protected void updateServer(final EJBRequest req, final EJBResponse res) {
        final CallContext callContext = CallContext.getCallContext();
        final BeanContext beanContext = callContext.getBeanContext();
        clusterableRequestHandler.updateServer(beanContext, req, res);
    }
View Full Code Here

Examples of org.apache.openejb.BeanContext

    }

    protected void doEjbObject_BUSINESS_METHOD(final EJBRequest req, final EJBResponse res) throws Exception {

        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = call.getBeanContext();
        final boolean asynchronous = beanContext.isAsynchronous(req.getMethodInstance());
        try {
            if (asynchronous) {
                final AtomicBoolean invocationCancelTag = new AtomicBoolean(false);
                ThreadContext.initAsynchronousCancelled(invocationCancelTag);
                asynchronousInvocationCancelMap.put(req.getBody().getRequestId(), invocationCancelTag);
View Full Code Here

Examples of org.apache.openejb.BeanContext

        // get all of the ejb deployments
        List<BeanContext> deployments = new ArrayList<BeanContext>();
        for (EjbJarInfo ejbJarInfo : appInfo.ejbJars) {
            for (EnterpriseBeanInfo beanInfo : ejbJarInfo.enterpriseBeans) {
                String deploymentId = beanInfo.ejbDeploymentId;
                BeanContext beanContext = containerSystem.getBeanContext(deploymentId);
                if (beanContext == null) {
                    undeployException.getCauses().add(new Exception("deployment not found: " + deploymentId));
                } else {
                    deployments.add(beanContext);
                }
View Full Code Here

Examples of org.apache.openejb.BeanContext

    protected Map<String,EJBRestServiceInfo> getRestEjbs(AppInfo appInfo) {
        Map<String, BeanContext> beanContexts = new HashMap<String, BeanContext>();
        for (EjbJarInfo ejbJar : appInfo.ejbJars) {
            for (EnterpriseBeanInfo bean : ejbJar.enterpriseBeans) {
                if (bean.restService) {
                    BeanContext beanContext = containerSystem.getBeanContext(bean.ejbDeploymentId);
                    if (beanContext == null) {
                        continue;
                    }

                    beanContexts.put(bean.ejbClass, beanContext);
View Full Code Here

Examples of org.apache.openejb.BeanContext

    private DeploymentIndex deploymentIndex;

    @Before
    public void setUp() throws SystemException {
        method = Method.class.getMethods()[0];
        beanContext = new BeanContext("aDeploymentId", null, new ModuleContext("", null, "", new AppContext("", SystemInstance.get(), null, null, null, false), null), DeploymentIndexTest.class, null, null, null, null, null, null, null, null, null, null, false);
        deploymentIndex = new DeploymentIndex(new BeanContext[] {beanContext, beanContext});
    }
View Full Code Here

Examples of org.apache.openejb.BeanContext

    @Test
    public void testGetDeploymentEJBRequest() throws RemoteException {
        EJBMetaDataImpl ejbMetadataWithId = new EJBMetaDataImpl(null, null, null, null, null, 1, InterfaceType.BUSINESS_REMOTE, null, null);
        EJBRequest request = new EJBRequest(null, ejbMetadataWithId, method, null, null);
        BeanContext info = deploymentIndex.getDeployment(request);
        assert beanContext.equals(info);
        assert request.getDeploymentId().equals(info.getDeploymentID());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.