public class ThinJarAppDeployer extends AbstractThinJarSupport implements org.springframework.cloud.deployer.spi.app.AppDeployer
AppDeployer
that launches thin jars as apps in the same JVM, using a
separate class loader. Computes the class path from the jar being deployed in the same
way as it would if you ran the jar in its own process. Makes an assumption that the
"main" class in the archive is a Spring application context (e.g. typically a
@SpringBootApplication
) so that there is a way to close the context when
the app is undeployed (a generic main method does not have that feature).Constructor and Description |
---|
ThinJarAppDeployer() |
ThinJarAppDeployer(String name,
String... profiles) |
Modifier and Type | Method and Description |
---|---|
String |
deploy(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request) |
Object |
getBean(String id,
Class<?> type)
Lookup a bean from a deployed application.
|
Map<String,Object> |
getBeansOfType(String id,
Class<?> type)
Lookup all beans from a deployed application.
|
protected Map<String,String> |
getProperties(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request) |
org.springframework.cloud.deployer.spi.app.AppStatus |
status(String id) |
void |
undeploy(String id) |
cancel, getWrapper
public String deploy(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
deploy
in interface org.springframework.cloud.deployer.spi.app.AppDeployer
deploy
in class AbstractThinJarSupport
protected Map<String,String> getProperties(org.springframework.cloud.deployer.spi.core.AppDeploymentRequest request)
getProperties
in class AbstractThinJarSupport
public org.springframework.cloud.deployer.spi.app.AppStatus status(String id)
status
in interface org.springframework.cloud.deployer.spi.app.AppDeployer
public void undeploy(String id)
undeploy
in interface org.springframework.cloud.deployer.spi.app.AppDeployer
public Object getBean(String id, Class<?> type)
id
- the app idtype
- the required type of the beanIllegalStateException
- if the bean cannot be foundpublic Map<String,Object> getBeansOfType(String id, Class<?> type)
id
- the app idtype
- the required type of the beanIllegalStateException
- if the beans cannot be foundgetBean(String, Class)
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.