Package org.nuxeo.runtime.test.runner
Class HotDeployer
- java.lang.Object
-
- org.nuxeo.runtime.test.runner.HotDeployer
-
public class HotDeployer extends Object
A dynamic component deployer which enable tests to deploy new contributions after the test was started (i.e. from inside the test method) The deployer is reloading all the components and reinject the test members.- Author:
- bogdan
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HotDeployer.ActionHandler
Deploy actions are usually used by features to customize the deployment of the runtime feature (which is using the DeaultDeployAction)protected class
HotDeployer.DefaultDeployHandler
This action has no next action and will deploy the contributions and then reload the component manager
-
Field Summary
Fields Modifier and Type Field Description static String
DEPLOY_ACTION
protected RuntimeHarness
harness
protected HotDeployer.ActionHandler
head
static String
RELOAD_ACTION
static String
RESET_ACTION
static String
RESTART_ACTION
protected FeaturesRunner
runner
protected static String
UNDEPLOY_ACTION
-
Constructor Summary
Constructors Constructor Description HotDeployer(FeaturesRunner runner, RuntimeHarness harness)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HotDeployer
addHandler(HotDeployer.ActionHandler action)
Add a custom deploy action that wraps the default action.void
deploy(String... contribs)
Deploy the given list of contributions.void
reinject()
void
reload()
Reloads the components and preserve the current registry state.boolean
removeHandler(HotDeployer.ActionHandler handler)
Remove the given handler if already registeredvoid
reset()
Restart the components and revert to the initial registry snapshot if any.void
restart()
Restart the components and preserve the current registry state.void
undeploy(String... contribs)
-
-
-
Field Detail
-
DEPLOY_ACTION
public static final String DEPLOY_ACTION
- See Also:
- Constant Field Values
-
UNDEPLOY_ACTION
protected static final String UNDEPLOY_ACTION
- See Also:
- Constant Field Values
-
RESTART_ACTION
public static final String RESTART_ACTION
- See Also:
- Constant Field Values
-
RESET_ACTION
public static final String RESET_ACTION
- See Also:
- Constant Field Values
-
RELOAD_ACTION
public static final String RELOAD_ACTION
- See Also:
- Constant Field Values
-
runner
protected FeaturesRunner runner
-
harness
protected RuntimeHarness harness
-
head
protected HotDeployer.ActionHandler head
-
-
Constructor Detail
-
HotDeployer
public HotDeployer(FeaturesRunner runner, RuntimeHarness harness)
-
-
Method Detail
-
addHandler
public HotDeployer addHandler(HotDeployer.ActionHandler action)
Add a custom deploy action that wraps the default action. You should call next.exec(...) in your action code to call the next action
-
removeHandler
public boolean removeHandler(HotDeployer.ActionHandler handler)
Remove the given handler if already registered
-
deploy
public void deploy(String... contribs) throws Exception
Deploy the given list of contributions. The format is bundleId[:componentPath]. If no component path is specified then the bundle identified by the bundleId part will be deployed. If a componentPath is givenRuntimeHarness.deployContrib(String,String)
will be used to deploy the contribution.- Throws:
Exception
-
restart
public void restart() throws Exception
Restart the components and preserve the current registry state.- Throws:
Exception
-
reset
public void reset() throws Exception
Restart the components and revert to the initial registry snapshot if any.- Throws:
Exception
-
reload
public void reload() throws Exception
Reloads the components and preserve the current registry state. This action performs a standby/resume onComponentManager
.- Throws:
Exception
- Since:
- 10.2
-
reinject
public void reinject()
-
-