|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.common.extension.ExtensionManager<T>
T - public abstract class ExtensionManager<T extends ExtensionHandler>
The ExtensionManager pattern is intended for out of box components to be extended by Broadleaf modules.
Each component that needs an extension should define an interface which is a descendant of ExtensionHandler.
The concrete ExtensionManager class will utilize that interface as a parameter (e.g. T below).
The default extension manager pattern loops through all handlers and examines their ExtensionResultStatusType
to determine whether or not to continue with other handlers.
| Field Summary | |
|---|---|
protected T |
extensionHandler
|
protected List<T> |
handlers
|
protected boolean |
handlersSorted
|
protected static String |
LOCK_OBJECT
|
| Constructor Summary | |
|---|---|
ExtensionManager(Class<T> _clazz)
Should take in a className that matches the ExtensionHandler interface being managed. |
|
| Method Summary | |
|---|---|
boolean |
continueOnHandled()
Returns whether or not this extension manager continues on ExtensionResultStatusType.HANDLED. |
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()
ExtensionManagers 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean handlersSorted
protected static String LOCK_OBJECT
protected T extends ExtensionHandler extensionHandler
protected List<T extends ExtensionHandler> handlers
| Constructor Detail |
|---|
public ExtensionManager(Class<T> _clazz)
className - | Method Detail |
|---|
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)}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 manager
public void setHandlers(List<T> handlers)
public boolean shouldContinue(ExtensionResultStatusType result,
ExtensionHandler handler,
Method method,
Object[] args)
public boolean continueOnHandled()
ExtensionResultStatusType.HANDLED.
public int getPriority()
ExtensionManagers 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 InvocationHandlerThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||