public class CommandLoggingHandler extends AbstractInvokeListener implements InvokeHandler, java.io.Closeable
Constructor and Description |
---|
CommandLoggingHandler(WorldEdit worldEdit,
java.util.logging.Logger logger)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
InvokeHandler |
createInvokeHandler()
Create a new invocation handler.
|
void |
postInvoke(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
java.lang.Object[] args,
CommandContext context)
Called after the parameter is invoked.
|
void |
preInvoke(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
java.lang.Object[] args,
CommandContext context)
Called before the parameter is invoked.
|
void |
preProcess(java.lang.Object object,
java.lang.reflect.Method method,
ParameterData[] parameters,
CommandContext context)
Called before parameters are processed.
|
updateDescription
public CommandLoggingHandler(WorldEdit worldEdit, java.util.logging.Logger logger)
worldEdit
- an instance of WorldEditlogger
- the logger to send messages topublic void preProcess(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, CommandContext context) throws CommandException, ParameterException
InvokeHandler
preProcess
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parameterscontext
- the contextCommandException
- can be thrown for an error, which will stop invocationParameterException
- on parameter errorpublic void preInvoke(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, java.lang.Object[] args, CommandContext context) throws CommandException
InvokeHandler
preInvoke
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parametersargs
- the arguments to be given to the methodcontext
- the contextCommandException
- can be thrown for an error, which will stop invocationpublic void postInvoke(java.lang.Object object, java.lang.reflect.Method method, ParameterData[] parameters, java.lang.Object[] args, CommandContext context) throws CommandException
InvokeHandler
postInvoke
in interface InvokeHandler
object
- the objectmethod
- the methodparameters
- the list of parametersargs
- the arguments to be given to the methodcontext
- the contextCommandException
- can be thrown for an errorpublic InvokeHandler createInvokeHandler()
InvokeListener
An example use of an InvokeHandler
would be to verify permissions
added by the CommandPermissions
annotation.
For simple InvokeHandler
, an object can implement both this
interface and InvokeHandler
.
createInvokeHandler
in interface InvokeListener
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable