Examples of InvocationRequest


Examples of org.jboss.remoting.InvocationRequest

            {
               request.put(HTTPUnMarshaller.PRESERVE_LINES, o);
            }

            receivedInvocationRequest.set(FALSE);
            InvocationRequest invocationRequest = null;
            MessageBytes method = req.method();
            if (method.equals("GET") || method.equals("HEAD")
                  || (method.equals("OPTIONS") && req.getContentLength() <= 0))
            {
               invocationRequest = createNewInvocationRequest(request, response, null);
            } else
            {
               // must be POST or PUT
               UnMarshaller unmarshaller = getUnMarshaller();
               request.put(HTTPMetadataConstants.USE_REMOTING_CONTENT_TYPE, useRemotingContentType);
               Object obj = null;
               if (unmarshaller instanceof VersionedUnMarshaller)
                  obj = ((VersionedUnMarshaller)unmarshaller).read(request.getInputStream(), request, version);
               else
                  obj = unmarshaller.read(request.getInputStream(), request);
               if (obj instanceof InvocationRequest)
               {
                  receivedInvocationRequest.set(TRUE);
                  invocationRequest = (InvocationRequest) obj;
                  if (invocationRequest.getReturnPayload() == null)
                  {
                     // need to create a return payload map, so can be populated with metadata
                     invocationRequest.setReturnPayload(response);
                  }
                  Map requestPayloadMap = invocationRequest.getRequestPayload();
                  if (requestPayloadMap != null)
                  {
                     request.putAll(requestPayloadMap);
                  }
                  invocationRequest.setRequestPayload(request);
               } else
               {
                  invocationRequest = createNewInvocationRequest(request, response, obj);
               }
            }
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

   {
      // will try to use the same session id if possible to track
      String sessionId = getSessionId(requestMap);
      String subSystem = (String) requestMap.get(HEADER_SUBSYSTEM);

      InvocationRequest request = null;

      boolean isLeaseQueury = checkForLeaseQuery(requestMap);
      if(isLeaseQueury)
      {
         addLeaseInfo(responseMap);
         request = new InvocationRequest(sessionId, subSystem, "$PING$", null, responseMap, null);
      }
      else
      {
         request = new InvocationRequest(sessionId, subSystem, payload,
                                                        requestMap, responseMap, null);
      }
      return request;
   }
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

      Map parameters = new HashMap();
      parameters.put(MicroSocketClientInvoker.WRAP_INTERRUPTED_EXCEPTION, "true");
      InvokerLocator il = new InvokerLocator("unittest", "127.0.0.1", 9999, "mock", parameters);
      CountDown startGate = new CountDown(1);
      MockMicroSocketClientInvoker ci = new MockMicroSocketClientInvoker(il, startGate);
      InvocationRequest ir = new InvocationRequest("", "", null, null, null, il);
     
      Runnable interrupterRunnable = new ThreadInterrupter(Thread.currentThread(), startGate);
      Thread interrupter = new Thread(interrupterRunnable);
      interrupter.start();
     
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

   public void testNotWrappedExceptionDefault() throws Throwable
   {
      InvokerLocator il = new InvokerLocator("unittest", "127.0.0.1", 9999, "mock", null);
      CountDown startGate = new CountDown(1);
      MockMicroSocketClientInvoker ci = new MockMicroSocketClientInvoker(il, startGate);
      InvocationRequest ir = new InvocationRequest("", "", null, null, null, il);
     
      Runnable interrupterRunnable = new ThreadInterrupter(Thread.currentThread(), startGate);
      Thread interrupter = new Thread(interrupterRunnable);
      interrupter.start();
     
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

      Map parameters = new HashMap();
      parameters.put(MicroSocketClientInvoker.WRAP_INTERRUPTED_EXCEPTION, "false");
      InvokerLocator il = new InvokerLocator("unittest", "127.0.0.1", 9999, "mock", parameters);
      CountDown startGate = new CountDown(1);
      MockMicroSocketClientInvoker ci = new MockMicroSocketClientInvoker(il, startGate);
      InvocationRequest ir = new InvocationRequest("", "", null, null, null, il);
     
      Runnable interrupterRunnable = new ThreadInterrupter(Thread.currentThread(), startGate);
      Thread interrupter = new Thread(interrupterRunnable);
      interrupter.start();
     
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

            {
               String userAgent = (String) userAgentObj;
               isRemotingUserAgent = userAgent.startsWith("JBossRemoting");
            }

            InvocationRequest invocationRequest = versionedRead(req, request, response, version);

            // FIXME: OPTIONS method handling ?
            try
            {
               // call transport on the subclass, get the result to handback
               responseObject = invoke(invocationRequest);
            }
            catch(Throwable ex)
            {
               log.debug("Error thrown calling invoke on server invoker.", ex);
               responseObject = ex;
               isError = true;
            }

            //Start with response code of 204 (no content), then if is a return from handler, change to 200 (ok)
            int status;
            String message = "";

            if(responseObject != null)
            {
               if(isError)
               {
                  status = 500;
                  message = "JBoss Remoting: Error occurred within target application.";
               }
               else
               {
                  status = 200;
                  message = "OK";
               }
            }
            else
            {
               if (isRemotingUserAgent && !req.method().equals("HEAD"))
               {
                  status = 200;
                  message = "OK";
               }
               else
               {
                  status = 204;
                  message = "No Content";
               }
            }

            // extract response code/message if exists
            Map responseMap = invocationRequest.getReturnPayload();
            if(responseMap != null)
            {
               Integer handlerStatus = (Integer) responseMap.get(HTTPMetadataConstants.RESPONSE_CODE);
               if(handlerStatus != null)
               {
                  status = handlerStatus.intValue();
               }
               String handlerMessage = (String) responseMap.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
               if(handlerMessage != null)
               {
                  message = handlerMessage;
               }
            }
            res.setStatus(status);
            res.setMessage(message);

            if (isRemotingUserAgent && ((Boolean)receivedInvocationRequest.get()).booleanValue())
            {
               responseMap = ((ResponseMap) responseMap).getMap();
               responseObject = new InvocationResponse(invocationRequest.getSessionId(),
                                                       responseObject, isError, responseMap);
            }

            if(responseObject != null)
            {
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

         case Version.VERSION_2:
         case Version.VERSION_2_2:
         {

            receivedInvocationRequest.set(FALSE);
            InvocationRequest invocationRequest = null;
            MessageBytes method = req.method();
            if (method.equals("GET") || method.equals("HEAD")
                  || (method.equals("OPTIONS") && req.getContentLength() <= 0))
            {
               invocationRequest = createNewInvocationRequest(request, response, null);
            } else
            {
               // must be POST or PUT
               UnMarshaller unmarshaller = getUnMarshaller();
               Object obj = null;
               if (unmarshaller instanceof VersionedUnMarshaller)
                  obj = ((VersionedUnMarshaller)unmarshaller).read(request.getInputStream(), request, version);
               else
                  obj = unmarshaller.read(request.getInputStream(), request);
               if (obj instanceof InvocationRequest)
               {
                  receivedInvocationRequest.set(TRUE);
                  invocationRequest = (InvocationRequest) obj;
                  if (invocationRequest.getReturnPayload() == null)
                  {
                     // need to create a return payload map, so can be populated with metadata
                     invocationRequest.setReturnPayload(response);
                  }
                  Map requestPayloadMap = invocationRequest.getRequestPayload();
                  if (requestPayloadMap != null)
                  {
                     request.putAll(requestPayloadMap);
                  }
                  invocationRequest.setRequestPayload(request);
               } else
               {
                  invocationRequest = createNewInvocationRequest(request, response, obj);
               }
            }
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

   {
      // will try to use the same session id if possible to track
      String sessionId = getSessionId(requestMap);
      String subSystem = (String) requestMap.get(HEADER_SUBSYSTEM);

      InvocationRequest request = null;

      boolean isLeaseQueury = checkForLeaseQuery(requestMap);
      if(isLeaseQueury)
      {
         addLeaseInfo(responseMap);
         request = new InvocationRequest(sessionId, subSystem, "$PING$", null, responseMap, null);
      }
      else
      {
         request = new InvocationRequest(sessionId, subSystem, payload,
                                                        requestMap, responseMap, null);
      }
      return request;
   }
View Full Code Here

Examples of org.jboss.remoting.InvocationRequest

   throws IOException, ConnectionFailedException, ClassNotFoundException
   {
      String listenerId = null;
      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

Examples of org.jboss.remoting.InvocationRequest


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