/** * Shut down the Mirror. This will close any open connections, * stop the regular mirror updates, and discard all entries. */ public void shutdown() { updateTask.kill(); orb.transport().perform(new Runnable() { public void run() { handleShutdown(); } }); }
/** * Shut down the Register. This will close any open connections * and stop the regular re-registration. */ public void shutdown() { updateTask.kill(); orb.transport().perform(new Runnable() { public void run() { handleShutdown(); } }); }
@Override public void destroy() { if (destroyed.getAndSet(true)) throw new RuntimeException("Already destroyed"); mirror.shutdown(); orb.transport().shutdown().join(); }
TargetPoolTask(RPCTargetPool pool, Supervisor orb) { this.pool = pool; this.jrtTask = orb.transport().createTask(this); this.jrtTask.schedule(1.0); }
@Override public void sync() { SyncTask sh = new SyncTask(); orb.transport().perform(sh); sh.await(); }
public FetchMirror(Request req, int timeout) { req.detach(); this.req = req; task = orb.transport().createTask(this); task.schedule(((double)timeout)/1000.0); } public void run() { // timeout
/** * Create a new MirrorAPI using the given Supervisor and slobrok * connect specs. * * @param orb the Supervisor to use * @param slobroks slobrok connect spec list * @param bop custom backoff policy, mostly useful for testing **/ public Mirror(Supervisor orb, SlobrokList slobroks, BackOffPolicy bop) { this.orb = orb; this.slobroks = slobroks; this.backOff = bop; updateTask = orb.transport().createTask(new Runnable() { public void run() { checkForUpdate(); } }); reqWait = new RequestWaiter() { public void handleRequestDone(Request req) { requestDone = true; updateTask.scheduleNow(); } }; updateTask.scheduleNow(); }
public void shutdown() { configSubscriber.close(); supervisor.transport().shutdown().join(); }
public void stop() { orb.transport().shutdown().join(); listener.shutdown().join(); }
private void unregisterInSlobrok() { if (slobrokRegistrator != null) slobrokRegistrator.shutdown(); if (acceptor != null) acceptor.shutdown().join(); if (supervisor != null) supervisor.transport().shutdown().join(); }
/** * Sets the destroyed flag to true. The very first time this method is called, it cleans up all its dependencies. * Even if you retain a reference to this object, all of its content is allowed to be garbage collected. * * @return True if content existed and was destroyed. */ public boolean destroy() { if (!destroyed.getAndSet(true)) { if (slobroksConfig != null) { slobroksConfig.shutdown(); } register.shutdown(); mirror.shutdown(); listener.shutdown().join(); orb.transport().shutdown().join(); targetPool.flushTargets(true); executor.shutdown(); return true; } return false; }
public Slobrok(int port) throws ListenFailedException { orb = new Supervisor(new Transport()); registerMethods(); try { listener = orb.listen(new Spec(port)); } catch (ListenFailedException e) { orb.transport().shutdown().join(); throw e; } }
target.close(); if (supervisor!=null) supervisor.transport().shutdown().join();
this.backOff = bop; mySpec = spec.toString(); updateTask = orb.transport().createTask(new Runnable() { public void run() { handleUpdate(); } });
listener = orb.listen(new Spec(params.getListenPort())); } catch (ListenFailedException e) { orb.transport().shutdown().join(); throw new RuntimeException(e);