Interface Service
-
- All Superinterfaces:
Stateful<ServiceState>
- All Known Implementing Classes:
AnalyticsService
,BackupService
,EventingService
,KeyValueService
,ManagerService
,QueryService
,SearchService
,ViewService
public interface Service extends Stateful<ServiceState>
The parent interface for all service implementations.Note that while this interface has been around since the 1.x days, it has been changed up quite a bit to make it simpler and provide more functionality based on real world experience with the first iteration.
- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
connect()
Instruct thisService
to connect.ServiceContext
context()
Returns the underlying contextual metadata for this service.Stream<EndpointDiagnostics>
diagnostics()
Returns diagnostics information for this service.void
disconnect()
Instruct thisService
to disconnect.Stream<InternalEndpointDiagnostics>
internalDiagnostics()
<R extends Request<? extends Response>>
voidsend(R request)
Sends the request into thisService
.ServiceType
type()
Represents the service type for this service.
-
-
-
Method Detail
-
connect
void connect()
Instruct thisService
to connect.This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful connection attempts.
-
disconnect
void disconnect()
Instruct thisService
to disconnect.This method is async and will return immediately. Use the other methods available to inspect the current state of the service, signaling potential successful disconnection attempts.
-
send
<R extends Request<? extends Response>> void send(R request)
Sends the request into thisService
.Note that there is no guarantee that the request will actually dispatched, based on the state this service is in.
- Parameters:
request
- the request to send.
-
context
ServiceContext context()
Returns the underlying contextual metadata for this service.
-
type
ServiceType type()
Represents the service type for this service.
-
diagnostics
Stream<EndpointDiagnostics> diagnostics()
Returns diagnostics information for this service.
-
internalDiagnostics
@Internal Stream<InternalEndpointDiagnostics> internalDiagnostics()
-
-