D
- the associated ServiceDefinition typepublic abstract class Service<D extends ServiceDefinition>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<ModuleKey,ServiceInstance<?,?>> |
attachedProviders
The Map of attached providers.
|
protected D |
def
The Service definition.
|
protected boolean |
isSetup
True if the Service has been setUp.
|
protected boolean |
modeExecutor
True if the executor mode is used to send services.
|
Modifier and Type | Method and Description |
---|---|
void |
addProvider(ServiceInstance<?,?> serviceImpl)
Add a Service instance provider to the Service.
|
void |
addSubscriber(ServiceInstance<?,?> serviceImpl)
Add a Service instance subscriber to the Service.
|
boolean |
attach(Module module)
Attach a module to the modules providers.
|
boolean |
attachProvider(ServiceInstance<?,?> service)
Attach a Service instance provider.
|
boolean |
detach(Module module)
Detach a module from the modules providers.
|
boolean |
detachProvider(ServiceInstance<?,?> service)
Detach a Service instance provider.
|
void |
error(ServiceInstance<?,?> instance,
char errorType)
Notify an error for the execution of the Service.
|
java.util.Map<ModuleKey,ServiceInstance<?,?>> |
getAttachedProviders()
Return the Service instance attached provider.
|
D |
getDefinition()
Return the Service Definition.
|
long |
getID()
Return the Service ID.
|
NamespaceKey |
getKey()
Return the Service key.
|
java.lang.String |
getName()
Return the Service name.
|
java.util.Map<ModuleIDKey,ServiceInstance<?,?>> |
getProviders()
Return the Service instance providers.
|
long |
getRequestID()
Return the Service request ID if the Service maintains a request ID.
|
short |
getServiceInvocationMode()
Return the service invocation mode.
|
ServiceInstance<?,?> |
getSubscriber(ModuleIDKey key)
Return a Service instance subscriber.
|
java.util.Map<ModuleIDKey,ServiceInstance<?,?>> |
getSubscribers()
Return the Service subscribers.
|
boolean |
hasRequestID()
Return true if the Service maintains a request ID.
|
boolean |
isCopyingDatas()
Return true if the datas of the service must be copied before being sent.
|
boolean |
isSetup()
Return true if the Service is setUp.
|
void |
notified(char type,
int count,
char invokeType)
Be notified of the execution of the Service.
|
void |
send(ServiceInstance<?,?> instance,
char invokeType)
Send the Service datas.
|
void |
send(ServiceInstance<?,?> instance,
int count,
char invokeType)
Send the Service datas.
|
void |
setUp()
Setup the Service.
|
protected D extends ServiceDefinition def
protected boolean isSetup
protected final java.util.Map<ModuleKey,ServiceInstance<?,?>> attachedProviders
protected boolean modeExecutor
ServiceInvocationMode
public Service(D def)
def
- the Service definition.public NamespaceKey getKey()
public java.lang.String getName()
public long getID()
public D getDefinition()
public short getServiceInvocationMode()
ServiceInvocationMode
public boolean detachProvider(ServiceInstance<?,?> service)
service
- the providerpublic boolean attachProvider(ServiceInstance<?,?> service)
service
- the providerpublic java.util.Map<ModuleKey,ServiceInstance<?,?>> getAttachedProviders()
public void addProvider(ServiceInstance<?,?> serviceImpl)
serviceImpl
- the Service instance providerpublic java.util.Map<ModuleIDKey,ServiceInstance<?,?>> getProviders()
public void addSubscriber(ServiceInstance<?,?> serviceImpl)
serviceImpl
- the Service instance subscriberpublic ServiceInstance<?,?> getSubscriber(ModuleIDKey key)
key
- the subscriber ModuleIDKeypublic java.util.Map<ModuleIDKey,ServiceInstance<?,?>> getSubscribers()
public boolean hasRequestID()
public boolean isCopyingDatas()
public long getRequestID()
public boolean detach(Module module)
module
- the Modulepublic boolean attach(Module module)
module
- the Modulepublic void error(ServiceInstance<?,?> instance, char errorType)
instance
- the Service instanceerrorType
- the error typepublic void send(ServiceInstance<?,?> instance, char invokeType)
instance
- the Service instanceinvokeType
- the invocation typepublic void send(ServiceInstance<?,?> instance, int count, char invokeType)
instance
- the Service instancecount
- the invocation countinvokeType
- the invocation typepublic void notified(char type, int count, char invokeType)
type
- the notification typecount
- the invocation countinvokeType
- the invocation typepublic void setUp()
public boolean isSetup()
Copyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence