hu.mta.sztaki.lpds.cloud.simulator.iaas.statenotifications
Class PowerStateChangeNotificationHandler

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.statenotifications.PowerStateChangeNotificationHandler
All Implemented Interfaces:
SingleNotificationHandler<PowerBehaviorChangeListener,org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState>>

public class PowerStateChangeNotificationHandler
extends Object
implements SingleNotificationHandler<PowerBehaviorChangeListener,org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState>>

implements a notification handler for sending out notifications about power state changes in resource spreaders

Author:
"Gabor Kecskemeti, Laboratory of Parallel and Distributed Systems, MTA SZTAKI (c) 2015"

Field Summary
private static PowerStateChangeNotificationHandler handlerSingleton
          the single object that will handle all notification operations on the same way
 
Constructor Summary
private PowerStateChangeNotificationHandler()
          disables the instantiation of the handler so we really just have a single instance for all handling operations
 
Method Summary
static StateDependentEventHandler<PowerBehaviorChangeListener,org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState>> getHandlerInstance()
          gets the event handler that will manage the notification subscriptions for the particular resource spreader object that asked for the handler.
 void sendNotification(PowerBehaviorChangeListener onObject, org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState> newPowerBehavior)
          The event handling mechanism for power state change notifications about resource spreaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlerSingleton

private static final PowerStateChangeNotificationHandler handlerSingleton
the single object that will handle all notification operations on the same way

Constructor Detail

PowerStateChangeNotificationHandler

private PowerStateChangeNotificationHandler()
disables the instantiation of the handler so we really just have a single instance for all handling operations

Method Detail

getHandlerInstance

public static StateDependentEventHandler<PowerBehaviorChangeListener,org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState>> getHandlerInstance()
gets the event handler that will manage the notification subscriptions for the particular resource spreader object that asked for the handler.

Returns:
the eventh handler

sendNotification

public void sendNotification(PowerBehaviorChangeListener onObject,
                             org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState> newPowerBehavior)
The event handling mechanism for power state change notifications about resource spreaders

Specified by:
sendNotification in interface SingleNotificationHandler<PowerBehaviorChangeListener,org.apache.commons.lang3.tuple.Pair<ResourceSpreader,PowerState>>
Parameters:
onObject - The listener to send the event to
newPowerBehavior - a data pair containing the resource spreader that changed its state and the power state that the spreader just switches to.


Copyright © 2012–2015 University of Innsbruck & MTA SZTAKI. All rights reserved.