}
@Override
public void deploy(DeploymentUnit unit, JBossAppMetaData metaData) throws DeploymentException
{
ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class);
if (classLoadingMetaData != null)
return;
LoaderRepositoryMetaData lrmd = metaData.getLoaderRepository();
if (lrmd != null && LoaderRepositoryMetaDataHelper.create(unit, lrmd) != null)
return;
// For isolated automatically create the classloader in a new domain
if (isolated)
{
String domain = EARDeployment.getJMXName(metaData, unit) + ",extension=LoaderRepository";
try
{
ObjectName canonical = ObjectName.getInstance(domain);
domain = canonical.getCanonicalName();
}
catch (MalformedObjectNameException ignored)
{
// Not a JMX ObjectName???
}
classLoadingMetaData = new ClassLoadingMetaData();
classLoadingMetaData.setName(unit.getName());
classLoadingMetaData.setDomain(domain);
classLoadingMetaData.setExportAll(ExportAll.NON_EMPTY);
classLoadingMetaData.setImportAll(true);
classLoadingMetaData.setVersion(Version.DEFAULT_VERSION);
classLoadingMetaData.setJ2seClassLoadingCompliance(false);
unit.addAttachment(ClassLoadingMetaData.class, classLoadingMetaData);
}
}