/** * Start a service using the specified operation and service */ public ServiceHost startService(Operation post, Service service) { return startService(post, service, null); }
@Override protected ServiceHost startService(Operation post, Service service, Operation onDemandTriggeringOp) { if (this.enablePostgres) { boolean registerFactory = !enableRegisterPostgresSchema || createTableOnFactoryStart; PostgresHostUtils .handleServiceStart(this, post, service, this.postgresDocumentIndexService, registerFactory); } return super.startService(post, service, onDemandTriggeringOp); }
/** * Starts a factory service using the provided factory creator and the provided factory URI. * This is helpful for starting a factory with a custom path. * @param factoryCreator a function which creates a factory service * @param servicePath the path to use for the factory * @return the service host */ public ServiceHost startFactory(Supplier<FactoryService> factoryCreator, String servicePath) { Operation post = Operation.createPost(UriUtils.buildUri(this, servicePath)); FactoryService factoryService = factoryCreator.get(); return startService(post, factoryService); }
/** * Start a service using the default start operation. * @param service the service to start * @return the service host */ public ServiceHost startService(Service service) { Operation post = Operation.createPost(UriUtils.buildUri(this, service.getClass())); return startService(post, service); }
private void startChildService(Operation o, Service childService) { o.addPragmaDirective(Operation.PRAGMA_DIRECTIVE_VERSION_CHECK); getHost().startService(o, childService); }
public static void main(String[] args) throws Throwable { ServiceHost host = ServiceHost.create(); host.start(); host.startDefaultCoreServicesSynchronously(); host.startService(new MyStatelessService()); host.startService(new MyNamespaceService()); }
public static void startServices(ServiceHost host) { String remoteAdapterReference = System .getProperty("dcp.management.container.registry.adapter.service.reference"); if (remoteAdapterReference != null && !remoteAdapterReference.isEmpty()) { registryAdapterReference = URI.create(remoteAdapterReference); } else { registryAdapterReference = UriUtils.buildUri(host, RegistryAdapterService.class); ensurePropertyExists(host, RegistryAdapterService.REGISTRY_PROXY_PARAM_NAME, () -> { ensurePropertyExists(host, RegistryAdapterService.REGISTRY_NO_PROXY_LIST_PARAM_NAME, () -> { host.startService(Operation.createPost(registryAdapterReference), new RegistryAdapterService()); }); }); } }
protected void startRedirectService(String sourcePath, String targetPath) { Operation post = Operation .createPost(UriUtils.buildUri(getHost(), sourcePath)); UiNgResourceForwarding rf = new UiNgResourceForwarding(sourcePath, targetPath, true); getHost().startService(post, rf); }
public static void main(String[] args) throws Throwable { ServiceHost host = ServiceHost.create(); host.start(); host.startDefaultCoreServicesSynchronously(); // A stateless service that enumerates all the // factory services started on the Service host. host.startService(new RootNamespaceService()); // start an example factory for folks that want to experiment with service instances host.startFactory(ExampleService.class, ExampleService::createFactory); }
protected void startForwardingService(String sourcePath, String targetPath) { Operation post = Operation .createPost(UriUtils.buildUri(getHost(), sourcePath)); UiNgResourceForwarding rf = new UiNgResourceForwarding(sourcePath, targetPath); getHost().startService(post, rf); }
public static void start(ServiceHost host, Consumer<Operation> parentHandler) { MaintenanceProxyService s = new MaintenanceProxyService(parentHandler); String path = UriUtils.buildUriPath(ServiceUriPaths.CORE, "netty-maint-proxies", host.nextUUID()); host.startService(Operation.createPost(UriUtils.buildUri(host, path)), s); }
public static void startServices(ServiceHost host) { try { host.startFactory( PhotonModelAdaptersRegistryService.class, PhotonModelAdaptersRegistryFactoryService::new); host.startFactory( ResourceOperationSpecService.class, ResourceOperationSpecFactoryService::new); host.startService(new ResourceOperationService()); } catch (Exception e) { host.log(Level.WARNING, "Error on start adapter registry related services. %s", Utils.toString(e)); throw e; } } }
static ServiceHost createAndStartHost(String... args) throws Throwable { ServiceHost host = ServiceHost.create(args); host.start(); host.startDefaultCoreServicesSynchronously(); host.startService(new RootNamespaceService()); host.startFactory(new UpgradeDemoEmployeeService()); // In order to support upgrading your Xenon application, you need to start the MigrationTaskService host.startFactory(new MigrationTaskService()); host.startService(new UpgradeDemoEmployeeServiceTransformService()); host.log(Level.INFO, "Starting host [add-logging] with args these args:%n[id=%s]%n[port=%d]%n[sandbox=%s]%n[peerNodes=%s]", host.getId(), host.getPort(), host.getStorageSandbox(), host.getInitialPeerHosts()); return host; }
static ServiceHost createAndStartHost(String... args) throws Throwable { ServiceHost host = ServiceHost.create(args); host.start(); host.startDefaultCoreServicesSynchronously(); host.startService(new RootNamespaceService()); host.startFactory(new UpgradeDemoEmployeeService()); // In order to support upgrading your Xenon application, you need to start the MigrationTaskService host.startFactory(new MigrationTaskService()); return host; }
private void startChildService(Operation post, String path, Service childService) { getHost().startService( Operation.createPost(UriUtils.extendUri(post.getUri(), path)) .setBody(post.getBodyRaw()), childService ); childServices.add(childService); }
private void startChildService(Operation post, String path, Service childService) { getHost().startService( Operation.createPost(UriUtils.extendUri(post.getUri(), path)) .setBody(post.getBodyRaw()), childService ); childServices.add(childService); }
private void startChildService(Operation post, String path, Service childService) { getHost().startService( Operation.createPost(UriUtils.extendUri(post.getUri(), path)) .setBody(post.getBodyRaw()), childService ); childServices.add(childService); }
@Override public ServiceHost start() throws Throwable { super.start(); startDefaultCoreServicesSynchronously(); // Start a factory for gathering test statistics super.startService( Operation.createPost(UriUtils.buildUri(this, TestResultsFactoryService.class)), new TestResultsFactoryService()); return this; } }
@Override public ServiceHost start() throws Throwable { super.start(); startDefaultCoreServicesSynchronously(); // Start a factory for gathering test statistics super.startService( Operation.createPost(UriUtils.buildUri(this, TestResultsFactoryService.class)), new TestResultsFactoryService()); return this; } }
static ServiceHost createAndStartHost(String... args) throws Throwable { ServiceHost host = ServiceHost.create(args); host.start(); host.startDefaultCoreServicesSynchronously(); host.startService(new RootNamespaceService()); host.startFactory(new UpgradeDemoEmployeeService()); // In order to support upgrading your Xenon application, you need to start the MigrationTaskService host.startFactory(new MigrationTaskService()); // Added for 'add-logging' project. host.log(Level.INFO, "Starting host [add-logging] with args these args:%n[id=%s]%n[port=%d]%n[sandbox=%s]%n[peerNodes=%s]", host.getId(), host.getPort(), host.getStorageSandbox(), host.getInitialPeerHosts()); return host; }