FileDocCategorySizeDatePackage
ModuleEnvironment.javaAPI DocGlassfish v2 API8497Fri May 04 22:35:00 BST 2007com.sun.enterprise.instance

ModuleEnvironment

public class ModuleEnvironment extends Object
Represents the environment of a standalone module to be deployed to given Server Instance.
author
Kedar
version
1.0

Fields Summary
private String
mModuleName
private String
mModulePath
private String
mModuleBackupPath
private String
mModuleGeneratedXMLPath
private String
mJavaWebStartPath
private String
mModuleStubPath
private String
mModuleJSPPath
private InstanceEnvironment
mInstance
private com.sun.enterprise.deployment.backend.DeployableObjectType
mType
Constructors Summary
public ModuleEnvironment(InstanceEnvironment instance, String moduleName, com.sun.enterprise.deployment.backend.DeployableObjectType type)
Creates new ModuleEnvironment.

param
instance InstanceEnvironment representing the Server Instance in which this module is to be deployed.
param
moduleName String representing name of this module.
type
the type of module - has to be WEB, EJB or RES
throws
IllegalArgumentException if instance or moduleName is null or type is not one of the supported ones.

/*
 *
    public ModuleEnvironment (InstanceEnvironment instance, String moduleName,
		int type) {
		if (instance == null || moduleName == null) {
			throw new IllegalArgumentException();
		}
		if (type!= kEJBModule && type != kWebModule) {
			throw new IllegalArgumentException();
		}
		mInstance	= instance;
		mModuleName	= moduleName;
		createModulePath();
		createModuleStubPath();
		
		if(type == kEJBModule)
			mType = DeployableObjectType.EJB;

		else if(type == kWebModule)
			mType = DeployableObjectType.WEB;
		
		else
			throw new IllegalArgumentException();
		
		Reminder.message("DEPRECTAED API -- use the other constructor for ModuleEnvironment");
    }

 */	
	 		  		         		    		       		            				        		       	
	
         
		  
		if (instance == null || moduleName == null) {
			throw new IllegalArgumentException();
		}
		
		if(type == null) {	// impossible to have an invalid module type (except null!!)
			throw new IllegalArgumentException(Localizer.getValue(ExceptionType.NULL_MODULE_TYPE));
		}
		
		mType		= type;
		mInstance	= instance;
		mModuleName	= moduleName;
		createModulePath();
		createModuleBackupPath();
		createModuleStubPath();
		createModuleJSPPath();
		createModuleGeneratedXMLPath();
		createJavaWebStartPath();
    
Methods Summary
private voidcreateJavaWebStartPath()
Creates the path to this application's java-web-start directory.

               String[] onlyFolderNames = new String[] {
                       mInstance.getJavaWebStartPath(),
                       mModuleName
               };

               mJavaWebStartPath = StringUtils.makeFilePath (onlyFolderNames, false);
        
public voidcreateModuleBackupPath()
Returns the absolute path for the backup path for this directory-deployed module Note that it does not create/check file/directory with such a path.

		String[] onlyFolderNames = new String[] {
			mInstance.getModuleBackupRepositoryPath(),
			mModuleName
		};
		
		mModuleBackupPath = StringUtils.makeFilePath (onlyFolderNames, false);
	
public voidcreateModuleGeneratedXMLPath()
Returns the absolute path for storing all the generated xml of this module. Note that it does not create/check file/directory with such a path.

		String[] onlyFolderNames = new String[] {
			mInstance.getModuleGeneratedXMLPath(),
			mModuleName
		};
		
		mModuleGeneratedXMLPath = StringUtils.makeFilePath (onlyFolderNames, false);
	
public voidcreateModuleJSPPath()
Creates the absolute path for storing the generated JSPs of this module. Note that it does not create/check file/directory with such a path.

		String[] onlyFolderNames = new String[] {
			mInstance.getWebModuleCompileJspPath(),
			mModuleName
		};
		
		mModuleJSPPath = StringUtils.makeFilePath (onlyFolderNames, false);
	
private voidcreateModulePath()

		String moduleRepositoryDirPath = mInstance.getModuleRepositoryPath ();
		String[] onlyFolderNames = new String[] {
			moduleRepositoryDirPath,
			mModuleName
			};
		mModulePath = StringUtils.makeFilePath (onlyFolderNames, false);
	
public voidcreateModuleStubPath()
Returns the absolute path for storing all the stubs of this module. Note that it does not create/check file/directory with such a path.

                String[] onlyFolderNames = new String[] {
                        mInstance.getModuleStubPath(),
                        mModuleName
                };

                mModuleStubPath = StringUtils.makeFilePath (onlyFolderNames, false);
        
public java.lang.StringgetJavaWebStartPath()
Returns the absolute path to the Java Web Start directory for this application. Note that it does not create/check file/directory with such a path.

            return mJavaWebStartPath;
        
public java.lang.StringgetModuleBackupPath()
Returns the absolute path for the backup path for this directory-deployed module Note that it does not create/check file/directory with such a path.

		return mModuleBackupPath;
	
public java.lang.StringgetModuleGeneratedXMLPath()
Returns the absolute path for the all the generated xml within this module. Note that it does not create/check file/directory with such a path.

		return mModuleGeneratedXMLPath;
	
public java.lang.StringgetModuleJSPPath()
Returns the absolute path for the generated JSPs from this module.

		return mModuleJSPPath;
	
public java.lang.StringgetModulePath()
Returns the absolute path for the all the elements within this module. Note that it does not create/check file/directory with such a path.

		return mModulePath;
	
public java.lang.StringgetModuleStubPath()
Returns the absolute path for the all the stubs within this module. Note that it does not create/check file/directory with such a path.

                return mModuleStubPath;
        
public java.lang.Stringverify()
return a String with the error, in English, if the required directories aren't there or have a problem. return null if all is OK

			return null;