Methods Summary |
---|
public java.lang.String | getContextRoot(java.lang.String modId)
return getWebModule(modId).getContextRoot();
|
public java.lang.String | getDescription(java.lang.String modId)
return getWebModule(modId).getDescription();
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.ClassLoader cl, java.lang.String moduleLoc, boolean validateXML)Returns the deployment descriptor object for the specified web module.
Application app = getDescriptor(modId, moduleLoc, validateXML);
app.setClassLoader(cl);
return app;
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.String modDir)Returns the deployment descriptor object for the web module in the
specified directory.
return getDescriptor(modId, modDir, false);
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.String modDir, boolean validateXml)Returns the deployment descriptor object for the web module in the
specified directory.
Application application = getRegisteredDescriptor(modId);
if (application!=null) {
return application;
}
try {
WebArchivist webArchivist = new WebArchivist();
webArchivist.setXMLValidation(validateXml);
FileArchive archive = openDDArchive(modId, modDir);
// Try to load the app from the serialized descriptor file.
SerializedDescriptorHelper.Loader sdLoader =
SerializedDescriptorHelper.load(modId, this);
Application deserializedApplication = sdLoader.getApplication();
if (deserializedApplication != null) {
application = deserializedApplication;
} else {
application = ApplicationArchivist.openArchive(modId, webArchivist, archive, true);
if(!isSystemAdmin(modId) && !isSystem(modId)) {
// we need to read persistence descriptors separately
// because they are read from appDir as oppsed to xmlDir.
readPersistenceDeploymentDescriptors(modDir, application);
}
}
application.setGeneratedXMLDirectory(getGeneratedXMLLocation(modId));
if (!application.getWebServiceDescriptors().isEmpty()) {
ModuleContentLinker visitor = new ModuleContentLinker(archive, true);
application.visit((com.sun.enterprise.deployment.util.ApplicationVisitor) visitor);
}
registerDescriptor(modId, application);
// If needed, save this app in serialized form for faster loading next time.
sdLoader.store(application);
return application;
} catch (IOException ioe) {
throw new ConfigException(Localizer.getValue(
ExceptionType.IO_ERROR_LOADING_DD, modId), ioe);
} catch (Throwable t) {
throw new ConfigException(Localizer.getValue(
ExceptionType.FAIL_DD_LOAD, modId), t);
}
|
public java.lang.String | getGeneratedXMLLocation(java.lang.String name)
ModuleEnvironment menv = instanceEnvironment.getModuleEnvironment(name,
DeployableObjectType.WEB);
return menv.getModuleGeneratedXMLPath();
|
public java.lang.String | getJSPLocation(java.lang.String name)
ModuleEnvironment menv = instanceEnvironment.getModuleEnvironment(name,
DeployableObjectType.WEB);
return menv.getModuleJSPPath();
|
public java.lang.String | getLocation(java.lang.String name)
WebModule webModule = (WebModule)
((Applications)this.configBean).getWebModuleByName(name);
String location = null;
if (webModule != null)
location = webModule.getLocation();
return resolvePath(location);
|
public javax.enterprise.deploy.shared.ModuleType | getModuleType()
return ModuleType.WAR;
|
public java.lang.String | getStubLocation(java.lang.String name)
ModuleEnvironment menv = instanceEnvironment.getModuleEnvironment(name,
DeployableObjectType.WEB);
return menv.getModuleStubPath();
|
public java.lang.String | getVirtualServers(java.lang.String modId)
Server server = ServerBeansFactory.getServerBean(configContext);
ApplicationRef ar = server.getApplicationRefByRef(modId);
return ar.getVirtualServers();
|
private com.sun.enterprise.config.serverbeans.WebModule | getWebModule(java.lang.String modId)
WebModule mod = (WebModule)
((Applications)this.configBean).getWebModuleByName(modId);
if(mod == null)
throw new ConfigException(Localizer.getValue(ExceptionType.NO_SUCH_WEB_MOD));
return mod;
|
public boolean | isEnabled(java.lang.String modId)
return getWebModule(modId).isEnabled();
|
protected boolean | isRegistered(java.lang.String modId, com.sun.enterprise.config.ConfigBean bean)
ConfigBean cb = null;
try {
cb = ((Applications)bean).getWebModuleByName(modId);
} catch(Exception cn) {
}
if(cb != null) return true;
return false;
|
public boolean | isSystem(java.lang.String modId)Checks whether this module is a systemmodule
ResourceType in domain.xml should start with "system-"
WebModule wm = getWebModule(modId);
String resourceType = wm.getObjectType();
if(resourceType.startsWith(SYSTEM_PREFIX))
return true;
else
return false;
|
public boolean | isSystemAdmin(java.lang.String modId)Checks whether this module is a system admin module
ResourceType in domain.xml should start with "system-admin"
WebModule wm = getWebModule(modId);
String resourceType = wm.getObjectType();
if(resourceType.startsWith(SYSTEM_ADMIN_PREFIX))
return true;
else
return false;
|
public boolean | isSystemPredeployed(java.lang.String modId)Checks whether this module is a pre-deployed system module
ResourceType in domain.xml should start with "system"
Also it should be directory deployed
WebModule wm = getWebModule(modId);
String resourceType = wm.getObjectType();
boolean isDirectoryDeployed = wm.isDirectoryDeployed();
if (resourceType.startsWith(SYSTEM_PREFIX) && isDirectoryDeployed) {
return true;
} else {
return false;
}
|
public java.util.List | listIds()Returns a list of (type java.lang.String) all web modules
deployed to the server.
ArrayList arr = new ArrayList();
WebModule[] mods = ((Applications)this.configBean).getWebModule();
// returns an empty list if there are no web modules in the domain
if(mods == null) return arr;
for (int i=0;i<mods.length;i++) {
String name = mods[i].getName();
// adds the web module to the list if
// it is referenced by this server
if ( isReferenced(name) ) {
arr.add(name);
}
}
return arr;
|
public com.sun.enterprise.config.serverbeans.WebModule[] | listWebModules()Returns a list of all WebModule beans deployed on the server.
WebModule[] modules = ((Applications)this.configBean).getWebModule();
if (modules == null) {
return new WebModule[0];
}
ArrayList list = new ArrayList();
for (int i=0; i<modules.length; i++) {
// add the modules to the list if it is referenced
// by this server
if ( isReferenced(modules[i].getName()) ) {
list.add(modules[i]);
}
}
// returns an array of modules referenced by this server
WebModule[] refList = new WebModule[list.size()];
return ( (WebModule[]) list.toArray(refList) );
|
public void | remove(java.lang.String modId)
WebModule backEm = (WebModule)
((Applications)configBean).getWebModuleByName(modId);
((Applications)configBean).removeWebModule(backEm);
|
public void | setContextRoot(java.lang.String modId, java.lang.String value)
getWebModule(modId).setContextRoot(value);
|
public void | setDescription(java.lang.String modId, java.lang.String desc)
getWebModule(modId).setDescription(desc);
|
public void | setEnable(java.lang.String modId, boolean enable)
getWebModule(modId).setEnabled(enable);
|
public void | setLocation(java.lang.String name, java.lang.String location)
WebModule webModule = (WebModule)
((Applications)this.configBean).getWebModuleByName(name);
if (webModule != null)
webModule.setLocation(location);
|
public void | setOptionalAttributes(java.lang.String modId, java.util.Properties optionalAttributes)Set the optional attributes for an module
if(optionalAttributes!=null) {
WebModule wm = getWebModule(modId);
Enumeration tags = optionalAttributes.keys();
while(tags.hasMoreElements())
{
String tag = (String)tags.nextElement();
String value = optionalAttributes.getProperty(tag);
wm.setAttributeValue(tag, value);
}
}
|