T
- type of service configurerpublic abstract class AbstractService<T extends ServiceConfigurer> extends AbstractPluginConfigurable<T> implements Service<T>
Constructor and Description |
---|
AbstractService() |
Modifier and Type | Method and Description |
---|---|
protected void |
addHandler(HttpServiceHandler handler)
Add handler to the Service.
|
protected void |
addHandlers(Iterable<? extends HttpServiceHandler> handlers)
Add a list of handlers to the Service.
|
protected abstract void |
configure()
Implements this method to configure this Service.
|
void |
configure(T serviceConfigurer)
Configure the Service by adding
HttpServiceHandler s to handle requests. |
protected T |
getConfigurer()
Returns the
ServiceConfigurer , only available at configuration time. |
protected void |
setDescription(String description)
Set the description of the Service.
|
protected void |
setInstances(int instances)
Sets the number of instances needed for the server that runs all
HttpServiceHandler s of this Service. |
protected void |
setName(String name)
Set the name for the Service.
|
protected void |
setResources(Resources resources)
Sets the resources requirements for the server that runs all
HttpServiceHandler s of this Service. |
usePlugin, usePlugin, usePluginClass, usePluginClass
addDatasetModule, addDatasetType, createDataset, createDataset, createDataset, createDataset
public final void configure(T serviceConfigurer)
Service
HttpServiceHandler
s to handle requests.configure
in interface Service<T extends ServiceConfigurer>
serviceConfigurer
- to use to add handlers to the Service.protected void setName(String name)
name
- of the service.protected void setDescription(String description)
description
- of the service.protected void addHandler(HttpServiceHandler handler)
handler
- to serve requests with.protected void addHandlers(Iterable<? extends HttpServiceHandler> handlers)
handlers
- to service requests with.protected void setInstances(int instances)
HttpServiceHandler
s of this Service.instances
- Number of instances, must be > 0.protected void setResources(Resources resources)
HttpServiceHandler
s of this Service.resources
- The requirements.protected final T getConfigurer()
ServiceConfigurer
, only available at configuration time.getConfigurer
in class AbstractPluginConfigurable<T extends ServiceConfigurer>
protected abstract void configure()
Copyright © 2021 Cask Data, Inc. Licensed under the Apache License, Version 2.0.