GigaSpaces XAP 9.0 API

org.openspaces.grid.gsm.machines.plugins.discovered
Class DiscoveredMachineProvisioningBean

java.lang.Object
  extended by org.openspaces.grid.gsm.machines.plugins.discovered.DiscoveredMachineProvisioningBean
All Implemented Interfaces:
Bean, ElasticProcessingUnitMachineIsolationAware, NonBlockingElasticMachineProvisioning, ProcessingUnitAware

public class DiscoveredMachineProvisioningBean
extends Object
implements NonBlockingElasticMachineProvisioning, Bean, ProcessingUnitAware


Constructor Summary
DiscoveredMachineProvisioningBean()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a bean factory after it has set all bean properties.
 void destroy()
          Invoked by a bean factory on destruction of a singleton.
 ElasticMachineProvisioningConfig getConfig()
           
 FutureGridServiceAgents getDiscoveredMachinesAsync(long duration, TimeUnit unit)
           
 Map<String,String> getProperties()
           
 boolean isStartMachineSupported()
           
 void setAdmin(Admin admin)
          Set the Admin instance to be used by this Bean.
 void setElasticProcessingUnitMachineIsolation(ElasticProcessingUnitMachineIsolation isolation)
           
 void setProcessingUnit(ProcessingUnit pu)
           
 void setProcessingUnitSchema(org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig schemaConfig)
           
 void setProperties(Map<String,String> properties)
          The bean properties supplied using a client side bean configuration object, or by plain String key-value pairs.
 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

DiscoveredMachineProvisioningBean

public DiscoveredMachineProvisioningBean()
Method Detail

setAdmin

public void setAdmin(Admin admin)
Description copied from interface: Bean
Set the Admin instance to be used by this Bean.

Specified by:
setAdmin in interface Bean
Parameters:
admin - an Admin instance.

setProperties

public void setProperties(Map<String,String> properties)
Description copied from interface: Bean
The bean properties supplied using a client side bean configuration object, or by plain String key-value pairs.

Specified by:
setProperties in interface Bean
Parameters:
properties - properties to configure this bean.

getProperties

public Map<String,String> getProperties()
Specified by:
getProperties in interface Bean
Returns:
properties used to configure this bean.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from interface: Bean
Invoked by a bean factory after it has set all bean properties. This method allows the bean instance to perform non-blocking initialization, which is only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

Specified by:
afterPropertiesSet in interface Bean
Throws:
Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails.
See Also:
BeanConfigurationException, BeanInitializationException

destroy

public void destroy()
             throws Exception
Description copied from interface: Bean
Invoked by a bean factory on destruction of a singleton.

Specified by:
destroy in interface Bean
Throws:
Exception - in case of shutdown errors. Exceptions will get logged but not re-thrown to allow other beans to release their resources too.
See Also:
BeanConfigException

setProcessingUnit

public void setProcessingUnit(ProcessingUnit pu)
Specified by:
setProcessingUnit in interface ProcessingUnitAware

setProcessingUnitSchema

public void setProcessingUnitSchema(org.openspaces.admin.internal.pu.elastic.ProcessingUnitSchemaConfig schemaConfig)
Specified by:
setProcessingUnitSchema in interface ProcessingUnitAware

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

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

setElasticProcessingUnitMachineIsolation

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

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.