Package org.apache.openejb

Examples of org.apache.openejb.BeanContext$Cmp


                }
        EjbResolver globalEjbResolver = SystemInstance.get().getComponent(EjbResolver.class);
        globalEjbResolver.add(appInfoGBean.getEjbJarInfo(moduleURI));

        for (String deploymentId: ejbs.keySet()) {
            BeanContext beanContext = openEjbSystem.getDeploymentInfo(deploymentId);
            GeronimoThreadContextListener.get().getEjbDeployment(beanContext);
        }
    }
View Full Code Here


            initHandlers();
        } catch (Exception e) {
            throw new WebServiceException("Error configuring handlers", e);
        }

        BeanContext beanContext =
            bus.getExtension(BeanContext.class);

        service.setInvoker(new EJBMethodInvoker(this, this.bus, beanContext));

        Endpoint endpoint = getEndpoint();
View Full Code Here

            public void timedOut(Instance instance) {
            }
        });

        deploymentId = "deploymentId";
        deploymentInfo = new BeanContext(deploymentId,
            null,
            new ModuleContext(deploymentId, null, null, new AppContext(deploymentId, SystemInstance.get(), getClass().getClassLoader(), null, null, false), null),
            SFSB.class,
            null,
            null,
View Full Code Here

        SecurityService securityService = (SecurityService) mock(SecurityService.class);
        container = (ClusteredStatefulContainer) intercept(ClusteredStatefulContainer.class, new Object[] {"id",
                securityService});
        deploymentId = "deploymentId";
        deploymentInfo = new BeanContext(deploymentId,
            null,
            new ModuleContext(deploymentId, null, null, new AppContext(deploymentId, SystemInstance.get(), getClass().getClassLoader(), null, null, false), null),
            SFSB.class,
            null,
            null,
View Full Code Here

    }
    @RemoteMethod
    public List<EjbInformation> getDeploymentInfo(String containerId,
            String deploymentId, HttpServletRequest request) {
        Container container = containerSystem.getContainer(containerId);
        BeanContext beanContext = container
                .getBeanContext(deploymentId);
        List<EjbInformation> informations = new ArrayList<EjbInformation>();
        EjbInformation information = new EjbInformation();
        information.setName(getLocalizedString(request, BUNDLE_NAME, BEANCLASSNAME_KEY));
        information.setValue(beanContext.getBeanClass().getName());
        informations.add(information);

        if (beanContext.getBusinessLocalInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, BLI_KEY));
            information.setValue(appendMultipleInterfaces(beanContext
                    .getBusinessLocalInterfaces()));
            informations.add(information);
        }
        if (beanContext.getBusinessRemoteInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, BRI_KEY));
            information.setValue(appendMultipleInterfaces(beanContext
                    .getBusinessRemoteInterfaces()));
            informations.add(information);
        }
        information = new EjbInformation();
        information.setName(getLocalizedString(request, BUNDLE_NAME, DEPLOYMENTID_KEY));
        information.setValue(deploymentId);
        informations.add(information);
        information = new EjbInformation();
        information.setName(getLocalizedString(request, BUNDLE_NAME, EJBNAME_KEY));
        information.setValue(beanContext.getEjbName());
        informations.add(information);
        if (beanContext.getHomeInterface() != null) {
            information = new EjbInformation();
            information.setValue(beanContext.getHomeInterface().getName());
            information.setName(getLocalizedString(request, BUNDLE_NAME, EJBHOMEI_KEY));
            informations.add(information);
        }
        if (!container.getContainerType().equals(ContainerType.MESSAGE_DRIVEN)) {
            information = new EjbInformation();
            Class cls = null;
            try {
                cls = Class.forName("org.apache.openejb.assembler.classic.JndiBuilder$Bindings");
                Method method = cls.getMethod("getBindings");
                List<String> jndiNames = (List) method.invoke(beanContext.get(cls));
                StringBuilder names = new StringBuilder();
                for (String jndiName : jndiNames) {
                    if (jndiName.startsWith("openejb/local/")) {
                        jndiName = jndiName.replaceFirst("openejb/local/", "");
                        names.append(jndiName).append(",");
                    }
                }
                information.setValue(names.substring(0, names.length() - 1));
            } catch (Exception e) {
                log.error("Exception when trying to get JNDI name", e);
            }
            information.setName(getLocalizedString(request, BUNDLE_NAME, JNDINAMES_KEY));
            informations.add(information);
        }
        if (beanContext.getLocalHomeInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, LHI_KEY));
            information.setValue(beanContext.getLocalHomeInterface()
                    .getName());
            informations.add(information);
        }

        if (beanContext.getLocalInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, LI_KEY));
            information.setValue(beanContext.getLocalInterface().getName());
            informations.add(information);
        }

        if (beanContext.getRemoteInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, RI_KEY));
            information.setValue(beanContext.getRemoteInterface().getName());
            informations.add(information);
        }

        if (beanContext.getPrimaryKeyClass() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, PKC_KEY));
            information.setValue(beanContext.getPrimaryKeyClass().getName());
            informations.add(information);
        }

        if (beanContext.getPrimaryKeyField() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, PKF_KEY));
            information.setValue(beanContext.getPrimaryKeyField());
            informations.add(information);
        }

        if (beanContext.getServiceEndpointInterface() != null) {
            information = new EjbInformation();
            information.setName(getLocalizedString(request, BUNDLE_NAME, SEI_KEY));
            information.setValue(beanContext.getServiceEndpointInterface()
                    .getName());
            informations.add(information);
        }

        return informations;
View Full Code Here

        return this;
    }

    @Override
    protected void destroy() {
        BeanContext info = deploymentInfo.get();
        if (null != info) {
            Container container = info.getContainer();
            if (null != container) {
                SessionManagerTracker sessionManagerTracker = (SessionManagerTracker) container;
                sessionManagerTracker.removeSessionManager(deploymentId, sessionManager);
            }
        }
View Full Code Here

                break;
            default:
                throw new IllegalArgumentException("Unknown component type: " + componentType);
        }

        BeanContext beanContext = proxyInfo.getBeanContext();
        CORBAEJBMetaData ejbMetaData = new CORBAEJBMetaData(getEJBHome(proxyInfo),
                ejbType,
                beanContext.getHomeInterface(),
                beanContext.getRemoteInterface(),
                beanContext.getPrimaryKeyClass());
        return ejbMetaData;
    }
View Full Code Here

        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);
            }
            if (proxy instanceof EJBHome) {
                return refGenerator.genHomeReference();
            } else if (proxy instanceof EJBObject) {
                Object primaryKey = null;
                if (beanContext.getComponentType() == BeanType.STATEFUL) {
                    RegistryId id = (RegistryId)((EjbObjectProxyHandler)ejbProxyHandler).getRegistryId();
                    primaryKey = id.getPrimaryKey();
                }
                else if (beanContext.getComponentType() != BeanType.STATELESS) {
                    EJBObject ejbObject = (EJBObject) proxy;
                    primaryKey = ejbObject.getPrimaryKey();
                }
                return refGenerator.genObjectReference(primaryKey);
            } else {
View Full Code Here

        this.location = portInfo.getLocation();

        assert this.location != null : "null location received";

        Class beanClass = ejbDeploymentContext.getBeanClass();
        BeanContext deploymentInfo = ejbDeploymentContext.getDeploymentInfo();
        Context context = deploymentInfo.getJndiEnc();

        Bus bus = CXFWebServiceContainer.getBus();
        bus.setExtension(new ServerJNDIResolver(context), JNDIResolver.class);
        bus.setExtension(portInfo, PortInfo.class);
        bus.setExtension(deploymentInfo, BeanContext.class);
View Full Code Here

        assert this.location != null : "null location received";

        String beanClassName = ejbDeploymentContext.getBeanClass().getName();
        ClassLoader classLoader = ejbDeploymentContext.getClassLoader();
        BeanContext deploymnetInfo = ejbDeploymentContext.getDeploymentInfo();
        Context context = deploymnetInfo.getJndiEnc();

        this.container = new EJBWebServiceContainer(portInfo, beanClassName, bundle, context, axis2ModuleRegistry, deploymnetInfo, abName.getNameProperty(NameFactory.EJB_MODULE));
        this.container.init();

        soapHandler.addWebService(this.location,
View Full Code Here

TOP

Related Classes of org.apache.openejb.BeanContext$Cmp

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.