org.apache.geronimo.system.serverinfo
Class BasicServerInfo

java.lang.Object
  extended by org.apache.geronimo.system.serverinfo.BasicServerInfo
All Implemented Interfaces:
ServerInfo

@GBean
public class BasicServerInfo
extends java.lang.Object
implements ServerInfo

Contains information about the server and functions for resolving pathnames.

Version:
$Rev: 835085 $ $Date: 2009-11-12 05:54:40 +0800 (Thu, 12 Nov 2009) $

Field Summary
static java.lang.String HOME_DIR_SYS_PROP
           
static java.lang.String SERVER_DIR_SYS_PROP
           
static java.lang.String SERVER_NAME_SYS_PROP
           
 
Constructor Summary
BasicServerInfo()
           
BasicServerInfo(java.lang.String defaultBaseDirectory)
           
BasicServerInfo(java.lang.String defaultBaseDirectory, boolean useSystemProperties)
           
BasicServerInfo(java.lang.String defaultBaseDirectory, boolean useSystemProperties, org.osgi.framework.BundleContext bundleContext)
           
BasicServerInfo(java.lang.String baseDirectory, java.lang.String serverName)
           
 
Method Summary
 java.lang.String getBaseDirectory()
          A config.xml setting for the base directory.
 java.lang.String getBuildDate()
           
 java.lang.String getBuildTime()
           
 java.lang.String getCopyright()
           
 java.lang.String getCurrentBaseDirectory()
          The base directory that this ServerInfo is actually using.
 java.lang.String getVersion()
           
 java.io.File resolve(java.lang.String filename)
          Resolves an abstract pathname to a File.
 java.net.URI resolve(java.net.URI uri)
           
 java.lang.String resolvePath(java.lang.String filename)
          Resolves an abstract pathname to an absolute one.
 java.io.File resolveServer(java.lang.String filename)
          Resolves a relative pathname to a File, relative to the server configuration directory.
 java.net.URI resolveServer(java.net.URI uri)
           
 java.lang.String resolveServerPath(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER_NAME_SYS_PROP

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

SERVER_DIR_SYS_PROP

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

HOME_DIR_SYS_PROP

public static final java.lang.String HOME_DIR_SYS_PROP
See Also:
Constant Field Values
Constructor Detail

BasicServerInfo

public BasicServerInfo()

BasicServerInfo

public BasicServerInfo(java.lang.String defaultBaseDirectory)
                throws java.lang.Exception
Throws:
java.lang.Exception

BasicServerInfo

public BasicServerInfo(java.lang.String defaultBaseDirectory,
                       boolean useSystemProperties)
                throws java.lang.Exception
Throws:
java.lang.Exception

BasicServerInfo

public BasicServerInfo(@ParamAttribute(name="baseDirectory")
                       java.lang.String defaultBaseDirectory,
                       @ParamAttribute(name="useSystemProperties")
                       boolean useSystemProperties,
                       @ParamSpecial(type=bundleContext)
                       org.osgi.framework.BundleContext bundleContext)
                throws java.lang.Exception
Throws:
java.lang.Exception

BasicServerInfo

public BasicServerInfo(java.lang.String baseDirectory,
                       java.lang.String serverName)
Method Detail

resolvePath

public java.lang.String resolvePath(java.lang.String filename)
Resolves an abstract pathname to an absolute one.

Specified by:
resolvePath in interface ServerInfo
Parameters:
filename - a pathname that can either be fully-qualified (i.e. starts with a "/") or relative (i.e. starts with any character but "/"). If it's fully-qualified it will be resolved to an absolute pathname using system-dependent rules (@link java.io.File). If it's relative it will be resolved relative to the base directory.
Returns:
an absolute pathname
See Also:
File.File(String pathname), File.getAbsolutePath()

resolveServerPath

public java.lang.String resolveServerPath(java.lang.String filename)
Specified by:
resolveServerPath in interface ServerInfo

resolve

public java.io.File resolve(java.lang.String filename)
Resolves an abstract pathname to a File.

Specified by:
resolve in interface ServerInfo
Parameters:
filename - a String containing a pathname, which will be resolved by resolvePath(String filename).
Returns:
a File value

resolveServer

public java.io.File resolveServer(java.lang.String filename)
Description copied from interface: ServerInfo
Resolves a relative pathname to a File, relative to the server configuration directory. Normally, this is the same as the Geronimo installation directory (e.g. "foo" becomes .../geronimo/foo). However, you can pass command-line arguments to the server to relocate this to a server-instance-specific directory (e.g. "var/foo" might become .../geronimo/instance1/var/foo if the server was started with the flag indicating that the server instance dir was "instance1").

Specified by:
resolveServer in interface ServerInfo

resolve

public java.net.URI resolve(java.net.URI uri)
Specified by:
resolve in interface ServerInfo

resolveServer

public java.net.URI resolveServer(java.net.URI uri)
Specified by:
resolveServer in interface ServerInfo

getBaseDirectory

public java.lang.String getBaseDirectory()
Description copied from interface: ServerInfo
A config.xml setting for the base directory. This is normally left null, which means the ServerInfo will use the Geronimo install directory.

Specified by:
getBaseDirectory in interface ServerInfo

getCurrentBaseDirectory

public java.lang.String getCurrentBaseDirectory()
Description copied from interface: ServerInfo
The base directory that this ServerInfo is actually using.

Specified by:
getCurrentBaseDirectory in interface ServerInfo

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface ServerInfo

getBuildDate

public java.lang.String getBuildDate()
Specified by:
getBuildDate in interface ServerInfo

getBuildTime

public java.lang.String getBuildTime()
Specified by:
getBuildTime in interface ServerInfo

getCopyright

public java.lang.String getCopyright()
Specified by:
getCopyright in interface ServerInfo


Copyright © 2003-2012 The Apache Geronimo development community. All Rights Reserved.