@Override public void leave() { final ServiceQueue serviceQueue = serviceContext().currentService(); leaveEventBus(serviceQueue); }
@Override public void stop() { started.set(false); try { if (requestQueue != null) requestQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop request queue", ex); } try { if (responseQueue != null) responseQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop response queues", ex); } if (systemManager != null) { this.systemManager.serviceShutDown(); this.systemManager.unregisterService(this); } if (!(service instanceof EventManager)) { if (joinEventManager) { serviceContext().eventManager().leaveEventBus(this); } } eventManager.ifPresent(em -> em.leaveEventBus(BaseServiceQueueImpl.this)); }
public void sendHi(String hi) { serviceContext().send("rick", "hello rick " + hi); } }
public <T> void send(String channel, T message) { eventManager().send(channel, message); } }
public <T> void send(String channel, T message) { eventManager().send(channel, message); } }
private void loadIfEmpty() { serviceContext.ifEmpty(() -> { serviceContext = ofNullable(ServiceContext.serviceContext()); serviceContext.ifPresent(serviceContext1 -> serviceQueue = ofNullable(serviceContext1.currentService())); }); }
serviceContext().eventManager().joinService(this);
public <T> void send(String channel, T message) { eventManager().send(channel, message); } }
@Override public void leave() { final ServiceQueue serviceQueue = serviceContext().currentService(); leaveEventBus(serviceQueue); }
@Override public void stop() { started.set(false); try { if (requestQueue != null) requestQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop request queue", ex); } try { if (responseQueue != null) responseQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop response queues", ex); } if (systemManager != null) { this.systemManager.serviceShutDown(); this.systemManager.unregisterService(this); } if (!(service instanceof EventManager)) { if (joinEventManager) { serviceContext().eventManager().leaveEventBus(this); } } eventManager.ifPresent(em -> em.leaveEventBus(BaseServiceQueueImpl.this)); }
@Override public void leave() { final ServiceQueue serviceQueue = serviceContext().currentService(); leaveEventBus(serviceQueue); }
@Override public void stop() { started.set(false); try { if (requestQueue != null) requestQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop request queue", ex); } try { if (responseQueue != null) responseQueue.stop(); } catch (Exception ex) { if (debug) logger.debug("Unable to stop response queues", ex); } if (systemManager != null) { this.systemManager.serviceShutDown(); this.systemManager.unregisterService(this); } if (!(service instanceof EventManager)) { if (joinEventManager) { serviceContext().eventManager().leaveEventBus(this); } } eventManager.ifPresent(em -> em.leaveEventBus(BaseServiceQueueImpl.this)); }
private void loadIfEmpty() { serviceContext.ifEmpty(() -> { serviceContext = ofNullable(ServiceContext.serviceContext()); serviceContext.ifPresent(serviceContext1 -> serviceQueue = ofNullable(serviceContext1.currentService())); }); }
serviceContext().eventManager().joinService(this);
private void check() { now = timer.now(); long duration = now - lastCheckTime; if (duration > checkInIntervalMS) { lastCheckTime = now; final ServiceQueue serviceQueue = ServiceContext.serviceContext().currentService(); boolean failing = serviceQueue.failing(); if (!failing) { healthServiceAsync.checkInOk(serviceName); } else { healthServiceAsync.checkIn(serviceName, HealthStatus.FAIL); } healthServiceAsync.clientProxyFlush(); } }
serviceContext().eventManager().joinService(this);