Package ej.rcommand.comm
Class RemoteCommandCommPopulator
- java.lang.Object
-
- ej.rcommand.comm.RemoteCommandCommPopulator
-
- All Implemented Interfaces:
ConnectivityManager
public class RemoteCommandCommPopulator extends Object implements ConnectivityManager
Adds a comm connection in the Rcommand manager.
-
-
Constructor Summary
Constructors Constructor Description RemoteCommandCommPopulator(String connectionString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnectivityListener(ConnectivityListener listener)Adds a listener.intgetAvailable()Returns the numbers of available connections.StringgetConnectionInfo()Returns a String representing how the service can be joined from remote clients.voidremoveConnectivityListener(ConnectivityListener listener)Removes a listener.voidstart(RemoteCommandManager commandManager)Creates the comm connection and adds it in the given remote command manager.voidstop()Stops the reading of the comm connection and closes it.
-
-
-
Constructor Detail
-
RemoteCommandCommPopulator
public RemoteCommandCommPopulator(String connectionString)
- Parameters:
connectionString- the connection string of the comm connection to create.
-
-
Method Detail
-
start
public void start(RemoteCommandManager commandManager) throws IOException
Creates the comm connection and adds it in the given remote command manager.- Parameters:
commandManager- the command manager to use to manage the created comm connection.- Throws:
IOException- if a I/O error occurs.
-
stop
public void stop()
Stops the reading of the comm connection and closes it.
-
getAvailable
public int getAvailable()
Description copied from interface:ConnectivityManagerReturns the numbers of available connections.- Specified by:
getAvailablein interfaceConnectivityManager- Returns:
- the numbers of available connections.
-
getConnectionInfo
public String getConnectionInfo()
Description copied from interface:ConnectivityManagerReturns a String representing how the service can be joined from remote clients.Examples of such strings are:
192.168.0.1:4000for a service listening on a TCP port on these addresses and ports.for a service listening on a TCP port on these addresses and ports.comm:com6;baudrate=115200for a service listening on a COMM port with these parameters
- Specified by:
getConnectionInfoin interfaceConnectivityManager- Returns:
- the connectivity URL, as a String.
-
addConnectivityListener
public void addConnectivityListener(ConnectivityListener listener)
Description copied from interface:ConnectivityManagerAdds a listener.- Specified by:
addConnectivityListenerin interfaceConnectivityManager- Parameters:
listener- the listener.
-
removeConnectivityListener
public void removeConnectivityListener(ConnectivityListener listener)
Description copied from interface:ConnectivityManagerRemoves a listener.- Specified by:
removeConnectivityListenerin interfaceConnectivityManager- Parameters:
listener- the listener.
-
-