Package javax.ejb

Examples of javax.ejb.EJBContext


                // 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 );

                // verify context was set via legacy set method
                Assert.assertNotNull("The MessageDrivenContext is null from setter method", mdbContext);
            } catch (Exception e){
View Full Code Here


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

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

                // verify context was set via legacy set method
                Assert.assertNotNull("The SessionContext is null from setter method", ejbContext );
            } catch (Exception e){
View Full Code Here

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

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

                // verify context was set via legacy set method
                Assert.assertNotNull("The SessionContext is null from setter method", ejbContext );
            } catch (Exception e){
View Full Code Here

            try {
                initialContext = new InitialContext();
            } catch (final NamingException e) {
                throw new RuntimeException(e);
            }
            final EJBContext ejbContext;
            try {
                ejbContext = (SessionContext) initialContext.lookup("java:comp/EJBContext");
            } catch (final NamingException e) {
                throw new RuntimeException(e);
            }

            final Principal callerPrincipal = ejbContext.getCallerPrincipal();
            if (expectedPrincipal != null) {
                if (!expectedPrincipal.equals(callerPrincipal)) {
                    throw new IllegalStateException("the caller principal " + callerPrincipal + " is not the expected " + expectedPrincipal);
                }
            } else {
View Full Code Here

        // If ejb, use isCallerInRole 
        if (isContainerContextAEJBContainerObject() && roleName == null) {
            ComponentInvocation componentInvocation =
                    ConnectorRuntime.getRuntime().getInvocationManager().getCurrentInvocation();
            EJBInvocation ejbInvocation = (EJBInvocation) componentInvocation;
            EJBContext ejbcontext = ejbInvocation.getEJBContext();
            Set<Map.Entry> s = (Set<Map.Entry>) groupNameSecurityMap.entrySet();
            Iterator i = s.iterator();
            while(i.hasNext()) {
                Map.Entry mapEntry = (Map.Entry) i.next();
                String key = (String) mapEntry.getKey();
                Principal entry = (Principal) mapEntry.getValue();

                boolean isInRole = false;
                try {
                    isInRole = ejbcontext.isCallerInRole(key);
                } catch (Exception ex) {
                    if(_logger.isLoggable(Level.FINE)) {
                        _logger.log(Level.FINE, "BasicPasswordAuthentication::caller not in role " + key);
                    }
                }
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

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.