Methods Summary |
---|
private ConnectorModule | getConnectorModule(java.lang.String modId)
ConnectorModule mod = (ConnectorModule)
((Applications)this.configBean).getConnectorModuleByName(modId);
if(mod == null)
throw new ConfigException(Localizer.getValue(ExceptionType.NO_SUCH_CON_MOD));
return mod;
|
public java.lang.String | getDescription(java.lang.String modId)
return getConnectorModule(modId).getDescription();
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.ClassLoader cl, java.lang.String modDir, boolean validateXml)Returns the deployment descriptor object for the connector module
in the specified directory.
Application application = getRegisteredDescriptor(modId);
if (application!=null) {
application.setClassLoader(cl);
return application;
}
try {
ConnectorArchivist connectorArchivist = new ConnectorArchivist();
connectorArchivist.setXMLValidation(validateXml);
connectorArchivist.setClassLoader(cl);
FileArchive archive = new FileArchive();
archive.open(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, connectorArchivist, archive, true);
}
application.setClassLoader(cl);
application.setGeneratedXMLDirectory(getGeneratedXMLLocation(modId));
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.CONN);
return menv.getModuleGeneratedXMLPath();
|
public java.lang.String | getLocation(java.lang.String name)
String location = null;
if (ResourcesUtil.createInstance().belongToSystemRar(name)) {
location = Switch.getSwitch().
getResourceInstaller().getSystemModuleLocation(name);
} else {
ConnectorModule connectorModule = (ConnectorModule)
((Applications)this.configBean).getConnectorModuleByName(name);
location = connectorModule.getLocation();
}
return resolvePath(location);
|
public javax.enterprise.deploy.shared.ModuleType | getModuleType()
return ModuleType.RAR;
|
public boolean | isEnabled(java.lang.String modId)
return getConnectorModule(modId).isEnabled();
|
protected boolean | isRegistered(java.lang.String modId, com.sun.enterprise.config.ConfigBean bean)
ConfigBean cb = null;
try {
cb = ((Applications)bean).getConnectorModuleByName(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-"
ConnectorModule cm = getConnectorModule(modId);
String resourceType = cm.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"
ConnectorModule cm = getConnectorModule(modId);
String resourceType = cm.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.
ConnectorModule cm = getConnectorModule(modId);
String resourceType = cm.getObjectType();
boolean isDirectoryDeployed = cm.isDirectoryDeployed();
if (resourceType.startsWith(SYSTEM_PREFIX) && isDirectoryDeployed) {
return true;
} else {
return false;
}
|
public ConnectorModule[] | listConnectorModules()Returns a list of all Connector modules deployed with the server.
ConnectorModule[] mods = ((Applications)this.configBean).getConnectorModule();
if(mods == null) return new ConnectorModule[0];
ArrayList list = new ArrayList();
for (int i=0; i<mods.length; i++) {
// add the modules to the list if it is referenced
// by this server
if ( isReferenced(mods[i].getName()) ) {
list.add(mods[i]);
}
}
// returns an array of modules referenced by this server
ConnectorModule[] refList = new ConnectorModule[list.size()];
return ( (ConnectorModule[]) list.toArray(refList) );
|
public java.util.List | listIds()Returns a list of all Connector modules deployed with the server.
ArrayList arr = new ArrayList();
ConnectorModule[] mods = ((Applications)this.configBean).getConnectorModule();
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 void | remove(java.lang.String modId)
ConnectorModule backEm = (ConnectorModule)((Applications)configBean).getConnectorModuleByName(modId);
((Applications)configBean).removeConnectorModule(backEm);
|
public void | setDescription(java.lang.String modId, java.lang.String desc)
getConnectorModule(modId).setDescription(desc);
|
public void | setEnable(java.lang.String modId, boolean enable)
getConnectorModule(modId).setEnabled(enable);
|
public void | setLocation(java.lang.String modId, java.lang.String location)
ConnectorModule connectorModule = (ConnectorModule)
((Applications)this.configBean).getConnectorModuleByName(modId);
connectorModule.setLocation(location);
|
public void | setOptionalAttributes(java.lang.String modId, java.util.Properties optionalAttributes)Set the optional attributes for an module
if(optionalAttributes!=null) {
ConnectorModule cm = getConnectorModule(modId);
Enumeration tags = optionalAttributes.keys();
while(tags.hasMoreElements())
{
String tag = (String)tags.nextElement();
String value = optionalAttributes.getProperty(tag);
cm.setAttributeValue(tag, value);
}
}
|