org.gcube.common.core.utils.handlers
Class GCUBEHandlerConnector<T,PREVIOUS extends GCUBEIHandler<? extends T>,NEXT extends GCUBEIHandler<? extends T>>

java.lang.Object
  extended by org.gcube.common.core.utils.handlers.GCUBEHandler<T>
      extended by org.gcube.common.core.utils.handlers.GCUBEHandlerConnector<T,PREVIOUS,NEXT>
Type Parameters:
PREVIOUS - the type of component handler which immediately precedes the connector.
NEXT - the type of component handler which immediately follows the connector.
All Implemented Interfaces:
GCUBEIHandler<T>

public abstract class GCUBEHandlerConnector<T,PREVIOUS extends GCUBEIHandler<? extends T>,NEXT extends GCUBEIHandler<? extends T>>
extends GCUBEHandler<T>

Abstract implementation of component handlers used to connect the output of those which immediately precede them with the input of those which immediately follow them.

Author:
Fabio Simeoni (University of Strathclyde)

Field Summary
protected  NEXT next
          The component handler which follows the connector.
protected  PREVIOUS previous
          The component handler which precedes the connector.
 
Fields inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler
handled, logger, producer
 
Constructor Summary
GCUBEHandlerConnector()
           
 
Method Summary
abstract  void connect()
          Invoked by {run(), defines the connections between the {previous and the {next component handlers.
 NEXT getNext()
          Return the component handler which follows the connector.
 PREVIOUS getPrevious()
          Return the component handler which precedes the connector.
 void run()
          Executes the task implemented by the handler.
 
Methods inherited from class org.gcube.common.core.utils.handlers.GCUBEHandler
clearBlackboard, getBlackboard, getHandled, getId, getLogger, getName, getScopeManager, getSecurityManager, getState, notify, setBlackboard, setHandled, setLogger, setName, setScopeManager, setSecurityManager, setState, subscribe, undo, unsubscribe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

previous

protected PREVIOUS extends GCUBEIHandler<? extends T> previous
The component handler which precedes the connector.


next

protected NEXT extends GCUBEIHandler<? extends T> next
The component handler which follows the connector.

Constructor Detail

GCUBEHandlerConnector

public GCUBEHandlerConnector()
Method Detail

getPrevious

public PREVIOUS getPrevious()
Return the component handler which precedes the connector.

Returns:
the component handler.

getNext

public NEXT getNext()
Return the component handler which follows the connector.

Returns:
the component handler.

run

public final void run()
               throws Exception
Executes the task implemented by the handler.

Specified by:
run in interface GCUBEIHandler<T>
Specified by:
run in class GCUBEHandler<T>
Throws:
Exception - if the execution of the task does not complete normally.

connect

public abstract void connect()
                      throws Exception
Invoked by {run(), defines the connections between the {previous and the {next component handlers. Implement to define specific connections.

Throws:
Exception


Copyright © 2012. All Rights Reserved.