Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.Invocation


public class EJBContextHelper
{
   public Principal getCallerPrincipal(SecurityContext sc,
         RealmMapping rm, SecurityDomain domain)
   {
      Invocation invocation = getCurrentInvocation("getCallerPrincipal");
      if(isStateless(invocation) && isLifecycleCallback(invocation))
         throw new IllegalStateException("getCallerPrincipal is not allowed in a stateless lifecycle callback (EJB3 4.5.2)");
     
      Principal callerPrincipal = null;
     
View Full Code Here


      return callerPrincipal;
   }
  
   private static Invocation getCurrentInvocation(String reason)
   {
      Invocation current = CurrentInvocation.getCurrentInvocation();
      if(isInjection(current))
         throw new IllegalStateException(reason + " not allowed during injection (EJB3 4.4.1 & 4.5.2)");
      return current;
   }
View Full Code Here

         RealmMapping rm,
         JBossEnterpriseBeanMetaData eb,
         String roleName,
         String ejbName)
   {
      Invocation invocation = getCurrentInvocation("isCallerInRole");
      if(isStateless(invocation) && isLifecycleCallback(invocation))
         throw new IllegalStateException("getCallerPrincipal is not allowed in a stateless lifecycle callback (EJB3 4.5.2)");
     
      if(sc == null)
      {
View Full Code Here

         {
            initParameterTypes = unadvisedMethod.getParameterTypes();
            initParameterValues = statefulInvocation.getArguments();
         }

         Invocation invocation = invokeInit(statefulInvocation.getMetaData(), unadvisedMethod, sessionId, initParameterTypes, initParameterValues);
        
         // Get JNDI Registrar
         JndiSessionRegistrarBase sfsbJndiRegistrar = this.getJndiRegistrar();

         // Determine if local/remote
         boolean isLocal = EJBLocalObject.class.isAssignableFrom(unadvisedMethod.getDeclaringClass());

         // Get the metadata
         JBossSessionBeanMetaData smd = this.getMetaData();

         // Get the appropriate JNDI Name
         String jndiName = isLocal ? smd.getLocalJndiName() : smd.getJndiName();

         // Find the Proxy Factory Key for this SFSB
         String proxyFactoryKey = sfsbJndiRegistrar.getProxyFactoryRegistryKey(jndiName, smd, isLocal);

         // Lookup the Proxy Factory in the Object Store
         StatefulSessionProxyFactory proxyFactory = Ejb3RegistrarLocator.locateRegistrar().lookup(proxyFactoryKey,
               StatefulSessionProxyFactory.class);

         // Create a new EJB2.x Proxy
         Object proxy = proxyFactory.createProxyEjb2x(sessionId);

         InvocationResponse response = marshallResponse(statefulInvocation, proxy, invocation.getResponseContextInfo());
         response.addAttachment(StatefulConstants.NEW_ID, sessionId);
         return response;
      }
      else if (unadvisedMethod.getName().equals("remove"))
      {
View Full Code Here

      return invocation.invokeNext();
   }
  
   protected Object invokeLocal(Invocation invocation, Container container) throws Throwable
   {
      Invocation copy = (Invocation) new MarshalledObjectForLocalCalls(invocation).get();
      copy.getMetaData().addMetaData(IS_LOCAL, IS_LOCAL, Boolean.TRUE, PayloadKey.AS_IS);
      org.jboss.aop.joinpoint.InvocationResponse response = null;

      // Invoke upon the container
      SessionContainer sc = (SessionContainer) container;
      response = sc.dynamicInvoke(copy);
View Full Code Here

   }

   public TimerService getTimerService() throws IllegalStateException
   {
      Invocation invocation = CurrentInvocation.getCurrentInvocation();
      if(InvocationHelper.isInjection(invocation))
         throw new IllegalStateException("getTimerService() not allowed during injection (EJB3 4.5.2)");
      return getContainer().getTimerService();
   }
View Full Code Here

   @Deprecated
   public Object invoke(Invocation invocation) throws Throwable
   {
      if(log.isTraceEnabled()) log.trace("interceptors " + Arrays.toString(interceptors));
      Invocation newInvocation = invocation.getWrapper(interceptors);
      return newInvocation.invokeNext();
   }
View Full Code Here

      return invocation.invokeNext();
   }
  
   protected Object invokeLocal(Invocation invocation, Container container) throws Throwable
   {
      Invocation copy = (Invocation) new MarshalledObjectForLocalCalls(invocation).get();
      copy.getMetaData().addMetaData(IS_LOCAL, IS_LOCAL, Boolean.TRUE);
      org.jboss.aop.joinpoint.InvocationResponse response = ((Advisor) container).dynamicInvoke(null, copy);
      Map contextInfo = response.getContextInfo();
      if (contextInfo != null)
      {
         MarshalledObjectForLocalCalls wrappedException = (MarshalledObjectForLocalCalls) response.getContextInfo().get(IS_LOCAL_EXCEPTION);
View Full Code Here

         {
            initParameterTypes = unadvisedMethod.getParameterTypes();
            initParameterValues = statefulInvocation.getArguments();
         }

         Invocation invocation = invokeInit(statefulInvocation.getMetaData(), unadvisedMethod, sessionId, initParameterTypes, initParameterValues);
        
         // Get JNDI Registrar
         JndiSessionRegistrarBase sfsbJndiRegistrar = this.getJndiRegistrar();

         // Determine if local/remote
         boolean isLocal = EJBLocalObject.class.isAssignableFrom(unadvisedMethod.getDeclaringClass());

         // Get the metadata
         JBossSessionBeanMetaData smd = this.getMetaData();

         // Get the appropriate JNDI Name
         String jndiName = isLocal ? smd.getLocalJndiName() : smd.getJndiName();

         // Find the Proxy Factory Key for this SFSB
         String proxyFactoryKey = sfsbJndiRegistrar.getProxyFactoryRegistryKey(jndiName, smd, isLocal);

         // Lookup the Proxy Factory in the Object Store
         StatefulSessionProxyFactory proxyFactory = Ejb3RegistrarLocator.locateRegistrar().lookup(proxyFactoryKey,
               StatefulSessionProxyFactory.class);

         // Create a new EJB2.x Proxy
         Object proxy = proxyFactory.createProxyEjb2x(sessionId);

         InvocationResponse response = marshallResponse(statefulInvocation, proxy, invocation.getResponseContextInfo());
         response.addAttachment(StatefulConstants.NEW_ID, sessionId);
         return response;
      }
      else if (unadvisedMethod.getName().equals("remove"))
      {
View Full Code Here

      return beanContext.getInstance();
   }

   public TimerService getTimerService() throws IllegalStateException
   {
      Invocation invocation = CurrentInvocation.getCurrentInvocation();
      if(InvocationHelper.isInjection(invocation))
         throw new IllegalStateException("getTimerService() not allowed during injection (EJB3 4.5.2)");
      return getContainer().getTimerService();
   }
View Full Code Here

TOP

Related Classes of org.jboss.aop.joinpoint.Invocation

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.