Package javax.ejb

Examples of javax.ejb.EJBContext


        // sets the context
        System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory");

        Context initialContext = new InitialContext();
        EJBContext ejbContext = (EJBContext) initialContext.lookup("java:comp/EJBContext");
        return ejbContext;
    }
View Full Code Here


     * Makes a setRollbackOnly that must to throw en exception.
     * @throws NamingException if a lookup error occurs.
     * @throws IllegalStateException if the bean try to call the setRollBackOnly
     */
    public void setRollbackOnly() throws NamingException, IllegalStateException {
        EJBContext ejbContext = EJBContextHelper.getEJBContext();
        ejbContext.setRollbackOnly();
    }
View Full Code Here

     * Makes a getRollbackOnly that must to throw en exception.
     * @throws NamingException if a lookup error occurs.
     * @throws IllegalStateException if the bean try to call the getRollBackOnly
     */
    public void getRollbackOnly() throws NamingException, IllegalStateException {
        EJBContext ejbContext = EJBContextHelper.getEJBContext();
        ejbContext.getRollbackOnly();
    }
View Full Code Here

        //Checks if the reference exists.
        if (ctx == null){
            throw new Exception("EJBContext is null.");
        }

        EJBContext ctx00 = (EJBContext) ctx.lookup("java:comp/EJBContext");

        if (ctx00 == null){
            throw new Exception("EJBContext could not get using another EJBContext reference.");
        }
    }
View Full Code Here

         // JAX-WS MessageContext
         BeanProperty beanProp = sbc.getWebServiceContextProperty();
         if (beanProp != null)
         {
            EJBContext ejbCtx = beanCtx.getEJBContext();           
            jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
            beanProp.set(beanCtx.getInstance(), jaxwsContext);
         }
      }
View Full Code Here

         // JAX-WS MessageContext
         BeanProperty beanProp = sbc.getWebServiceContextProperty();
         if (beanProp != null)
         {
            EJBContext ejbCtx = beanCtx.getEJBContext();           
            jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
            beanProp.set(beanCtx.getInstance(), jaxwsContext);
         }
      }
View Full Code Here

         // JAX-WS MessageContext
         BeanProperty beanProp = sbc.getWebServiceContextProperty();
         if (beanProp != null)
         {
            EJBContext ejbCtx = beanCtx.getEJBContext();           
            jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
            beanProp.set(beanCtx.getInstance(), jaxwsContext);
         }
      }
View Full Code Here

         // JAX-WS MessageContext
         BeanProperty beanProp = sbc.getWebServiceContextProperty();
         if (beanProp != null)
         {
            EJBContext ejbCtx = beanCtx.getEJBContext();           
            jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
            beanProp.set(beanCtx.getInstance(), jaxwsContext);
         }
      }
View Full Code Here

         // JAX-WS MessageContext
         BeanProperty beanProp = sbc.getWebServiceContextProperty();
         if (beanProp != null)
         {
            EJBContext ejbCtx = beanCtx.getEJBContext();           
            jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
            beanProp.set(beanCtx.getInstance(), jaxwsContext);
         }
      }
View Full Code Here

    public void onEntityCallback(Object entity) {
        try {
            invocationCount++;
            // Thread.dumpStack();
            InitialContext jndiContext = new InitialContext();
            EJBContext ctx = (EJBContext)jndiContext.lookup("java:comp/EJBContext");
              System.out.println(ctx.getCallerPrincipal().getName() + ", entity=" + entity);
        } catch (NamingException e) {
            throw new RuntimeException("initial context error", e);
        }

    }
View Full Code Here

TOP

Related Classes of javax.ejb.EJBContext

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.