Package org.apache.openejb

Examples of org.apache.openejb.BeanContext$Comp


    @Override
    public javax.ejb.EJBMetaData getEJBMetaData(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();

        final BeanContext beanContext = info.getBeanContext();
        final int idCode = -1;

        return buildEjbMetaData(info, beanContext, idCode);
    }
View Full Code Here


    }

    @Override
    public javax.ejb.Handle getHandle(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = info.getBeanContext();

        final int idCode = -1;

        Object securityIdentity = null;
        try {
View Full Code Here

    }

    @Override
    public javax.ejb.HomeHandle getHomeHandle(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = info.getBeanContext();

        final int idCode = -1;

        Object securityIdentity = null;
        try {
View Full Code Here

    }

    @Override
    public javax.ejb.EJBObject getEJBObject(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = info.getBeanContext();

        final int idCode = -1;

        Object securityIdentity = null;
        try {
View Full Code Here

    }

    @Override
    public Object getBusinessObject(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = info.getBeanContext();

        final int idCode = -1;

        Object securityIdentity = null;
        try {
            securityIdentity = call.getEJBRequest().getClientIdentity();
        } catch (Exception e) {
            e.printStackTrace();
        }
        final ClientMetaData cMetaData = new ClientMetaData(securityIdentity);
        final EJBMetaDataImpl eMetaData = new EJBMetaDataImpl(null, null,
            beanContext.getPrimaryKeyClass(),
            beanContext.getComponentType().toString(),
            beanContext.getDeploymentID().toString(),
            idCode,
            convert(info.getInterfaceType()),
            info.getInterfaces(),
            beanContext.getAsynchronousMethodSignatures());
        eMetaData.loadProperties(beanContext.getProperties());

        final Object primKey = info.getPrimaryKey();

        final EJBObjectHandler hanlder = EJBObjectHandler.createEJBObjectHandler(JNDIContext.globalExecutor(), eMetaData, getServerMetaData(), cMetaData, primKey, null);
View Full Code Here

    }

    @Override
    public javax.ejb.EJBHome getEJBHome(final ProxyInfo info) {
        final CallContext call = CallContext.getCallContext();
        final BeanContext beanContext = info.getBeanContext();

        final int idCode = -1;

        Object securityIdentity = null;
        try {
View Full Code Here

            } catch (LoginException t) {
                failed = true;
                return setResponseError(res, version, t, "Client identity is not valid - " + req);
            }

            final BeanContext di;

            try {
                di = this.daemon.getDeployment(req);
            } catch (RemoteException e) {
                failed = true;
                return setResponseError(res, version, e, "No such deployment");
            } catch (Throwable t) {
                failed = true;
                return setResponseError(res, version, t, "Unkown error occured while retrieving deployment: " + req);
            }

            try {

                //Need to set this for deserialization of the body - Will always be reset by EjbDaemon
                final ClassLoader classLoader = di.getBeanClass().getClassLoader();
                Thread.currentThread().setContextClassLoader(classLoader);

                res.start(EJBResponse.Time.DESERIALIZATION);

                req.getBody().readExternal(in);
View Full Code Here

        }
    }

    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

    }

    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

                }
            }
        }

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

        updateServer(req, res, proxyInfo);

        switch (proxyInfo.getInterfaceType()) {
            case EJB_HOME: {
                res.setResponseCode(ResponseCodes.JNDI_EJBHOME);
                final EJBMetaDataImpl metaData = new EJBMetaDataImpl(beanContext.getHomeInterface(),
                    beanContext.getRemoteInterface(),
                    beanContext.getPrimaryKeyClass(),
                    beanContext.getComponentType().toString(),
                    deploymentID,
                    -1,
                    convert(proxyInfo.getInterfaceType()),
                    null,
                    beanContext.getAsynchronousMethodSignatures());
                metaData.loadProperties(beanContext.getProperties());
                log(metaData);
                res.setResult(metaData);
                break;
            }
            case EJB_LOCAL_HOME: {
                res.setResponseCode(ResponseCodes.JNDI_NAMING_EXCEPTION);
                final NamingException namingException = new NamingException("Not remotable: '" +
                    name +
                    "'. EJBLocalHome interfaces are not remotable as per the EJB specification.");
                res.setResult(new ThrowableArtifact(namingException));
                break;
            }
            case BUSINESS_REMOTE: {
                res.setResponseCode(ResponseCodes.JNDI_BUSINESS_OBJECT);
                final EJBMetaDataImpl metaData = new EJBMetaDataImpl(null,
                    null,
                    beanContext.getPrimaryKeyClass(),
                    beanContext.getComponentType().toString(),
                    deploymentID,
                    -1,
                    convert(proxyInfo.getInterfaceType()),
                    proxyInfo.getInterfaces(),
                    beanContext.getAsynchronousMethodSignatures());
                metaData.setPrimaryKey(proxyInfo.getPrimaryKey());
                metaData.loadProperties(beanContext.getProperties());

                log(metaData);
                res.setResult(metaData);
                break;
            }
View Full Code Here

TOP

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

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.