@Start(order = 10) public void start() { persistService.start(); // At this point JPA is started and ready. }
@Override public void init(FilterConfig filterConfig) throws ServletException { persistService.start(); }
@Override public void init(FilterConfig filterConfig) throws ServletException { persistService.start(); }
@Inject public Initializer(PersistService service) { service.start(); } }
/** * Initializes the JPA service. * @param service to be initialized. */ @Inject protected JPAInitializer(PersistService service) { service.start(); } }
@Inject public GoogleGuicePersistService(PersistService persistService) { super(); this.persistService = persistService; LOGGER.info("starting persistence"); persistService.start(); }
/** * Start {@link PersistService} * @see <a href="https://github.com/xvik/guice-persist-orient#lifecycle">Lifecycle of guice-persist-orient</a> * @param application Wicket application */ @Override public void init(Application application) { OrienteerWebApplication app = (OrienteerWebApplication) application; PersistService persistService = app.getServiceInstance(PersistService.class); persistService.start(); }
public static void main(final String[] args) { final Injector injector = getInjector(); injector.getInstance(PersistService.class).start(); injector.getInstance(ExecutionScope.class).enter(); final MetadataRepositoryMigrator metadataRepositoryMigrator = injector.getInstance(MetadataRepositoryMigrator.class); try { metadataRepositoryMigrator.migrateData(); } catch (final IOException | DMPPersistenceException e) { final String message = "could not migrate metadata repository state successfully"; LOG.error(message, e); throw new RuntimeException(message, e); } }
private void init() { //JPA module final Map<String, Object> props = Maps.newHashMap(configuration); props.put("hibernate.connection.datasource", DataSourceManager.get().load(catalogShardName, configuration).get(catalogShardName)); final Module jpaModule = new JpaPersistModule("s3").properties(props); final Module s3Module = new S3Module(catalogName, configuration, infoConverter); final Injector injector = Guice.createInjector(jpaModule, s3Module); persistService = injector.getInstance(PersistService.class); persistService.start(); this.databaseService = injector.getInstance(ConnectorDatabaseService.class); this.tableService = injector.getInstance(ConnectorTableService.class); this.partitionService = injector.getInstance(ConnectorPartitionService.class); }
public Client(@NonNull Path filePath, @NonNull Config config, boolean cleanRun, @NonNull List<?> listeners) { this.filePath = checkFile(filePath); this.cleanRun = cleanRun; Injector injector = Guice.createInjector( Stage.PRODUCTION, new ConfigurationModule(ConfigValidator.checkValid(config.withFallback(ConfigFactory.load()))), new JpaRepositoryModule(), new ServiceModule() ); persistService = injector.getInstance(PersistService.class); persistService.start(); handlerType = injector.getInstance(MovieHandler.Type.class); handlerChain = injector.getInstance(MovieHandler.class); importProgressService = injector.getInstance(ImportProgressService.class); eventBus = new EventBus(); listeners.forEach(eventBus::register); }
public class PocWebApp extends GuiceServletContextListener { @Inject PersistService ps; @Override protected Injector getInjector() { Injector injector = Guice.createInjector(new ServletModule() { @Override protected void configureServlets() { install(new JpaPersistModule("DesktopPU")); serve("/socket/main/").with(MainSocket.class); } }); injector.injectMembers(this); return injector; } @Override public void contextInitialized(ServletContextEvent servletContextEvent) { super.contextInitialized(servletContextEvent); ps.start(); } }
@Inject ApplicationInitializer(PersistService service) { service.start(); for (int i = 0; i < persistanceThreadCount; i++)
public static void init(String localConfigFilename) { configFilename = localConfigFilename; ToDoConfiguration configuration = createConfiguration(localConfigFilename); Properties properties = createPropertiesFromConfiguration(configuration); JpaPersistModule jpaPersistModule = new JpaPersistModule(JPA_UNIT); jpaPersistModule.properties(properties); injector = Guice.createInjector(jpaPersistModule, new ToDoGuiceModule()); injector.getInstance(PersistService.class).start(); }
public void run() { try { GuiceContext.get(DataSource.class, annotation); } catch (Throwable T) { LogFactory.getLog("DBStartup") .log(Level.SEVERE, "Datasource Unable to start", T); } PersistService ps = GuiceContext.get(PersistService.class, annotation); ps.start(); UnitOfWork ow = GuiceContext.get(UnitOfWork.class, annotation); ow.end(); LogFactory.getLog("DBStartup") .log(Level.CONFIG, "DBStartupThread Started - " + annotation.getSimpleName()); }
/** * Starts the system. */ @Override protected void doStart() { try { String build = _configuration.getValue(SystemConfiguration.Property.BUILD); String version = _configuration.getValue(SystemConfiguration.Property.VERSION); String year = new SimpleDateFormat("yyyy").format(new Date()); _log.info("Argus version {} build {}.", version, build); _log.info("Copyright Salesforce.com, {}.", year); _log.info("{} started.", getName()); _persistService.start(); _serviceFactory.getUserService().findAdminUser(); _serviceFactory.getUserService().findDefaultUser(); } catch (Throwable ex) { _log.error(getName() + " startup aborted.", ex); } finally { _mergeServiceConfiguration(); _mergeNotifierConfiguration(); _log.info(_configuration.toString()); } }
/** * Starts the system. */ @Override protected void doStart() { try { String build = _configuration.getValue(SystemConfiguration.Property.BUILD); String version = _configuration.getValue(SystemConfiguration.Property.VERSION); String year = new SimpleDateFormat("yyyy").format(new Date()); _log.info("Argus version {} build {}.", version, build); _log.info("Copyright Salesforce.com, {}.", year); _log.info("{} started.", getName()); _persistService.start(); _serviceFactory.getUserService().findAdminUser(); _serviceFactory.getUserService().findDefaultUser(); } catch (Throwable ex) { _log.error(getName() + " startup aborted.", ex); } finally { _mergeServiceConfiguration(); _mergeNotifierConfiguration(); _log.info(_configuration.toString()); } }
@BeforeClass public static void startUp() throws Exception { final Injector newInjector = GuicedTest.getInjector(); newInjector.getInstance(PersistService.class).start(); newInjector.getInstance(ExecutionScope.class).enter(); startUp(newInjector); }
/** * Boots the persistence unit during post-load asynchronously */ @Override public void postLoad() { try { GuiceContext.get(DataSource.class, getBindingAnnotation()); } catch (Throwable T) { LogFactory.getLog("DBStartup") .log(Level.SEVERE, "Datasource Unable to start", T); } PersistService ps = GuiceContext.get(PersistService.class, getBindingAnnotation()); ps.start(); UnitOfWork ow = GuiceContext.get(UnitOfWork.class, getBindingAnnotation()); ow.end(); LogFactory.getLog("DBStartup") .log(Level.CONFIG, "DB Post Startup Completed - " + getBindingAnnotation().getSimpleName()); }
@BeforeClass public static void startUp() throws Exception { final Injector newInjector = GuicedTest.getInjector(); newInjector.getInstance(PersistService.class).start(); newInjector.getInstance(ExecutionScope.class).enter(); startUp(newInjector); }