org.ow2.jasmine.vmm.agent.domain
Class ServerPool

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jasmine.vmm.agent.domain.ManagedResource
          extended by org.ow2.jasmine.vmm.agent.domain.ServerPool
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.ow2.jasmine.vmm.api.ManagedResourceMXBean, org.ow2.jasmine.vmm.api.ServerPoolMXBean
Direct Known Subclasses:
HyperVServerPool, LibvirtServerPool, XenServerPool

public abstract class ServerPool
extends ManagedResource
implements org.ow2.jasmine.vmm.api.ServerPoolMXBean

Base class partially implementing the ServerPoolMXBean interface and expected to be sub-classed on a per driver basis.

A ServerPool is associated with a VM placement policy which determines where a provisioned VM is to be placed on one host among the members of the server pool


Field Summary
protected  java.util.Map<java.lang.String,java.lang.String> attributes
           
protected  java.util.List<org.ow2.jasmine.vmm.api.HostMXBean> hosts
           
protected static org.apache.log4j.Logger logger
           
protected  VMPlacementPolicy placementPolicy
           
protected  java.lang.String servername
           
 
Fields inherited from class org.ow2.jasmine.vmm.agent.domain.ManagedResource
objectName, path
 
Constructor Summary
ServerPool(java.lang.String name, javax.management.ObjectName objectName, java.util.Map<java.lang.String,java.lang.String> attributes)
          Constructs a new server pool
 
Method Summary
protected  void addHost(org.ow2.jasmine.vmm.api.HostMXBean host)
          Adds a new host to the server pool
 org.ow2.jasmine.vmm.api.HostMXBean addHost(java.util.Map<java.lang.String,java.lang.String> attributes)
           
 void deleteHost(org.ow2.jasmine.vmm.api.HostMXBean host)
           
abstract  void deleteImageStore()
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
           
 org.ow2.jasmine.vmm.api.HostMXBean getLatestHost()
           
 java.util.List<org.ow2.jasmine.vmm.api.HostMXBean> getManagedHosts()
           
 java.lang.String getName()
           
 javax.management.MBeanNotificationInfo[] getNotificationInfo()
           
abstract  org.ow2.jasmine.vmm.api.VirtualMachineImageStoreMXBean getVMImageStore()
           
 void moveHost(org.ow2.jasmine.vmm.api.HostMXBean host, org.ow2.jasmine.vmm.api.ServerPoolMXBean server)
           
abstract  org.ow2.jasmine.vmm.api.HostMXBean newHost(java.lang.String hostName, java.util.Map<java.lang.String,java.lang.String> props)
           
 org.ow2.jasmine.vmm.api.VirtualMachineMXBean provisionVM(org.ow2.jasmine.vmm.api.VMConfigSpec vmSpec, java.util.Map<java.lang.String,java.lang.String> constraints, boolean sync)
           
 void setProvisioningPolicy(java.lang.String policyId)
           
 
Methods inherited from class org.ow2.jasmine.vmm.agent.domain.ManagedResource
emitNotification, emitNotification, getObjectName, getPath
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.jasmine.vmm.api.ServerPoolMXBean
getHypervisor
 
Methods inherited from interface org.ow2.jasmine.vmm.api.ManagedResourceMXBean
getObjectName, getPath
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

servername

protected java.lang.String servername

attributes

protected java.util.Map<java.lang.String,java.lang.String> attributes

hosts

protected final java.util.List<org.ow2.jasmine.vmm.api.HostMXBean> hosts

placementPolicy

protected VMPlacementPolicy placementPolicy
Constructor Detail

ServerPool

public ServerPool(java.lang.String name,
                  javax.management.ObjectName objectName,
                  java.util.Map<java.lang.String,java.lang.String> attributes)
Constructs a new server pool

Parameters:
name - symbolic name of the server pool
objectName - JMX object name of the server pool
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean

newHost

public abstract org.ow2.jasmine.vmm.api.HostMXBean newHost(java.lang.String hostName,
                                                           java.util.Map<java.lang.String,java.lang.String> props)
                                                    throws org.ow2.jasmine.vmm.api.VMMException
Throws:
org.ow2.jasmine.vmm.api.VMMException

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Specified by:
getAttributes in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean

addHost

protected void addHost(org.ow2.jasmine.vmm.api.HostMXBean host)
Adds a new host to the server pool

Parameters:
host - host to add

addHost

public org.ow2.jasmine.vmm.api.HostMXBean addHost(java.util.Map<java.lang.String,java.lang.String> attributes)
                                           throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
addHost in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

deleteHost

public void deleteHost(org.ow2.jasmine.vmm.api.HostMXBean host)
                throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
deleteHost in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

moveHost

public void moveHost(org.ow2.jasmine.vmm.api.HostMXBean host,
                     org.ow2.jasmine.vmm.api.ServerPoolMXBean server)
              throws org.ow2.jasmine.vmm.api.VMMException
Specified by:
moveHost in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean
Throws:
org.ow2.jasmine.vmm.api.VMMException

setProvisioningPolicy

public void setProvisioningPolicy(java.lang.String policyId)
Specified by:
setProvisioningPolicy in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean

provisionVM

public org.ow2.jasmine.vmm.api.VirtualMachineMXBean provisionVM(org.ow2.jasmine.vmm.api.VMConfigSpec vmSpec,
                                                                java.util.Map<java.lang.String,java.lang.String> constraints,
                                                                boolean sync)
                                                         throws org.ow2.jasmine.vmm.api.InsufficientResourcesException,
                                                                org.ow2.jasmine.vmm.api.InvalidVMConfigException,
                                                                org.ow2.jasmine.vmm.api.VMMException
Specified by:
provisionVM in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean
Throws:
org.ow2.jasmine.vmm.api.InsufficientResourcesException
org.ow2.jasmine.vmm.api.InvalidVMConfigException
org.ow2.jasmine.vmm.api.VMMException

getVMImageStore

public abstract org.ow2.jasmine.vmm.api.VirtualMachineImageStoreMXBean getVMImageStore()
Specified by:
getVMImageStore in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean

deleteImageStore

public abstract void deleteImageStore()

getManagedHosts

public java.util.List<org.ow2.jasmine.vmm.api.HostMXBean> getManagedHosts()
Specified by:
getManagedHosts in interface org.ow2.jasmine.vmm.api.ServerPoolMXBean

getLatestHost

public org.ow2.jasmine.vmm.api.HostMXBean getLatestHost()

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Overrides:
getNotificationInfo in class javax.management.NotificationBroadcasterSupport


Copyright © 2011 OW2 Consortium. All Rights Reserved.