|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.core.utils.handlers.GCUBEHandler<HANDLED>
org.gcube.common.core.utils.handlers.GCUBEComplexHandler<HANDLED>
HANDLED - the type of the object handled by the component handlers.public abstract class GCUBEComplexHandler<HANDLED>
An abstract extension of GCUBEHandler that manages one or more
component handlers.
A GCUBEComplexHandler may
constrain its components to handle objects of the same type (by instantiating the type parameter
to a type other than Object).
In turn, the component handlers may be built so as to share
the same handled object.
| Field Summary |
|---|
| Fields inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler |
|---|
handled, logger, producer |
| Constructor Summary | |
|---|---|
GCUBEComplexHandler(GCUBEIHandler<? extends HANDLED>... components)
Creates an instance with a list of component handlers. |
|
| Method Summary | |
|---|---|
void |
addHandlers(GCUBEIHandler<? extends HANDLED>... components)
Adds one or more handlers to the list of component handlers. |
List<GCUBEIHandler<? extends HANDLED>> |
getHandlers()
Returns the component handlers. |
boolean |
removeHandler(GCUBEIHandler<? extends HANDLED> component)
Removes (the first occurrence of) a handler from the list of component handlers. |
void |
setLogger(GCUBELog logger)
Sets the logger. |
void |
undo()
Reverts the actions of the handler. |
| Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler |
|---|
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getScopeManager, getSecurityManager, getState, notify, run, setBlackboard, setHandled, setName, setScopeManager, setSecurityManager, setState, subscribe, unsubscribe |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GCUBEComplexHandler(GCUBEIHandler<? extends HANDLED>... components)
components - the component handlers.| Method Detail |
|---|
public void addHandlers(GCUBEIHandler<? extends HANDLED>... components)
throws IllegalArgumentException
components - the handlers.
IllegalArgumentExceptionpublic void setLogger(GCUBELog logger)
setLogger in interface GCUBEIHandler<HANDLED>setLogger in class GCUBEHandler<HANDLED>logger - the logger.public boolean removeHandler(GCUBEIHandler<? extends HANDLED> component)
component - the handler.
true if the handler was in the list, false otherwise.public List<GCUBEIHandler<? extends HANDLED>> getHandlers()
public void undo()
debug-logs the invocation.
If required, override as per handler semantics. For robustness, do not
assume the invocation occurs after the execution of the handler.
undo in interface GCUBEIHandler<HANDLED>undo in class GCUBEHandler<HANDLED>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||