Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.remoting.samples.chat.server;

Title: Chat4

Description:

Copyright: Copyright (c) 2003

Company:

Author(s):
not attributable
Version:
1.0
import  org.jboss.logging.Logger;
public class CallbackThread extends Thread
   protected static final Logger log = Logger.getLogger(CallbackThread.class);
   
   private ShutDownGate shutDownGate;
   private boolean memberLeaving;
   private int backChatSize;
   
   public CallbackThread(InvokerCallbackHandler callbackHandlerShutDownGate shutDownGate,
         ReadWriteArrayList messages)
   {
      this. = callbackHandler;
      this. = false;
      this. = shutDownGate;
      this. = messages;
       = messages.size();
      ArrayList backChat = new ArrayList();
      backChat = messages.copy();
      RemoteInvocation invocation = new RemoteInvocation("sendMultiple"new Object[] {backChat});
      Callback callback = new Callback(invocation);
      try
      {
         callbackHandler.handleCallback(callback);
      }
      catch (HandleCallbackException e)
      {
         .error(e);
      }
   }
   public void setMemberLeaving()
   {
       = true;
   }
   
   public void run()
   {
      int i = ;
      
      while (!.isShuttingDown() && !)
      {
         RemoteInvocation invocation = new RemoteInvocation("send"new Object[] {.get(i)});
         Callback callback = new Callback(invocation);
         
         try
         {
            .handleCallback(callback);
         }
         catch (HandleCallbackException e)
         {
            .error(e);
         }
         
         i++;
      }
   }
New to GrepCode? Check out our FAQ X