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

java.lang.Object
  extended by hu.mta.sztaki.lpds.cloud.simulator.iaas.statenotifications.VMStateChangeNotificationHandler
All Implemented Interfaces:
SingleNotificationHandler<VirtualMachine.StateChange,org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State>>

public class VMStateChangeNotificationHandler
extends Object
implements SingleNotificationHandler<VirtualMachine.StateChange,org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State>>

implements a notification handler for sending out notifications about VM state changes

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

Field Summary
private static VMStateChangeNotificationHandler handlerSingleton
          the singleton notification sender object that will send out all notifications about a VM state changes on a uniform way
 
Constructor Summary
private VMStateChangeNotificationHandler()
          disables the instantiation of the handler so we really just have a single instance for all handling operations
 
Method Summary
static StateDependentEventHandler<VirtualMachine.StateChange,org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State>> getHandlerInstance()
          gets the event handler that will manage the subscriptions for the particular VM object that asked for the handler.
 void sendNotification(VirtualMachine.StateChange onObject, org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State> stateData)
          The event handling mechanism for VM state change notifications
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlerSingleton

private static final VMStateChangeNotificationHandler handlerSingleton
the singleton notification sender object that will send out all notifications about a VM state changes on a uniform way

Constructor Detail

VMStateChangeNotificationHandler

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

Method Detail

getHandlerInstance

public static StateDependentEventHandler<VirtualMachine.StateChange,org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State>> getHandlerInstance()
gets the event handler that will manage the subscriptions for the particular VM object that asked for the handler. One should be requested for every VM that expects to send out state change notifications.

Returns:
the eventh handler

sendNotification

public void sendNotification(VirtualMachine.StateChange onObject,
                             org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State> stateData)
The event handling mechanism for VM state change notifications

Specified by:
sendNotification in interface SingleNotificationHandler<VirtualMachine.StateChange,org.apache.commons.lang3.tuple.Triple<VirtualMachine,VirtualMachine.State,VirtualMachine.State>>
Parameters:
onObject - The listener to send the event to
stateData - a data triplet containing the VM and its the past and future states.


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