Package org.jboss.remoting

Examples of org.jboss.remoting.InvocationRequest


      {
         PacketSupport packet = null;
        
         if (obj instanceof InvocationRequest)
         {                       
            InvocationRequest req = (InvocationRequest)obj;
           
            Object param = req.getParameter();
           
            if (param instanceof PacketSupport)
            {
               // A JBM invocation
               packet = (PacketSupport)param;   
View Full Code Here


      {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
        
         OutputStream oos = new DataOutputStream(bos);
        
         InvocationRequest ir = new InvocationRequest("session123", null, req, null, null, null);  
        
         wf.write(ir, oos);
                 
         byte[] bytes = bos.toByteArray();
        
View Full Code Here

  
   public Object getPayload()
   {
      //Wrap this in an InvocationRequest
        
      InvocationRequest req = new InvocationRequest(null, ServerPeer.REMOTING_JMS_SUBSYSTEM,
                                                    this, null, null, null);
     
      return req;
   }
View Full Code Here

         client.invokeOneway("blip");

         // make sure invocation reached the target subsystem

         InvocationRequest i =
            RemotingTestSubsystemService.getNextInvocationFromServer(subsystemService, 2000);

         assertNotNull(i);
         assertEquals("blip", i.getParameter());
      }
      finally
      {
         if (client != null)
         {
View Full Code Here

         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

    public Object removeDecoration(Object obj) throws IOException
    {
        if(obj instanceof InvocationRequest)
        {
           InvocationRequest remoteInv = (InvocationRequest) obj;
           Object param = remoteInv.getParameter();

           if(param instanceof MarshalledInvocation)
           {
              MarshalledInvocation mi = (MarshalledInvocation) param;
              Object txCxt = mi.getTransactionPropagationContext();
View Full Code Here

   }

    public Object addDecoration(Object dataObject) throws IOException {
        if(dataObject instanceof InvocationRequest)
        {
           InvocationRequest remoteInv = (InvocationRequest) dataObject;

           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());
                 }

                 // reset the invocation parameter within remote invocation
                 remoteInv.setParameter(marshInv);
              }
              else
              {
                 //Should never get here, but will check anyways
                 log.error("Attempting to marshall Invocation but is null.  Can not proceed.");
View Full Code Here

                              Marshaller marshaller, UnMarshaller unmarshaller)
   throws IOException, ConnectionFailedException, ClassNotFoundException
   {
      if (invocation instanceof InvocationRequest)
      {
         InvocationRequest ir = (InvocationRequest) invocation;
         Object o = ir.getParameter();
         if (o instanceof InternalInvocation)
         {
            InternalInvocation ii = (InternalInvocation) o;
            if (InternalInvocation.ADDLISTENER.equals(ii.getMethodName())
                && ir.getLocator() != null) // getLocator() == null for pull callbacks
            {
               Map requestPayload = ir.getRequestPayload();
               listenerId = (String) requestPayload.get(Client.LISTENER_ID_KEY);
               listenerIdToClientInvokerMap.put(listenerId, this);
               BisocketServerInvoker callbackServerInvoker;
               callbackServerInvoker = BisocketServerInvoker.getBisocketServerInvoker(listenerId);
               callbackServerInvoker.createControlConnection(listenerId, true);
View Full Code Here


   InvokerLocator getSecondaryLocator() throws Throwable
   {
      InternalInvocation ii = new InternalInvocation(Bisocket.GET_SECONDARY_INVOKER_LOCATOR, null);
      InvocationRequest r = new InvocationRequest(null, null, ii, null, null, null);
      log.debug("getting secondary locator");
      Exception savedException = null;
     
      for (int i = 0; i < maxRetries; i++)
      {
View Full Code Here

      boolean shouldLease = false;
      long leasePeriod = -1;

      if(invocation != null && invocation instanceof InvocationRequest)
      {
         InvocationRequest request = (InvocationRequest)invocation;

         Object payload = request.getParameter();
         // although a bit of a hack, this will determin if first time ping called by client.
         if(payload != null && payload instanceof String && "$PING$".equalsIgnoreCase((String)payload) && request.getReturnPayload() != null)
         {
            try
            {
               // now know is a ping request, so convert to be a HEAD method call
               conn.setDoOutput(false);
               conn.setDoInput(true);
               conn.setRequestMethod("HEAD");
               // set the remoting version
               conn.setRequestProperty(HTTPMetadataConstants.REMOTING_VERSION_HEADER, new Integer(Version.getDefaultVersion()).toString());
               // set the user agent
               conn.setRequestProperty(HTTPMetadataConstants.REMOTING_USER_AGENT, "JBossRemoting - " + Version.VERSION);
               conn.setRequestProperty(HTTPMetadataConstants.REMOTING_LEASE_QUERY, "true");
               conn.setRequestProperty("sessionId", request.getSessionId());
               conn.connect();

               //InputStream is = (conn.getResponseCode() < 400) ? conn.getInputStream() : conn.getErrorStream();
               Map headers = conn.getHeaderFields();
View Full Code Here

TOP

Related Classes of org.jboss.remoting.InvocationRequest

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.