Package org.jboss.ejb3.context.spi

Examples of org.jboss.ejb3.context.spi.InvocationContext


      return getClass().getName();
   }

   public Object invoke(Invocation invocation) throws Throwable
   {
      InvocationContext ctx = getInvocationContext(invocation);
      CurrentInvocationContext.push(ctx);
      try
      {
         return invocation.invokeNext();
      }
View Full Code Here


   // TODO: LifecycleMethodInterceptorsInvocation can not be cast to EJBInvocation
   private InvocationContext getInvocationContext(LifecycleMethodInterceptorsInvocation invocation)
   {
      BeanContext<?> beanContext = (BeanContext<?>) invocation.getBeanContext();
      InvocationContext invocationContext = beanContext.createLifecycleInvocation();
      invocationContext.setEJBContext(beanContext.getEJBContext());
      return invocationContext;
   }
View Full Code Here

        }

        @Override
        public Object getInstance() {
            // get the current invocation context and the EJBComponent out of it
            final InvocationContext currentInvocationContext = CurrentInvocationContext.get();
            final EJBComponent ejbComponent = currentInvocationContext.getComponent();
            if (ejbComponent == null) {
                throw new IllegalStateException("EJBComponent has not been set in the current invocation context " + currentInvocationContext);
            }
            return ejbComponent.getTimerService();
        }
View Full Code Here

    @Override
    public Object processInvocation(InterceptorContext context) throws Exception {
        Method method = context.getMethod();
        Object[] parameters = context.getParameters();
        InvocationContext invocationContext = new CustomInvocationContext(context, method, parameters);
        context.putPrivateData(InvocationContext.class, invocationContext);
        CurrentInvocationContext.push(invocationContext);
        try {
            return context.proceed();
        } finally {
View Full Code Here

    public Principal getCallerPrincipal() {
        return utilities.getSecurityManager().getCallerPrincipal();
    }

    protected TransactionAttributeType getCurrentTransactionAttribute() {
        final InvocationContext currentInvocationContext = CurrentInvocationContext.get();
        if (currentInvocationContext == null) {
            return null;
        }
        final Method invokedMethod = currentInvocationContext.getMethod();
        // if method is null, then it's a lifecycle invocation
        if (invokedMethod == null) {
            return null;
        }
        // get the tx attribute of the invoked method
View Full Code Here

    * </p>
    * @return
    */
   protected boolean isLifecycleCallbackInvocation()
   {
      InvocationContext currentInvocationContext = null;
      try
      {
         currentInvocationContext = CurrentInvocationContext.get();
      }
      catch (IllegalStateException ise)
      {
         // no context info available so return false
         return false;
      }
      // If the method in current invocation context is null,
      // then it represents a lifecycle callback invocation
      Method invokedMethod = currentInvocationContext.getMethod();
      if (invokedMethod == null)
      {
         // it's a lifecycle callback
         return true;
      }
View Full Code Here

     
   }
  
   private boolean isSingletonBeanInvocation()
   {
      InvocationContext currentInvocationContext = null;
      try
      {
         currentInvocationContext = CurrentInvocationContext.get();
        
         if (currentInvocationContext instanceof TimerServiceInvocationContext)
View Full Code Here

        }

        @Override
        public Object getInstance() {
            // get the current invocation context and the EJBComponent out of it
            final InvocationContext currentInvocationContext = CurrentInvocationContext.get();
            final EJBComponent ejbComponent = currentInvocationContext.getComponent();
            if (ejbComponent == null) {
                throw new IllegalStateException("EJBComponent has not been set in the current invocation context " + currentInvocationContext);
            }
            return ejbComponent.getTimerService();
        }
View Full Code Here

    public Principal getCallerPrincipal() {
        return utilities.getSecurityManager().getCallerPrincipal();
    }

    protected TransactionAttributeType getCurrentTransactionAttribute() {
        final InvocationContext currentInvocationContext = CurrentInvocationContext.get();
        if (currentInvocationContext == null) {
            return null;
        }
        final Method invokedMethod = currentInvocationContext.getMethod();
        // if method is null, then it's a lifecycle invocation
        if (invokedMethod == null) {
            return null;
        }
        // get the tx attribute of the invoked method
View Full Code Here

    private SessionBeanSetSessionContextMethodInvocationInterceptor() {
    }

    @Override
    public Object processInvocation(final InterceptorContext context) throws Exception {
        final InvocationContext invocationContext = CurrentInvocationContext.get();
        if (invocationContext instanceof BaseSessionInvocationContext) {
            ((SessionBean) context.getTarget()).setSessionContext((BaseSessionInvocationContext) invocationContext);
        }
        return context.proceed();
    }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.context.spi.InvocationContext

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.