receive(ServiceInstance service)
method will be called each time the module is notified from the position
service:<applications> <application name="application"> <modules> <module name="FMS" > <implementation path="org.da.aircraft.Aircraft" > <initEntryPoint method="init" /> <defaultSendEntryPoint method="send" /> </implementation> <interfaces> <subscribe service="position" /> </interfaces> </module> </modules> </application> </applications>
sendServiceInstance service)
method will be called each time the position
service is automatically invoked:<applications> <application name="application"> <modules> <module name="Aircraft" > <implementation path="org.da.aircraft.Aircraft" > <initEntryPoint method="init" /> <defaultSendEntryPoint method="send" /> </implementation> <interfaces> <cyclic service="position" frequency="200ms "/> </interfaces> </module> </modules> </application> </applications>
sendServiceInstance service)
method will be called each time the tick
service is automatically invoked:<applications> <application name="application"> <modules> <module name="Aircraft" > <implementation path="org.da.aircraft.Aircraft" > <initEntryPoint method="init" /> <defaultSendEntryPoint method="send" /> </implementation> <interfaces> <cyclicEvent service="tick" frequency="1s "/> </interfaces> </module> </modules> </application> </applications>
public void subscribe(ServiceInstance<?, ?> service) { if (service.getName().equals("myService") { ... } }An when taking into account the full service identification:
public void subscribe(ServiceInstance<?, ?> service) { NamespaceKey key = NamespaceKey.createKey("http://my.uri", "myService"); if (service.getKey().equals(key) { ... } }
invoke
method in the original service, except that the current values of the copied service will be used for the Datas. java.time.Duration
in milliseconds (as for the System.currentTimeMillis()
) by calling the ServiceInstance.getTimeStamp() method. This value is the exact time when the service was invoked.
public void receive(ServiceInstance service) { Data latitude = service.getData("latitude"); float lat = data.getValueAsFloat(); }
public void send(ServiceInstance service) { Data latitude = service.getData("latitude"); data.setValueAsFloat(0.25f); }
<types> <objectType name="obj" class="my.package.MyClass" /> </types>The following code will retrieve the data associated value:
public void received(ServiceInstance service) { Data data = service.getData("data"); MyClass instance = (MyClass)data.getValue(); }
public void send(ServiceInstance service) { Data latitude = service.getData("latitude"); data.setValueAsFloat(0.25f); service.invoke(); }
getProcessingDuration()
method return the duration for the last responsegetProcessingDuration(long requestID)
method return the duration for the reponse corresponding to a specified request IDCopyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence