|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface OutSlot.Listener
Allows to receive information about the status of an OutSlot.
You can implement this interface by your own classes
and add instances of these classes to OutSlots
by using the addListener
method. In this case, the OutSlot calls methods of this
interface when special events occur. These events are:
InSlot
connects to the
OutSlot, i.e. you should start providing
data values to the OutSlot. When this
event happens, the startOutSlot
method
of the listener gets called.
stopOutSlot
method
of the listener gets called.
Also keep in mind that these methods do not get called by the main thread of your application, but from other threads created in the device management system. For this reason, you have to ensure that your implementation of these methods is thread-safe!
The following example demonstrates how to create an anonymous class that implemenents the listener interface and calls methods of the enclosing class:
public class Sender { private static void startOutSlot(OutSlot outSlot) { ... } private static void stopOutSlot(OutSlot outSlot) { ... } public static void main(String[] args) { ... OutSlot outSlot = ...; outSlot.addListener( new OutSlot.Listener() { public void startOutSlot(OutSlot outSlot) { Sender.startOutSlot(outSlot); } public void stopOutSlot(OutSlot outSlot) { Sender.stopOutSlot(outSlot); } } ); ... } }
Method Summary | |
---|---|
void |
startOutSlot(OutSlot outSlot)
Gets called when an OutSlot gets connected to the first InSlot. |
void |
stopOutSlot(OutSlot outSlot)
Gets called when an OutSlot gets disconnected from the last InSlot. |
Method Detail |
---|
void startOutSlot(OutSlot outSlot)
You can use this callback to get a notification when you should start writing values to an OutSlot.
Please keep in mind that you should not block under any circumstance in this methods, and you should not perform time-consuming tasks. This method is just meant to do short notifications about the event.
Also keep in mind that this method does not get called by the main thread of your application, but from other threads created in the device management system. For this reason, you have to ensure that your implementation of this method is thread-safe!
outSlot
- The OutSlot that generated the event.void stopOutSlot(OutSlot outSlot)
You can use this callback to get a notification when you can stop writing values to an OutSlot.
Please keep in mind that you should not block under any circumstance in this methods, and you should not perform time-consuming tasks. This method is just meant to do short notifications about the event.
Also keep in mind that this method does not get called by the main thread of your application, but from other threads created in the device management system. For this reason, you have to ensure that your implementation of this method is thread-safe!
outSlot
- The OutSlot that generated the event.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |