Package org.km3net.clb.remote
Class Control
- java.lang.Object
-
- org.km3net.clb.remote.Control
-
public class Control extends java.lang.Object
Control 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: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 class
Control.CommandGroup
A 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 CmdBase
bse
Exposes the base features.CmdLogicBoard
clb
Controller Logic BoardCmdDebug
dbg
This section contains commands for the debug group.CmdInstrumentation
ins
Contains commands for controlling the instrumentation.CmdNetwork
net
Contains commands for controlling the network and WhiteRabbitCmdSystem
sys
This section contains commands for the system group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this Control class.void
flush()
Flushes all pending commands or events, sending them to the remote side.MessageProcessor
getProcessor()
boolean
isBatchMode()
Whether or not this control is in batch mode.boolean
isBroadcast()
void
setBatchMode(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.IOException
Create 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.UnknownHostException
java.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
-true
to enable batch mode,false
to 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:
true
if it is,false
otherwise.
-
isBroadcast
public boolean isBroadcast()
-
close
public void close() throws java.lang.InterruptedException
Closes this Control class.- Throws:
java.lang.InterruptedException
- If interrupted.
-
-