Package ej.rcommand
Interface CommandSenderProvider
-
- All Known Subinterfaces:
RemoteCommandManager
- All Known Implementing Classes:
DefaultRemoteCommandManager,GatewayRemoteCommandManager
public interface CommandSenderProviderProvides a list of active connections.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<? extends CommandSender>getCommandSenders(String command)Returns the command senders that handle the given command.Collection<String>getRegisteredCommands()Gets the collections of registered commands withregisterListener(RemoteCommandListener).voidregisterListener(RemoteCommandListener listener)Registers a listener that will be called when command managed by the listener is read.
-
-
-
Method Detail
-
getCommandSenders
Collection<? extends CommandSender> getCommandSenders(String command)
Returns the command senders that handle the given command.Synchronize on this
CommandSenderProviderwhile using the returned collection to avoid concurrent modifications of the collection.
-
registerListener
void registerListener(RemoteCommandListener listener) throws IllegalStateException
Registers a listener that will be called when command managed by the listener is read.- Parameters:
listener- the listener to register- Throws:
IllegalStateException- if a listener is already registered for a command managed by the listener
-
getRegisteredCommands
Collection<String> getRegisteredCommands()
Gets the collections of registered commands withregisterListener(RemoteCommandListener).- Returns:
- the collections of registered commands
-
-