@Override protected void doStart() throws Exception { super.doStart(); endpoint.onStarted(this); }
@Override public void doStop() throws Exception { super.doStop(); if(this.threadPool != null) { this.threadPool.shutdown(); this.threadPool = null; } }
@Override public NettyEndpoint getEndpoint() { return (NettyEndpoint) super.getEndpoint(); }
@Override public void doShutdown() throws Exception { super.doShutdown(); if(this.threadPool != null) { this.threadPool.shutdown(); this.threadPool = null; } }
@Override public void doShutdown() throws Exception { super.doShutdown(); if(this.threadPool != null) { this.threadPool.shutdown(); this.threadPool = null; } }
@Override public void doStop() throws Exception { super.doStop(); if(this.threadPool != null) { this.threadPool.shutdown(); this.threadPool = null; } }
@Override protected void doStart() throws Exception { super.doStart(); this.service.attachCamelProducer(endpoint.getStream(), this); }
@Override public JmsEndpoint getEndpoint() { return (JmsEndpoint) super.getEndpoint(); }
protected void doStop() throws Exception { super.doStop(); // must stop/un-init reply manager if it was in use unInitReplyManager(); }
@Override protected void doStart() throws Exception { super.doStart(); // use Camel to create the thread pool for us this.executor = getEndpoint().getCamelContext().getExecutorServiceManager().newFixedThreadPool(this, "ERP", 10); }
@Override public NettyEndpoint getEndpoint() { return (NettyEndpoint) super.getEndpoint(); }
@Override protected void doStop() throws Exception { endpoint.onStopped(this); super.doStop(); } }
@Override public void doStart() throws Exception { super.doStart(); this.exchange = this.endpoint.createAMQPExchange(); if (this.endpoint.isUsingDefaultExchange()) { LOG.info("Using default exchange of type {}", this.exchange.getClass().getSimpleName()); } else { LOG.info("Declaring exchange {} of type {}", this.exchange.getName(), this.exchange.getClass().getSimpleName()); try { this.endpoint.amqpAdministration.declareExchange(this.exchange); } catch(AmqpIOException e) { //The actual reason for failed exceptions is often swallowed up by Camel or Spring, find it Throwable rootCause = SpringAMQPComponent.findRootCause(e); LOG.error("Could not initialize exchange!", rootCause); throw e; } catch (AmqpConnectException e) { LOG.error("Producer cannot connect to broker - stopping endpoint {}", this.endpoint.toString(), e); stop(); this.endpoint.stop(); return; } } //Initialize execution pool this.threadPool = this.endpoint.getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, "amqp-producer"); }
@Override public RabbitMQEndpoint getEndpoint() { return (RabbitMQEndpoint) super.getEndpoint(); }
@Override protected void doStop() throws Exception { super.doStop(); this.service.detachCamelProducer(endpoint.getStream()); }
@Override public void doStart() throws Exception { super.doStart(); this.exchange = this.endpoint.createAMQPExchange(); if (this.endpoint.isUsingDefaultExchange()) { LOG.info("Using default exchange of type {}", this.exchange.getClass().getSimpleName()); } else { LOG.info("Declaring exchange {} of type {}", this.exchange.getName(), this.exchange.getClass().getSimpleName()); try { this.endpoint.amqpAdministration.declareExchange(this.exchange); } catch(AmqpIOException e) { //The actual reason for failed exceptions is often swallowed up by Camel or Spring, find it Throwable rootCause = SpringAMQPComponent.findRootCause(e); LOG.error("Could not initialize exchange!", rootCause); throw e; } catch (AmqpConnectException e) { LOG.error("Producer cannot connect to broker - stopping endpoint {}", this.endpoint.toString(), e); stop(); this.endpoint.stop(); return; } } //Initialize execution pool this.threadPool = this.endpoint.getCamelContext().getExecutorServiceManager().newDefaultThreadPool(this, "amqp-producer"); }
@Override protected void doStop() throws Exception { super.doStop(); // shutdown thread pool when we stop getEndpoint().getCamelContext().getExecutorServiceManager().shutdown(executor); }
protected void doStart() throws Exception { super.doStart(); if (uuidGenerator == null) { // use the generator configured on the camel context uuidGenerator = getEndpoint().getCamelContext().getUuidGenerator(); } if (endpoint.isTestConnectionOnStartup()) { testConnectionOnStartup(); } }
@Override protected void doStop() throws Exception { LOG.debug("Stopping producer at address: {}", configuration.getAddress()); // close all channels LOG.trace("Closing {} channels", allChannels.size()); ChannelGroupFuture future = allChannels.close(); future.awaitUninterruptibly(); // and then shutdown the thread pools if (workerGroup != null) { workerGroup.shutdownGracefully(); workerGroup = null; } if (pool != null) { if (LOG.isDebugEnabled()) { LOG.debug("Stopping producer with channel pool[active={}, idle={}]", pool.getNumActive(), pool.getNumIdle()); } pool.close(); pool = null; } ServiceHelper.stopService(correlationManager); super.doStop(); }
@Override protected void doStart() throws Exception { super.doStart(); // as in Undertow tests pool = new DefaultByteBufferPool(true, 17 * 1024); final Xnio xnio = Xnio.getInstance(); worker = xnio.createWorker(options); final SSLContext sslContext = getEndpoint().getSslContext(); if (sslContext != null) { ssl = new UndertowXnioSsl(xnio, options, sslContext); } client = UndertowClient.getInstance(); if (endpoint.isWebSocket()) { this.webSocketHandler = (CamelWebSocketHandler) endpoint.getComponent().registerEndpoint(endpoint.getHttpHandlerRegistrationInfo(), endpoint.getSslContext(), new CamelWebSocketHandler()); } LOG.debug("Created worker: {} with options: {}", worker, options); }