Examples of MarshalledInvocation


Examples of org.jboss.invocation.MarshalledInvocation

      if( user == null && readOnlyContext != null )
      {
         // Extract the invocation
         ServletInputStream sis = request.getInputStream();
         ObjectInputStream ois = new ObjectInputStream(sis);
         MarshalledInvocation mi = null;
         try
         {
            mi = (MarshalledInvocation) ois.readObject();
         }
         catch(ClassNotFoundException e)
         {
            throw new ServletException("Failed to read MarshalledInvocation", e);
         }
         request.setAttribute("MarshalledInvocation", mi);
         /* Get the invocation method. If there is no method then this must
            be an invocation on an mbean other than our invoker so let it go
         */
         mi.setMethodMap(namingMethodMap);
         Method m = mi.getMethod();
         if( m != null )
            validateAccess(m, mi);
      }

      chain.doFilter(request, response);
View Full Code Here

Examples of org.jboss.invocation.MarshalledInvocation

         try
         {
            // Set the method hash to Method mapping
            if (invocation instanceof MarshalledInvocation)
            {
               MarshalledInvocation mi = (MarshalledInvocation) invocation;
               mi.setMethodMap(marshalledInvocationMapping);
            }
            // Invoke the MBeanServer method via reflection
            Method method = invocation.getMethod();
            Object[] args = invocation.getArguments();
            Principal principal = invocation.getPrincipal();
View Full Code Here

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

Examples of org.jboss.invocation.MarshalledInvocation

           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

Examples of org.jboss.invocation.MarshalledInvocation

           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

Examples of org.jboss.invocation.MarshalledInvocation

      {        
         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

Examples of org.jboss.invocation.MarshalledInvocation

      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

Examples of org.jboss.invocation.MarshalledInvocation

          * 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

Examples of org.jboss.invocation.MarshalledInvocation

         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

Examples of org.jboss.invocation.MarshalledInvocation

   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
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.