T
- public abstract class ExtensionManager<T extends ExtensionHandler> extends Object implements InvocationHandler
ExtensionResultStatusType
to determine whether or not to continue with other handlers.Modifier and Type | Field and Description |
---|---|
protected T |
extensionHandler |
protected List<T> |
handlers |
protected boolean |
handlersSorted |
protected static String |
LOCK_OBJECT |
Constructor and Description |
---|
ExtensionManager(Class<T> _clazz)
Should take in a className that matches the ExtensionHandler interface being managed.
|
Modifier and Type | Method and Description |
---|---|
boolean |
continueOnHandled()
Returns whether or not this extension manager continues on
ExtensionResultStatusType .HANDLED. |
protected ExtensionResultStatusType |
execute(ExtensionManagerOperation operation,
Object... params)
Provides a mechanism for executing multiple extension handler touchpoints without utilizing reflection.
|
List<T> |
getHandlers()
If you are attempting to register a handler with this manager and are invoking this outside of an
ExtensionManager
subclass, consider using registerHandler(ExtensionHandler) instead. |
int |
getPriority()
ExtensionManager s don't really need a priority but they pick up this property due to the
fact that we want them to implement the same interface |
T |
getProxy() |
Object |
invoke(Object proxy,
Method method,
Object[] args) |
boolean |
registerHandler(T handler)
Intended to be invoked from the extension handlers themselves.
|
void |
setHandlers(List<T> handlers) |
boolean |
shouldContinue(ExtensionResultStatusType result,
ExtensionHandler handler,
Method method,
Object[] args)
Utility method that is useful for determining whether or not an ExtensionManager implementation
should continue after processing a ExtensionHandler call.
|
protected void |
sortHandlers() |
protected boolean handlersSorted
protected static String LOCK_OBJECT
protected T extends ExtensionHandler extensionHandler
protected List<T extends ExtensionHandler> handlers
public T getProxy()
public List<T> getHandlers()
ExtensionManager
subclass, consider using registerHandler(ExtensionHandler)
instead.
While the sorting of the handlers prior to their return is thread safe, adding directly to this list is not.#registerHandler(ExtensionHandler)}
protected void sortHandlers()
public boolean registerHandler(T handler)
ExtensionManager
by checking the class names of the already-added handlers.
This method is thread safe.handler
- the handler to register with this extension managerpublic boolean shouldContinue(ExtensionResultStatusType result, ExtensionHandler handler, Method method, Object[] args)
public boolean continueOnHandled()
ExtensionResultStatusType
.HANDLED.public int getPriority()
ExtensionManager
s don't really need a priority but they pick up this property due to the
fact that we want them to implement the same interface public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
Throwable
protected ExtensionResultStatusType execute(ExtensionManagerOperation operation, Object... params)
operation
- params
- Copyright © 2022. All rights reserved.