Examples of Invocation


Examples of org.jboss.aop.joinpoint.Invocation

         {
            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

Examples of org.jboss.aop.joinpoint.Invocation

         {
            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

Examples of org.jboss.aop.joinpoint.Invocation

    @return
    */
   public static ContainerMethodInvocation getCurrentInvocation()
   {
      // Obtain current invocation
      Invocation currentInvocation = CurrentInvocation.getCurrentInvocation();

      // Cast and return
      try
      {
         return ContainerMethodInvocation.class.cast(currentInvocation);
      }
      catch (ClassCastException cce)
      {
         throw new RuntimeException("Current invocation is not of type " + ContainerMethodInvocation.class.getName()
               + " but instead is " + currentInvocation.getClass().getName(), cce);
      }
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.Invocation

         {
            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

Examples of org.jboss.aop.joinpoint.Invocation

      // Get the existing SecurityContext
      final SecurityContext sc = SecurityActions.getSecurityContext();

      // Copy the invocation (must be done for Thread safety, as we spawn this off and
      // subsequent calls can mess with the internal interceptor index
      final Invocation nextInvocation = invocation.copy();

      // Make the asynchronous task from the invocation
      final Callable<Object> asyncTask = new AsyncInvocationTask<Object>(nextInvocation, sc);

      // Short-circuit the invocation into new Thread
View Full Code Here

Examples of org.jboss.invocation.Invocation

    * @return
    * @throws Throwable
    */
   public Object invoke(InvocationRequest invocationReq) throws Throwable
   {
      Invocation invocation = (Invocation) invocationReq.getParameter();
      Thread currentThread = Thread.currentThread();
      ClassLoader oldCl = currentThread.getContextClassLoader();
      ObjectName mbean = null;
      try
      {
         mbean = (ObjectName) Registry.lookup(invocation.getObjectName());

         // The cl on the thread should be set in another interceptor
         Object obj = getServer().invoke(mbean,
                                         "invoke",
                                         new Object[]{invocation},
View Full Code Here

Examples of org.jboss.invocation.Invocation

      }

      @Override
      public Object invoke(InvocationRequest invocationReq) throws Throwable
      {
         Invocation invocation = (Invocation) invocationReq.getParameter();
         InvokerHaFailureType failureType = (InvokerHaFailureType)invocation.getValue("FAILURE_TYPE");
         if (failureType != null)
         {
            failureType.injectFailureIfExistsAfterServer((Integer)invocation.getAsIsValue("FAILOVER_COUNTER"));
         }
        
         log.debug("invoking on " + invocation.getObjectName());
        
         return super.invoke(invocationReq);
      }
View Full Code Here

Examples of org.jboss.invocation.Invocation

      }

      @Override
      public Object invoke(Object param, Map metadata) throws Throwable
      {
         Invocation inv = (Invocation) param;
         inv.getTransientPayload().put("TEST_USED_TARGET", this.getInvoker().getLocator());
        
         /* Down the call stack in Remoting's Client.invoke, marshaller is
          * called which via org.jboss.invocation.unified.marshall.InvocationMarshaller
          * sets the transaction progagation context.
          *
 
View Full Code Here

Examples of org.jboss.invocation.Invocation

      {
         NoSuchMethodException e = new NoSuchMethodException(actionName);
         throw new ReflectionException(e, actionName);
      }

      Invocation invocation = (Invocation) params[0];
      try
      {
         Object value = invoke(invocation);
         return value;
      }
View Full Code Here

Examples of org.jboss.invocation.Invocation

        {
           InvocationRequest remoteInv = (InvocationRequest) dataObject;

           if(remoteInv.getParameter() instanceof Invocation)
           {
              Invocation inv = (Invocation) remoteInv.getParameter();

              MarshalledInvocation marshInv = new MarshalledInvocation(inv);

              if(inv != null)
              {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.