Methods Summary |
---|
public void | addOptionalArgument(java.lang.String key, java.lang.String value)Adds one optional argument.
optionalArguments.put(key, value);
|
public void | addOptionalArguments(java.util.Properties props)Adds the optional arguments for this request. Currently - these are CMP-only args.
It would have been nice to add these args to the pre-existing
optionalAttributes. But those attributes are all blindly added to Config by
classes in the instance package. It would have been a KLUDGE-fest to separate
the different name-value pairs in this class and then repackage. Which is why
we have yet-another Properties object.
bnevins 4/3/2003
/* We want to be slightly smart here. If this method is called more than once,
* we can't just wipe-out the earlier mappings!
* So we keep our own Properties object and always ADD to it...
* If this method is never called, optionalArguments will be empty but not null.
*/
optionalArguments.putAll(props);
|
public void | addOptionalArguments(java.util.Map map)
optionalArguments.putAll(map);
|
private void | checkForRedeploy()We need to figure-out if it is REALLY an App-Redeploy very early
because DeployerFactory needs to create the right kind of Deployer object
if(isUnDeploy())
return; // don't need to do anything!
assert (appEnv != null && moduleEnv == null)|| (appEnv == null && moduleEnv != null);
assert !isVerified;
assert StringUtils.ok(name);
assert instanceEnv != null;
if(moduleEnv != null)
{
// too difficult, and not neccessary, to figure this out here
return;
}
try
{
AppsManager appMgr = new AppsManager(instanceEnv);
boolean isReg = appMgr.isRegistered(name);
if(forced && isReg && isDeploy())
command = DeploymentCommand.REDEPLOY;
}
catch(Exception e)
{
throw new IASDeploymentException(e);
}
|
private void | createName()
String aname = fileSource.getSource().getName();
// special-case. If it's xxx.ear, the name is xxx, not xxx_ear
if(isEar())
name = FileUtils.makeFriendlyFilenameNoExtension(aname);
else
name = FileUtils.makeFriendlyFilename(aname);
|
public void | done()Releases any resources held by the deployment request, notably the
EJBClassLoader.
if ( ! isDone) {
isDone = true;
if (ejbClassLoader != null && ejbClassLoader instanceof EJBClassLoader) {
((EJBClassLoader) ejbClassLoader).done();
}
}
|
public int | getActionCode()returns the actionCode
return actionCode;
|
com.sun.enterprise.instance.ApplicationEnvironment | getAppEnv()
if(!isApplication()) {
String msg = localStrings.getString(
"enterprise.deployment.backend.illegal_getapplicationenv_call");
throw new IASDeploymentException( msg );
}
return appEnv;
|
public boolean | getCascade()returns true if cascade is true false otherwise
return this.cascade;
|
public java.io.File | getClientJar()
return clientJar;
|
DeploymentCommand | getCommand()
return command;
|
java.util.List | getCompleteClasspath()Returns the complete class paths for this request.
return this.completeClasspath;
|
public java.lang.String | getContextRoot()
return contextRoot;
|
public DeploymentStatus | getCurrentDeploymentStatus()Returns the current deployment status
return currentDeploymentStatus;
|
public boolean | getDebug()
return debug;
|
public java.lang.String | getDefaultContextRoot()
return defaultContextRoot;
|
public java.io.File | getDeployedDirectory()Return the App or Module Directory so that ownership can be modified, if neccessary.
if(!FileUtils.safeIsDirectory(deployedDirectory))
deployedDirectory = null;
return deployedDirectory;
|
public com.sun.enterprise.management.deploy.DeploymentCallback | getDeploymentCallback()
return deploymentCallback;
|
public java.io.File | getDeploymentPlan()
return deploymentPlan;
|
public java.lang.String | getDescription()
return description;
|
public com.sun.enterprise.deployment.Application | getDescriptor()
return application;
|
java.lang.ClassLoader | getEjbClassLoader()Returns the ejb class loader for this request.
return this.ejbClassLoader;
|
public FileSource | getFileSource()
return fileSource;
|
public boolean | getGenerateRMIStubs()
return generateRMIStubs;
|
public java.io.File | getGeneratedXMLDirectory()Return the Directory where the modified xml files will be located.
if(!FileUtils.safeIsDirectory(generatedXMLDirectory))
generatedXMLDirectory = null;
return generatedXMLDirectory;
|
public java.lang.String | getHttpHostName()
return httpHostName;
|
public int | getHttpPort()
return httpPort;
|
public java.lang.String | getHttpsHostName()
return httpsHostName;
|
public int | getHttpsPort()
return httpsPort;
|
public com.sun.enterprise.instance.InstanceEnvironment | getInstanceEnv()String getInstanceName()
{
return instanceEnv.getName();
}
return instanceEnv;
|
public java.io.File | getJSPDirectory()Return the Stubs Directory so that ownership can be modified, if neccessary.
if(!FileUtils.safeIsDirectory(jspDirectory))
jspDirectory = null;
return jspDirectory;
|
public java.lang.String | getLibraries()
return libraries;
|
java.util.List | getModuleClasspath()
return moduleClasspath;
|
com.sun.enterprise.instance.ModuleEnvironment | getModuleEnv()
if(!isModule()) {
String msg = localStrings.getString(
"enterprise.deployment.backend.illegal_getmoduleenv_call");
throw new IASDeploymentException( msg );
}
return moduleEnv;
|
public java.lang.String | getName()
return name;
|
public boolean | getNoEJBC()
return noEJBC;
|
public java.util.Properties | getOptionalArguments()Returns the optional arguments for this request.
It is guaranteed to be not-null, but might be empty.
return optionalArguments;
|
public java.util.Properties | getOptionalAttributes()Returns the optional attributes for this request.
return this.optionalAttributes;
|
java.lang.ClassLoader | getParentClassLoader()Returns the parent class loader for this request.
return this.parentClassLoader;
|
java.util.List | getParentClasspath()Returns the parent class paths for this request.
return this.parentClasspath;
|
public boolean | getPrecompileJSP()
return precompileJSP;
|
public boolean | getReRegisterOnFailure()Should the app or module be re-registered on fatal errors?
If false is returned, this means that it could NOT be rollbacked
to a previous working version.
return reregisterOnFailure;
|
public java.lang.String | getResourceAction()
return resourceAction;
|
public java.lang.String | getResourceTargetList()
return resourceTargetList;
|
public java.io.File | getStubsDirectory()Return the Stubs Directory so that ownership can be modified, if neccessary.
if(!FileUtils.safeIsDirectory(stubsDirectory))
stubsDirectory = null;
return stubsDirectory;
|
public javax.enterprise.deploy.spi.Target | getTarget()Returns the target
return target;
|
public java.lang.String | getTargetName()
return targetName;
|
public DeployableObjectType | getType()
return type;
|
public boolean | isAborted()
return isAborted;
|
public boolean | isAppClientModule()
return DeployableObjectType.CAR.equals(type);
|
public boolean | isApplication()
return DeployableObjectType.APP.equals(type);
|
public boolean | isArchive()
if(isUnDeploy()) {
String msg = localStrings.getString(
"enterprise.deployment.backend.invalid_isarchive_call" );
throw new IASDeploymentException( msg );
}
return getFileSource().isArchive();
|
public boolean | isAvailabilityEnabled()
return availabilityEnabled;
|
public boolean | isConnectorModule()
return DeployableObjectType.CONN.equals(type);
|
private boolean | isContextRootRequired()
// it is required for WebModules that are Deployed or Redeployed
return isWebModule() && ( isDeploy() || isReDeploy());
|
public boolean | isDeploy()
if(command == null)
{
String msg =localStrings.getString( "enterprise.deployment.backend.no_command");
throw new IASDeploymentException( msg );
}
// setCommand, called from the ctor already verified command
// if this assert fires that means a programmer must have set the
// command back to null -- Programmer Error
//assert command != null;
// check for null again -- this might be a release build!
//if(command == null)
//return false;
return command.equals(DeploymentCommand.DEPLOY);
|
public boolean | isDirectory()
if(isUnDeploy())
//throw new IASDeploymentException("Internal Error -- invalid to call isDirectory() for an Undeploy");
return false;
return getFileSource().isDirectory();
|
boolean | isEar()
// check if it's archive deployment and
// if it's an application
return isApplication() && fileSource.isArchive();
|
boolean | isEjbJar()
// check if it's archive deployment and
// if it's a ejb module
return isEjbModule() && fileSource.isArchive();
|
public boolean | isEjbModule()
return DeployableObjectType.EJB.equals(type);
|
public boolean | isExternallyManagedApp()
return isExternallyManagedApp;
|
public boolean | isExternallyManagedPath()
return isExternallyManagedPath;
|
private boolean | isFileSourceRequired()
if(isUnDeploy())
return false;
else
return true;
|
public boolean | isForced()gets the 'forced' attribute.
return forced;
|
public boolean | isJavaWebStartEnabled()
return javaWebStartEnabled;
|
boolean | isMaybeCMPDropTables()return false, if the variable is false. Any other case -- return true.
String s = getOptionalArguments().getProperty(Constants.CMP_DROP_TABLES);
if(s != null && s.equalsIgnoreCase(Constants.FALSE))
return false;
return true;
|
public boolean | isModule()
return isWebModule() || isEjbModule() || isConnectorModule() || isAppClientModule();
|
private boolean | isNameRequired()
if(isDeploy())
return false;
else
return true;
|
public boolean | isReDeploy()
if(command == null)
{
String msg =localStrings.getString( "enterprise.deployment.backend.no_command");
throw new IASDeploymentException( msg );
}
// setCommand, called from the ctor already verified command
// if this assert fires that means a programmer must have set the
// command back to null -- Programmer Error
//assert command != null;
// check for null again -- this might be a release build!
//if(command == null)
//return false;
return command.equals(DeploymentCommand.REDEPLOY);
|
public boolean | isRedeployInProgress()Reports whether this request is part of a larger redeployment sequence.
return isRedeployInProgress;
|
public boolean | isReload()
return isReload;
|
public boolean | isSharedModule()
return isModule() && shared;
|
public boolean | isStandAloneModule()
return isModule() && !shared;
|
public boolean | isStartOnDeploy()returns true if isStartOnDeploy is true false otherwise
return this.startOnDeploy;
|
public boolean | isUnDeploy()
if(command == null)
{
String msg =localStrings.getString( "enterprise.deployment.backend.no_command");
throw new IASDeploymentException( msg );
}
// setCommand, called from the ctor already verified command
// if this assert fires that means a programmer must have set the
// command back to null -- Programmer Error
//assert command != null;
// check for null again -- this might be a release build!
//if(command == null)
//return false;
return command.equals(DeploymentCommand.UNDEPLOY);
|
public boolean | isVerifying()Returns a boolean indicating whether this application is going
to be verified during deployment.
return isVerifying;
|
boolean | isWar()
// check if it's archive deployment and
// if it's a web module
return isWebModule() && fileSource.isArchive();
|
public boolean | isWebModule()
return DeployableObjectType.WEB.equals(type);
|
public void | setAbort(boolean isAborted)
this.isAborted = isAborted;
|
public void | setActionCode(int actionCode)Sets the actioncode to as specified
this.actionCode = actionCode;
|
public void | setAvailabilityEnabled(boolean newAvailabilityEnabled)sets the 'availability-enabled' attribute.
availabilityEnabled = newAvailabilityEnabled;
|
public void | setCascade(boolean cascade)Sets cascade. Dependent resources associated with a connector resource are
destroyed if this flag is true
this.cascade = cascade;
|
void | setClientJar(java.io.File f)
/*
File p = f.getParentFile();
if(!FileUtils.safeIsDirectory(f))
throw new IASDeploymentException("Illegal parameter to setClientJarFile(). " +
"The file (" + FileUtils.safeGetCanonicalPath(f) + ") has no existing parent directory.");
*/
clientJar = f;
|
void | setCommand(DeploymentCommand theCommand)
command = theCommand;
if(command == null) {
String msg = localStrings.getString(
"enterprise.deployment.backend.null_command_type" );
throw new IASDeploymentException( msg );
}
|
void | setCompleteClasspath(java.util.List classpaths)Sets the complete class paths for this request.
this.completeClasspath = classpaths;
|
public void | setContextRoot(java.lang.String s)Set the Context Root for Web Modules
contextRoot = s;
|
public void | setCurrentDeploymentStatus(DeploymentStatus status)Sets the current deployment status to as specified
currentDeploymentStatus = status;
|
public void | setDebug(boolean what)
debug = true;
|
public void | setDefaultContextRoot(java.lang.String s)Set the default Context Root for Web Modules
defaultContextRoot = s;
|
public void | setDeployedDirectory(java.io.File d)Set the App or Module Directory so that ownership can be modified, if neccessary.
deployedDirectory = d;
|
public void | setDeploymentCallback(com.sun.enterprise.management.deploy.DeploymentCallback callback)
deploymentCallback = callback;
|
public void | setDeploymentPlan(java.io.File plan)
deploymentPlan = plan;
|
public void | setDescription(java.lang.String description)Sets the description associated with this request
this.description = description;
|
public void | setDescriptor(com.sun.enterprise.deployment.Application app)Sets the descriptor associated with this request
this.application = app;
|
void | setEjbClassLoader(java.lang.ClassLoader cl)Sets the ejb class loader to be used for this request.
this.ejbClassLoader = cl;
|
private void | setEnv()
if(instanceEnv == null) {
String msg = localStrings.getString(
"enterprise.deployment.backend.null_instanceenvironment" );
throw new IASDeploymentException( msg );
}
if(isApplication())
appEnv = new ApplicationEnvironment(instanceEnv, name);
else if(isWebModule())
moduleEnv = new ModuleEnvironment(instanceEnv, name, DeployableObjectType.WEB);
else if(isEjbModule())
moduleEnv = new ModuleEnvironment(instanceEnv, name, DeployableObjectType.EJB);
else if(isConnectorModule())
moduleEnv = new ModuleEnvironment(instanceEnv, name, DeployableObjectType.CONN);
else if (isAppClientModule())
moduleEnv = new ModuleEnvironment(instanceEnv, name ,DeployableObjectType.CAR);
else {
String msg = localStrings.getString(
"enterprise.deployment.backend.unknown_deployable_object",
getClass().getName() );
throw new IASDeploymentException( msg );
}
|
public void | setExternallyManagedApp(boolean isExtManagedApp)
isExternallyManagedApp = isExtManagedApp;
|
public void | setExternallyManagedPath(boolean isExtManagedPath)
isExternallyManagedPath = isExtManagedPath;
|
public void | setFileSource(java.lang.String src)Sets the source of deployment files.
Deploy - required
Redeploy - required
Undeploy - not required
setFileSource(new File(src));
|
public void | setFileSource(java.io.File src)Sets the source of deployment files.
Deploy - required
Redeploy - required
Undeploy - not required
fileSource = null;
if(src == null && !isFileSourceRequired())
return; // all OK...
try
{
fileSource = new FileSource(src);
}
catch(Exception e)
{
if(isFileSourceRequired())
throw new IASDeploymentException("DeploymentRequest.setFileSource()" + e);
}
|
public void | setForced(boolean newForced)sets the 'forced' attribute. If set to true - no error occurs if the App or Module is
already registered. If false, an Exception will be thrown if the App or Module is already
deployed.
forced = newForced;
|
public void | setGenerateRMIStubs(boolean newGenerateRMIStubs)sets the 'generate-rmi-stubs' attribute.
generateRMIStubs = newGenerateRMIStubs;
|
public void | setGeneratedXMLDirectory(java.io.File d)Set the Directory where the modified xml files will be located
generatedXMLDirectory = d;
|
public void | setHttpHostName(java.lang.String hostName)
httpHostName = hostName;
|
public void | setHttpPort(int port)
httpPort = port;
|
public void | setHttpsHostName(java.lang.String hostName)
httpsHostName = hostName;
|
public void | setHttpsPort(int port)
httpsPort = port;
|
public void | setIsRedeployInProgress(boolean inProgress)Sets whether this request is part of a larger redeployment sequence.
isRedeployInProgress = inProgress;
|
public void | setJSPDirectory(java.io.File d)Set the Stubs Directory so that ownership can be modified, if neccessary.
jspDirectory = d;
|
public void | setJavaWebStartEnabled(boolean newJavaWebStartEnabled)sets the 'java-web-start-enabled' attribute.
javaWebStartEnabled = newJavaWebStartEnabled;
|
public void | setLibraries(java.lang.String newLibraries)sets the 'libraries' attribute.
libraries = newLibraries;
|
void | setModuleClasspath(java.util.List classpath)Sets the module classpath (no env classpath) for this
request
moduleClasspath = classpath;
|
public void | setName(java.lang.String theName)sets the Name of the App or Module. If you don't call this, and if it's legal,
one will be provided for you at no cost.
Deploy - not required
Redeploy - required
Undeploy - required
if(StringUtils.ok(theName))
name = theName;
else if(isNameRequired()) {
String msg = localStrings.getString(
"enterprise.deployment.backend.null_setname" );
throw new IASDeploymentException( msg );
}
|
public void | setNoEJBC()
noEJBC = true;
|
public void | setOptionalAttributes(java.util.Properties optionalAttributes)Sets the optional attributes for this request.
this.optionalAttributes = optionalAttributes;
|
void | setParentClassLoader(java.lang.ClassLoader cl)Sets the parent class loader to be used for this request.
this.parentClassLoader = cl;
|
void | setParentClasspath(java.util.List classpaths)Sets the parent class paths for this request.
this.parentClasspath = classpaths;
|
public void | setPrecompileJSP(boolean newPrecompileJSP)sets the 'precompile-jsp' attribute. If set to true - JSP precompilation is
performed, if neccessary. If the precompile has errors, the deployment will
officially fail. This feature is by default, false.
precompileJSP = newPrecompileJSP;
|
void | setReRegisterOnFailure(boolean b)
reregisterOnFailure = b;
|
public void | setReload(boolean isReload)
this.isReload = isReload;
|
public void | setResourceAction(java.lang.String newResourceAction)sets the 'resourceAction' attribute.
resourceAction = newResourceAction;
|
public void | setResourceTargetList(java.lang.String newTargetList)sets the 'targetList' attribute.
resourceTargetList = newTargetList;
|
public void | setShared(boolean newShared)sets the 'shared' attribute
if(!isEjbModule()) {
String msg = localStrings.getString(
"enterprise.deployment.backend.cannot_set_shared_flag" );
throw new IASDeploymentException( msg );
}
shared = newShared;
|
public void | setStartOnDeploy(boolean startOnDeploy)Sets startOnUndeploy. An application is set to enabled after
deployment or association when this is true
this.startOnDeploy = startOnDeploy;
|
public void | setStubsDirectory(java.io.File d)Set the Stubs Directory so that ownership can be modified, if neccessary.
stubsDirectory = d;
|
public void | setTarget(javax.enterprise.deploy.spi.Target target)Sets the target to as specified
this.target = target;
|
public void | setTargetName(java.lang.String name)
targetName = name;
|
private void | setType(DeployableObjectType theType)
type = theType;
if(isConnectorModule())
shared = true;
else
shared = false;
|
public void | setVerifying(boolean what)Deployment backend runs verifier during deployment when set to true.
isVerifying = what;
|
public java.lang.String | toString()
return ObjectAnalyzer.toString(this);
|
public void | verify()Makes sure everything that needs to be setup is OK. Use it
just before deploying
WBN: 4-26-02 added code to change Deploy to Redeploy if neccessary
if(isVerified)
return;
if(isFileSourceRequired() && fileSource == null) {
String msg = localStrings.getString(
"enterprise.deployment.backend.file_source_required" );
throw new IASDeploymentException( msg );
}
if(isNameRequired() && name == null) {
String msg = localStrings.getString(
"enterprise.deployment.backend.name_required" );
throw new IASDeploymentException( msg );
}
if(isContextRootRequired() && contextRoot == null &&
defaultContextRoot == null) {
String msg = localStrings.getString(
"enterprise.deployment.backend.context_root_required" );
throw new IASDeploymentException( msg );
}
if(name == null) // this is true iff no name is required to be supplied
createName();
// Bug 4679970 -- we must have a file-system-legal name.
// we have a contract with other code that there will be a client jar
// whose name is <app-name>Client.jar
// thus AppName: "foo?<*//x" --> "foo?<*//xClient.jar" -- impossible to create!!
if(!FileUtils.isLegalFilename(name))
{
// 2 approaches -- (1) don't allow it and (2) change the name
// We're going with approach (1) for now...
// approach (1)
String msg = localStrings.getString(
"enterprise.deployment.backend.illegal_characters_in_component_name",
FileUtils.getIllegalFilenameCharacters() );
throw new IASDeploymentException( msg );
// approach (2)
//name = FileUtils.makeLegalFilename(name);
}
setEnv();
checkForRedeploy();
isVerified = true;
|