Package org.apache.openejb.core

Examples of org.apache.openejb.core.Operation


                * If the bean has a primary key; And its not being returned following a remove operation;
                * then the bean is being returned to the method ready pool after successfully executing a business method or create
                * method. In this case we need to call the bean instance's ejbPassivate before returning it to the pool per EJB 1.1
                * Section 9.1.
                */
                Operation currentOp = callContext.getCurrentOperation();

                callContext.setCurrentOperation(Operation.PASSIVATE);
                BaseContext.State[] originalStates = callContext.setCurrentAllowedStates(EntityContext.getStates());

                try {
View Full Code Here


    public void freeInstance(ThreadContext callContext, EntityBean bean) throws SystemException {

        discardInstance(callContext, bean);

        Operation currentOp = callContext.getCurrentOperation();
        callContext.setCurrentOperation(Operation.UNSET_CONTEXT);
        BaseContext.State[] originalStates = callContext.setCurrentAllowedStates(EntityContext.getStates());

        try {
            /*
 
View Full Code Here

    /**
     * Performs EJB rules when a system exception occurs.
     */
    public static void handleSystemException(TransactionPolicy txPolicy, Throwable sysException, ThreadContext callContext) throws InvalidateReferenceException {
        // Log the system exception or error
        Operation operation = null;
        if (callContext != null) {
            operation = callContext.getCurrentOperation();
        }
        if (operation != null && operation.isCallback()) {
            logger.error("startup.beanInstanceSystemExceptionThrown", sysException, sysException.getMessage());
        } else {
            logger.debug("startup.beanInstanceSystemExceptionThrown", sysException, sysException.getMessage());
        }

View Full Code Here

    private Instance newInstance(Object primaryKey, Class beanClass, Map<EntityManagerFactory, EntityManager> entityManagers) throws OpenEJBException {
        Instance instance = null;

        ThreadContext threadContext = ThreadContext.getThreadContext();
        Operation currentOperation = threadContext.getCurrentOperation();
        try {
            ThreadContext callContext = ThreadContext.getThreadContext();
            CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();
            Context ctx = deploymentInfo.getJndiEnc();
View Full Code Here

        synchronized (instance) {
            // Is the instance alreayd in use?
            if (instance.isInUse()) {
                // the bean is already being invoked; the only reentrant/concurrent operations allowed are Session synchronization callbacks
                Operation currentOperation = callContext.getCurrentOperation();
                if (currentOperation != Operation.AFTER_COMPLETION && currentOperation != Operation.BEFORE_COMPLETION) {
                    throw new ApplicationException(new RemoteException("Concurrent calls not allowed."));
                }
            }
View Full Code Here

    public Object newInstance(Object primaryKey, Class beanClass) throws OpenEJBException {
        Object bean = null;

        ThreadContext threadContext = ThreadContext.getThreadContext();
        Operation currentOperation = threadContext.getCurrentOperation();
        try {
            ObjectRecipe objectRecipe = new ObjectRecipe(beanClass);
            objectRecipe.allow(Option.FIELD_INJECTION);
            objectRecipe.allow(Option.PRIVATE_PROPERTIES);
//            objectRecipe.allow(Option.IGNORE_MISSING_PROPERTIES);
View Full Code Here

            }
            return entry.bean;
        } else {
            // if it is not in the queue, the bean is already being invoked
            // the only reentrant/concurrent operations allowed are Session synchronization callbacks
            Operation currentOperation = callContext.getCurrentOperation();
            if (currentOperation != Operation.AFTER_COMPLETION && currentOperation != Operation.BEFORE_COMPLETION) {
                throw new ApplicationException(new RemoteException("Concurrent calls not allowed"));
            }

            return entry.bean;
View Full Code Here

        }

        // remember the return value or exception so it can be logged
        Object returnValue = null;
        OpenEJBException openEjbException = null;
        Operation oldOperation = callContext.getCurrentOperation();
        callContext.setCurrentOperation(Operation.BUSINESS);
        BaseContext.State[] originalStates = callContext.setCurrentAllowedStates(MdbContext.getStates());
        try {
            if (logger.isInfoEnabled()) {
                logger.info("invoking method " + method.getName() + " on " + deployInfo.getDeploymentID());
View Full Code Here

            // method invoked. Section 6.6 of EJB 1.1 specification.
            throw new InvalidateReferenceException(new NoSuchObjectException("Timed Out"));
        }

        // call the activate method
        Operation currentOperation = callContext.getCurrentOperation();
        callContext.setCurrentOperation(Operation.ACTIVATE);
        try {
            CoreDeploymentInfo deploymentInfo = callContext.getDeploymentInfo();

            StatefulInstanceManager.Instance instance = (StatefulInstanceManager.Instance) entry.bean;
View Full Code Here

        return entry.bean;
    }

    protected void handleTimeout(BeanEntry entry, ThreadContext threadContext) {
        Operation currentOperation = threadContext.getCurrentOperation();
        threadContext.setCurrentOperation(Operation.PRE_DESTROY);
        BaseContext.State[] originalAllowedStates = threadContext.setCurrentAllowedStates(StatefulContext.getStates());
        CoreDeploymentInfo deploymentInfo = threadContext.getDeploymentInfo();
        Instance instance = (Instance) entry.bean;
View Full Code Here

TOP

Related Classes of org.apache.openejb.core.Operation

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.