org.gcube.common.core.contexts.service
Class Consumer

java.lang.Object
  extended by org.gcube.common.core.contexts.service.Consumer
All Implemented Interfaces:
GCUBEConsumer<GCUBEServiceContext.RILifetimeTopic,GCUBEServiceContext>
Direct Known Subclasses:
GCUBEPortTypeContext.PTConsumer, GCUBERIPersistenceManager.StateChangeConsumer, GCUBEServiceContext.Stager

public class Consumer
extends Object
implements GCUBEConsumer<GCUBEServiceContext.RILifetimeTopic,GCUBEServiceContext>

Partial implemention of GCUBEConsumer of RI lifetime events.

Author:
Fabio Simeoni (University of Strathclyde)

Field Summary
protected  GCUBELog consumerLogger
          Object logger.
 
Constructor Summary
Consumer()
           
 
Method Summary
 GCUBEServiceContext.RILifetimeTopic[] getTopics()
          Returns the list of topics handled by the consumer.
<T1 extends GCUBEServiceContext.RILifetimeTopic,P1 extends GCUBEServiceContext>
void
onEvent(GCUBEEvent<T1,P1>... events)
          Receives RI lifetime events and dispatches them to topic-specific callbacks.
protected  void onGHNShutdown(GCUBEServiceContext.RILifetimeEvent event)
          gHN shutdown even.
protected  void onRIDeployed(GCUBEServiceContext.RILifetimeEvent event)
          Deployment event callback.
protected  void onRIFailed(GCUBEServiceContext.RILifetimeEvent event)
          Failure event callback.
protected  void onRIInitialised(GCUBEServiceContext.RILifetimeEvent event)
          Initialisation event callback.
protected  void onRIReady(GCUBEServiceContext.RILifetimeEvent event)
          Ready event callback.
protected  void onRIStateChange(GCUBEServiceContext.RILifetimeEvent event)
          State change event callback.
protected  void onRIUpdated(GCUBEServiceContext.RILifetimeEvent event)
          Update event callback.
 void setLogger(GCUBELog logger)
          Sets the instance logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumerLogger

protected GCUBELog consumerLogger
Object logger.

Constructor Detail

Consumer

public Consumer()
Method Detail

setLogger

public void setLogger(GCUBELog logger)
Sets the instance logger.

Parameters:
logger - the logger;

onEvent

public <T1 extends GCUBEServiceContext.RILifetimeTopic,P1 extends GCUBEServiceContext> void onEvent(GCUBEEvent<T1,P1>... events)
Receives RI lifetime events and dispatches them to topic-specific callbacks.

Specified by:
onEvent in interface GCUBEConsumer<GCUBEServiceContext.RILifetimeTopic,GCUBEServiceContext>
Type Parameters:
T1 - the topic type.
P1 - the payload type.
Parameters:
events - the events.

getTopics

public GCUBEServiceContext.RILifetimeTopic[] getTopics()
Returns the list of topics handled by the consumer.

Returns:
the topics.

onGHNShutdown

protected void onGHNShutdown(GCUBEServiceContext.RILifetimeEvent event)
                      throws Exception
gHN shutdown even. callback

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIDeployed

protected void onRIDeployed(GCUBEServiceContext.RILifetimeEvent event)
                     throws Exception
Deployment event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIInitialised

protected void onRIInitialised(GCUBEServiceContext.RILifetimeEvent event)
                        throws Exception
Initialisation event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIReady

protected void onRIReady(GCUBEServiceContext.RILifetimeEvent event)
                  throws Exception
Ready event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIFailed

protected void onRIFailed(GCUBEServiceContext.RILifetimeEvent event)
                   throws Exception
Failure event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIUpdated

protected void onRIUpdated(GCUBEServiceContext.RILifetimeEvent event)
                    throws Exception
Update event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.

onRIStateChange

protected void onRIStateChange(GCUBEServiceContext.RILifetimeEvent event)
                        throws Exception
State change event callback.

Parameters:
event - the event.
Throws:
Exception - if the callback could not complete successfully.


Copyright © 2012. All Rights Reserved.