Package org.jboss.remoting.invocation

Examples of org.jboss.remoting.invocation.InternalInvocation


      else if(InternalInvocation.ADDSTREAMCALLBACK.equals(methodName))
      {
         StreamHandler streamHandler = getStreamHandler(invocation);
         if(handler instanceof StreamInvocationHandler)
         {
            InternalInvocation inv = (InternalInvocation)invocation.getParameter();
            // second parameter should be the param payload
            result = ((StreamInvocationHandler)handler).
               handleStream(streamHandler, (InvocationRequest)inv.getParameters()[1]);
         }
         else
         {
            log.error("Client request is an InputStream, but the registered handlers do not " +
                      "implement the StreamInvocationHandler interface, so could not process call.");
View Full Code Here


      executor.run(onewayRun);
   }

   private StreamHandler getStreamHandler(InvocationRequest invocation) throws Exception
   {
      InternalInvocation inv = (InternalInvocation)invocation.getParameter();
      String locator = (String)inv.getParameters()[0];
      return new StreamHandler(locator);
   }
View Full Code Here

               }

               // Sending internal invocation so server invoker we are sending to will know how
               // pass onto it's client callback handler

               InternalInvocation internalInvocation =
                  new InternalInvocation(InternalInvocation.HANDLECALLBACK, new Object[]{callback});

               callBackClient.setSessionId(sessionId);

               if (asynch)
               {
View Full Code Here

                  if (disconnectTimeout > 0)
                     metadata.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));

                  try
                  {
                     invoke(new InternalInvocation(InternalInvocation.REMOVELISTENER, null), metadata);
                  }
                  catch (Exception e)
                  {
                     log.warn("unable to remove remote callback handler: " + e.getMessage());
                  }
               }

               // clean up callback poller if one exists
               CallbackPoller callbackPoller = (CallbackPoller) callbackPollers.remove(callbackHandler);
               if (callbackPoller != null)
               {
                  callbackPoller.stop();
               }

               listeners.remove(callbackHandler);
            }
            else
            {
               // have a push callback handler
               List holderList = invoker.getClientLocators(sessionId, callbackHandler);
               if(holderList != null && holderList.size() > 0)
               {
                  for(int x = 0; x < holderList.size(); x++)
                  {
                     AbstractInvoker.CallbackLocatorHolder holder =
                        (AbstractInvoker.CallbackLocatorHolder)holderList.get(x);
                     listenerId = holder.getListenerId();
                     InvokerLocator locator = holder.getLocator();
                     Map metadata = new HashMap();
                     metadata.put(LISTENER_ID_KEY, listenerId);

                     // If disconnectTimeout == 0, skip network i/o.
                     if (disconnectTimeout != 0)
                     {
                        if (disconnectTimeout > 0)
                           metadata.put(ServerInvoker.TIMEOUT, Integer.toString(disconnectTimeout));

                        try
                        {
                           // now call target server to remove listener
                           InternalInvocation ii =
                              new InternalInvocation(InternalInvocation.REMOVELISTENER, null);

                           invoke(ii, metadata);
                        }
                        catch (Exception e)
                        {
                           log.warn("unable to remove remote callback handler: " + e.getMessage());
                        }
                     }

                     // call to callback server to remove listener
                     Client client = new Client(locator, subsystem);
                     client.setSessionId(getSessionId());
                     client.connect();
                     InternalInvocation ii =
                        new InternalInvocation(InternalInvocation.REMOVECLIENTLISTENER,
                              new Object[]{callbackHandler});

                     client.invoke(ii, metadata);
                     client.disconnect();
                  }
View Full Code Here

         {
            if (metadata == null)
               metadata = new HashMap();
           
            metadata.put(LISTENER_ID_KEY, listenerId);
            InternalInvocation invocation = new InternalInvocation(InternalInvocation.GETCALLBACKS, null);

            try
            {
               List response = (List) invoke(invocation, metadata);
               return response;
View Full Code Here

                                callbackHandler + "), please verify handler " +
                                "has been registered as listener.");
         }

         Object[] params = new Object[] {callbackIds, responseList};
         InternalInvocation invocation =
            new InternalInvocation(InternalInvocation.ACKNOWLEDGECALLBACK, params);
         invoke(invocation, metadata);
         return callbackIds.size();
      }
      else
      {
View Full Code Here

      String locator = streamServer.getInvokerLocator();

      // now call on target server and pass locator for stream callbacks
      InvocationRequest invocationRequest =
         new InvocationRequest(sessionId, subsystem, param, null, null, null);
      return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK,
                                           new Object[]{locator, invocationRequest}), null);
   }
View Full Code Here

      // now call on target server and pass locator for stream callbacks
      InvocationRequest invocationRequest =
         new InvocationRequest(sessionId, subsystem, param, null, null, null);

      return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK,
                                           new Object[]{locator, invocationRequest}), null);
   }
View Full Code Here

      String locator = streamServer.getInvokerLocator();

      // now call on target server and pass locator for stream callbacks
      InvocationRequest invocationRequest =
         new InvocationRequest(sessionId, subsystem, param, null, null, null);
      return invoke(new InternalInvocation(InternalInvocation.ADDSTREAMCALLBACK,
                                           new Object[]{locator, invocationRequest}), null);
   }
View Full Code Here

            if(metadata != null)
            {
               internalMetadata.putAll(metadata);
            }
            // now call server to add listener
            invoke(new InternalInvocation(InternalInvocation.ADDLISTENER, null),
                   internalMetadata, callbackLocator);
         }
      }
      else
      {
         // is going to be push callbacks which means callback server locator involved.
         // will have to delegate to client invoker.
         String listenerId = invoker.addClientLocator(sessionId, callbackhandler, callbackLocator);

         if (listenerId != null)
         {

            Map internalMetadata = new HashMap();
            internalMetadata.put(LISTENER_ID_KEY, listenerId);
            if(metadata != null)
            {
               internalMetadata.putAll(metadata);
            }

            Client client = new Client(callbackLocator, subsystem);
            client.setSessionId(getSessionId());
            client.connect();

            try
            {
               InternalInvocation i =
                  new InternalInvocation(InternalInvocation.ADDCLIENTLISTENER,
                                         new Object[]{callbackhandler, callbackHandlerObject});

               client.invoke(i, internalMetadata);
            }
            finally
            {
               client.disconnect();
            }

            // now call server to add listener
            invoke(new InternalInvocation(InternalInvocation.ADDLISTENER, null),
                   internalMetadata, callbackLocator);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.remoting.invocation.InternalInvocation

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.