Methods Summary |
---|
public void | applyServerXmlChanges()
if(!this.useBackupServerXml) {
throw new ConfigException(Localizer.getValue(ExceptionType.CANT_APPLY));
}
this.configContext.flush();
instanceEnvironment.applyServerXmlChanges(false);
|
public java.lang.String[] | getBytecodeProcessorClassNames()Returns an array of bytecode preprocessor class name(s) as set in
server.xml.
String result[] = null;
//ROB: config changes - use of domain.xml
JavaConfig jc = ServerBeansFactory.getJavaConfigBean(configContext);
if (jc != null) {
String value = jc.getBytecodePreprocessors();
_logger.log(Level.INFO,
"core.preprocessor_class_name", value);
// Split the comma delimited list of bytecode preprocessor
// class names into the result array
result = value.split(",");
}
return result;
|
public com.sun.enterprise.config.ConfigContext | getConfigContext()Returns the config context associated with this manager.
return this.configContext;
|
public java.lang.String | getContextRoot(java.lang.String id)override for Web Modules
throw new UnsupportedOperationException(Localizer.getValue(
ExceptionType.UNSUPPORTED, "getContextRoot()"));
|
public abstract java.lang.String | getDescription(java.lang.String id)
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.ClassLoader cl, boolean validateXML)Returns a virtual application for standalone module or a fully
initialized application object from the deployment descriptors
return getDescriptor(modId, cl, getLocation(modId), validateXML);
|
public abstract com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String modId, java.lang.ClassLoader cl, java.lang.String loc, boolean validateXML)Returns a virtual application for standalone module or a fully
initialized application object from the deployment descriptors
|
public com.sun.enterprise.deployment.Application | getDescriptor(java.lang.String appID)This method only returns from cache. Call it only when you are
are sure the application should be in the instance managers.
return getRegisteredDescriptor(appID);
|
public abstract java.lang.String | getGeneratedXMLLocation(java.lang.String id)
|
public InstanceEnvironment | getInstanceEnvironment()
return this.instanceEnvironment;
|
public java.util.List | getJavacOptions()Returns the javac options for deployment. The options can be anything
except "-d", "-classpath" and "-cp".
It tokenizes the options by blank space between them. It does
not to detect options like "-g -g -g" since javac handles it.
List javacOptions = new ArrayList();
// bean that represents the java configuration
JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_JAVACONFIG);
String options = jconfig.getJavacOptions();
if (options == null) {
options = jconfig.getDefaultJavacOptions();
}
StringTokenizer st = new StringTokenizer(options, " ");
while (st.hasMoreTokens()) {
String op = (String) st.nextToken();
if ( !(op.startsWith("-d")
|| op.startsWith("-cp") || op.startsWith("-classpath")) ) {
javacOptions.add(op);
} else {
_logger.log(Level.WARNING, "core.unsupported_javac_option", op);
}
}
return javacOptions;
|
public abstract java.lang.String | getLocation(java.lang.String id)
|
public abstract javax.enterprise.deploy.shared.ModuleType | getModuleType()
|
public com.sun.enterprise.deployment.Application | getRegisteredDescriptor(java.lang.String registrationName)
Map map = getRegisteredDescriptors();
if (map==null) {
return null;
}
return (Application) map.get(registrationName);
|
public abstract java.util.Map | getRegisteredDescriptors()
|
public long | getReloadPollIntervalInMillis()Returns the reload polling interval in milli-seconds.
// pool interval from server configuration in seconds
String intv = appConfig.getDynamicReloadPollIntervalInSeconds();
long pollIntv;
try {
pollIntv = Long.parseLong(intv) * 1000;
} catch (NumberFormatException nme) {
// use the default interval
intv = appConfig.getDefaultDynamicReloadPollIntervalInSeconds();
try {
pollIntv = Long.parseLong(intv) * 1000;
} catch (NumberFormatException ne) {
// this should never happen
pollIntv = 2000l;
}
}
return pollIntv;
|
public java.util.List | getRmicOptions()Returns the rmic options for deployment.
List rmicOptions = new ArrayList();
// bean that represents the java configuration
JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_JAVACONFIG);
String options = jconfig.getRmicOptions();
if (options == null) {
options = jconfig.getDefaultRmicOptions();
}
StringTokenizer st = new StringTokenizer(options, " ");
while (st.hasMoreTokens()) {
String op = (String) st.nextToken();
rmicOptions.add(op);
_logger.log(Level.FINE, "Detected Rmic option: " + op);
}
return rmicOptions;
|
public java.util.List | getSharedClasspath(boolean resolveOnDAS, java.lang.String target)Per the platform specification, connector classes are to be availble
to all applications, i.e. a connector deployed to target foo should
be available to apps deployed on foo (and not target bar). In that
case, we will need to figure out all connector module deployed to
the target on which the application is deployed. Resolving the
classpath accordlingly.
List classpath = new ArrayList();
ConnectorModule[] mods = null;
if (resolveOnDAS && (target != null)) {
mods = ServerHelper.getAssociatedConnectorModules(
configContext, target);
} else {
mods = ((Applications)this.configBean).getConnectorModule();
}
if (mods != null) {
for (int i=0; i<mods.length; i++) {
if (resolveOnDAS) {
classpath.add(RelativePathResolver.resolvePath(
mods[i].getLocation()));
} else {
classpath.add(mods[i].getLocation());
}
}
}
return classpath;
|
public java.lang.String | getStubLocation(java.lang.String id)
throw new UnsupportedOperationException(Localizer.getValue(
ExceptionType.UNSUPPORTED, "getStubLocation()"));
|
public java.util.List | getSystemCPathPrefixNSuffix()Returns the java class path for this server instance.
It includes the "classpath-prefix" and "classpath-suffix".
This method is called during deployment to construct the
class loader. Deployment assumes that server class path will
not differ between admin instance and a regular instance.
So, only prefix and suffix are added to the class path.
List classPath = new ArrayList();
// bean that represents the java configuration
JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_JAVACONFIG);
// add the class path prefix first
String prefix = jconfig.getClasspathPrefix();
if (prefix != null) {
StringTokenizer st = new StringTokenizer(prefix,File.pathSeparator);
while (st.hasMoreTokens()) {
classPath.add(st.nextToken());
}
}
// adds the class path suffix to the list
String suffix = jconfig.getClasspathSuffix();
if (suffix != null) {
StringTokenizer st = new StringTokenizer(suffix,File.pathSeparator);
while (st.hasMoreTokens()) {
classPath.add(st.nextToken());
}
}
return classPath;
|
public java.util.List | getSystemClasspath()Returns the system class path for this server instance.
It includes the "classpath-prefix", "classpath" and "classpath-suffix".
if(!Boolean.getBoolean(com.sun.enterprise.server.PELaunch.USE_NEW_CLASSLOADER_PROPERTY)){
List classPath = new ArrayList();
// bean that represents the java configuration
JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_JAVACONFIG);
// add the class path prefix first
String prefix = jconfig.getClasspathPrefix();
if (prefix != null) {
StringTokenizer st = new StringTokenizer(prefix,File.pathSeparator);
while (st.hasMoreTokens()) {
classPath.add(st.nextToken());
}
}
// adds the server classpath to the list
String serverClasspath = jconfig.getServerClasspath();
if (serverClasspath != null) {
StringTokenizer st =
new StringTokenizer(serverClasspath,File.pathSeparator);
while (st.hasMoreTokens()) {
classPath.add(st.nextToken());
}
}
// adds the class path suffix to the list
String suffix = jconfig.getClasspathSuffix();
if (suffix != null) {
StringTokenizer st = new StringTokenizer(suffix,File.pathSeparator);
while (st.hasMoreTokens()) {
classPath.add(st.nextToken());
}
}
return classPath;
} else {
return com.sun.enterprise.server.PELaunch.getServerClasspath();
}
|
public boolean | isByteCodePreprocessingEnabled()Returns a boolean indicating whether or not bytecode preprocessing is
enabled. The bytecode preprocessor is deemed to be enabled if if a
value for bytecode-preprocessors is set in the java config.
boolean result = false;
//ROB: config changes
JavaConfig jc = ServerBeansFactory.getJavaConfigBean(configContext);
if (jc != null) {
if (jc.getBytecodePreprocessors() != null) {
result = true;
}
}
return result;
|
public boolean | isDynamicReloadEnabled()Returns true if dynamic reloading is enabled.
//ROB: config changes
//return ((Applications)this.configBean).isDynamicReloadEnabled();
return appConfig.isDynamicReloadEnabled();
|
public abstract boolean | isEnabled(java.lang.String id)
|
public boolean | isEnvClasspathIgnored()Returns true if environment class path ignore flag is turned on.
// bean that represents the java configuration
JavaConfig jconfig = (JavaConfig) ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_JAVACONFIG);
return jconfig.isEnvClasspathIgnored();
|
public final boolean | isIASOwned(java.lang.String id)
// WBN 2/7/2002 -- I don't think this bit of info is ever going
// to be persisted. Here is a M^2 technology way of doing it.
assert instanceEnvironment != null;
try
{
return instanceEnvironment.isIASOwned(getLocation(id));
}
catch(Exception e)
{
return false;
}
|
boolean | isReferenced(java.lang.String appId)Returns true if the given application is referenced by this
server instance.
try {
return ServerHelper.serverReferencesApplication(this.configContext,
instanceEnvironment.getName(), appId);
} catch (ConfigException ex) {
//This represents an unexpected exception. Log and return false
_logger.log(Level.WARNING, "isReferenced.unexpectedException", ex);
return false;
}
|
public boolean | isRegistered(java.lang.String id)
return isRegistered(id, this.configBean);
|
protected abstract boolean | isRegistered(java.lang.String id, com.sun.enterprise.config.ConfigBean bean)
|
public static java.lang.String | isRegisteredAnywhere(InstanceEnvironment ienv, java.lang.String id)
try {
BaseManager[] mans = new BaseManager[]{
new WebModulesManager(ienv),
new EjbModulesManager(ienv),
new AppclientModulesManager(ienv),
new ConnectorModulesManager(ienv),
new AppsManager(ienv)
};
String[] errors = new String[] {"Web Module", "EJB Module", "App Client Module", "Connector Module", "Application"};
for(int i = 0; i < mans.length; i++){
if(mans[i].listIds().contains(id)) {
return errors[i];
}
}
}
catch(Exception e){
}
return null;
|
public boolean | isShared(java.lang.String id)
throw new UnsupportedOperationException(
Localizer.getValue(ExceptionType.UNSUPPORTED, "isShared()"));
|
public abstract boolean | isSystem(java.lang.String id)
|
public abstract boolean | isSystemAdmin(java.lang.String id)
|
public abstract boolean | isSystemPredeployed(java.lang.String id)
|
public abstract java.util.List | listIds()
|
protected com.sun.enterprise.deployment.deploy.shared.FileArchive | openDDArchive(java.lang.String appId, java.lang.String appDir)
FileArchive in = new FileArchive();
if (isSystemPredeployed(appId)) {
in.open(appDir);
} else {
String xmlDir = getGeneratedXMLLocation(appId);
if (FileUtils.safeIsDirectory(xmlDir)) {
in.open(xmlDir);
} else {
// log a warning message in the server log
_logger.log(Level.WARNING, "core.no_xmldir",
new Object[]{xmlDir, appDir});
in.open(appDir);
}
}
return in;
|
protected void | readPersistenceDeploymentDescriptors(java.lang.String appDir, com.sun.enterprise.deployment.Application application)This method is needed because we need to read persistence descriptors
from the original app exploded dir as opposed to generated dir
because generated XML do not contain any information about PUs.
One way to avoid this would be to write out PU details in
sun-application.xml, but we have not done that yet.
FileArchive archive = new FileArchive();
archive.open(appDir);
try {
ApplicationArchivist.readPersistenceDeploymentDescriptorsRecursively(
archive, application);
} finally {
archive.close();
}
|
public synchronized void | refreshConfigContext(com.sun.enterprise.config.ConfigContext ctx)Refreshes config context using the given context. This method is called
during dynamic deploy/undeploy of applications and stand alone modules.
this.configContext = ctx;
this.configBean = ConfigBeansFactory.
getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_APPLICATIONS);
|
public synchronized void | refreshConfigContext()
configContext.refresh(true);
configBean = ConfigBeansFactory.getConfigBeanByXPath(this.configContext,
ServerXPathHelper.XPATH_APPLICATIONS);
|
public void | registerDescriptor(java.lang.String registrationName, com.sun.enterprise.deployment.Application descriptor)register an new application descriptor in the map
Map map = getRegisteredDescriptors();
if (map==null) {
return;
}
map.put(registrationName, descriptor);
|
public abstract void | remove(java.lang.String name)
|
public void | saveAppDescriptor(java.lang.String appId, com.sun.enterprise.deployment.Application appDes, java.lang.String appDir, java.lang.String generatedAppDir, boolean isVirtual)
try {
if (isVirtual) {
appDes.setVirtual(true);
}
SerializedDescriptorHelper.store(appId, this, appDes);
FileArchive archive = new FileArchive();
archive.open(generatedAppDir);
FileArchive archive2 = new FileArchive();
archive2.open(appDir);
DescriptorArchivist archivist = new DescriptorArchivist();
archivist.write(appDes, archive2, archive);
// copy the additional webservice elements etc
Archivist.copyExtraElements(archive2, archive);
} catch (Throwable t) {
throw new ConfigException(
Localizer.getValue(ExceptionType.FAIL_DD_SAVE, appId), t);
}
|
public void | saveConfigContext()
if(!this.useBackupServerXml) {
throw new ConfigException(Localizer.getValue(ExceptionType.CANT_APPLY));
}
this.configContext.flush();
|
public void | setContextRoot(java.lang.String id, java.lang.String value)override for Web Modules
throw new UnsupportedOperationException(Localizer.getValue(
ExceptionType.UNSUPPORTED, "setContextRoot()"));
|
public abstract void | setDescription(java.lang.String id, java.lang.String desc)
|
public abstract void | setEnable(java.lang.String id, boolean enabled)
|
public abstract void | setLocation(java.lang.String id, java.lang.String location)
|
public abstract void | setOptionalAttributes(java.lang.String id, java.util.Properties optionalAttributes)
|
public void | setShared(java.lang.String modId, boolean shared)
throw new UnsupportedOperationException(Localizer.getValue(
ExceptionType.UNSUPPORTED, "setShared()"));
|
public void | setVirtualServers(java.lang.String modId, java.lang.String value)
|
public void | unregisterDescriptor(java.lang.String registrationName)
Map map = getRegisteredDescriptors();
if (map==null) {
return;
}
map.remove(registrationName);
|