public SocketThread(Socket sock, DataInputStream ois, String group_name, Address logical_addr) { super(Util.getGlobalThreadGroup(), "SocketThread " + (threadCounter++)); this.sock=sock; input=ois; this.group_name=group_name; this.logical_addr=logical_addr; }
public WriterThread(OutputStream out, byte[] buf) { super(Util.getGlobalThreadGroup(), "TimedWriter.WriterThread"); this.out=new DataOutputStream(out); this.buf=buf; }
public WriterThread(OutputStream out, int i) { super(Util.getGlobalThreadGroup(), "TimedWriter.WriterThread"); this.out=new DataOutputStream(out); this.i=i; }
public void start() { if(thread == null) { thread=new Thread(Util.getGlobalThreadGroup(), this, UCAST_RECEIVER_THREAD_NAME); // thread.setDaemon(true); running=true; thread.start(); } }
public Thread newThread(final Runnable command) { Thread thread = new Thread(Util.getGlobalThreadGroup(), command, "STREAMING_STATE_TRANSFER state provider-" + threadCounter.incrementAndGet()); return thread; } };
final void start() { if(acceptor == null) { acceptor=new Thread(Util.getGlobalThreadGroup(), this, "ServerSocket acceptor thread"); acceptor.setDaemon(true); acceptor.start(); } }
private void passStreamUp(final StateTransferInfo sti) { Runnable readingThread = new Runnable() { public void run() { up_prot.up(new Event(Event.STATE_TRANSFER_INPUTSTREAM, sti)); } }; if(use_reading_thread){ new Thread(Util.getGlobalThreadGroup(), readingThread, "STREAMING_STATE_TRANSFER.reader").start(); }else{ readingThread.run(); } }
public void start() { if(t == null || !t.isAlive()) { t=new Thread(Util.getGlobalThreadGroup(), this, THREAD_NAME); t.setDaemon(true); t.start(); } }
public void start() { if(thread == null || !thread.isAlive()) { thread=new Thread(Util.getGlobalThreadGroup(), this, "MERGE2.FindSubgroups thread"); thread.setDaemon(true); thread.start(); } }
void start() { if(t == null || !t.isAlive()) { t=new Thread(Util.getGlobalThreadGroup(), this, THREAD_NAME); t.setDaemon(true); t.start(); } }
private void startReceiver() { if(receiver == null || !receiver.isAlive()) { receiver=new Thread(Util.getGlobalThreadGroup(), this, "ReceiverThread"); receiver.setDaemon(true); receiver.start(); if(log.isTraceEnabled()) log.trace("receiver thread started"); } }
public void start() { thread_lock.lock(); try { if(thread == null || !thread.isAlive()) { thread=new Thread(Util.getGlobalThreadGroup(), this, "PingWaiter"); thread.setDaemon(true); thread.start(); } } finally { thread_lock.unlock(); } }
public void start() { lock.lock(); try { if(thread == null || !thread.isAlive()) { thread=new Thread(Util.getGlobalThreadGroup(), this, "PingSender"); thread.setDaemon(true); thread.start(); } } finally { lock.unlock(); } }
CloserThread(Event evt) { super(Util.getGlobalThreadGroup(), "CloserThread"); this.evt=evt; setDaemon(true); }
/** * Does *not* need to be synchronized on pinger_mutex because the caller (down()) already has the mutex acquired */ void startPingerThread() { running=true; if(pinger_thread == null) { pinger_thread=new Thread(Util.getGlobalThreadGroup(), this, "FD_SOCK Ping thread"); pinger_thread.setDaemon(true); pinger_thread.start(); if(group_name != null) { String tmp, prefix=Global.THREAD_PREFIX; tmp=pinger_thread.getName(); if(tmp != null && !tmp.contains(prefix)) { tmp+=prefix + group_name + ")"; pinger_thread.setName(tmp); } } } }
void start() throws IOException { diag_sock=new MulticastSocket(diagnostics_port); java.util.List interfaces=Util.getAllAvailableInterfaces(); bindToInterfaces(interfaces, diag_sock); if(thread == null || !thread.isAlive()) { thread=new Thread(Util.getGlobalThreadGroup(), this, THREAD_NAME); thread.setDaemon(true); thread.start(); } }
public void connectionStatusChange(int newState) { if(currentState == RouterStub.STATUS_CONNECTED && newState == RouterStub.STATUS_CONNECTION_LOST){ startReconnecting(); } else if(currentState != RouterStub.STATUS_CONNECTED && newState == RouterStub.STATUS_CONNECTED){ stopReconnecting(); Thread receiver = new Thread(Util.getGlobalThreadGroup(), new TunnelReceiver(), "TUNNEL receiver"); receiver.setDaemon(true); receiver.start(); } currentState = newState; } }
synchronized void start(boolean unsuspend) { if(q.closed()) q.reset(); if(unsuspend) { suspended=false; Future future; synchronized(resume_tasks) { future=resume_tasks.remove(merge_id); } if(future != null) future.cancel(true); } merge_id=null; if(thread == null || !thread.isAlive()) { thread=new Thread(Util.getGlobalThreadGroup(), this, "ViewHandler"); thread.setDaemon(false); // thread cannot terminate if we have tasks left, e.g. when we as coord leave thread.start(); if(log.isTraceEnabled()) log.trace("ViewHandler started"); } }
protected static ThreadPoolExecutor createThreadPool() { int min_threads=1, max_threads=4; long keep_alive=30000; ThreadFactory factory=new ThreadFactory() { AtomicInteger num = new AtomicInteger(1); ThreadGroup mux_threads=new ThreadGroup(Util.getGlobalThreadGroup(), "MultiplexerThreads"); public Thread newThread(Runnable command) { Thread ret=new Thread(mux_threads, command, "Multiplexer-" + num.incrementAndGet()); ret.setDaemon(true); return ret; } }; min_threads=Global.getPropertyAsInteger(Global.MUX_MIN_THREADS, min_threads); max_threads=Global.getPropertyAsInteger(Global.MUX_MAX_THREADS, max_threads); keep_alive=Global.getPropertyAsLong(Global.MUX_KEEPALIVE, keep_alive); return new ThreadPoolExecutor(min_threads, max_threads, keep_alive, TimeUnit.MILLISECONDS, new SynchronousQueue<Runnable>(), factory, new ThreadPoolExecutor.CallerRunsPolicy()); }
public final void start() throws Exception { super.start(); //Roland Kurmann 4/7/2003, build new thread group thread_group = new ThreadGroup(Util.getGlobalThreadGroup(), "ConnectionTableThreads"); init(); srv_sock=createServerSocket(srv_port, max_port); if (external_addr!=null) local_addr=new IpAddress(external_addr, srv_sock.getLocalPort()); else if (bind_addr != null) local_addr=new IpAddress(bind_addr, srv_sock.getLocalPort()); else local_addr=new IpAddress(srv_sock.getLocalPort()); if(log.isDebugEnabled()) log.debug("server socket created on " + local_addr); //Roland Kurmann 4/7/2003, put in thread_group acceptor=new Thread(thread_group, this, "ConnectionTable.AcceptorThread"); acceptor.setDaemon(true); acceptor.start(); m_backGroundThreads.add(acceptor); // start the connection reaper - will periodically remove unused connections if(use_reaper && reaper == null) { reaper=new Reaper(); reaper.start(); } }