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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.api.admin.ServerEnvironment
org.glassfish.api.admin.ServerEnvironment.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringfolder where the configuration of this instance is storedstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringfolder where all generated code like compiled jsps, stubs is storedstatic final Stringstatic final Stringinit file namestatic final Stringstatic final Stringstatic final StringFields inherited from interface org.glassfish.api.admin.ServerEnvironment
DEFAULT_INSTANCE_NAME, kCompileJspDirName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the directory to store external alternate deployment descriptors NormallyROOT/generated/altddReturns the path for compiled JSP Pages from an application that is deployed on this instance.Returns the path for policy files for applications deployed on this instance.Gets the directory to store deployed applications NormallyROOT/applicationsGets the directory to store generated stuff.Gets the directory to store configuration.Returns the folder where the admin console application's folder (in the name of admin console application) should be found.Gets the init.conf file.Every server has a name that can be found in the server element in domain.xmlgetJKS()Gets the directory for hosting user-provided jar files.final StringReturn the value of one property.getProps()org.glassfish.api.admin.RuntimeTypecom.sun.enterprise.module.bootstrap.StartupContextorg.glassfish.api.admin.ServerEnvironment.StatusbooleanisDas()Am I a running GlassFish DAS server?booleanisDebug()booleanbooleanAm I a running GlassFish server instance?booleanvoidThis is where the real initialization happens.voidsetStatus(org.glassfish.api.admin.ServerEnvironment.Status status)
-
Field Details
-
kGeneratedDirName
folder where all generated code like compiled jsps, stubs is stored- See Also:
-
kRepositoryDirName
- See Also:
-
kAppAltDDDirName
- See Also:
-
kEJBStubDirName
- See Also:
-
kGeneratedXMLDirName
- See Also:
-
kPolicyFileDirName
- See Also:
-
kConfigXMLFileName
- See Also:
-
kConfigXMLFileNameBackup
- See Also:
-
kLoggingPropertiesFileName
- See Also:
-
kDefaultLoggingPropertiesFileName
- See Also:
-
kConfigDirName
folder where the configuration of this instance is stored- See Also:
-
kInitFileName
init file name- See Also:
-
DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT
- See Also:
-
DEFAULT_ADMIN_CONSOLE_APP_NAME
- See Also:
-
-
Constructor Details
-
ServerEnvironmentImpl
public ServerEnvironmentImpl()Compute all the values per default. -
ServerEnvironmentImpl
-
-
Method Details
-
postConstruct
public void postConstruct()This is where the real initialization happens.- Specified by:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
getDomainName
-
getInstanceRoot
- Specified by:
getInstanceRootin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getStartupContext
public com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()- Specified by:
getStartupContextin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getConfigDirPath
Gets the directory to store configuration. NormallyROOT/config- Specified by:
getConfigDirPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationRepositoryPath
Gets the directory to store deployed applications NormallyROOT/applications- Specified by:
getApplicationRepositoryPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationStubPath
Gets the directory to store generated stuff. NormallyROOT/generated- Specified by:
getApplicationStubPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getInitFilePath
Gets the init.conf file. -
getLibPath
Gets the directory for hosting user-provided jar files. NormallyROOT/lib- Specified by:
getLibPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationEJBStubPath
- Specified by:
getApplicationEJBStubPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationGeneratedXMLPath
- Specified by:
getApplicationGeneratedXMLPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
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
Returns the path for policy files for applications deployed on this instance.- Specified by:
getApplicationPolicyFilePathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getApplicationAltDDPath
Gets the directory to store external alternate deployment descriptors NormallyROOT/generated/altdd- Specified by:
getApplicationAltDDPathin interfaceorg.glassfish.api.admin.ServerEnvironment
-
getProp
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
-
getProps
-
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
- Specified by:
getMasterPasswordFilein interfaceorg.glassfish.api.admin.ServerEnvironment
-
getJKS
- Specified by:
getJKSin interfaceorg.glassfish.api.admin.ServerEnvironment
-
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
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()
-