Package javax.ejb

Examples of javax.ejb.MessageDrivenContext


    }

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        final MessageDrivenComponentInstance componentInstance = (MessageDrivenComponentInstance) context.getPrivateData(ComponentInstance.class);
        final MessageDrivenContext messageDrivenContext = (MessageDrivenContext) componentInstance.getEjbContext();
        ((MessageDrivenBean) context.getTarget()).setMessageDrivenContext(messageDrivenContext);
        return context.proceed();
    }
View Full Code Here


    }
  }

  public void testJmsMdb() throws Exception {
    MockControl mc = MockControl.createControl(MessageDrivenContext.class);
    MessageDrivenContext sc = (MessageDrivenContext) mc.getMock();
    mc.replay();
 
    final BeanFactory bf = new StaticListableBeanFactory();
    BeanFactoryLocator bfl = new BeanFactoryLocator() {
      public BeanFactoryReference useBeanFactory(String factoryKey) throws FatalBeanException {
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final MessageDrivenContext sctx = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

    /**
     * Set the associated message driven context. The container calls this method
     * after the instance creation.
     */
    public MessageDrivenContext getMessageDrivenContext() throws EJBException {
        MessageDrivenContext ejbContext = null;
        try {
            ejbContext = (MessageDrivenContext) new InitialContext().lookup("java:comp/EJBContext");
        } catch (final NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final MessageDrivenContext messageDrivenContext = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/mdbcontext is null", messageDrivenContext);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

            try {
                final InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                final MessageDrivenContext sctx = (MessageDrivenContext) ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx);

                // lookup using global name
                final EJBContext ejbCtx = (EJBContext) ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx);
View Full Code Here

            try{
                InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                MessageDrivenContext sctx = (MessageDrivenContext)ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx );

                // lookup using global name
                EJBContext ejbCtx = (EJBContext)ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx );
View Full Code Here

    /**
     * Set the associated message driven context. The container calls this method
     * after the instance creation.
     */
    public MessageDrivenContext getMessageDrivenContext() throws EJBException, RemoteException {
        MessageDrivenContext ejbContext = null;
        try {
            ejbContext = (MessageDrivenContext) new InitialContext().lookup("java:comp/EJBContext");
        } catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
View Full Code Here

            try{
                InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                MessageDrivenContext messageDrivenContext = (MessageDrivenContext)ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The SessionContext got from java:comp/env/mdbcontext is null", messageDrivenContext );

                // lookup using global name
                EJBContext ejbCtx = (EJBContext)ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The SessionContext got from java:comp/EJBContext is null ", ejbCtx );
View Full Code Here

            try{
                InitialContext ctx = new InitialContext();
                Assert.assertNotNull("The InitialContext is null", ctx);

                // lookup in enc
                MessageDrivenContext sctx = (MessageDrivenContext)ctx.lookup("java:comp/env/mdbcontext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/env/mdbcontext is null", sctx );

                // lookup using global name
                EJBContext ejbCtx = (EJBContext)ctx.lookup("java:comp/EJBContext");
                Assert.assertNotNull("The MessageDrivenContext got from java:comp/EJBContext is null ", ejbCtx );
View Full Code Here

TOP

Related Classes of javax.ejb.MessageDrivenContext

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.