Package org.km3net.clb.remote
Class Control
- java.lang.Object
-
- org.km3net.clb.remote.Control
-
public class Control extends java.lang.ObjectControl is the main entry point for CLB control. It offers high-level interface to most CLB functionality. Each Control instance only relates to one DOM. Control uses an asynchronous command / reply semantics, therefore its high level call will return a 'Response' object. This allows for the batching of multiple commands:
All command sections have there own public final field, which you can use to easly access its functions.control.setBatchMode(true); Response<int[]> resp1 = control.dbg.readAddress(0x3000, 10); Response<int[]> resp2 = control.dbg.readAddress(0x3000, 10); for (Integer addr : resp1.get()) // Only now the request is send is send, and the replies System.out.println(addr); // processed. for (Integer addr : resp2.get()) System.out.println(addr);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classControl.CommandGroupA command group implements a group of CLB commands belonging to a specific functional section of the CLB.
-
Field Summary
Fields Modifier and Type Field Description CmdBasebseExposes the base features.CmdLogicBoardclbController Logic BoardCmdDebugdbgThis section contains commands for the debug group.CmdInstrumentationinsContains commands for controlling the instrumentation.CmdNetworknetContains commands for controlling the network and WhiteRabbitCmdSystemsysThis section contains commands for the system group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this Control class.voidflush()Flushes all pending commands or events, sending them to the remote side.MessageProcessorgetProcessor()booleanisBatchMode()Whether or not this control is in batch mode.booleanisBroadcast()voidsetBatchMode(boolean batch)Sets the batching mode.
-
-
-
Field Detail
-
dbg
public final CmdDebug dbg
This section contains commands for the debug group.
-
sys
public final CmdSystem sys
This section contains commands for the system group.
-
clb
public final CmdLogicBoard clb
Controller Logic Board
-
net
public final CmdNetwork net
Contains commands for controlling the network and WhiteRabbit
-
ins
public final CmdInstrumentation ins
Contains commands for controlling the instrumentation.
-
bse
public final CmdBase bse
Exposes the base features.
-
-
Constructor Detail
-
Control
public Control(java.net.Inet4Address addr) throws java.io.IOExceptionCreate a new control instance. Usually a Control instance is bound to a specific dom. However, it is possible to create a broad-casting socket using the specific broadcast IP address. Using a broad-casting IP will make it impossible to send and receive anything but events.- Parameters:
addr- The IPv4 address of the DOM or a broadcasting address for creating a broadcast socket.- Throws:
java.io.IOException- See Also:
- http://en.wikipedia.org/wiki/Broadcast_address
-
Control
public Control(int v1, int v2, int v3, int v4) throws java.io.IOException- Throws:
java.io.IOException
-
Control
public Control(java.lang.String text) throws java.net.UnknownHostException, java.io.IOException- Throws:
java.net.UnknownHostExceptionjava.io.IOException
-
-
Method Detail
-
setBatchMode
public void setBatchMode(boolean batch)
Sets the batching mode. When in batching mode as much commands as possible are queued before send. To force an explicit sending, useflush()- Parameters:
batch-trueto enable batch mode,falseto disable.
-
getProcessor
public MessageProcessor getProcessor()
-
flush
public void flush()
Flushes all pending commands or events, sending them to the remote side.
-
isBatchMode
public boolean isBatchMode()
Whether or not this control is in batch mode.- Returns:
trueif it is,falseotherwise.
-
isBroadcast
public boolean isBroadcast()
-
close
public void close() throws java.lang.InterruptedExceptionCloses this Control class.- Throws:
java.lang.InterruptedException- If interrupted.
-
-