Interface IfaceAwareService<T extends BinaryMsgIface>
- All Superinterfaces:
BinaryMsgIfaceFactory
,BinaryMsgIfaceListener<T>
,IfaceAware<T>
public interface IfaceAwareService<T extends BinaryMsgIface>
extends IfaceAware<T>, BinaryMsgIfaceListener<T>, BinaryMsgIfaceFactory
TODO
- Version:
- 2025-06-19
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tccc.kos.core.service.hardware.IfaceAware
IfaceAware.IfaceCallback<T>, IfaceAware.IfaceExceptionHandler
-
Method Summary
Modifier and TypeMethodDescriptioncreateIface
(BinaryMsgSession session) Return an instance of the custom iface for the service.default BinaryMsgIface
getIface
(String name, BinaryMsgSession session) Handle iface checks and only callcreateIface
for matching iface.Return the name of the iface for this service.default void
CallsonIfaceConnect()
to avoid name collisions when usingwithIface()
methods.default void
onDisconnect
(T iface) CallsonIfaceDisconnect()
void
Called once the associated iface is initialized and ready for use.void
Called when the associated iface is shutdown.Methods inherited from interface com.tccc.kos.core.service.hardware.IfaceAware
getIface, setIface, withIface, withIface, withIfaceCatch, withIfaceCatch, withIfaceCatch, withIfaceCatch, withIfaceOrThrow
-
Method Details
-
getIfaceName
String getIfaceName()Return the name of the iface for this service. -
createIface
Return an instance of the custom iface for the service. This is called when the adapter for the service connects to java. The iface returned by this method can be accessed viagetIface()
. This will be called every time the adapter connects to the service. -
getIface
Handle iface checks and only callcreateIface
for matching iface.- Specified by:
getIface
in interfaceBinaryMsgIfaceFactory
- Parameters:
name
- the name of the interfacesession
- the session to back the interface- Returns:
- the iface or null
-
onIfaceConnect
Called once the associated iface is initialized and ready for use.- Throws:
Exception
-
onIfaceDisconnect
Called when the associated iface is shutdown.- Throws:
Exception
-
onConnect
CallsonIfaceConnect()
to avoid name collisions when usingwithIface()
methods.- Specified by:
onConnect
in interfaceBinaryMsgIfaceListener<T extends BinaryMsgIface>
- Throws:
Exception
-
onDisconnect
CallsonIfaceDisconnect()
- Specified by:
onDisconnect
in interfaceBinaryMsgIfaceListener<T extends BinaryMsgIface>
- Throws:
Exception
-