public void afterPropertiesSet() throws Exception { // lets bind the URI to a pojo notNull(uri, "uri"); // Always resolve the camel context by using the camelContextID if (ObjectHelper.isNotEmpty(camelContextId)) { camelContext = CamelContextResolverHelper.getCamelContextWithId(applicationContext, camelContextId); } notNull(camelContext, "camelContext"); if (serviceRef != null && getService() == null && applicationContext != null) { setService(applicationContext.getBean(serviceRef)); } Endpoint endpoint = CamelContextHelper.getMandatoryEndpoint(camelContext, uri); notNull(getService(), "service"); Object proxy = getProxyForService(); try { // need to start endpoint before we create consumer ServiceHelper.startService(endpoint); consumer = endpoint.createConsumer(new BeanProcessor(proxy, camelContext)); // add and start consumer camelContext.addService(consumer, true, true); } catch (Exception e) { throw new FailedToCreateConsumerException(endpoint, e); } }
ServiceHelper.startService(endpoint); producer = endpoint.createProducer();
@Override protected void doStart() throws Exception { super.doStart(); ServiceHelper.startService(endpoint); }
@Override protected void doStart() throws Exception { LOG.info("Starting notifier " + notifier); ServiceHelper.startService(notifier); managementStrategy.addEventNotifier(notifier); }
@Override protected void doStart() throws Exception { super.doStart(); ServiceHelper.startService(endpoint); }
private void updateMapping(String url) { LOG.info("Updating Dozer Mapping file " + url); WatcherDozerTypeConverterLoader loader = loaders.get(url); if (url != null) { try { // update by restarting loader ServiceHelper.stopAndShutdownService(loader); camelContext.removeService(loader); ServiceHelper.startService(loader); } catch (Exception e) { LOG.warn("Error updating dozer mapping due to: " + e, e); } } }
protected synchronized NotifierRegistration addNotifier(String id, CamelContextService camelContextService, AuditEventNotifier notifier, ManagementStrategy managementStrategy) throws Exception { removeNotifier(id); NotifierRegistration registration = new NotifierRegistration(id, camelContextService, notifier, managementStrategy); ServiceHelper.startService(registration); notifierMap.put(id, registration); return registration; }
@Override protected void doStart() throws Exception { ObjectHelper.notNull(camelContext, "camelContext", this); ServiceHelper.startService(getProducerTemplate()); }
@Override protected void doStart() throws Exception { super.doStart(); zookeeperGroupSupport.setCamelContext(getCamelContext()); ServiceHelper.startService(zookeeperGroupSupport); }
@Override protected void doStart() throws Exception { super.doStart(); if (producerCache == null) { producerCache = new ProducerCache(this, getCamelContext(), cacheSize); } ServiceHelper.startService(producerCache); }
@Override protected void doStart() throws Exception { super.doStart(); if (producerCache == null) { producerCache = new ProducerCache(this, getCamelContext(), cacheSize); } ServiceHelper.startService(producerCache); }
@Override protected void doStart() throws Exception { ObjectHelper.notNull(getComponent(), "QuartzComponent", this); if (loadBalancer == null) { loadBalancer = createLoadBalancer(); } ServiceHelper.startService(loadBalancer); if (isDeleteJob() && isPauseJob()) { throw new IllegalArgumentException("Cannot have both options deleteJob and pauseJob enabled"); } }
@Override protected void doStart() throws Exception { super.doStart(); if (cacheManagerFactory == null) { if (configurationFile != null) { InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), configurationFile); cacheManagerFactory = new DefaultCacheManagerFactory(is, configurationFile); } else { cacheManagerFactory = new DefaultCacheManagerFactory(); } } ServiceHelper.startService(cacheManagerFactory); }
protected void initialize() throws Exception { // start the service here camelEndpoint = getCamelContext().getEndpoint(getCamelEndpointUri()); consumer = camelEndpoint.createConsumer(new ConsumerProcessor()); ServiceHelper.startService(consumer); }
@Override protected void doStart() throws Exception { String url = getEndpoint().getUrl() + "?authUsername=" + getEndpoint().getUsername() + "&authPassword=" + getEndpoint().getPassword() + "&authMethod=Basic"; if (log.isInfoEnabled()) { log.info("Creating NetWeaverProducer using url: {}", URISupport.sanitizeUri(url)); } http = getEndpoint().getCamelContext().getEndpoint(url).createProducer(); ServiceHelper.startService(http); }
@Override protected void doStart() throws Exception { ObjectHelper.notNull(camelContext, "CamelContext", this); timeoutLogger = new CamelLogger(LOG, timeoutLoggingLevel); if (scheduledExecutorService == null) { scheduledExecutorService = camelContext.getExecutorServiceManager().newSingleThreadScheduledExecutor(this, "NettyTimeoutCorrelationManager"); } if (workerPool == null) { workerPool = camelContext.getExecutorServiceManager().newDefaultThreadPool(this, "NettyTimeoutWorkerPool"); } map = new NettyStateTimeoutMap(scheduledExecutorService); ServiceHelper.startService(map); }
protected ReplyManager createReplyManager() throws Exception { // use a temporary queue ReplyManager replyManager = new TemporaryQueueReplyManager(getEndpoint().getCamelContext()); replyManager.setEndpoint(getEndpoint()); String name = "RabbitMQReplyManagerTimeoutChecker[" + getEndpoint().getExchangeName() + "]"; ScheduledExecutorService replyManagerExecutorService = getEndpoint().getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(name, name); replyManager.setScheduledExecutorService(replyManagerExecutorService); log.debug("Staring ReplyManager: {}", name); ServiceHelper.startService(replyManager); return replyManager; } }
@Override protected void doStart() throws Exception { super.doStart(); this.statisticsCalculator = new StatisticsCalculator(context, getCacheId(), getEventWindow(), getQueryString()); this.statisticsCalculator.setStatisticsType(getStatisticsType()); this.statisticsCalculator.setCacheImplementation(getCacheImplementation()); ServiceHelper.startService(statisticsCalculator); }
@Override protected void doStart() throws Exception { if (this.statisticsProcessor == null) { Processor childProcessor = null; this.statisticsProcessor = new StatisticsProcessor(getCamelContext(), childProcessor, getCacheId(), getEventWindow(), getBatchUpdateTime(), getStatisticsType(), getQueryString()); this.statisticsProcessor.setCacheImplementation(getCacheImplementation()); } ServiceHelper.startService(statisticsProcessor); super.doStart(); } }
@Override protected void doStart() throws Exception { super.doStart(); String path = endpoint.getComponent().getCamelClusterPath(endpoint.getGroupName()); this.groupListener = new ZookeeperGroupListenerSupport(path, endpoint, onLockOwned(), onDisconnected()); this.groupListener.setCamelContext(endpoint.getCamelContext()); this.groupListener.setZooKeeperUrl(endpoint.getComponent().getZooKeeperUrl()); this.groupListener.setZooKeeperPassword(endpoint.getComponent().getZooKeeperPassword()); this.groupListener.setCurator(endpoint.getComponent().getCurator()); this.groupListener.setMaximumConnectionTimeout(endpoint.getComponent().getMaximumConnectionTimeout()); ServiceHelper.startService(groupListener); LOG.info("Attempting to become master for endpoint: " + endpoint + " in " + endpoint.getCamelContext() + " with singletonID: " + endpoint.getGroupName()); thisNodeState = createNodeState(); groupListener.updateState(thisNodeState); }