protected void start() { running=true; thread=server.factory.newThread(this, String.format("NioConnection.Reader [%s]", peer_addr)); thread.setDaemon(true); thread.start(); }
public synchronized void start() { if(running) return; if(thread == null || !thread.isAlive()) { String name=thread_name != null? thread_name : "runner"; thread=factory != null? factory.newThread(this, name) : new Thread(this, name); running=true; thread.start(); } }
public synchronized void start() { if(thread == null || !thread.isAlive()) { thread=factory.newThread(new Reaper(), "Reaper"); thread.start(); } }
public synchronized void start() { if(thread == null || !thread.isAlive()) { thread=getThreadFactory().newThread(this, name); thread.start(); } }
protected void start() { if(acceptor == null) { acceptor=getThreadFactory().newThread(this, "FD_SOCK acceptor"); acceptor.setDaemon(true); acceptor.start(); } }
protected synchronized void startRunner() { stopRunner(); runner=timer_thread_factory != null? timer_thread_factory.newThread(this, "Timer runner") : new Thread(this, "Timer runner"); runner.start(); }
protected boolean runInNewThread(Runnable task) { try { Thread thread=thread_factory != null? thread_factory.newThread(task, "jgroups-temp-thread") : new Thread(task, "jgroups-temp-thread"); thread.start(); return true; } catch(Throwable t) { log.error("failed spawning new thread", t); return false; } }
protected synchronized void startTimer() { timer=getThreadFactory().newThread(this,"VERIFY_SUSPECT.TimerThread"); timer.setDaemon(true); timer.start(); }
public Thread newThread(final Runnable command) { return getThreadFactory().newThread(command, "StreamingStateTransfer-sender-" + thread_id.getAndIncrement()); } };
public Receiver(ThreadFactory f) { recv=f.newThread(this,"Connection.Receiver [" + getSockAddress() + "]"); }
protected void startReceiver() { if(receiver == null || !receiver.isAlive()) { ThreadFactory factory=getThreadFactory(); receiver=factory != null? factory.newThread(this, "MPING") : new Thread(this, "MPING)"); receiver.setDaemon(true); receiver.start(); log.debug("receiver thread started"); } }
@Override public Thread newThread(final Runnable r, String name) { Runnable task = () -> { try { r.run(); } finally { // Defensively reset the TCCL this.setContextClassLoader(Thread.currentThread()); } }; return this.setContextClassLoader(this.factory.newThread(task, name)); }
/** * Does *not* need to be synchronized on pinger_mutex because the caller (down()) already has the mutex acquired */ protected synchronized boolean startPingerThread() { if(!isPingerThreadRunning()) { ThreadFactory factory=getThreadFactory(); pinger_thread=factory.newThread(this, "FD_SOCK pinger"); pinger_thread.setDaemon(true); pinger_thread.start(); return true; } return false; }
public synchronized void start() { if(running) stop(); bundler_thread=transport.getThreadFactory().newThread(this, THREAD_NAME); running=true; bundler_thread.start(); }
protected void submitToPool(Task task) { if(non_blocking_task_handling && !task.canBlock()) { task.run(); return; } try { pool.execute(task); } catch(RejectedExecutionException rejected) { // only thrown if rejection policy is "abort" Thread thread=timer_thread_factory != null? timer_thread_factory.newThread(task, "Timer temp thread") : new Thread(task, "Timer temp thread"); thread.start(); } }
/** * @param views Guaranteed to be non-null and to have >= 2 members, or else this thread would not be started */ public synchronized void start(Map<Address, View> views) { if(thread != null && thread.isAlive()) // the merge thread is already running return; this.coords.clear(); this.subviews.clear(); subviews.addAll(views.values()); // now remove all members which don't have us in their view, so RPCs won't block (e.g. FLUSH) // https://jira.jboss.org/browse/JGRP-1061 sanitizeViews(views); Map<Address,Collection<Address>> tmp_coords=determineMergeCoords(views); this.coords.putAll(tmp_coords); thread=gms.getThreadFactory().newThread(this, "MergeTask"); thread.setDaemon(true); thread.start(); }
public void start() throws IOException { // https://jira.jboss.org/jira/browse/JGRP-777 - this doesn't work on MacOS, and we don't have // cross talking on Windows anyway, so we just do it for Linux. (How about Solaris ?) // if(can_bind_to_mcast_addr) // diag_sock=Util.createMulticastSocket(getSocketFactory(), // Global.TP_DIAG_MCAST_SOCK, diagnostics_addr, diagnostics_port, log); //else diag_sock=socket_factory.createMulticastSocket("jgroups.tp.diag.mcast_sock", diagnostics_port); diag_sock.setTimeToLive(ttl); List<NetworkInterface> interfaces=bind_interfaces != null? bind_interfaces : Util.getAllAvailableInterfaces(); bindToInterfaces(interfaces, diag_sock); if(thread == null || !thread.isAlive()) { thread=thread_factory.newThread(this, THREAD_NAME); thread.setDaemon(true); thread.start(); } }
protected StateProviderAcceptor createAcceptor() { StateProviderAcceptor retval=new StateProviderAcceptor(thread_pool, Util.createServerSocket(getSocketFactory(), "jgroups.streaming_state_transfer.srv_sock", bind_addr, bind_port)); Thread t=getThreadFactory().newThread(retval, "STATE server socket acceptor"); t.start(); return retval; }
public void start() throws Exception { super.start(); srv_sock=Util.createServerSocket(getSocketFactory(), "jgroups.stomp.srv_sock", bind_addr, port, port+50); if(log.isDebugEnabled()) log.debug("server socket listening on " + srv_sock.getLocalSocketAddress()); if(acceptor == null) { acceptor=getThreadFactory().newThread(this, "STOMP acceptor"); acceptor.setDaemon(true); acceptor.start(); } endpoint=endpoint_addr != null? endpoint_addr : getAddress(); }
@Override public void start() throws Exception { if(running.compareAndSet(false, true)) { super.start(); selector=Selector.open(); conn=createConnection(remote_addr); conn.connect(remote_addr, false); local_addr=conn.localAddress(); if(use_peer_connections) conn.sendLocalAddress(local_addr); conn.start(); acceptor=factory.newThread(new Acceptor(), "NioClient.Acceptor [srv=" + remote_addr + "]"); acceptor.setDaemon(true); acceptor.start(); } }