Package org.apache.openejb

Examples of org.apache.openejb.SystemException


            } else if (cause instanceof HeuristicMixedException) {
                throw new ApplicationException(cause);
            } else if (cause instanceof HeuristicRollbackException) {
                throw new ApplicationException(cause);
            } else if (cause instanceof IllegalStateException) {
                throw new SystemException(cause);
            } else if (cause instanceof SecurityException) {
                throw new SystemException(cause);
            } else if (cause instanceof javax.transaction.SystemException) {
                throw new SystemException(cause);
            }

            // wrap with application or system exception based on type
            if (e instanceof HeuristicCompletionException) {
                throw new ApplicationException(e);
            } else if (e instanceof UnexpectedRollbackException) {
                throw new ApplicationException(e);
            }
            throw new SystemException(e);
        }
    }
View Full Code Here


            }
        });
    }

    public void enlistResource(XAResource xaResource) throws SystemException {
        throw new SystemException(new UnsupportedOperationException("SpringTransactionPolicy does not support XAResource enlistment"));
    }
View Full Code Here

    }

    protected EntityBean getPooledInstance(ThreadContext callContext) throws OpenEJBException {
        BeanContext beanContext = callContext.getBeanContext();
        Stack methodReadyPool = poolMap.get(beanContext.getDeploymentID());
        if (methodReadyPool == null) throw new SystemException("Invalid deployment id " + beanContext.getDeploymentID() + " for this container");

        EntityBean bean = (EntityBean) methodReadyPool.pop();
        if (bean == null) {
            try {
                bean = (EntityBean) beanContext.getBeanClass().newInstance();
            } catch (Exception e) {
                logger.error("Bean instantiation failed for class " + beanContext.getBeanClass(), e);
                throw new SystemException(e);
            }

            Operation currentOp = callContext.getCurrentOperation();
            callContext.setCurrentOperation(Operation.SET_CONTEXT);
View Full Code Here

        }
    }

    private Instance obtainInstance(Object primaryKey, ThreadContext callContext, Method callMethod) throws OpenEJBException {
        if (primaryKey == null) {
            throw new SystemException(new NullPointerException("Cannot obtain an instance of the stateful session bean with a null session id"));
        }

        Transaction currentTransaction = getTransaction(callContext);

        // Find the instance
        Instance instance;
        synchronized (primaryKey) {
            instance = checkedOutInstances.get(primaryKey);
            if (instance == null) {
                try {
                    instance = cache.checkOut(primaryKey);
                } catch (OpenEJBException e) {
                    throw e;
                } catch (Exception e) {
                    throw new SystemException("Unexpected load exception", e);
                }

                // Did we find the instance?
                if (instance == null) {
                    throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
View Full Code Here

     * @param callContext
     * @param bean
     * @throws OpenEJBException
     */
    public void poolInstance(ThreadContext callContext, Object bean) throws OpenEJBException {
        if (bean == null) throw new SystemException("Invalid arguments");
        Instance instance = Instance.class.cast(bean);

        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
        Data data = (Data) deploymentInfo.getContainerData();

View Full Code Here

     *
     * @param callContext
     * @param bean
     */
    public void discardInstance(ThreadContext callContext, Object bean) throws SystemException {
        if (bean == null) throw new SystemException("Invalid arguments");
        Instance instance = Instance.class.cast(bean);

        CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
        Data data = (Data) deploymentInfo.getContainerData();

View Full Code Here

        }
    }

    private Instance obtainInstance(Object primaryKey, ThreadContext callContext) throws OpenEJBException {
        if (primaryKey == null) {
            throw new SystemException(new NullPointerException("Cannot obtain an instance of the stateful session bean with a null session id"));
        }

        Transaction currentTransaction = getTransaction(callContext);

        // Find the instance
        Instance instance = checkedOutInstances.get(primaryKey);
        if (instance == null) {
            try {
                instance = cache.checkOut(primaryKey);
            } catch (OpenEJBException e) {
                throw e;
            } catch (Exception e) {
                throw new SystemException("Unexpected load exception", e);
            }

            // Did we find the instance?
            if (instance == null) {
                throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
View Full Code Here

     * @param callContext
     * @param bean
     * @throws OpenEJBException
     */
    public void poolInstance(ThreadContext callContext, Object bean) throws OpenEJBException {
        if (bean == null) throw new SystemException("Invalid arguments");
        Instance instance = Instance.class.cast(bean);

        BeanContext beanContext = callContext.getBeanContext();
        Data data = (Data) beanContext.getContainerData();

View Full Code Here

     *
     * @param callContext
     * @param bean
     */
    public void discardInstance(final ThreadContext callContext, final Object bean) throws SystemException {
        if (bean == null) throw new SystemException("Invalid arguments");
        final Instance instance = Instance.class.cast(bean);

        final BeanContext beanContext = callContext.getBeanContext();
        final Data data = (Data) beanContext.getContainerData();

View Full Code Here

        MdbInstanceFactory instanceFactory = endpointFactory.getInstanceFactory();
        Instance instance;
        try {
            instance = (Instance) instanceFactory.createInstance(true);
        } catch (UnavailableException e) {
            throw new SystemException("Unable to create instance for invocation", e);
        }

        try {
            beforeDelivery(beanContext, instance, method, null);
            Object value = invoke(instance, method, type, args);
View Full Code Here

TOP

Related Classes of org.apache.openejb.SystemException

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.