/** * Create a default factory service that starts instances of this task service on POST. */ public static FactoryService createFactory() { return TaskFactoryService.create(ExampleTaskService.class, ServiceOption.IDEMPOTENT_POST, ServiceOption.INSTRUMENTATION); }
public static FactoryService createFactory() { return TaskFactoryService.create(TaskDemoService.class); }
/** * Creates meta-data for a task service. It is a shortcut to * <code>factoryService(serviceClass, () -> TaskFactoryService.create(serviceClass))</code>. * * @return cached ServiceMetadata * * @see TaskFactoryService */ public static ServiceMetadata taskService(Class<? extends Service> serviceClass) { return factoryService(serviceClass, () -> TaskFactoryService.create(serviceClass)); }
public static void handleStartDocumentIndexService(ServiceHost host, Service documentIndexService, NodeSelectorService defaultNodeSelectorService, StartCoreServicesSynchronouslyHandler startCoreServicesSynchronously) throws Throwable { Service[] queryServiceArray = new Service[] { documentIndexService, new QueryTaskFactoryService() { @Override public void handlePost(Operation post) { updateQueryTask(post); super.handlePost(post); } }, new LocalQueryTaskFactoryService() { @Override public void handlePost(Operation post) { updateQueryTask(post); super.handlePost(post); } }, TaskFactoryService.create(GraphQueryTaskService.class), TaskFactoryService.create(SynchronizationTaskService.class), new QueryPageForwardingService(defaultNodeSelectorService) }; startCoreServicesSynchronously.accept(queryServiceArray); }
SshCommandTaskService.createFactory()); host.startFactory(ResourceAllocationTaskService.class, () -> TaskFactoryService.create(ResourceAllocationTaskService.class)); host.startFactory(ResourceEnumerationTaskService.class, () -> ResourceEnumerationTaskService.createFactory()); () -> ImageEnumerationTaskService.createFactory()); host.startFactory(ScheduledTaskService.class, () -> TaskFactoryService.create(ScheduledTaskService.class)); host.startFactory(ResourceRemovalTaskService.class, () -> TaskFactoryService.create(ResourceRemovalTaskService.class)); host.startFactory(ProvisionComputeTaskService.class, () -> TaskFactoryService.create(ProvisionComputeTaskService.class)); host.startFactory(ProvisionNetworkTaskService.class, () -> TaskFactoryService.create(ProvisionNetworkTaskService.class)); host.startFactory(ProvisionSubnetTaskService.class, () -> TaskFactoryService.create(ProvisionSubnetTaskService.class)); host.startFactory(ProvisionLoadBalancerTaskService.class, () -> TaskFactoryService.create(ProvisionLoadBalancerTaskService.class)); host.startFactory(SnapshotTaskService.class, () -> TaskFactoryService.create(SnapshotTaskService.class)); host.startFactory(ProvisionSecurityGroupTaskService.class, () -> TaskFactoryService.create(ProvisionSecurityGroupTaskService.class)); host.startFactory(EndpointAllocationTaskService.class, () -> TaskFactoryService.create(EndpointAllocationTaskService.class)); host.startFactory(EndpointRemovalTaskService.class, () -> TaskFactoryService.create(EndpointRemovalTaskService.class)); host.startFactory(SingleResourceStatsAggregationTaskService.class, () -> SingleResourceStatsAggregationTaskService.createFactory());
/** * Start document index service. Allow to override the loading of the core query services. */ protected void startDocumentIndexService(Service documentIndexService, NodeSelectorService defaultNodeSelectorService) throws Throwable { if (documentIndexService instanceof LuceneDocumentIndexService) { Service[] queryServiceArray = new Service[] { documentIndexService, new LuceneDocumentIndexBackupService(), new QueryTaskFactoryService(), new LocalQueryTaskFactoryService(), TaskFactoryService.create(GraphQueryTaskService.class), TaskFactoryService.create(SynchronizationTaskService.class), new QueryPageForwardingService(defaultNodeSelectorService) }; startCoreServicesSynchronously(queryServiceArray); // register auto-backup consumer to the document index service // turning on/off the feature is checked in consumer to allow toggling at runtime this.registerForServiceAvailability((o, e) -> { URI subscriptionUri = UriUtils.buildSubscriptionUri(this, this.documentIndexService.getSelfLink()); Operation createSubscriptionOp = Operation.createPost(subscriptionUri).setReferer(getUri()); Consumer<Operation> autoBackupConsumer = LuceneDocumentIndexBackupService.createAutoBackupConsumer(this, this.managementService); startSubscriptionService(createSubscriptionOp, autoBackupConsumer); }, this.documentIndexService.getSelfLink()); } }