org.glassfish.virtualization.spi
Interface AllocationStrategy


public interface AllocationStrategy

An allocation strategy is responsible for allocating virtual machines given a set of server pools and machines within these server pools.

Author:
Jerome Dochez

Method Summary
 PhasedFuture<AllocationPhase,VirtualMachine> allocate(Collection<ServerPool> serverPools, AllocationConstraints constraints, List<Listener<AllocationPhase>> listeners)
          allocate a virtual machine within the provided server pools, notifying of progress all listeners
 ServerPoolAllocationStrategy getServerPoolStrategy(ServerPool serverPool)
          Returns the server pool allocation strategy for a particular server pool instance.
 

Method Detail

allocate

PhasedFuture<AllocationPhase,VirtualMachine> allocate(Collection<ServerPool> serverPools,
                                                      AllocationConstraints constraints,
                                                      List<Listener<AllocationPhase>> listeners)
                                                      throws VirtException
allocate a virtual machine within the provided server pools, notifying of progress all listeners

Parameters:
serverPools - the server pools elligible to run the virtual machine
constraints - the virtual machine requested characteristics
listeners - listeners to register before any work is performed
Returns:
a phased future implementation that can be used to monitor progress and get the result of the allocation as VirtualMachine instance.
Throws:
VirtException - if the allocation failed.

getServerPoolStrategy

ServerPoolAllocationStrategy getServerPoolStrategy(ServerPool serverPool)
Returns the server pool allocation strategy for a particular server pool instance.

Parameters:
serverPool - the server pool instance
Returns:
the server pool allocation strategy


Copyright © 2012. All Rights Reserved.