Class ServerEnvironmentImpl

  • All Implemented Interfaces:
    ServerEnvironment, org.glassfish.hk2.api.PostConstruct

    @Service
    public class ServerEnvironmentImpl
    extends Object
    implements 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
    • 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:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • getStartupContext

        public com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()
        Description copied from interface: ServerEnvironment
        return the startup context used to initialize this runtime
        Specified by:
        getStartupContext in interface ServerEnvironment
      • getInitFilePath

        public File getInitFilePath()
        Gets the init.conf file.
      • getLibPath

        public File getLibPath()
        Gets the directory for hosting user-provided jar files. Normally ROOT/lib
        Specified by:
        getLibPath in interface 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:
        getApplicationCompileJspPath in interface ServerEnvironment
      • getApplicationAltDDPath

        public File getApplicationAltDDPath()
        Gets the directory to store external alternate deployment descriptors Normally ROOT/generated/altdd
        Specified by:
        getApplicationAltDDPath in interface 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()
        Description copied from interface: ServerEnvironment
        A JCEKS keystore which is locked with a fixed-key. This is the "security-by-obfuscation" carried over from V2.
        Specified by:
        getMasterPasswordFile in interface ServerEnvironment
        Returns:
        File representing the JCEKS store containing the real master password
      • getJKS

        public File getJKS()
        Description copied from interface: ServerEnvironment
        A Java KeyStore which is locked by administrator's master password.
        Specified by:
        getJKS in interface ServerEnvironment
        Returns:
        File representing the JKS which is server's keystore in developer-product case
      • isEmbedded

        public boolean isEmbedded()
      • getInstanceName

        public String getInstanceName()
        Every server has a name that can be found in the server element in domain.xml
        Specified by:
        getInstanceName in interface ServerEnvironment
        Returns:
        the name of this server i.e. "my" name
      • isInstance

        public boolean isInstance()
        Am I a running GlassFish server instance?
        Specified by:
        isInstance in interface ServerEnvironment
        Returns:
        true if we are an instance
      • isDas

        public boolean isDas()
        Am I a running GlassFish DAS server?
        Specified by:
        isDas in interface ServerEnvironment
        Returns:
        true if we are a DAS
      • isDebug

        public boolean isDebug()
      • isVerbose

        public boolean isVerbose()