|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.command.CommandHandler
public abstract class CommandHandler
Defines the work that a command performs.
For more information about using this class, see the package overview.
Constructor Summary | ||
---|---|---|
CommandHandler()
Create a CommandHandler instance. |
Method Summary | ||
---|---|---|
boolean |
canExecute(ReadOnlyCommandMetadata metadata,
Object context)
Determines whether a call to execute() is valid using the passed-in context object. |
|
abstract void |
execute(ReadOnlyCommandMetadata metadata,
Object context)
Implementations of this method can ignore the passed-in context object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandHandler()
Method Detail |
---|
public abstract void execute(ReadOnlyCommandMetadata metadata, Object context)
metadata
- Metadata that the CommandHandler
was registered with.
Cannot be modified.context
- External state information.public boolean canExecute(ReadOnlyCommandMetadata metadata, Object context)
execute()
is valid using the passed-in context object.
Implementations of this method can ignore the passed-in context object.
Note: Calling this method for
CommandHandler
instances retrieved from RemoteCommandRegistrarConnection
always returns true
. This is because of performance
concerns when looping over a list of command handlers and potentially calling this method
in different processes.
metadata
- Metadata that the CommandHandler
was registered with.
Cannot be modified.context
- External state information.
true
if the execute()
method can be called, false
otherwise.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal