Package org.jboss.remoting.callback

Examples of org.jboss.remoting.callback.Callback


               Iterator it = callbackHandlers.iterator();
               while (it.hasNext())
               {
                  InvokerCallbackHandler callbackHandler = (InvokerCallbackHandler) it.next();
                  log.info("sending callback: " + ++counter);
                  callbackHandler.handleCallback(new Callback("callback"));
               }
               log.info("sent callback");
            }
            catch (HandleCallbackException e)
            {
View Full Code Here


      public void addListener(InvokerCallbackHandler callbackHandler)
      {
         System.out.println("Adding callback listener.");
         try
         {
            callbackHandler.handleCallback(new Callback("callback"));
         }
         catch (HandleCallbackException e)
         {
            log.error("Unable to send callback");
         }
View Full Code Here

      public void addListener(InvokerCallbackHandler callbackHandler)
      {
         try
         {
            System.out.println("sending callback");
            callbackHandler.handleCallback(new Callback("callback"));
            System.out.println("sent callback");
         }
         catch (HandleCallbackException e)
         {
            System.out.println("error handling callback");
View Full Code Here

      public Object invoke(InvocationRequest invocation) throws Throwable
      {
         try
         {
            callbackHandler.handleCallback(new Callback("callback"));
         }
         catch (HandleCallbackException e)
         {
            log.error("Unable to send callback");
         }
View Full Code Here

      // Public ---------------------------------------------------

      public void sendCallback(Object arg) throws Exception
      {
         Callback callback = new Callback(arg);
         theOnlyHandler.handleCallback(callback);
      }
View Full Code Here

                  while(itr.hasNext())
                  {
                     InvokerCallbackHandler callbackHandler = (InvokerCallbackHandler) itr.next();
                     try
                     {
                        callbackHandler.handleCallback(new Callback(getCallbackMessage()));
                        if(isMemLow())
                        {
                           Thread.currentThread().sleep(1000);
                        }
                     }
                     catch(HandleCallbackException e)
                     {
                        e.printStackTrace();
                     }
                  }
               }
            }
            // done adding callbacks, now release memory
            memHolder = null;
         }

         isDone = true;

         synchronized(pushListeners)
         {
            Iterator itr = pushListeners.iterator();
            while(itr.hasNext())
            {
               InvokerCallbackHandler handler = (InvokerCallbackHandler) itr.next();
               try
               {
                  handler.handleCallback(new Callback("Done"));
               }
               catch(HandleCallbackException e)
               {
                  e.printStackTrace();
               }
View Full Code Here

//   }

   public void finishedProcessing(Object obj)
   {
      System.out.println("finishedProcessing called with " + obj);
      Callback callback = (Callback)obj;
      try
      {
         handleCallback(callback);
      }
      catch(HandleCallbackException e)
View Full Code Here

                  while(itr.hasNext())
                  {
                     InvokerCallbackHandler callbackHandler = (InvokerCallbackHandler) itr.next();
                     try
                     {
                        callbackHandler.handleCallback(new Callback(getCallbackMessage()));
                        if(isMemLow())
                        {
                           Thread.currentThread().sleep(1000);
                        }
                     }
                     catch(HandleCallbackException e)
                     {
                        e.printStackTrace();
                     }
                  }
               }
            }
            // done adding callbacks, now release memory
            memHolder = null;
         }

         isDone = true;

         synchronized(pushListeners)
         {
            Iterator itr = pushListeners.iterator();
            while(itr.hasNext())
            {
               InvokerCallbackHandler handler = (InvokerCallbackHandler) itr.next();
               try
               {
                  handler.handleCallback(new Callback("Done"));
               }
               catch(HandleCallbackException e)
               {
                  e.printStackTrace();
               }
            }
         }

         Thread.sleep(5000);

         System.gc();

         Thread.sleep(5000);

         for(int x = 0; x < 10; x++)
         {
         synchronized(pullListeners)
         {
            Iterator itr = pullListeners.iterator();
            while(itr.hasNext())
            {
               InvokerCallbackHandler handler = (InvokerCallbackHandler) itr.next();
               try
               {
                  handler.handleCallback(new Callback("Done"));
               }
               catch(HandleCallbackException e)
               {
                  e.printStackTrace();
               }
View Full Code Here

         System.out.println("command: " + command);

         for (Iterator it = callbackHandlers.iterator(); it.hasNext(); )
         {
            InvokerCallbackHandler callbackHandler = (InvokerCallbackHandler) it.next();
            Callback cb1 = new Callback(command + "1");
            HashMap returnPayload1 = new HashMap();
            returnPayload1.put(ServerInvokerCallbackHandler.CALLBACK_ID, command + "1");
            returnPayload1.put(ServerInvokerCallbackHandler.CALLBACK_LISTENER, this);
            cb1.setReturnPayload(returnPayload1);
            if (REMOTING_ACKNOWLEDGEMENT_TEST.equals(command))
            {
               returnPayload1.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, "true");
            }
            else
            {
               returnPayload1.put(APPLICATION_ACKNOWLEDGEMENT_TEST, "true");
            }
            callbackHandler.handleCallback(cb1);

            Callback cb2 = new Callback(command + "2");
            HashMap returnPayload2 = new HashMap();
            returnPayload2.put(ServerInvokerCallbackHandler.CALLBACK_ID, command + "2");
            returnPayload2.put(ServerInvokerCallbackHandler.CALLBACK_LISTENER, this);
            cb2.setReturnPayload(returnPayload2);
            if (REMOTING_ACKNOWLEDGEMENT_TEST.equals(command))
            {
               returnPayload2.put(ServerInvokerCallbackHandler.REMOTING_ACKNOWLEDGES_PUSH_CALLBACKS, "true");
            }
            else
View Full Code Here

      public void addListener(InvokerCallbackHandler callbackHandler)
      {
         try
         {
            callbackHandler.handleCallback(new Callback("callback"));
         }
         catch (HandleCallbackException e)
         {
            log.error("error handling 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.