Package org.jboss.invocation

Examples of org.jboss.invocation.MarshalledInvocation


      if ("invoke".equals(invocation.getName()))
      {
         Object[] args = invocation.getArgs();
         if ((args.length == 1) && (args[0] instanceof MarshalledInvocation))
         {
            MarshalledInvocation mi = (MarshalledInvocation) args[0];
            result = policy.filter(mi, result);
         }
      }
      return result;
   }
View Full Code Here


           InvocationRequest remoteInv = (InvocationRequest) obj;
           Object param = remoteInv.getParameter();

           if(param instanceof MarshalledInvocation)
           {
              MarshalledInvocation mi = (MarshalledInvocation) param;
              Object txCxt = mi.getTransactionPropagationContext();
              if(txCxt != null)
              {
                 TransactionPropagationContextImporter tpcImporter = TransactionPropagationContextUtil.getTPCImporter();
                 mi.setTransaction(tpcImporter.importTransactionPropagationContext(txCxt));
              }
           }
        }
        return obj;
    }
View Full Code Here

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

              MarshalledInvocation marshInv = new MarshalledInvocation(inv);

              if(inv != null)
              {
                 // now that have invocation object related to ejb invocations,
                 // need to get the possible known payload objects and make sure
                 // they get serialized.

                 try
                 {
                    marshInv.setTransactionPropagationContext(getTransactionPropagationContext());
                 }
                 catch(SystemException e)
                 {
                    log.error("Error setting transaction propagation context.", e);
                    throw new IOException("Error setting transaction context.  Message: " + e.getMessage());
View Full Code Here

      {        
         try
         {
            if( trace )
               log.trace("Invoking on target="+target);
            MarshalledInvocation mi = new MarshalledInvocation(null, method, args, null, null, null);
            mi.setObjectName (""); //FIXME: Fake value! Bill's optimisations regarding MI make the hypothesis
                                   // that ObjectName is always here otherwise the writeExternal code of MI
                                   // "out.writeInt(payload.size() - 3);" is wrong
            HARMIResponse rsp = target.invoke(this.familyClusterInfo.getCurrentViewId (), mi);
            if (rsp.newReplicants != null)
            {
View Full Code Here

      Boolean returnValueAsAttribute = (Boolean) request.getAttribute("returnValueAsAttribute");
      try
      {
         response.setContentType(RESPONSE_CONTENT_TYPE);
         // See if the request already has the MarshalledInvocation
         MarshalledInvocation mi = (MarshalledInvocation) request.getAttribute("MarshalledInvocation");
         if( mi == null )
         {
            // Get the invocation from the post
            ServletInputStream sis = request.getInputStream();
            ObjectInputStream ois = new ObjectInputStream(sis);
            mi = (MarshalledInvocation) ois.readObject();
            ois.close();
         }
         /* If the invocation carries no auth context, look to to the auth
         context of this servlet as seen in the SecurityAssocation. This allows
         the web app authentication to transparently be used as the call
         authentication.
         */
         if (mi.getPrincipal() == null && mi.getCredential() == null)
         {
            mi.setPrincipal(GetPrincipalAction.getPrincipal());
            mi.setCredential(GetCredentialAction.getCredential());
         }
         Object[] params = {mi};
         String[] sig = {"org.jboss.invocation.Invocation"};
         ObjectName invokerName = localInvokerName;
         // If there is no associated invoker, get the name from the invocation
         if( invokerName == null )
         {
            Integer nameHash = (Integer) mi.getObjectName();
            invokerName = (ObjectName) Registry.lookup(nameHash);
            if( invokerName == null )
               throw new ServletException("Failed to find invoker name for hash("+nameHash+")");
         }
         // Forward the invocation onto the JMX invoker
View Full Code Here

          * transaction progagation context manually in the mock class.
          *
          * Not ideal, as I try avoiding production code in UTs as much as
          * possible, but makes the mock implementation a lot simpler.
          */
         MarshalledInvocation marshInv = new MarshalledInvocation(inv);
         marshInv.setTransactionPropagationContext(getTransactionPropagationContext());

         MockUnifiedInvokerHA invoker = ((MockInvokerLocator)getInvoker().getLocator()).getInvoker();
        
         return invoker.invoke(new InvocationRequest("", "", marshInv,
               metadata, null, null));
View Full Code Here

         if( methodMap == null )
            initMethodMap(invocation);
         HashSet methodRoles = new HashSet();
         if( invokeInfo instanceof MarshalledInvocation )
         {
            MarshalledInvocation mi = (MarshalledInvocation) invokeInfo;
            mi.setMethodMap(methodMap);
         }
         Method method = invokeInfo.getMethod();
         boolean isRead = isReadMethod(method);
         if( isRead == true )
            methodRoles.add(READER_ROLE);
View Full Code Here

   private static final Logger log = Logger.getLogger(UserTransactionStickinessVerifierInterceptor.class);
  
   @Override
   public Object invoke(Invocation inv) throws Exception
   {
      MarshalledInvocation mi = (MarshalledInvocation)inv;     
      Object tpc = mi.getTransactionPropagationContext();
      TransactionPropagationContextImporter tpcImporter = TransactionPropagationContextUtil.getTPCImporter();
      Transaction tx = tpcImporter.importTransactionPropagationContext(tpc);
      log.debug("Tpc " + tpc + " is associated with tx " + tx);
     
      /* If a tpc is retrieved on the server side but matches no transaction
View Full Code Here

   public Object invoke(Invocation invocation) throws Exception
   {
      // Set the method hash to Method mapping
      if (invocation instanceof MarshalledInvocation)
      {
         MarshalledInvocation mi = (MarshalledInvocation) invocation;
         mi.setMethodMap(marshalledInvocationMapping);
      }
      // Invoke the Naming method via reflection
      Method method = invocation.getMethod();
      Class methodClass = method.getDeclaringClass();
      Object[] args = invocation.getArguments();
View Full Code Here

   {
      Object result = null;
     
      if(invocation instanceof MarshalledInvocation){
        
         MarshalledInvocation mi = (MarshalledInvocation)invocation;
         mi.setMethodMap(marshalledInvocationMapping);
      }
     
      final Method targetMethod = invocation.getMethod();
      final Class targetClass = targetMethod.getDeclaringClass();
      final Object[] targetArguments = invocation.getArguments();
View Full Code Here

TOP

Related Classes of org.jboss.invocation.MarshalledInvocation

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.