org.glassfish.server
Class ServerEnvironmentImpl

java.lang.Object
  extended by org.glassfish.server.ServerEnvironmentImpl
All Implemented Interfaces:
ServerEnvironment, org.jvnet.hk2.component.PostConstruct

@Service
public class ServerEnvironmentImpl
extends java.lang.Object
implements ServerEnvironment, org.jvnet.hk2.component.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
ServerEnvironment.Status
 
Field Summary
static java.lang.String DEFAULT_ADMIN_CONSOLE_APP_NAME
           
static java.lang.String DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT
           
static java.lang.String kConfigDirName
          folder where the configuration of this instance is stored
static java.lang.String kConfigXMLFileName
           
static java.lang.String kConfigXMLFileNameBackup
           
static java.lang.String kEJBStubDirName
           
static java.lang.String kGeneratedDirName
          folder where all generated code like compiled jsps, stubs is stored
static java.lang.String kGeneratedXMLDirName
           
static java.lang.String kInitFileName
          init file name
static java.lang.String kLoggingPropertiesFileName
           
static java.lang.String kPolicyFileDirName
           
static java.lang.String kRepositoryDirName
           
 
Fields inherited from interface org.glassfish.api.admin.ServerEnvironment
DEFAULT_INSTANCE_NAME, kCompileJspDirName
 
Constructor Summary
ServerEnvironmentImpl()
          Compute all the values per default.
ServerEnvironmentImpl(java.io.File root)
           
 
Method Summary
 java.io.File getApplicationCompileJspPath()
          Returns the path for compiled JSP Pages from an application that is deployed on this instance.
 java.io.File getApplicationEJBStubPath()
           
 java.io.File getApplicationGeneratedXMLPath()
           
 java.io.File getApplicationPolicyFilePath()
          Returns the path for policy files for applications deployed on this instance.
 java.io.File getApplicationRepositoryPath()
          Gets the directory to store deployed applications Normally ROOT/applications
 java.io.File getApplicationStubPath()
          Gets the directory to store generated stuff.
 java.io.File getConfigDirPath()
          Gets the directory to store configuration.
 java.io.File getDefaultAdminConsoleFolderOnDisk()
          Returns the folder where the admin console application's folder (in the name of admin console application) should be found.
 java.lang.String getDomainName()
           
 java.io.File getDomainRoot()
          Deprecated. As of GlassFish 3.1 replaced with getInstanceRoot()
 java.io.File getDomainXML()
           
 java.io.File getInitFilePath()
          Gets the init.conf file.
 java.lang.String getInstanceName()
          Every server has a name that can be found in the server element in domain.xml
 java.io.File getInstanceRoot()
           
 java.io.File getJKS()
           
 java.io.File getLibPath()
          Gets the directory for hosting user-provided jar files.
 java.io.File getMasterPasswordFile()
           
 java.util.Map<java.lang.String,java.lang.String> getProps()
           
 RuntimeType getRuntimeType()
           
 com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()
           
 ServerEnvironment.Status getStatus()
           
 java.io.File getTrustStore()
           
 boolean isDas()
          Am I a running GlassFish DAS server?
 boolean isEmbedded()
           
 boolean isInstance()
          Am I a running GlassFish server instance?
 void postConstruct()
          This is where the real initialization happens.
 void setStatus(ServerEnvironment.Status status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kGeneratedDirName

public static final java.lang.String kGeneratedDirName
folder where all generated code like compiled jsps, stubs is stored

See Also:
Constant Field Values

kRepositoryDirName

public static final java.lang.String kRepositoryDirName
See Also:
Constant Field Values

kEJBStubDirName

public static final java.lang.String kEJBStubDirName
See Also:
Constant Field Values

kGeneratedXMLDirName

public static final java.lang.String kGeneratedXMLDirName
See Also:
Constant Field Values

kPolicyFileDirName

public static final java.lang.String kPolicyFileDirName
See Also:
Constant Field Values

kConfigXMLFileName

public static final java.lang.String kConfigXMLFileName
See Also:
Constant Field Values

kConfigXMLFileNameBackup

public static final java.lang.String kConfigXMLFileNameBackup
See Also:
Constant Field Values

kLoggingPropertiesFileName

public static final java.lang.String kLoggingPropertiesFileName
See Also:
Constant Field Values

kConfigDirName

public static final java.lang.String kConfigDirName
folder where the configuration of this instance is stored

See Also:
Constant Field Values

kInitFileName

public static final java.lang.String kInitFileName
init file name

See Also:
Constant Field Values

DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT

public static final java.lang.String DEFAULT_ADMIN_CONSOLE_CONTEXT_ROOT
See Also:
Constant Field Values

DEFAULT_ADMIN_CONSOLE_APP_NAME

public static final java.lang.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(java.io.File root)
Method Detail

postConstruct

public void postConstruct()
This is where the real initialization happens.

Specified by:
postConstruct in interface org.jvnet.hk2.component.PostConstruct

getDomainName

public java.lang.String getDomainName()

getInstanceRoot

public java.io.File getInstanceRoot()
Specified by:
getInstanceRoot in interface ServerEnvironment

getDomainRoot

@Deprecated
public java.io.File getDomainRoot()
Deprecated. As of GlassFish 3.1 replaced with getInstanceRoot()

Specified by:
getDomainRoot in interface ServerEnvironment
Returns:
the instance root

getStartupContext

public com.sun.enterprise.module.bootstrap.StartupContext getStartupContext()
Specified by:
getStartupContext in interface ServerEnvironment

getConfigDirPath

public java.io.File getConfigDirPath()
Gets the directory to store configuration. Normally ROOT/config

Specified by:
getConfigDirPath in interface ServerEnvironment

getApplicationRepositoryPath

public java.io.File getApplicationRepositoryPath()
Gets the directory to store deployed applications Normally ROOT/applications

Specified by:
getApplicationRepositoryPath in interface ServerEnvironment

getApplicationStubPath

public java.io.File getApplicationStubPath()
Gets the directory to store generated stuff. Normally ROOT/generated

Specified by:
getApplicationStubPath in interface ServerEnvironment

getInitFilePath

public java.io.File getInitFilePath()
Gets the init.conf file.


getLibPath

public java.io.File getLibPath()
Gets the directory for hosting user-provided jar files. Normally ROOT/lib

Specified by:
getLibPath in interface ServerEnvironment

getApplicationEJBStubPath

public java.io.File getApplicationEJBStubPath()
Specified by:
getApplicationEJBStubPath in interface ServerEnvironment

getApplicationGeneratedXMLPath

public java.io.File getApplicationGeneratedXMLPath()
Specified by:
getApplicationGeneratedXMLPath in interface ServerEnvironment

getApplicationCompileJspPath

public java.io.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

getApplicationPolicyFilePath

public java.io.File getApplicationPolicyFilePath()
Returns the path for policy files for applications deployed on this instance.

Specified by:
getApplicationPolicyFilePath in interface ServerEnvironment

getProps

public java.util.Map<java.lang.String,java.lang.String> getProps()

getDefaultAdminConsoleFolderOnDisk

public java.io.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 java.io.File getMasterPasswordFile()
Specified by:
getMasterPasswordFile in interface ServerEnvironment

getJKS

public java.io.File getJKS()
Specified by:
getJKS in interface ServerEnvironment

getTrustStore

public java.io.File getTrustStore()
Specified by:
getTrustStore in interface ServerEnvironment

getDomainXML

public java.io.File getDomainXML()
Specified by:
getDomainXML in interface ServerEnvironment

getStatus

public ServerEnvironment.Status getStatus()
Specified by:
getStatus in interface ServerEnvironment

setStatus

public void setStatus(ServerEnvironment.Status status)

isEmbedded

public boolean isEmbedded()

getRuntimeType

public RuntimeType getRuntimeType()
Specified by:
getRuntimeType in interface ServerEnvironment

getInstanceName

public java.lang.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


Copyright © 2012 GlassFish Community. All Rights Reserved.