org.objectweb.telosys.common
Class Telosys

java.lang.Object
  extended byorg.objectweb.telosys.common.Telosys

public final class Telosys
extends java.lang.Object

General Telosys environment informations and utilities


Constructor Summary
Telosys()
           
 
Method Summary
static void error(java.lang.String sMsg)
           
static void error(java.lang.String sClassName, java.lang.String sMsg)
           
static void error(java.lang.String sClassName, java.lang.Throwable ex)
           
static void error(java.lang.Throwable ex)
           
static java.lang.String getDbConfigFileName()
          Returns the file name (or resource name) of the DbConfig XML file.
static java.io.InputStream getDbConfigInputStream()
          Returns the InputStream of the DbConfig XML file or resource.
static TelosysFactory getFactory()
          Returns the Telosys factory
static java.lang.String getFullPath(java.lang.String sFile)
          Return the full path for the given relative file
( ie : "myfile.txt" -> "C:/dir1/dir2/mywebapp/myfile.txt" )
This method concats the "Application Root Dir" with the file name
if the "Application Root Dir" is not set, it returns the file as is.
static java.util.Properties getProperties()
          Returns the Telosys properties ( loaded from the 'telosys.properties' file )
static java.lang.String getProperty(java.lang.String sPropertyName)
          Returns the property value for the given property name
( properties loaded from the "telosys.properties" file )
static java.lang.String getSAXParserClassName()
          Returns the SAX parser class name
static java.lang.String getScreensConfigFileName()
          Returns the file name (or resource name) of the DbConfig XML file.
static java.io.InputStream getScreensConfigInputStream()
          Returns the InputStream of the DbConfig XML file or resource.
static javax.servlet.ServletContext getServletContext()
          Returns the web app ServletContext object
static java.lang.String getTagsConfigFileName()
           
static java.io.InputStream getTagsConfigInputStream()
           
static java.lang.String getTraceConfigFileName()
           
static java.io.InputStream getTraceConfigInputStream()
           
static java.lang.String getVersion()
          Returns the Telosys framework version ( e.g. "1.2.3" )
static java.lang.String getWebAppName()
          Returns the name of the current Web App ( from tag 'display-name' in web.xml )
Set from ServletContext.getServletContextName()
static java.lang.String getWebAppRootDir()
          Returns the absolute filesystem root directory of the current Web App
e.g.
static javax.xml.parsers.DocumentBuilderFactory getXmlDomParserFactory()
           
static IXmlWrapperProvider getXmlWrapperProvider()
          Returns the XmlWrapperProvider provided by the Telosys factory
static void info(java.lang.String sMsg)
           
static void info(java.lang.String sClassName, java.lang.String sMsg)
           
static java.util.Properties init(IExternalMainFactory extFactory)
          Try to initialize the Telosys properties :
try to find 'telosys.properties' using the classpath if the file is find
the properties are loaded and Telosys is initialized.
static java.util.Properties init(IExternalMainFactory extFactory, javax.servlet.ServletConfig servletConfig)
          Initialize the Telosys properties.
static java.util.Properties init(IExternalMainFactory extFactory, javax.servlet.ServletContext servletContext)
          Initialize the Telosys properties.
static java.util.Properties init(IExternalMainFactory extFactory, java.lang.String sPropFile)
          Initialize the Telosys properties using a specific properties file
static boolean isAuthenticationRequired()
          Returns true if user authentication is required
static boolean isInitialized()
          Returns true if Telosys is initialized
( true if the properties are loaded and the factory exists )
static void trace(java.lang.String sMsg)
           
static void trace(java.lang.String sClassName, java.lang.String sMsg)
           
static void warn(java.lang.String sMsg)
           
static void warn(java.lang.String sClassName, java.lang.String sMsg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Telosys

public Telosys()
Method Detail

getVersion

public static java.lang.String getVersion()
Returns the Telosys framework version ( e.g. "1.2.3" )

Returns:

isInitialized

public static boolean isInitialized()
Returns true if Telosys is initialized
( true if the properties are loaded and the factory exists )

Returns:

init

public static java.util.Properties init(IExternalMainFactory extFactory)
Try to initialize the Telosys properties :
try to find 'telosys.properties' using the classpath if the file is find
the properties are loaded and Telosys is initialized.

Returns:
the properties

init

public static java.util.Properties init(IExternalMainFactory extFactory,
                                        javax.servlet.ServletContext servletContext)
Initialize the Telosys properties.
Try to find a properties file :
1/ specific file name in 'web.xml' ( servlet TelosysProperties )
2/ 'telosys.properties' located in 'WEB-INF/conf'
3/ 'telosys.properties' located via CLASSPATH

Parameters:
extFactory -
servletContext - : the ServletContext to use
Returns:

init

public static java.util.Properties init(IExternalMainFactory extFactory,
                                        javax.servlet.ServletConfig servletConfig)
Initialize the Telosys properties.
Try to find a properties file :
1/ specific file name in 'web.xml' ( servlet TelosysProperties )
2/ 'telosys.properties' located in 'WEB-INF/conf'
3/ 'telosys.properties' located via CLASSPATH

Parameters:
extFactory -
servletConfig - : the ServletConfig to use ( can be null )
Returns:

init

public static java.util.Properties init(IExternalMainFactory extFactory,
                                        java.lang.String sPropFile)
Initialize the Telosys properties using a specific properties file

Parameters:
extFactory -
sPropFile -
Returns:

getWebAppRootDir

public static java.lang.String getWebAppRootDir()
Returns the absolute filesystem root directory of the current Web App
e.g. "C:\dir1\dir2\mywebapp\"
Set from ServletContext.getRealPath("/"), so it can be null

Returns:
the full WebApp path or null if the WAR file is not exploded in the server filesystem

getWebAppName

public static java.lang.String getWebAppName()
Returns the name of the current Web App ( from tag 'display-name' in web.xml )
Set from ServletContext.getServletContextName()

Returns:
the WebApp display name or null if not defined

getSAXParserClassName

public static java.lang.String getSAXParserClassName()
Returns the SAX parser class name

Returns:

getFullPath

public static java.lang.String getFullPath(java.lang.String sFile)
Return the full path for the given relative file
( ie : "myfile.txt" -> "C:/dir1/dir2/mywebapp/myfile.txt" )
This method concats the "Application Root Dir" with the file name
if the "Application Root Dir" is not set, it returns the file as is.

Parameters:
sFile -
Returns:

getProperties

public static java.util.Properties getProperties()
Returns the Telosys properties ( loaded from the 'telosys.properties' file )

Returns:

getFactory

public static TelosysFactory getFactory()
Returns the Telosys factory

Returns:

getServletContext

public static javax.servlet.ServletContext getServletContext()
Returns the web app ServletContext object

Returns:
Since:
1.0.0

getXmlWrapperProvider

public static IXmlWrapperProvider getXmlWrapperProvider()
Returns the XmlWrapperProvider provided by the Telosys factory

Returns:

isAuthenticationRequired

public static boolean isAuthenticationRequired()
Returns true if user authentication is required

Returns:

getXmlDomParserFactory

public static javax.xml.parsers.DocumentBuilderFactory getXmlDomParserFactory()

error

public static void error(java.lang.String sClassName,
                         java.lang.String sMsg)

error

public static void error(java.lang.String sMsg)

error

public static void error(java.lang.String sClassName,
                         java.lang.Throwable ex)

error

public static void error(java.lang.Throwable ex)

warn

public static void warn(java.lang.String sClassName,
                        java.lang.String sMsg)

warn

public static void warn(java.lang.String sMsg)

info

public static void info(java.lang.String sClassName,
                        java.lang.String sMsg)

info

public static void info(java.lang.String sMsg)

trace

public static void trace(java.lang.String sClassName,
                         java.lang.String sMsg)

trace

public static void trace(java.lang.String sMsg)

getDbConfigFileName

public static java.lang.String getDbConfigFileName()
Returns the file name (or resource name) of the DbConfig XML file.

Returns:

getDbConfigInputStream

public static java.io.InputStream getDbConfigInputStream()
Returns the InputStream of the DbConfig XML file or resource.

Returns:
the InputStream ( or null if cannot get it )

getScreensConfigFileName

public static java.lang.String getScreensConfigFileName()
Returns the file name (or resource name) of the DbConfig XML file.

Returns:

getScreensConfigInputStream

public static java.io.InputStream getScreensConfigInputStream()
Returns the InputStream of the DbConfig XML file or resource.

Returns:
the InputStream ( or null if cannot get it )

getTagsConfigFileName

public static java.lang.String getTagsConfigFileName()

getTagsConfigInputStream

public static java.io.InputStream getTagsConfigInputStream()

getTraceConfigFileName

public static java.lang.String getTraceConfigFileName()

getTraceConfigInputStream

public static java.io.InputStream getTraceConfigInputStream()

getProperty

public static java.lang.String getProperty(java.lang.String sPropertyName)
Returns the property value for the given property name
( properties loaded from the "telosys.properties" file )

Parameters:
sPropertyName -
Returns: