public class BasicJcloudsLocationCustomizer extends BasicConfigurableObject implements JcloudsLocationCustomizer, EntityInitializer
When the class is used as an EntityInitializer it inserts itself into the entity's
JcloudsLocationConfig.JCLOUDS_LOCATION_CUSTOMIZERS under the
BrooklynConfigKeys.PROVISIONING_PROPERTIES key.
BasicConfigurableObject.BasicConfigurationSupportConfigurable.ConfigurationSupport| Constructor and Description |
|---|
BasicJcloudsLocationCustomizer() |
BasicJcloudsLocationCustomizer(ConfigBag params) |
BasicJcloudsLocationCustomizer(java.util.Map<?,?> params) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(EntityLocal entity)
Applies initialization logic to a just-built entity.
|
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
JcloudsMachineLocation machine)
Override to configure the given machine once it has been created and started by Jclouds.
|
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.domain.Template template)
Override to configure a subclass of this with the built template, or to configure the built
template's
TemplateOptions. |
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.domain.TemplateBuilder templateBuilder)
Override to configure
templateBuilder
before it is built and immutable. |
void |
customize(JcloudsLocation location,
org.jclouds.compute.ComputeService computeService,
org.jclouds.compute.options.TemplateOptions templateOptions)
Override to configure the
TemplateOptions that will
be used by JcloudsLocation to obtain machines. |
void |
customize(JcloudsLocation location,
org.jclouds.compute.domain.NodeMetadata node,
ConfigBag setup)
Override to configure the
NodeMetadata, and ConfigBag that will be used when
connecting to the machine. |
void |
postRelease(JcloudsMachineLocation machine)
Override to handle machine-related cleanup after Jclouds is called to release (destroy) the machine.
|
void |
postReleaseOnObtainError(JcloudsLocation jcloudsLocation,
JcloudsMachineLocation machineLocation,
java.lang.Exception cause)
Override to handle cleanup after failure to obtain a machine.
|
void |
preRelease(JcloudsMachineLocation machine)
Override to handle machine-related cleanup before Jclouds is called to release (destroy) the machine.
|
void |
preReleaseOnObtainError(JcloudsLocation jcloudsLocation,
JcloudsMachineLocation machineLocation,
java.lang.Exception cause)
Override to handle cleanup after failure to obtain a machine.
|
config, getBrooklynManagementContext, getConfig, getId, setManagementContextpublic BasicJcloudsLocationCustomizer()
public BasicJcloudsLocationCustomizer(java.util.Map<?,?> params)
public BasicJcloudsLocationCustomizer(ConfigBag params)
public void apply(EntityLocal entity)
EntityInitializerapply in interface EntityInitializerentity - guaranteed to be the actual implementation instance,
thus guaranteed to be castable to EntityInternal which is often desired,
or to the type at hand (it is not even a proxy)public void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.domain.TemplateBuilder templateBuilder)
JcloudsLocationCustomizertemplateBuilder
before it is built and immutable.customize in interface JcloudsLocationCustomizerpublic void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.domain.Template template)
JcloudsLocationCustomizerTemplateOptions.
This method will be called before JcloudsLocationCustomizer.customize(JcloudsLocation, ComputeService, TemplateOptions).
customize in interface JcloudsLocationCustomizerpublic void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, org.jclouds.compute.options.TemplateOptions templateOptions)
JcloudsLocationCustomizerTemplateOptions that will
be used by JcloudsLocation to obtain machines.customize in interface JcloudsLocationCustomizerpublic void customize(JcloudsLocation location, org.jclouds.compute.domain.NodeMetadata node, ConfigBag setup)
JcloudsLocationCustomizerNodeMetadata, and ConfigBag that will be used when
connecting to the machine.customize in interface JcloudsLocationCustomizerpublic void customize(JcloudsLocation location, org.jclouds.compute.ComputeService computeService, JcloudsMachineLocation machine)
JcloudsLocationCustomizer
If CloudLocationConfig.WAIT_FOR_SSHABLE is true the machine is guaranteed to be
SSHable when this method is called.
customize in interface JcloudsLocationCustomizerpublic void preRelease(JcloudsMachineLocation machine)
JcloudsLocationCustomizerpreRelease in interface JcloudsLocationCustomizerpublic void postRelease(JcloudsMachineLocation machine)
JcloudsLocationCustomizerpostRelease in interface JcloudsLocationCustomizerpublic void preReleaseOnObtainError(JcloudsLocation jcloudsLocation, @Nullable JcloudsMachineLocation machineLocation, java.lang.Exception cause)
JcloudsLocationCustomizerInterruptedException
in which case return as quickly as possible.preReleaseOnObtainError in interface JcloudsLocationCustomizerpublic void postReleaseOnObtainError(JcloudsLocation jcloudsLocation, @Nullable JcloudsMachineLocation machineLocation, java.lang.Exception cause)
JcloudsLocationCustomizer
Override to handle cleanup after failure to obtain a machine. Called after releasing the locations' underlying node.
Could be called as a result of an InterruptedException in which case return as quickly as possible.
Will be skipped if CloudLocationConfig.DESTROY_ON_FAILURE is set to false.
postReleaseOnObtainError in interface JcloudsLocationCustomizer