public class RequestServiceInstance extends ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
attachmethod, datas, externalTimeStamp, interDef, isActive, module, recmethod, sendmethod, service
Constructor and Description |
---|
RequestServiceInstance(org.da.protoframework.model.core.RequestResponseService service,
org.da.protoframework.model.def.RequestInterfaceDefinition def,
Module module)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeInvoke()
Performed before the Service is invoked.
|
RequestServiceInstance |
clone()
Clone the service.
|
boolean |
copyFromService(ServiceInstance<?,?> service,
boolean strict)
Copy the values of the output datas of a service to this service.
|
Data<?> |
getData(java.lang.String name)
Return the Data of a specified name.
|
java.util.Map<ModuleIDKey,ServiceInstance<?,?>> |
getInstanceListeners()
Return the Service instance subscribers.
|
java.util.Map<ModuleIDKey,ServiceInstance<?,?>> |
getInstanceSubscribers()
Return the Service instance subscribers.
|
long |
getNextRequestID()
Return the requestID for the next invokcation of the service.
|
long |
getProcessingDuration()
Return the time spent to processs the last request.
|
long |
getProcessingDuration(long requestID)
Return the time spent to processs a request.
|
long |
getReceivedRequestID()
Return the request ID received by the Service instance.
|
boolean |
hasChanged(java.lang.String name)
Return true if the Data with a specified name has changed since the last reception.
|
boolean |
hasData(java.lang.String name,
boolean isInput)
Return true if there is a Data for a specified name.
|
boolean |
hasDatas(boolean isInput)
Return true if the Service instance has some datas for receiving or invoking services.
|
protected boolean |
invoke(char invokeType)
Invoke the Service.
|
boolean |
invokeBlocking()
Invoke the Service.
|
boolean |
isProvidingData()
Return true.
|
boolean |
isSubscriber()
Return true.
|
void |
notifiedInvoke(char type,
int count,
char invokeType)
Called for a
MessageConstants.INVOKE notification. |
void |
preSetup()
Setup the Service instance.
|
short |
setDataBooleanValue(java.lang.String name,
boolean value)
Set a boolean Data value.
|
short |
setDataByteValue(java.lang.String name,
byte value)
Set a byte Data value.
|
short |
setDataCharValue(java.lang.String name,
char value)
Set a char Data value.
|
short |
setDataDoubleValue(java.lang.String name,
double value)
Set a double Data value.
|
short |
setDataFloatValue(java.lang.String name,
float value)
Set a float Data value.
|
short |
setDataIntValue(java.lang.String name,
int value)
Set an int Data value.
|
short |
setDataJSONValue(java.lang.String name,
org.json.JSONElement value)
Set a JSON Data value.
|
short |
setDataLongValue(java.lang.String name,
long value)
Set a long Data value.
|
short |
setDataShortValue(java.lang.String name,
short value)
Set a short Data value.
|
short |
setDataStringValue(java.lang.String name,
java.lang.String value)
Set a String Data value.
|
short |
setDataURLValue(java.lang.String name,
java.lang.String value)
Set an URL Data value.
|
short |
setDataURLValue(java.lang.String name,
java.net.URL value)
Set an URL Data value.
|
short |
setDataValue(java.lang.String name,
java.lang.Object value)
Set a Data value.
|
short |
setDataXMLValue(java.lang.String name,
java.lang.String value)
Set an XML Data value.
|
short |
setDataXMLValue(java.lang.String name,
org.mdiutil.xml.tree.XMLNode value)
Set an XML Data value.
|
void |
setReceivedRequestID(long requestID)
Set the request ID received by the Service instance.
|
void |
setUp()
SetUp the Service instance.
|
addProtocol, afterInvoke, attach, attach, attach, copyFromService, copyFromService, countDatas, createCopy, detach, detach, detach, error, fireEventLogger, getDataAsArray, getDataAsMap, getDataAsStructure, getDataAsSwitch, getDataAsUnion, getDatas, getDataType, getDataValue, getDataValues, getDefinition, getElapsedTime, getErrorType, getFullName, getID, getInvokerAppliID, getInvokerModule, getInvokerModuleID, getKey, getModule, getModuleIDKey, getModuleKey, getName, getNamespace, getNamespaceAsString, getProtocols, getSendMethod, getSendRequestID, getService, getState, getTimestamp, getTimestampMillis, getType, getType, getValue, getValueAsArray, getValueAsBoolean, getValueAsByte, getValueAsChar, getValueAsDouble, getValueAsDouble, getValueAsFloat, getValueAsFloat, getValueAsInt, getValueAsJSON, getValueAsLong, getValueAsShort, getValueAsString, getValueAsStructure, getValueAsURL, getValueAsXML, getVoidService, hasChanged, hasData, hasQualifiedName, hasQualifiedName, hasRequestID, hasUpdateCap, invoke, invokeAndBlock, invokeAndCopy, invokedByMe, isActive, isCopyingDatas, isEnabled, isInvoked, isNominal, isNotified, isSubscribedTo, isUsingExecutorMode, notified, notified, notified, notified, notified, notified, notified, notifiedAttachDetach, notifiedException, notifiedOnError, setActive, setAttachEntryPointMethod, setDataDoubleValue, setDataFileValue, setDataFloatValue, setDataXMLValue, setEntryPointMethod, setInvoker, setState, setTime, setTime, setTimeInternal, shutdown, toString
public RequestServiceInstance(org.da.protoframework.model.core.RequestResponseService service, org.da.protoframework.model.def.RequestInterfaceDefinition def, Module module)
service
- the Servicedef
- the Interface Definitionmodule
- the Modulepublic RequestServiceInstance clone()
clone
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public java.util.Map<ModuleIDKey,ServiceInstance<?,?>> getInstanceSubscribers()
getInstanceSubscribers
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public java.util.Map<ModuleIDKey,ServiceInstance<?,?>> getInstanceListeners()
getInstanceListeners
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public long getNextRequestID()
public boolean invokeBlocking()
ServiceInstance.isActive()
is false.protected boolean invoke(char invokeType)
ServiceInstance.isActive()
is false.invoke
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
invokeType
- the invocation typepublic void notifiedInvoke(char type, int count, char invokeType)
MessageConstants.INVOKE
notification.notifiedInvoke
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
invokeType
- the invocation typecount
- the invocation counttype
- the notification typepublic long getProcessingDuration(long requestID)
requestID
- the request IDpublic long getProcessingDuration()
public void setReceivedRequestID(long requestID)
setReceivedRequestID
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
requestID
- the request IDpublic long getReceivedRequestID()
public boolean isSubscriber()
isSubscriber
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public boolean isProvidingData()
isProvidingData
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public boolean hasDatas(boolean isInput)
hasDatas
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
isInput
- true for receiving servicespublic boolean hasData(java.lang.String name, boolean isInput)
hasData
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the nameisInput
- true for input dataspublic void preSetup() throws FrameworkException
preSetup
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
FrameworkException
public void setUp()
setUp
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
protected void beforeInvoke()
beforeInvoke
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
public boolean copyFromService(ServiceInstance<?,?> service, boolean strict)
strict
argument:
Data.copy(org.da.protoframework.model.core.Data, boolean)
with the second argument set to true)copyFromService
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
service
- the service to copystrict
- true if the framework should check if the types of the datas are identical to make the copy for each datapublic Data<?> getData(java.lang.String name)
getData
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the namepublic boolean hasChanged(java.lang.String name)
hasChanged
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namepublic short setDataValue(java.lang.String name, java.lang.Object value)
setDataValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data valueDataState
)public short setDataIntValue(java.lang.String name, int value)
setDataIntValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data int valueDataState
)public short setDataByteValue(java.lang.String name, byte value)
setDataByteValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data byte valueDataState
)public short setDataLongValue(java.lang.String name, long value)
setDataLongValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data long valueDataState
)public short setDataCharValue(java.lang.String name, char value)
setDataCharValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data char valueDataState
)public short setDataShortValue(java.lang.String name, short value)
setDataShortValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data short valueDataState
)public short setDataFloatValue(java.lang.String name, float value)
setDataFloatValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data float valueDataState
)public short setDataDoubleValue(java.lang.String name, double value)
setDataDoubleValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data double valueDataState
)public short setDataBooleanValue(java.lang.String name, boolean value)
setDataBooleanValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data boolean valueDataState
)public short setDataStringValue(java.lang.String name, java.lang.String value)
setDataStringValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data String valueDataState
)public short setDataURLValue(java.lang.String name, java.lang.String value)
setDataURLValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data URL value, as a StringDataState
)public short setDataURLValue(java.lang.String name, java.net.URL value)
setDataURLValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data URL valueDataState
)public short setDataXMLValue(java.lang.String name, java.lang.String value)
setDataXMLValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data XML valueDataState
)public short setDataXMLValue(java.lang.String name, org.mdiutil.xml.tree.XMLNode value)
setDataXMLValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data XML valueDataState
)public short setDataJSONValue(java.lang.String name, org.json.JSONElement value)
setDataJSONValue
in class ServiceInstance<org.da.protoframework.model.core.RequestResponseService,org.da.protoframework.model.def.RequestInterfaceDefinition>
name
- the data namevalue
- the data JSON valueDataState
)Copyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence