org.globus.ogsa.impl.core.logging
Class OGSALogFactory

java.lang.Object
  extended byorg.apache.commons.logging.LogFactory
      extended byorg.globus.ogsa.impl.core.logging.OGSALogFactory

public class OGSALogFactory
extends org.apache.commons.logging.LogFactory

Implementation of a commons LogFactory that bridges to Websphere's JRAS internal logger, and optionally to Log4J's logger object. In either case, level filters and management are external to the underlying log implementations- current version supports log4j only

Author:
John Wiley, John Wiley, OGSA Development, IBM Poughkeepsie

Field Summary
 
Fields inherited from class org.apache.commons.logging.LogFactory
factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, SERVICE_ID
 
Constructor Summary
OGSALogFactory()
          Constructor for OGSALogFactory
 
Method Summary
protected  org.apache.commons.logging.Log createInstance(java.lang.String aName)
          createInstance(String)
 java.lang.Object getAttribute(java.lang.String aName)
          getAttribute(String)
 java.lang.Object getAttributeConfig(java.lang.String aName)
          get configuration attribute.-bypass runtime cache, read config file only
 java.lang.String[] getAttributeNames()
          getAttributeNames()
 java.lang.String[] getAttributeNamesConfig()
          getAttributeNames()
static java.util.ResourceBundle getConfig()
          retrieve logging parms properties file as a resourcebundle
static java.lang.String getDefaultFileName()
          Get name of default logfile if it exists- helper method
 org.apache.commons.logging.Log getInstance(java.lang.Class aClass)
          getInstance(String)
 org.apache.commons.logging.Log getInstance(java.lang.String aName)
          getInstance(String)
 java.lang.String getLogDestinationBasePath()
           
 boolean hasAttribute(java.lang.String aName)
          hasAttribute(String)
 boolean hasAttributeConfig(java.lang.String aName)
          hasAttributeConfig(String)
 void loadAttributes()
          setup attribute cache form ogsilogging.properties file
 void loadAttributesFisrt()
          setup attribute cache form ogsilogging.properties file as defined by the global parameters
 void loadParms()
          get logging factory parms
 void logging_service_ActiveState(boolean state)
          helper for logging service to indicate its readiness
protected  void modifyRuntime(java.lang.String aName)
          modifyRuntime Log object, with previously stored attributes
 boolean rasLogFactorySelfTest(OgsiLogging ls)
           
 void release()
          Release any internal references to previously created Log instances returned by this factory.
 void removeAttribute(java.lang.String aName)
          Remove a configuration attribute.
 void removeAttributeConfig(java.lang.String aName)
          Remove a configuration attribute.
 void saveRuntime()
          Save boot properties file as directed by Location key in bundle
 void setAttribute(java.lang.String aName, java.lang.Object aValue)
          Set cached attribute.
 void setAttributeConfig(java.lang.String aName, java.lang.Object aValue)
          Set configuration attribute.-bypass runtime cache, mod config file only
 void writeToServiceData(LogMessageElement aMsg)
          writeToServiceData
 
Methods inherited from class org.apache.commons.logging.LogFactory
findClassLoader, getFactory, getLog, getLog, newFactory, releaseAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OGSALogFactory

public OGSALogFactory()
Constructor for OGSALogFactory

Method Detail

loadParms

public void loadParms()
get logging factory parms


getLogDestinationBasePath

public java.lang.String getLogDestinationBasePath()

saveRuntime

public void saveRuntime()
                 throws UnableToPersistFaultElement
Save boot properties file as directed by Location key in bundle

Throws:
UnableToPersistFaultElement

loadAttributesFisrt

public void loadAttributesFisrt()
setup attribute cache form ogsilogging.properties file as defined by the global parameters


loadAttributes

public void loadAttributes()
                    throws UnableToPersistFaultElement
setup attribute cache form ogsilogging.properties file

Throws:
UnableToPersistFaultElement

getDefaultFileName

public static java.lang.String getDefaultFileName()
                                           throws UnableToPersistFaultElement
Get name of default logfile if it exists- helper method

Returns:
String name or null
Throws:
UnableToPersistFaultElement

setAttributeConfig

public void setAttributeConfig(java.lang.String aName,
                               java.lang.Object aValue)
                        throws UnableToPersistFaultElement
Set configuration attribute.-bypass runtime cache, mod config file only

Throws:
UnableToPersistFaultElement

getAttributeConfig

public java.lang.Object getAttributeConfig(java.lang.String aName)
                                    throws UnableToPersistFaultElement
get configuration attribute.-bypass runtime cache, read config file only

Returns:
Object value of attribute named
Throws:
UnableToPersistFaultElement

hasAttributeConfig

public boolean hasAttributeConfig(java.lang.String aName)
                           throws UnableToPersistFaultElement
hasAttributeConfig(String)

Returns:
boolean, was there or not
Throws:
UnableToPersistFaultElement

removeAttributeConfig

public void removeAttributeConfig(java.lang.String aName)
                           throws UnableToPersistFaultElement
Remove a configuration attribute. removeAttributeConfig(String)

Throws:
UnableToPersistFaultElement

setAttribute

public void setAttribute(java.lang.String aName,
                         java.lang.Object aValue)
Set cached attribute.


modifyRuntime

protected void modifyRuntime(java.lang.String aName)
modifyRuntime Log object, with previously stored attributes


getAttributeNames

public java.lang.String[] getAttributeNames()
getAttributeNames()

Returns:
String array of all attribute values

getAttributeNamesConfig

public java.lang.String[] getAttributeNamesConfig()
                                           throws UnableToPersistFaultElement
getAttributeNames()

Returns:
String array of all attribute values
Throws:
UnableToPersistFaultElement

getAttribute

public java.lang.Object getAttribute(java.lang.String aName)
getAttribute(String)

Returns:
String value of the input attribute name

hasAttribute

public boolean hasAttribute(java.lang.String aName)
hasAttribute(String)

Returns:
boolean, was there or not

removeAttribute

public void removeAttribute(java.lang.String aName)
Remove a configuration attribute. removeAttribute(String)


getInstance

public org.apache.commons.logging.Log getInstance(java.lang.String aName)
                                           throws org.apache.commons.logging.LogConfigurationException
getInstance(String)

Returns:
Log object - commons Log api interface
Throws:
org.apache.commons.logging.LogConfigurationException - if a suitable Log instance cannot be returned

getInstance

public org.apache.commons.logging.Log getInstance(java.lang.Class aClass)
                                           throws org.apache.commons.logging.LogConfigurationException
getInstance(String)

Returns:
Log object - commons Log api interface
Throws:
org.apache.commons.logging.LogConfigurationException - if a suitable Log instance cannot be returned

createInstance

protected org.apache.commons.logging.Log createInstance(java.lang.String aName)
                                                 throws org.apache.commons.logging.LogConfigurationException
createInstance(String)

Returns:
Log object - commons Log api interface
Throws:
org.apache.commons.logging.LogConfigurationException

release

public void release()
Release any internal references to previously created Log instances returned by this factory. This is useful environments like servlet containers, which implement application reloading by throwing away a ClassLoader. Dangling references to objects in that class loader would prevent garbage collection.


rasLogFactorySelfTest

public boolean rasLogFactorySelfTest(OgsiLogging ls)

writeToServiceData

public void writeToServiceData(LogMessageElement aMsg)
writeToServiceData


logging_service_ActiveState

public void logging_service_ActiveState(boolean state)
helper for logging service to indicate its readiness


getConfig

public static java.util.ResourceBundle getConfig()
retrieve logging parms properties file as a resourcebundle



Copyright ? 1999 University of Chicago and The University of Southern California. All Rights Reserved.