Package org.jboss.ejb

Examples of org.jboss.ejb.StatelessSessionEnterpriseContext$TimerServiceWrapper


   // Protected -----------------------------------------------------
   protected EnterpriseContext create(Object instance)
      throws Exception
   {
      // The instance is created by the caller and is a newInstance();
      return new StatelessSessionEnterpriseContext(instance, getContainer());
   }
View Full Code Here


   // Interceptor implementation --------------------------------------
  
   public Object invokeHome(final Invocation mi) throws Exception
   {
      InstancePool pool = container.getInstancePool();
      StatelessSessionEnterpriseContext ctx = null;
      try
      {
         // Acquire an instance in case the ejbCreate throws a CreateException 
         ctx = (StatelessSessionEnterpriseContext) pool.get();
         mi.setEnterpriseContext(ctx);
View Full Code Here

   public Object invoke(final Invocation mi) throws Exception
   {
      // Get context
      InstancePool pool = container.getInstancePool();
      StatelessSessionEnterpriseContext ctx = null;
      try
      {
         ctx = (StatelessSessionEnterpriseContext) pool.get();
      }
      catch (EJBException e)
      {
         throw e;
      }
      catch (RemoteException e)
      {
         throw e;
      }
      catch (Exception e)
      {
         InvocationType type = mi.getType();
         boolean isLocal = (type == InvocationType.LOCAL || type == InvocationType.LOCALHOME);
         if (isLocal)
            throw new EJBException("Unable to get an instance from the pool", e);
         else
            throw new RemoteException("Unable to get an intance from the pool", e);
      }


      // Set the current security information
      ctx.setPrincipal(mi.getPrincipal());
      // Set the JACC EnterpriseBean PolicyContextHandler data
      EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());

      // Use this context
      mi.setEnterpriseContext(ctx);

      // JAXRPC/JAXWS message context
      Object msgContext = mi.getValue(InvocationKey.SOAP_MESSAGE_CONTEXT);

      // Timer invocation
      if (ejbTimeout.equals(mi.getMethod()))
      {
         AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_TIMEOUT);
      }

      // Service Endpoint invocation
      else if (msgContext != null)
      {
         if (msgContext instanceof javax.xml.rpc.handler.MessageContext)
            ctx.setMessageContext((javax.xml.rpc.handler.MessageContext)msgContext);

         AllowedOperationsAssociation.pushInMethodFlag(IN_SERVICE_ENDPOINT_METHOD);
      }

      // Business Method Invocation
View Full Code Here

   }

   protected EnterpriseContext create(Object instance)
      throws Exception
   {
      return new StatelessSessionEnterpriseContext(instance, getContainer());
   }
View Full Code Here

   // Protected -----------------------------------------------------
   protected EnterpriseContext create(Object instance)
      throws Exception
   {
      // The instance is created by the caller and is a newInstance();
      return new StatelessSessionEnterpriseContext(instance, getContainer());
   }
View Full Code Here

/*     */   }
/*     */
/*     */   protected EnterpriseContext create(Object instance)
/*     */     throws Exception
/*     */   {
/* 178 */     return new StatelessSessionEnterpriseContext(instance, getContainer());
/*     */   }
View Full Code Here

/*    */   }
/*    */
/*    */   protected EnterpriseContext create(Object instance)
/*    */     throws Exception
/*    */   {
/* 49 */     return new StatelessSessionEnterpriseContext(instance, getContainer());
/*    */   }
View Full Code Here

/*     */
/*     */   public Object invokeHome(Invocation mi)
/*     */     throws Exception
/*     */   {
/*  89 */     InstancePool pool = this.container.getInstancePool();
/*  90 */     StatelessSessionEnterpriseContext ctx = null;
/*     */     try
/*     */     {
/*  94 */       ctx = (StatelessSessionEnterpriseContext)pool.get();
/*  95 */       mi.setEnterpriseContext(ctx);
/*     */
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public Object invoke(Invocation mi) throws Exception {
/* 112 */     InstancePool pool = this.container.getInstancePool();
/* 113 */     StatelessSessionEnterpriseContext ctx = null;
/*     */     boolean isLocal;
/*     */     try {
/* 116 */       ctx = (StatelessSessionEnterpriseContext)pool.get();
/*     */     }
/*     */     catch (EJBException e)
/*     */     {
/* 120 */       throw e;
/*     */     }
/*     */     catch (RemoteException e)
/*     */     {
/* 124 */       throw e;
/*     */     }
/*     */     catch (Exception e)
/*     */     {
/* 128 */       InvocationType type = mi.getType();
/* 129 */       isLocal = (type == InvocationType.LOCAL) || (type == InvocationType.LOCALHOME);
/* 130 */       if (isLocal) {
/* 131 */         throw new EJBException("Unable to get an instance from the pool", e);
/*     */       }
/* 133 */       throw new RemoteException("Unable to get an intance from the pool", e);
/*     */     }
/*     */
/* 137 */     ctx.setSecurityContext(mi.getSecurityContext());
/*     */
/* 139 */     ctx.setPrincipal(mi.getPrincipal());
/*     */
/* 141 */     EnterpriseBeanPolicyContextHandler.setEnterpriseBean(ctx.getInstance());
/*     */
/* 144 */     mi.setEnterpriseContext(ctx);
/*     */
/* 147 */     Object msgContext = mi.getValue(InvocationKey.SOAP_MESSAGE_CONTEXT);
/*     */
/* 150 */     if (ejbTimeout.equals(mi.getMethod()))
/*     */     {
/* 152 */       AllowedOperationsAssociation.pushInMethodFlag(IN_EJB_TIMEOUT);
/*     */     }
/* 156 */     else if (msgContext != null)
/*     */     {
/* 158 */       if ((msgContext instanceof MessageContext)) {
/* 159 */         ctx.setMessageContext((MessageContext)msgContext);
/*     */       }
/* 161 */       AllowedOperationsAssociation.pushInMethodFlag(IN_SERVICE_ENDPOINT_METHOD);
/*     */     }
/*     */     else
/*     */     {
View Full Code Here

TOP

Related Classes of org.jboss.ejb.StatelessSessionEnterpriseContext$TimerServiceWrapper

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.