Package org.jboss.remoting.callback

Examples of org.jboss.remoting.callback.Callback


                 
                  if (trace) { log.trace("Params is " + params); }
                 
                  if (params != null && params.length > 0 && params[0] instanceof Callback)
                  {
                     Callback callback = (Callback) params[0];
                    
                     if (trace) { log.trace("It's a callback: " + callback); }
                    
                     if (callback.getParameter() instanceof ClientDelivery)
                     {                       
                        packet = (ClientDelivery)callback.getParameter();
                       
                        if (trace) { log.trace("Message delivery callback"); }
                     }
                     else if (callback.getParameter() instanceof ConnectionFactoryUpdate)
                     {
                        packet = (ConnectionFactoryUpdate)callback.getParameter();
                       
                        if (trace) { log.trace("Connection factory update callback"); }
                     }
                  }
               }
View Full Code Here


         Client callbackClient = callbackHandler.getCallbackClient();

         ClientDelivery del = new ClientDelivery(message, id, deliveryId, ref.getDeliveryCount());

         Callback callback = new Callback(del);

         try
         {
            // FIXME - due a design (flaw??) in the socket based transports, they use a pool of TCP
            // connections, so subsequent invocations can end up using different underlying
View Full Code Here

      List activeConnections = serverPeer.getConnectionManager().getActiveConnections();

      ConnectionFactoryUpdate message =
         new ConnectionFactoryUpdate(delegates, failoverMap);

      Callback callback = new Callback(message);

      for (Iterator i = activeConnections.iterator(); i.hasNext();)
      {
         ServerConnectionEndpoint connEndpoint = (ServerConnectionEndpoint)i.next();
View Full Code Here

               throw new IllegalStateException(("Can't deal with methodId=" + id));
         }
        
         cs.read(is);
        
         Callback cb = new Callback(cs);
                 
         callbacks.add(cb);
      }     
   }
View Full Code Here

      Iterator iter = callbacks.iterator();
     
      while (iter.hasNext())
      {
         Callback cb = (Callback)iter.next();

         CallbackSupport cs = (CallbackSupport) cb.getParameter();
        
         cs.write(os)
      }
     
      os.flush();
View Full Code Here

         client.invoke(new OnewayCallbackTrigger("blop"));

         // make sure we get the callback

         Callback c = callbackHandler.getNextCallback(3000);

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

         client.invoke(new OnewayCallbackTrigger("blip"));

         // make sure we get the callback

         Callback c = callbackHandler.getNextCallback(3000);

         assertNotNull(c);
         assertEquals("blip", c.getParameter());

         // sleep for twice the timeout, to be sure
         long sleepTime = ServerInvoker.DEFAULT_TIMEOUT_PERIOD + 60000;
         log.info("sleeping for " + (sleepTime / 60000) + " minutes ...");

         Thread.sleep(sleepTime);

         log.debug("woke up");

         client.invoke(new OnewayCallbackTrigger("blop"));

         // make sure we get the callback

         c = callbackHandler.getNextCallback(3000);

         assertNotNull(c);
         assertEquals("blop", c.getParameter());

      }
      finally
      {
         if (client != null)
View Full Code Here

         log.info("sent invocation");

         // make sure we get the callback

         Callback c = callbackHandler.getNextCallback(3000);

         assertNotNull(c);
         assertEquals("blip", c.getParameter());

         log.info("sleeping for " + (sleepTime / 60000) + " minutes ...");

         Thread.sleep(sleepTime);

         log.debug("woke up");

         // make sure we get the second callback

         c = callbackHandler.getNextCallback(20000);

         assertNotNull(c);
         assertEquals("blip1", c.getParameter());

      }
      finally
      {
         if (client != null)
View Full Code Here

         {
            responseList = new ArrayList(responses.size());
            responseIterator = responses.iterator();
         }

         Callback callback = null;
         Object response = null;
         String listenerId = null;

         for (int i = 0; i < callbacks.size(); i++)
         {
            callback = (Callback) idsIterator.next();

            if (responseIterator != null)
            {
               response = responseIterator.next();
            }

            Map returnPayload = callback.getReturnPayload();

            if (returnPayload != null)
            {
               Object callbackId = returnPayload.get(ServerInvokerCallbackHandler.CALLBACK_ID);
               if (callbackId != null)
View Full Code Here

      // We send the message to the client on the current thread. The message is written onto the
      // transport and then the thread returns immediately without waiting for a response.

      ClientDelivery del = new ClientDelivery(ref.getMessage(), consumer.getID(), deliveryID, ref.getDeliveryCount());

      Callback callback = new Callback(del);

      try
      {
         // one way invocation, no acknowledgment sent back by the client
         if (trace) { log.trace(this + " submitting message " + ref.getMessage() + " to the remoting layer to be sent asynchronously"); }
View Full Code Here

TOP

Related Classes of org.jboss.remoting.callback.Callback

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.