Package org.jboss.remoting.callback

Examples of org.jboss.remoting.callback.Callback


         Object parameter = invocation.getParameter();
         if (SEND_CALLBACK.equals(parameter))
         {
            try
            {
               callbackHandler.handleCallback(new Callback("callback"));
            }
            catch (HandleCallbackException e)
            {
               log.error("unable to send callback", e);
            }
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

         if(callbackContainer != null && callbackContainer.getCallbackHandler() != null)
         {
            Object[] params = param.getParameters();
           
            Callback callbackRequest = (Callback) params[0];
                                   
            Object obj = callbackContainer.getCallbackHandleObject();
           
            if (obj != null)
            {
               Map callbackHandleObject = callbackRequest.getReturnPayload();
              
               if(callbackHandleObject == null)
               {
                  callbackHandleObject = new HashMap();
               }
                             
               //We only want to add it if it is not null otherwise is a redundant operation
               callbackHandleObject.put(Callback.CALLBACK_HANDLE_OBJECT_KEY,
                                        obj);
              
               callbackRequest.setReturnPayload(callbackHandleObject);
            }
           
            InvokerCallbackHandler callbackHandler = callbackContainer.getCallbackHandler();
           
            callbackHandler.handleCallback(callbackRequest);
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

                 
                  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

               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

   public Object getPayload()
   {
      // Basically remoting forces us to create this ridiculous pile of objects
      // just to do a callback
     
      Callback callback = new Callback(this);

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

      OnewayInvocation oi = new OnewayInvocation(ii);
View Full Code Here

      log.debug("updateClusteredClients being called!!! clientFactoriesToUpdate.size = " + handlers.size());

      ConnectionFactoryUpdate message =
         new ConnectionFactoryUpdate(uniqueName, delegates, failoverMap);

      Callback callback = new Callback(message);

      for (InvokerCallbackHandler o: handlers)
      {
         log.debug("Updating CF on callback " + o);
         ((ServerInvokerCallbackHandler)o).handleCallbackOneway(callback);
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.