Package org.glassfish.server
Class ServerEnvironmentImpl
- java.lang.Object
-
- org.glassfish.server.ServerEnvironmentImpl
-
- All Implemented Interfaces:
org.glassfish.api.admin.ServerEnvironment,org.glassfish.hk2.api.PostConstruct
@Service public class ServerEnvironmentImpl extends Object implements org.glassfish.api.admin.ServerEnvironment, org.glassfish.hk2.api.PostConstruct
Defines various global configuration for the running GlassFish instance.This primarily replaces all the system variables in V2.
- Author:
- Jerome Dochez, Byron Nevins
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_ADMIN_CONSOLE_APP_NAMEstatic StringDEFAULT_ADMIN_CONSOLE_CONTEXT_ROOTstatic StringkAppAltDDDirNamestatic StringkConfigDirNamefolder where the configuration of this instance is storedstatic StringkConfigXMLFileNamestatic StringkConfigXMLFileNameBackupstatic StringkDefaultLoggingPropertiesFileNamestatic StringkEJBStubDirNamestatic StringkGeneratedDirNamefolder where all generated code like compiled jsps, stubs is storedstatic StringkGeneratedXMLDirNamestatic StringkInitFileNameinit file namestatic StringkLoggingPropertiesFileNamestatic StringkPolicyFileDirNamestatic StringkRepositoryDirName
-
Constructor Summary
Constructors Constructor Description ServerEnvironmentImpl()Compute all the values per default.ServerEnvironmentImpl(File root)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FilegetApplicationAltDDPath()Gets the directory to store external alternate deployment descriptors NormallyROOT/generated/altddFilegetApplicationCompileJspPath()Returns the path for compiled JSP Pages from an application that is deployed on this instance.FilegetApplicationEJBStubPath()FilegetApplicationGeneratedXMLPath()FilegetApplicationPolicyFilePath()Returns the path for policy files for applications deployed on this instance.FilegetApplicationRepositoryPath()Gets the directory to store deployed applications NormallyROOT/applicationsFilegetApplicationStubPath()Gets the directory to store generated stuff.FilegetConfigDirPath()Gets the directory to store configuration.FilegetDefaultAdminConsoleFolderOnDisk()Returns the folder where the admin console application's folder (in the name of admin console application) should be found.StringgetDomainName()FilegetDomainRoot()Deprecated.As of GlassFish 3.1 replaced withgetInstanceRoot()FilegetInitFilePath()Gets the init.conf file.StringgetInstanceName()Every server has a name that can be found in the server element in domain.xmlFilegetInstanceRoot()FilegetJKS()FilegetLibPath()Gets the directory for hosting user-provided jar files.FilegetMasterPasswordFile()StringgetProp(String key)Return the value of one property.Map<String,String>getProps()org.glassfish.api.admin.RuntimeTypegetRuntimeType()com.sun.enterprise.module.bootstrap.StartupContextgetStartupContext()org.glassfish.api.admin.ServerEnvironment.StatusgetStatus()FilegetTrustStore()booleanisDas()Am I a running GlassFish DAS server?booleanisDebug()booleanisEmbedded()booleanisInstance()Am I a running GlassFish server instance?booleanisVerbose()voidpostConstruct()This is where the real initialization happens.voidsetStatus(org.glassfish.api.admin.ServerEnvironment.Status status)
-
-
-
Field Detail
-
kGeneratedDirName
public static final String kGeneratedDirName
folder where all generated code like compiled jsps, stubs is stored- See Also:
- Constant Field Values
-
kRepositoryDirName
public static final String kRepositoryDirName
- See Also:
- Constant Field Values
-
kAppAltDDDirName
public static final String kAppAltDDDirName
- See Also:
- Constant Field Values
-
kEJBStubDirName
public static final String kEJBStubDirName
- See Also:
- Constant Field Values
-
kGeneratedXMLDirName
public static final String kGeneratedXMLDirName
- See Also:
- Constant Field Values
-
kPolicyFileDirName
public static final String kPolicyFileDirName
- See Also:
- Constant Field Values
-
kConfigXMLFileName
public static final String kConfigXMLFileName
- See Also:
- Constant Field Values
-
kConfigXMLFileNameBackup
public static final String kConfigXMLFileNameBackup
- See Also:
- Constant Field Values
-
kLoggingPropertiesFileName
public static final String kLoggingPropertiesFileName
- See Also:
- Constant Field Values
-
kDefaultLoggingPropertiesFileName
public static final String kDefaultLoggingPropertiesFileName
- See Also:
- Constant Field Values
-
kConfigDirName
public static final String kConfigDirName
folder where the configuration of this instance is stored- See Also:
- Constant Field Values
-
kInitFileName
public static final String kInitFileName
init file name- See Also:
- Constant Field Values
-
DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT
public static final String DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT
- See Also:
- Constant Field Values
-
DEFAULT_ADMIN_CONSOLE_APP_NAME
public static final String DEFAULT_ADMIN_CONSOLE_APP_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServerEnvironmentImpl
public ServerEnvironmentImpl()
Compute all the values per default.
-
ServerEnvironmentImpl
public ServerEnvironmentImpl(File root)
-
-
Method Detail
-
postConstruct
public void postConstruct()
This is where the real initialization happens.- Specified by:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
getDomainName
public String getDomainName()
-
getInstanceRoot
public File getInstanceRoot()
- Specified by:
getInstanceRootin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getDomainRoot
@Deprecated public File getDomainRoot()
Deprecated.As of GlassFish 3.1 replaced withgetInstanceRoot()- Specified by:
getDomainRootin interfaceorg.glassfish.api.admin.ServerEnvironment- Returns:
- the instance root
-
getStartupContext
public com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()
- Specified by:
getStartupContextin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getConfigDirPath
public File getConfigDirPath()
Gets the directory to store configuration. NormallyROOT/config- Specified by:
getConfigDirPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationRepositoryPath
public File getApplicationRepositoryPath()
Gets the directory to store deployed applications NormallyROOT/applications- Specified by:
getApplicationRepositoryPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationStubPath
public File getApplicationStubPath()
Gets the directory to store generated stuff. NormallyROOT/generated- Specified by:
getApplicationStubPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getInitFilePath
public File getInitFilePath()
Gets the init.conf file.
-
getLibPath
public File getLibPath()
Gets the directory for hosting user-provided jar files. NormallyROOT/lib- Specified by:
getLibPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationEJBStubPath
public File getApplicationEJBStubPath()
- Specified by:
getApplicationEJBStubPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationGeneratedXMLPath
public File getApplicationGeneratedXMLPath()
- Specified by:
getApplicationGeneratedXMLPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationCompileJspPath
public File getApplicationCompileJspPath()
Returns the path for compiled JSP Pages from an application that is deployed on this instance. By default all such compiled JSPs should lie in the same folder.- Specified by:
getApplicationCompileJspPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationPolicyFilePath
public File getApplicationPolicyFilePath()
Returns the path for policy files for applications deployed on this instance.- Specified by:
getApplicationPolicyFilePathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationAltDDPath
public File getApplicationAltDDPath()
Gets the directory to store external alternate deployment descriptors NormallyROOT/generated/altdd- Specified by:
getApplicationAltDDPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getProp
public final String getProp(String key)
Return the value of one property. Example
String pr = getProp(SystemPropertyConstants.PRODUCT_ROOT_PROPERTY);- Parameters:
key- the name of the property- Returns:
- the value of the property
-
getDefaultAdminConsoleFolderOnDisk
public File getDefaultAdminConsoleFolderOnDisk()
Returns the folder where the admin console application's folder (in the name of admin console application) should be found. Thus by default, it should be: [install-dir]/lib/install/applications. No attempt is made to check if this location is readable or writable.- Returns:
- java.io.File representing parent folder for admin console application Never returns a null
-
getMasterPasswordFile
public File getMasterPasswordFile()
- Specified by:
getMasterPasswordFilein interfaceorg.glassfish.api.admin.ServerEnvironment
-
getJKS
public File getJKS()
- Specified by:
getJKSin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getTrustStore
public File getTrustStore()
- Specified by:
getTrustStorein interfaceorg.glassfish.api.admin.ServerEnvironment
-
getStatus
public org.glassfish.api.admin.ServerEnvironment.Status getStatus()
- Specified by:
getStatusin interfaceorg.glassfish.api.admin.ServerEnvironment
-
setStatus
public void setStatus(org.glassfish.api.admin.ServerEnvironment.Status status)
-
isEmbedded
public boolean isEmbedded()
-
getRuntimeType
public org.glassfish.api.admin.RuntimeType getRuntimeType()
- Specified by:
getRuntimeTypein interfaceorg.glassfish.api.admin.ServerEnvironment
-
getInstanceName
public String getInstanceName()
Every server has a name that can be found in the server element in domain.xml- Specified by:
getInstanceNamein interfaceorg.glassfish.api.admin.ServerEnvironment- Returns:
- the name of this server i.e. "my" name
-
isInstance
public boolean isInstance()
Am I a running GlassFish server instance?- Specified by:
isInstancein interfaceorg.glassfish.api.admin.ServerEnvironment- Returns:
- true if we are an instance
-
isDas
public boolean isDas()
Am I a running GlassFish DAS server?- Specified by:
isDasin interfaceorg.glassfish.api.admin.ServerEnvironment- Returns:
- true if we are a DAS
-
isDebug
public boolean isDebug()
-
isVerbose
public boolean isVerbose()
-
-