GigaSpaces XAP 9.0 API

org.openspaces.grid.gsm.machines.plugins
Class NonBlockingElasticMachineProvisioningAdapter

java.lang.Object
  extended by org.openspaces.grid.gsm.machines.plugins.NonBlockingElasticMachineProvisioningAdapter
All Implemented Interfaces:
ElasticProcessingUnitMachineIsolationAware, NonBlockingElasticMachineProvisioning

public class NonBlockingElasticMachineProvisioningAdapter
extends Object
implements NonBlockingElasticMachineProvisioning

An adapter that wraps an ElasticMachineProvisioning and exposes a NonBlockingElasticMachineProvisioning

Author:
itaif
See Also:
NonBlockingElasticMachineProvisioning, ElasticMachineProvisioning

Constructor Summary
NonBlockingElasticMachineProvisioningAdapter(ProcessingUnit pu, ElasticMachineProvisioning machineProvisioning, ExecutorService executorService, ScheduledThreadPoolExecutor scheduledExecutorService)
           
 
Method Summary
 ElasticMachineProvisioningConfig getConfig()
           
 FutureGridServiceAgents getDiscoveredMachinesAsync(long duration, TimeUnit unit)
           
 boolean isStartMachineSupported()
           
 void setElasticProcessingUnitMachineIsolation(ElasticProcessingUnitMachineIsolation isolation)
           
 FutureGridServiceAgent[] startMachinesAsync(CapacityRequirements capacityRequirements, long duration, TimeUnit unit)
          Starts a new machine with a new grid service agent with the specified zone.
 void stopMachineAsync(GridServiceAgent agent, long duration, TimeUnit unit)
          Shuts down the grid service agent and the machine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonBlockingElasticMachineProvisioningAdapter

public NonBlockingElasticMachineProvisioningAdapter(ProcessingUnit pu,
                                                    ElasticMachineProvisioning machineProvisioning,
                                                    ExecutorService executorService,
                                                    ScheduledThreadPoolExecutor scheduledExecutorService)
Method Detail

startMachinesAsync

public FutureGridServiceAgent[] startMachinesAsync(CapacityRequirements capacityRequirements,
                                                   long duration,
                                                   TimeUnit unit)
Description copied from interface: NonBlockingElasticMachineProvisioning
Starts a new machine with a new grid service agent with the specified zone. All started machines must have Grid Service Agents with zones as defined by ElasticMachineProvisioningConfig.getGridServiceAgentZones() and ElasticMachineProvisioningConfig.isGridServiceAgentZoneMandatory() This method is non blocking and returns a future object with the new grid service agent.

Specified by:
startMachinesAsync in interface NonBlockingElasticMachineProvisioning
duration - - the maximum duration after which a TimeoutException is raised.
unit - - the time unit for the duration
Returns:
the grid service agent futures

stopMachineAsync

public void stopMachineAsync(GridServiceAgent agent,
                             long duration,
                             TimeUnit unit)
Description copied from interface: NonBlockingElasticMachineProvisioning
Shuts down the grid service agent and the machine. The implementation should be able to close machines that it has not started, but rather an older instance of this object started perhaps with different configuration. This method is non blocking and is idempotent.

Specified by:
stopMachineAsync in interface NonBlockingElasticMachineProvisioning

getDiscoveredMachinesAsync

public FutureGridServiceAgents getDiscoveredMachinesAsync(long duration,
                                                          TimeUnit unit)
Specified by:
getDiscoveredMachinesAsync in interface NonBlockingElasticMachineProvisioning
Parameters:
duration - - the maximum duration after which a TimeoutException is raised.
unit - - the time unit for the duration
Returns:
a future array of grid service agents that reside in the data center (or cloud region) defined in ElasticMachineProvisioningConfig The caller then filters the result using the criteria defined in ElasticMachineProvisioningConfig.getGridServiceAgentZones() , ElasticMachineProvisioningConfig.isGridServiceAgentZoneMandatory() and ElasticMachineProvisioningConfig.isDedicatedManagementMachines() so it is not mandatory for the implementation to do so.

getConfig

public ElasticMachineProvisioningConfig getConfig()
Specified by:
getConfig in interface NonBlockingElasticMachineProvisioning
Returns:
the configuration used by this object

isStartMachineSupported

public boolean isStartMachineSupported()
Specified by:
isStartMachineSupported in interface NonBlockingElasticMachineProvisioning
Returns:
true if this object supports starting and stopping of machines. False indicates that NonBlockingElasticMachineProvisioning.startMachinesAsync(CapacityRequirements, long, TimeUnit) and NonBlockingElasticMachineProvisioning.stopMachineAsync(GridServiceAgent, long, TimeUnit) raise UnsupportedOperationException

setElasticProcessingUnitMachineIsolation

public void setElasticProcessingUnitMachineIsolation(ElasticProcessingUnitMachineIsolation isolation)
Specified by:
setElasticProcessingUnitMachineIsolation in interface ElasticProcessingUnitMachineIsolationAware

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.