/*** * Override to register factory services used by the host. */ protected void registerPostgresSchema(PostgresSchemaManager sm) { sm.addFactory(CheckpointFactoryService.SELF_LINK, CheckpointService.class); sm.addTable(td -> { td.useStatefulService(AuthCredentialsService.class); td.setIndexType("privateKey", "hash"); td.setIndexType("publicKey", "hash"); }); sm.addFactory(RoleService.class); sm.addFactory(TenantService.class); sm.addFactory(UserService.class); sm.addFactory(UserGroupService.class); sm.addFactory(ResourceGroupService.class); sm.addFactory(TransactionFactoryService.SELF_LINK, TransactionService.class); }
@Override protected void registerPostgresSchema(PostgresSchemaManager sm) { super.registerPostgresSchema(sm); sm.addFactory(TestService.class); sm.addFactory(TestPeriodicService.class); sm.addFactory(TestImmutableService.class); }
/** * Performs SQL initialization for the given document type, e.g. creating a dedicated table for * it, etc. * * Expected to be called once per document type upon host startup. */ public void initForDocument(String factoryLink, Class<? extends ServiceDocument> documentType, ServiceDocumentDescription sdd) { this.schemaManager.addFactory(factoryLink, documentType, sdd); TableDescription desc = this.schemaManager.getTableDescriptionForFactoryLink(factoryLink); if (desc != null) { ensureTableExists(desc); } }
try { if (serviceMetadata.factoryCreator != null) { sm.addFactory((StatefulService) serviceMetadata.factoryCreator.get() .createServiceInstance()); } else { sm.addFactory( (Class<? extends StatefulService>) serviceMetadata.serviceClass);