public abstract class AbstractLocalDeployerSupport extends Object
Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractLocalDeployerSupport.Instance |
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
static String |
USE_SPRING_APPLICATION_JSON_KEY |
Constructor and Description |
---|
AbstractLocalDeployerSupport(LocalDeployerProperties properties)
Instantiates a new abstract deployer support.
|
Modifier and Type | Method and Description |
---|---|
protected ProcessBuilder |
buildProcessBuilder(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request,
Map<String,String> appInstanceEnv,
Map<String,String> appProperties,
Optional<Integer> appInstanceNumber,
String deploymentId)
Builds the process builder.
|
protected String |
buildRemoteDebugInstruction(Map<String,String> deploymentProperties,
String deploymentId,
int instanceIndex,
int port) |
protected int |
calculateDebugPort(Map<String,String> deploymentProperties,
int instanceIndex)
Gets the base debug port value and adds the instance count.
|
protected boolean |
containsValidDebugPort(Map<String,String> deploymentProperties,
String deploymentId)
Determines if there is a valid debug port specified in the deployment properites.
|
protected org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo |
createRuntimeEnvironmentInfo(Class<?> spiClass,
Class<?> implementationClass)
Create the RuntimeEnvironmentInfo.
|
protected LocalDeployerProperties |
getLocalDeployerProperties()
Gets the local deployer properties.
|
protected void |
handleAppPropertiesPassing(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request,
Map<String,String> appProperties,
Map<String,String> appInstanceEnvToUse,
Map<String,String> appPropertiesToUse) |
protected static boolean |
isAlive(Process process) |
protected void |
retainEnvVars(Set<String> vars)
Retain the environment variable strings in the provided set indicated by
LocalDeployerProperties.getEnvVarsToInherit() . |
protected void |
shutdownAndWait(AbstractLocalDeployerSupport.Instance instance)
Shut down the
Process backing the application AbstractLocalDeployerSupport.Instance . |
public static final String USE_SPRING_APPLICATION_JSON_KEY
protected final org.slf4j.Logger logger
public AbstractLocalDeployerSupport(LocalDeployerProperties properties)
properties
- the local deployer propertiesprotected String buildRemoteDebugInstruction(Map<String,String> deploymentProperties, String deploymentId, int instanceIndex, int port)
protected org.springframework.cloud.deployer.spi.core.RuntimeEnvironmentInfo createRuntimeEnvironmentInfo(Class<?> spiClass, Class<?> implementationClass)
protected final LocalDeployerProperties getLocalDeployerProperties()
protected void retainEnvVars(Set<String> vars)
LocalDeployerProperties.getEnvVarsToInherit()
.
This assumes that the provided set can be modified.vars
- set of environment variable stringsprotected ProcessBuilder buildProcessBuilder(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request, Map<String,String> appInstanceEnv, Map<String,String> appProperties, Optional<Integer> appInstanceNumber, String deploymentId)
request
- the requestappInstanceEnv
- the instance environment variablesappProperties
- the app propertiesprotected void handleAppPropertiesPassing(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request, Map<String,String> appProperties, Map<String,String> appInstanceEnvToUse, Map<String,String> appPropertiesToUse)
protected void shutdownAndWait(AbstractLocalDeployerSupport.Instance instance)
Process
backing the application AbstractLocalDeployerSupport.Instance
.
If the application exposes a /shutdown
endpoint, that will be
invoked followed by a wait that will not exceed the number of seconds
indicated by LocalDeployerProperties.shutdownTimeout
. If the
timeout period is exceeded (or if the /shutdown
endpoint is not exposed),
the process will be shut down via Process.destroy()
.instance
- the application instance to shut downprotected static boolean isAlive(Process process)
protected boolean containsValidDebugPort(Map<String,String> deploymentProperties, String deploymentId)
deploymentProperties
- the deployment properties to validatedeploymentId
- the deployment Id for logging purposesprotected int calculateDebugPort(Map<String,String> deploymentProperties, int instanceIndex)
containsValidDebugPort(Map, String)
has been called before to validate the deployment properties.deploymentProperties
- deployment properties with a valid value of debug portinstanceIndex
- the index of the application to deployCopyright © 2018 Pivotal Software, Inc.. All rights reserved.