@Override public void onApplicationEvent(ContextStartedEvent event) { sessionService.executeInSystemContext(new Runnable() { @Override public void run() { try { JobDataMap data = new JobDataMap(); data.put("jobName", "dashboardMessageJob"); schedulerService.scheduleNow(DashboardMessageJob.class, data, 600000); } catch (SchedulerException e) { log.error("Failed to schedule DashboardMessageJob", e); } } }); }
@Override public void onApplicationEvent(ContextStartedEvent event) { if (log.isInfoEnabled()) { log.info("Scheduling one time only or repetitive automation resources"); } sessionService.executeInSystemContext(new Runnable() { @Override public void run() { for (Realm realm : realmRepository.allRealms()) { for (AutomationResource resource : repository.getResources(realm)) { if (!resource.isDailyJob()) { schedule(resource); } } } scheduleDailyJobs(); } }); }
@Override public void onApplicationEvent(ContextStartedEvent event) { sessionService.executeInSystemContext(new Runnable() { @Override public void run() { for(PrincipalSuspension s : repository.getSuspensions()) { try { if (s.getDuration() > 0) { scheduleResume(s.getPrincipal(), s.getStartTime(), s.getDuration()); } } catch (ResourceCreationException e) { log.error("Could not schedule resumption of user account " + s.getPrincipal().getName(), e); } } } }); }
@EventListener(ContextStartedEvent.class) public void start() throws Exception { int port = properties.getPort(); NettyServerBuilder builder = NettyServerBuilder.forPort(port); bindableServices.forEach(builder::addService); if (properties.isSecure()) { configureSsl(builder); } grpcServer = builder.build(); try { grpcServer.start(); } catch (IOException e) { if (e.getCause() instanceof BindException) { throw new BindException("Address already in use: " + port); } throw new RuntimeException(e); } if (properties.getHealthCheckPort() > 0) { log.info("Starting health check at port {}", properties.getHealthCheckPort()); healthCheckSocket = new ServerSocket(properties.getHealthCheckPort()); healthChecker = new Thread(this::healthCheck, "Health Checker"); healthChecker.setDaemon(true); healthChecker.start(); } log.info("Server started, GRPC API listening on {}", grpcServer.getPort()); String endpointUrl = properties.getEndpointUrl(); if (endpointUrl == null) { log.warn("No endpoint url provided"); } else { for (Address address : ethereumConfig.getAddresses()) { ContractsManager contractManager = factory.getContractManager(address); EndpointRegistry registry = new EndpointRegistry(contractManager.endpointRegistry()); registry.registerEndpoint(address, endpointUrl); } } }
@Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextStartedEvent) { populateGraph(); } }
@Override public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextStartedEvent) { this.startStandAlone(); } else if (event instanceof ContextClosedEvent || event instanceof ContextStoppedEvent) { this.stopStandAlone(); } }
public void onApplicationEvent(ApplicationEvent event) { if (event instanceof ContextStartedEvent && !isImmediateStart()) { try { start(); } catch (Exception e) { LOGGER.error( e.getLocalizedMessage(), e); } } else if (event instanceof ContextClosedEvent || event instanceof ContextStoppedEvent) { stop(); } }
@Override public void onApplicationEvent(ContextStartedEvent contextStartedEvent) { policyDefinitions() .filter(definition -> !pdpPolicyRepository.findByNameAndLatestRevision(definition.getName(), true).isPresent()) .forEach(definition -> { String policyXml = policyTemplateEngine.createPolicyXml(definition); PdpPolicy pdpPolicy = new PdpPolicy(policyXml, definition.getName(), true, "provisioned", "surfnet", "system", true, definition.getType()); pdpPolicyRepository.save(pdpPolicy); }); }
@Override public void onApplicationEvent(ContextStartedEvent event) { executeInSystemContext(new Runnable() { @Override public void run() { if (log.isInfoEnabled()) { log.info("Scheduling session reaper job"); } for (Session session : repository.getSystemSessions()) { if (systemSession != null && systemSession.equals(session)) { continue; } closeSession(session); } try { JobDataMap data = new JobDataMap(); data.put("jobName", "firstRunSessionReaperJob"); data.put("firstRun", true); schedulerService.scheduleNow(SessionReaperJob.class, data); data = new JobDataMap(); data.put("jobName", "sessionReaperJob"); schedulerService.scheduleIn(SessionReaperJob.class, data, 60000, 60000); } catch (SchedulerException e) { log.error("Failed to schedule session reaper job", e); } } }); }
@Override public void start() { getLifecycleProcessor().start(); publishEvent(new ContextStartedEvent(this)); }
private void onStartedEvent(ApplicationEvent event) { if (ContextStartedEvent.class.getName().equals(event.getClass().getName())) { startRpcClient(); } }
@Override public void onApplicationEvent(ContextStartedEvent arg0) { try{ log.info("Starting CloudMeterStartup from source: " + arg0.getSource().toString()); InputStream is = CloudMeterStartup.class.getClassLoader().getResourceAsStream("jmeter.properties"); JMeterUtils.loadJmeterProperties(is); log.info("Property load complete. Cloud-Meter properties initialized."); }catch(Exception e){ log.error("exception while loading properties: " + e.getClass().toString() + "/" + e.getMessage()); } }
@EventListener({ContextStartedEvent.class, ContextRefreshedEvent.class}) public void handleContextStart() { LOG.info("Context Started of refreshed!!!!!!!!!!!!"); }
@Override protected void processApplicationEvent(ApplicationEvent arg0) { if (m_bSendEventsOnInit && arg0 instanceof ContextStartedEvent) startReplay(); }
@Override public void onApplicationEvent(ContextStartedEvent event) { decorateByFields(); decorateBySetters(); }
@Override public void onApplicationEvent(final ContextStartedEvent event) { LOGGER.info(MessageCatalog._00022_PIPELINE_STARTING); LOGGER.info(MessageCatalog._00023_PIPELINE_STARTED); }
@Override public void onApplicationEvent(ContextStartedEvent contextStartedEvent) { started.set(true); }
public void start() { getLifecycleProcessor().start(); publishEvent(new ContextStartedEvent(this)); }
@Override public void onApplicationEvent(ContextStartedEvent contextStartedEvent) { }
@EventListener public void handleContextStarted ( ContextStartedEvent event ) { logger.warn( "This will never get invoked because it is for configuratble context only" ); }