protected void deployWebModule(DeploymentUnit unit, JBossWebMetaData metaData, AbstractWarDeployment deployment) throws Exception
{
log.debug("deployWebModule: " + unit.getName());
try
{
ServiceMetaData webModule = new ServiceMetaData();
String name = getObjectName(metaData);
ObjectName objectName = new ObjectName(name);
webModule.setObjectName(objectName);
webModule.setCode(WebModule.class.getName());
// WebModule(DeploymentUnit, AbstractWarDeployer, AbstractWarDeployment)
ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
constructor.setSignature(new String[] { DeploymentUnit.class.getName(), AbstractWarDeployer.class.getName(), AbstractWarDeployment.class.getName() });
constructor.setParameters(new Object[] { unit, this, deployment });
webModule.setConstructor(constructor);
List<ServiceAttributeMetaData> attrs = new ArrayList<ServiceAttributeMetaData>();
ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
attr.setName("SecurityManagement");
ServiceInjectionValueMetaData injectionValue = new ServiceInjectionValueMetaData(deployment.getSecurityManagementName());
attr.setValue(injectionValue);
attrs.add(attr);
ServiceAttributeMetaData attrPR = new ServiceAttributeMetaData();
attrPR.setName("PolicyRegistration");
ServiceInjectionValueMetaData injectionValuePR = new ServiceInjectionValueMetaData(deployment.getPolicyRegistrationName());
attrPR.setValue(injectionValuePR);
attrs.add(attrPR);
ServiceAttributeMetaData attrKernel = new ServiceAttributeMetaData();
attrKernel.setName("Kernel");
ServiceInjectionValueMetaData injectionValueKernel = new ServiceInjectionValueMetaData(KernelConstants.KERNEL_NAME);
attrKernel.setValue(injectionValueKernel);
attrs.add(attrKernel);
webModule.setAttributes(attrs);
// Dependencies...Still have old jmx names here
Collection<String> depends = metaData.getDepends();
List<ServiceDependencyMetaData> dependencies = new ArrayList<ServiceDependencyMetaData>();
if (depends != null && depends.isEmpty() == false)
{
if (log.isTraceEnabled())
log.trace(name + " has dependencies: " + depends);
for (String iDependOn : depends)
{
ServiceDependencyMetaData sdmd = new ServiceDependencyMetaData();
sdmd.setIDependOn(iDependOn);
dependencies.add(sdmd);
}
}
webModule.setDependencies(dependencies);
// Here's where a bit of magic happens. By attaching the ServiceMetaData
// to the deployment, we now make the deployment "relevant" to
// deployers that use ServiceMetaData as an input (e.g. the
// org.jboss.system.deployers.ServiceDeployer). Those deployers