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 Details

  • Constructor Details

    • ServerEnvironmentImpl

      public ServerEnvironmentImpl()
      Compute all the values per default.
    • ServerEnvironmentImpl

      public ServerEnvironmentImpl(File root)
  • Method Details

    • postConstruct

      public void postConstruct()
      This is where the real initialization happens.
      Specified by:
      postConstruct in interface org.glassfish.hk2.api.PostConstruct
    • getDomainName

      public String getDomainName()
    • getInstanceRoot

      public File getInstanceRoot()
      Specified by:
      getInstanceRoot in interface org.glassfish.api.admin.ServerEnvironment
    • getStartupContext

      public com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()
      Specified by:
      getStartupContext in interface org.glassfish.api.admin.ServerEnvironment
    • getConfigDirPath

      public File getConfigDirPath()
      Gets the directory to store configuration. Normally ROOT/config
      Specified by:
      getConfigDirPath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationRepositoryPath

      public File getApplicationRepositoryPath()
      Gets the directory to store deployed applications Normally ROOT/applications
      Specified by:
      getApplicationRepositoryPath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationStubPath

      public File getApplicationStubPath()
      Gets the directory to store generated stuff. Normally ROOT/generated
      Specified by:
      getApplicationStubPath in interface org.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. Normally ROOT/lib
      Specified by:
      getLibPath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationEJBStubPath

      public File getApplicationEJBStubPath()
      Specified by:
      getApplicationEJBStubPath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationGeneratedXMLPath

      public File getApplicationGeneratedXMLPath()
      Specified by:
      getApplicationGeneratedXMLPath in interface org.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:
      getApplicationCompileJspPath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationPolicyFilePath

      public File getApplicationPolicyFilePath()
      Returns the path for policy files for applications deployed on this instance.
      Specified by:
      getApplicationPolicyFilePath in interface org.glassfish.api.admin.ServerEnvironment
    • getApplicationAltDDPath

      public File getApplicationAltDDPath()
      Gets the directory to store external alternate deployment descriptors. Normally ROOT/generated/altdd
      Specified by:
      getApplicationAltDDPath in interface org.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
    • getProps

      public Map<String,String> getProps()
    • 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:
      File representing parent folder for admin console application. Never returns a null.
    • getMasterPasswordFile

      public File getMasterPasswordFile()
      Specified by:
      getMasterPasswordFile in interface org.glassfish.api.admin.ServerEnvironment
    • getJKS

      public File getJKS()
      Specified by:
      getJKS in interface org.glassfish.api.admin.ServerEnvironment
    • getTrustStore

      public File getTrustStore()
      Specified by:
      getTrustStore in interface org.glassfish.api.admin.ServerEnvironment
    • getStatus

      public org.glassfish.api.admin.ServerEnvironment.Status getStatus()
      Specified by:
      getStatus in interface org.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:
      getRuntimeType in interface org.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:
      getInstanceName in interface org.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:
      isInstance in interface org.glassfish.api.admin.ServerEnvironment
      Returns:
      true if we are an instance
    • isDas

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

      public boolean isDebug()
    • isVerbose

      public boolean isVerbose()