/** * Stops each service. * * @throws Exception */ public void stop() throws Exception { for (Service service : this) { service.stop(); } }
/** * Starts each service. * * @throws Exception */ public void start() throws Exception { for (Service service : this) { service.start(); } }
/** Starts the Restlet. */ public synchronized void start() throws Exception { if (isEnabled()) { this.started = true; } }
if (service.isEnabled()) { .createInboundFilter((getContext() == null) ? null : getContext().createChildContext()); .createOutboundFilter((getContext() == null) ? null : getContext().createChildContext());
if (service.isEnabled()) { .createInboundFilter((getContext() == null) ? null : getContext().createChildContext()); .createOutboundFilter((getContext() == null) ? null : getContext().createChildContext());
/** Stops the service and its timer */ @Override public synchronized void stop() throws Exception { super.stop(); if (agentRefreshTimer != null) { agentRefreshTimer.cancel(); } } }
@Override public synchronized void start() throws Exception { if (getWrapped().isShutdown()) { setWrapped(wrap(createExecutorService())); } super.start(); }
/** Stops the Restlet. */ public synchronized void stop() throws Exception { if (isEnabled()) { this.started = false; } }
/** Stops the service and its timer */ @Override public synchronized void stop() throws Exception { super.stop(); if (agentRefreshTimer != null) { agentRefreshTimer.cancel(); } } }
@Override public synchronized void start() throws Exception { if ((getWrapped() == null) || getWrapped().isShutdown()) { setWrapped(wrap(createExecutorService(getCorePoolSize()))); } super.start(); }
/** Starts the Restlet. */ public synchronized void start() throws Exception { if (isEnabled()) { this.started = true; } }
/** Stops the service and its timer */ @Override public synchronized void stop() throws Exception { super.stop(); if (agentRefreshTimer != null) { agentRefreshTimer.cancel(); } } }
@Override public synchronized void start() throws Exception { if (isEnabled() && thread == null) { super.start(); this.thread = new Thread(() -> { // loop that polls new messages with maximum long poll time while (isStarted()) { try { ReceiveMessageRequest request = new ReceiveMessageRequest(queueUrl) .withWaitTimeSeconds(LONG_POLL_SECONDS); ReceiveMessageResult result = sqsClient.getSqs().receiveMessage(request); // apply the message handle chain and finally delete message if // everything else succeeds Stream<CompletableFuture<Message>> messages = result.getMessages().stream() .map(this::handleMessage) .map(this::completeMessage) .map(this::deleteMessage); sequence(messages).join(); // artificial slow down to allow scaling to happen Threads.sleep(10000); } catch (RuntimeException ex) { LOGGER.warn("SQS receive or message handling failed", ex); Threads.sleep(WAIT_AFTER_FAILURE_MILLIS); } } }); this.thread.start(); } }
/** Stops the Restlet. */ public synchronized void stop() throws Exception { if (isEnabled()) { this.started = false; } }
/** Stops the service and its timer */ @Override public synchronized void stop() throws Exception { super.stop(); if (agentRefreshTimer != null) { agentRefreshTimer.cancel(); } } }
/** * Starts the log service by attempting to read the log properties if the * {@link #getLogPropertiesRef()} returns a non null URI reference. */ @Override public synchronized void start() throws Exception { super.start(); this.responseLogTemplate = (getResponseLogFormat() == null) ? null : new Template(getResponseLogFormat()); if (getLogPropertiesRef() != null) { Representation logProperties = new ClientResource(getContext(), getLogPropertiesRef()).get(); if (logProperties != null) { java.util.logging.LogManager.getLogManager().readConfiguration( logProperties.getStream()); } } } }
/** Stops the service and its timer */ @Override public synchronized void stop() throws Exception { super.stop(); if (agentRefreshTimer != null) { agentRefreshTimer.cancel(); } } }
@Override public synchronized void stop() throws Exception { super.stop(); if (thread != null) { thread.join(); thread = null; } }
@Override public synchronized void stop() throws Exception { super.stop(); if (!getWrapped().isShutdown()) { getWrapped().shutdown(); } }
@Override public synchronized void stop() throws Exception { super.stop(); if ((getWrapped() != null) && !getWrapped().isShutdown()) { getWrapped().shutdown(); } }