Attach an invocation listener.
Invocation handlers are called in order that their listeners are
registered with a
ParametricBuilder. It is not guaranteed that
a listener may be called, in the case of a
CommandException being
thrown at any time before the appropriate listener or handler is called.
It is possible for a
InvokeHandler#preInvoke(Object,Method,ParameterData[],Object[],CommandContext) to
be called for a invocation handler, but not the associated
InvokeHandler#postInvoke(Object,Method,ParameterData[],Object[],CommandContext).
An example of an invocation listener is one to handle
CommandPermissions, by first checking to see if permission is available
in a
InvokeHandler#preInvoke(Object,Method,ParameterData[],Object[],CommandContext)call. If permission is not found, then an appropriate
CommandExceptioncan be thrown to cease invocation.