[
https://issues.jboss.org/browse/AS7-5707?page=com.atlassian.jira.plugin.s...
]
Thomas Diesler edited comment on AS7-5707 at 10/9/12 4:26 AM:
--------------------------------------------------------------
The most promising approach to support deferred sub deployments was this one
{code}
// Defer the {@link Phase.FIRST_MODULE_USE} phase
List<String> deferredModules =
DeploymentUtils.getDeferredModules(deploymentUnit);
if (deferredModules.size() > 0) {
if (nextPhase == Phase.FIRST_MODULE_USE) {
if (deferredModules.contains(name)) {
DEPLOYMENT_LOGGER.infoDeferredModulePhase(name);
phaseServiceBuilder.setInitialMode(Mode.NEVER);
} else {
DEPLOYMENT_LOGGER.infoDeferredModulePhase(name);
phaseServiceBuilder.setInitialMode(Mode.PASSIVE);
}
if (parent != null) {
ServiceName parentPhaseServiceName =
Services.deploymentUnitName(parent.getName(), nextPhase);
ServiceController<?> parentPhaseService =
container.getRequiredService(parentPhaseServiceName);
parentPhaseService.setMode(Mode.PASSIVE);
}
}
}
{code}
It is however flawed in (at least) two ways.
#1 There is no guarantee that a sibling bundle that is not deferred will have the next
phase service setup after the deferred bundle has marked the top level DU. As a result the
sibling's FIRST_MODULE_USE phase will fail because of the the missing dependency on
the EAR's FIRST_MODULE_USE phase
#2 Setting the mode of the EAR's FIRST_MODULE_USE phase to PASSIVE works during normal
operation but not at boot time. The BootstrapListener expects an active service. This may
be overcome by adding support for START_REQUESTED_to_DOWN
was (Author: thomas.diesler):
The most promising approach to support deferred sub deployments was this one
{code}
// Defer the {@link Phase.FIRST_MODULE_USE} phase
List<String> deferredModules =
DeploymentUtils.getDeferredModules(deploymentUnit);
if (deferredModules.size() > 0) {
if (nextPhase == Phase.FIRST_MODULE_USE) {
if (deferredModules.contains(name)) {
DEPLOYMENT_LOGGER.infoDeferredModulePhase(name);
phaseServiceBuilder.setInitialMode(Mode.NEVER);
} else {
DEPLOYMENT_LOGGER.infoDeferredModulePhase(name);
phaseServiceBuilder.setInitialMode(Mode.PASSIVE);
}
if (parent != null) {
ServiceName parentPhaseServiceName =
Services.deploymentUnitName(parent.getName(), nextPhase);
ServiceController<?> parentPhaseService =
container.getRequiredService(parentPhaseServiceName);
parentPhaseService.setMode(Mode.PASSIVE);
}
}
}
{code}
Add support for deferred module phase for sub deployments
---------------------------------------------------------
Key: AS7-5707
URL:
https://issues.jboss.org/browse/AS7-5707
Project: Application Server 7
Issue Type: Feature Request
Components: OSGi
Reporter: Thomas Diesler
Assignee: Thomas Diesler
Fix For: 7.2.0.CR1
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira