Пример #1
0
 protected void shutdownBootstrapServices() {
   Collections.reverse(services);
   for (BootstrapService service : services) {
     service.stop(Application.getApplication());
   }
   services.clear();
 }
Пример #2
0
 protected void startBootstrapService(Class<? extends BootstrapService> serviceType) {
   try {
     BootstrapService service = serviceType.newInstance();
     service.init(Application.getApplication());
     service.start(Application.getApplication());
     services.add(service);
   } catch (InstantiationException ex) {
     throw new BootstrapServiceException(serviceType.getName(), ex);
   } catch (IllegalAccessException ex) {
     throw new BootstrapServiceException(serviceType.getName(), ex);
   }
 }