{
createTopLevelServiceBeanWithMetaData(contextId, unit, metaData);
}
else
{
ServiceMetaData subjaccPolicy = getServiceMetaData();
String deploymentName = unit.getSimpleName();
try
{
subjaccPolicy.setObjectName(new ObjectName(getObjectName(unit)));
}
catch (Exception e)
{
throw new RuntimeException(e);
}
// Provide a constructor for the service bean
ServiceConstructorMetaData serviceConstructor = new ServiceConstructorMetaData();
serviceConstructor.setSignature(new String[]{String.class.getName(), getMetaDataClassType().getName()});
serviceConstructor.setParameters(new Object[]{deploymentName, metaData});
subjaccPolicy.setConstructor(serviceConstructor);
ArrayList<ServiceMetaData> services = new ArrayList<ServiceMetaData>();
services.add(subjaccPolicy);
unit.addAttachment(JACC_ATTACHMENT_NAME, subjaccPolicy, ServiceMetaData.class);
// Add a dependence into the parent JaccPolicy
ServiceMetaData parentServiceMetaData = this.getParentJaccPolicyBean(unit);
if (parentServiceMetaData != null)
{
ServiceDependencyMetaData serviceDependencyMetaData = new ServiceDependencyMetaData();
serviceDependencyMetaData.setIDependOnObjectName(subjaccPolicy.getObjectName());
parentServiceMetaData.addDependency(serviceDependencyMetaData);
// Add an attribute in the parent service
ServiceAttributeMetaData serviceAttributeMetaData = new ServiceAttributeMetaData();
serviceAttributeMetaData.setName("PolicyConfigurationFacadeMBean");
ServiceDependencyValueMetaData dependencyValue = new ServiceDependencyValueMetaData();
dependencyValue.setDependency(subjaccPolicy.getObjectName().toString());
dependencyValue.setProxyType("attribute");
serviceAttributeMetaData.setValue(dependencyValue);
parentServiceMetaData.addAttribute(serviceAttributeMetaData);
}
}
/** Register XACML/ACL policies if present in the deployment */
if(this.policyRegistration != null)