}
return versionIdentifier;
}
public ClassLoader getClassLoader(final ClassLoader parent, DeploymentContext context) {
ASURLClassLoader cloader = AccessController.doPrivileged(new PrivilegedAction<ASURLClassLoader>() {
@Override
public ASURLClassLoader run() {
return new ASURLClassLoader(parent);
}
});
try {
String compatProp = context.getAppProps().getProperty(
DeploymentProperties.COMPATIBILITY);
// if user does not specify the compatibility property
// let's see if it's defined in glassfish-ejb-jar.xml
if (compatProp == null) {
GFEjbJarXMLParser gfEjbJarXMLParser =
new GFEjbJarXMLParser(context.getSource());
compatProp = gfEjbJarXMLParser.getCompatibilityValue();
if (compatProp != null) {
context.getAppProps().put(
DeploymentProperties.COMPATIBILITY, compatProp);
}
}
// if user does not specify the compatibility property
// let's see if it's defined in sun-ejb-jar.xml
if (compatProp == null) {
SunEjbJarXMLParser sunEjbJarXMLParser =
new SunEjbJarXMLParser(context.getSourceDir());
compatProp = sunEjbJarXMLParser.getCompatibilityValue();
if (compatProp != null) {
context.getAppProps().put(
DeploymentProperties.COMPATIBILITY, compatProp);
}
}
// if the compatibility property is set to "v2", we should add
// all the jars under the ejb module root to maintain backward
// compatibility of v2 jar visibility
if (compatProp != null && compatProp.equals("v2")) {
List<URL> moduleRootLibraries =
ASClassLoaderUtil.getURLsAsList(null,
new File[]{context.getSourceDir()}, true);
for (URL url : moduleRootLibraries) {
cloader.addURL(url);
}
}
cloader.addURL(context.getSource().getURI().toURL());
cloader.addURL(context.getScratchDir("ejb").toURI().toURL());
// add libraries referenced from manifest
for (URL url : getManifestLibraries(context)) {
cloader.addURL(url);
}
} catch (Exception e) {
_logger.log(Level.SEVERE, e.getMessage());
throw new RuntimeException(e);
}