return createMetaData(deployment, name, version, false, packages);
}
protected static ClassLoadingMetaData createMetaData(PredeterminedManagedObjectAttachments deployment, String name, Version version, boolean useVersionOnPackages, Class<?>... packages)
{
MockClassLoadingMetaData classLoadingMetaData = new MockClassLoadingMetaData(name, version);
classLoadingMetaData.setPaths(packages);
CapabilitiesMetaData capabilities = classLoadingMetaData.getCapabilities();
Capability capability = classLoadingMetaDataFactory.createModule(name, version);
capabilities.addCapability(capability);
if (packages != null)
{
for (Class<?> pkg : packages)
{
if (useVersionOnPackages)
capability = classLoadingMetaDataFactory.createPackage(pkg.getPackage().getName(), version);
else
capability = classLoadingMetaDataFactory.createPackage(pkg.getPackage().getName());
capabilities.addCapability(capability);
}
}
classLoadingMetaData.setCapabilities(capabilities);
return classLoadingMetaData;
}