org.enhydra.shark
Class CallbackUtil

java.lang.Object
  extended byorg.enhydra.shark.CallbackUtil
All Implemented Interfaces:
CallbackUtilities, java.io.Serializable

public class CallbackUtil
extends java.lang.Object
implements CallbackUtilities, java.io.Serializable

Implementation of Callback Utilities interface.

Author:
Sasa Bojanic, Tanja Jovanovic
See Also:
Serialized Form

Field Summary
protected  java.util.Map classes
           
protected  long everything
           
protected  boolean logObjectToo
           
protected  boolean logStackTrace
           
protected  java.util.Map methods
           
protected  java.util.Properties properties
           
 
Constructor Summary
protected CallbackUtil()
           
 
Method Summary
 void debug(WMSessionHandle shandle, java.lang.String msg)
          Log a message object with the DEBUG level.
 void debug(WMSessionHandle shandle, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the DEBUG level.
 void debug(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg)
          Log a message object with the DEBUG level.
 void debug(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the DEBUG level.
 void error(WMSessionHandle shandle, java.lang.String msg)
          Log a message object with the ERROR Level.
 void error(WMSessionHandle shandle, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the ERROR Level.
 void error(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg)
          Log a message object with the ERROR Level.
 void error(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the ERROR Level.
 java.util.Properties getProperties()
          Returns all properties used for Shark configuration.
 java.lang.String getProperty(java.lang.String name)
          Returns value of property propertyName used for Shark configuration.
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Returns value of property name used for Shark configuration.
 void info(WMSessionHandle shandle, java.lang.String msg)
          Log a message object with the INFO Level.
 void info(WMSessionHandle shandle, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the INFO Level.
 void info(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg)
          Log a message object with the INFO Level.
 void info(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the INFO Level.
 boolean isEnabled(WMSessionHandle shandle, int level)
           
 boolean isEnabled(WMSessionHandle shandle, java.lang.String channel, int level)
           
protected  long lenght4location(java.lang.String location)
           
 void methodEnd(WMSessionHandle shandle, long stamp, java.lang.String location, java.lang.Object o)
           
 void methodEnd(WMSessionHandle shandle, long stamp, java.lang.String location, java.lang.Object o, java.lang.String channel)
           
 long methodStart(WMSessionHandle shandle, java.lang.String location)
           
 void setProperties(java.util.Properties props)
          Sets properties for Shark configuration.
 void warn(WMSessionHandle shandle, java.lang.String msg)
          Log a message object with the WARN Level.
 void warn(WMSessionHandle shandle, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the WARN Level.
 void warn(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg)
          Log a message object with the WARN Level.
 void warn(WMSessionHandle shandle, java.lang.String channel, java.lang.String msg, java.lang.Exception ex)
          Log a message object with the WARN Level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

properties

protected java.util.Properties properties

methods

protected java.util.Map methods

everything

protected long everything

logObjectToo

protected boolean logObjectToo

logStackTrace

protected boolean logStackTrace

classes

protected java.util.Map classes
Constructor Detail

CallbackUtil

protected CallbackUtil()
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns value of property propertyName used for Shark configuration.

Specified by:
getProperty in interface CallbackUtilities
Parameters:
name - property name.
Returns:
Value of property name .

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    java.lang.String defaultValue)
Returns value of property name used for Shark configuration. If doesn't exist the default value is returned.

Specified by:
getProperty in interface CallbackUtilities
Parameters:
name - property name.
defaultValue - default property value.
Returns:
Value of property name or default value.

getProperties

public java.util.Properties getProperties()
Returns all properties used for Shark configuration.

Specified by:
getProperties in interface CallbackUtilities
Returns:
Properties object.

setProperties

public void setProperties(java.util.Properties props)
Sets properties for Shark configuration.

Specified by:
setProperties in interface CallbackUtilities
Parameters:
props - Properties object.

isEnabled

public boolean isEnabled(WMSessionHandle shandle,
                         int level)
Specified by:
isEnabled in interface CallbackUtilities

isEnabled

public boolean isEnabled(WMSessionHandle shandle,
                         java.lang.String channel,
                         int level)
Specified by:
isEnabled in interface CallbackUtilities

error

public void error(WMSessionHandle shandle,
                  java.lang.String msg)
Log a message object with the ERROR Level.

Specified by:
error in interface CallbackUtilities
Parameters:
msg - the message to log.

error

public void error(WMSessionHandle shandle,
                  java.lang.String msg,
                  java.lang.Exception ex)
Log a message object with the ERROR Level.

Specified by:
error in interface CallbackUtilities
Parameters:
msg - the message to log.
ex - the exception to log, including its stack trace.

error

public void error(WMSessionHandle shandle,
                  java.lang.String channel,
                  java.lang.String msg)
Log a message object with the ERROR Level.

Specified by:
error in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.

error

public void error(WMSessionHandle shandle,
                  java.lang.String channel,
                  java.lang.String msg,
                  java.lang.Exception ex)
Log a message object with the ERROR Level.

Specified by:
error in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.
ex - the exception to log, including its stack trace.

warn

public void warn(WMSessionHandle shandle,
                 java.lang.String msg)
Log a message object with the WARN Level.

Specified by:
warn in interface CallbackUtilities
Parameters:
msg - the message to log.

warn

public void warn(WMSessionHandle shandle,
                 java.lang.String msg,
                 java.lang.Exception ex)
Log a message object with the WARN Level.

Specified by:
warn in interface CallbackUtilities
Parameters:
msg - the message to log.
ex - the exception to log, including its stack trace.

warn

public void warn(WMSessionHandle shandle,
                 java.lang.String channel,
                 java.lang.String msg)
Log a message object with the WARN Level.

Specified by:
warn in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.

warn

public void warn(WMSessionHandle shandle,
                 java.lang.String channel,
                 java.lang.String msg,
                 java.lang.Exception ex)
Log a message object with the WARN Level.

Specified by:
warn in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.
ex - the exception to log, including its stack trace.

info

public void info(WMSessionHandle shandle,
                 java.lang.String msg)
Log a message object with the INFO Level.

Specified by:
info in interface CallbackUtilities
Parameters:
msg - the message to log.

info

public void info(WMSessionHandle shandle,
                 java.lang.String msg,
                 java.lang.Exception ex)
Log a message object with the INFO Level.

Specified by:
info in interface CallbackUtilities
Parameters:
msg - the message to log.
ex - the exception to log, including its stack trace.

info

public void info(WMSessionHandle shandle,
                 java.lang.String channel,
                 java.lang.String msg)
Log a message object with the INFO Level.

Specified by:
info in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.

info

public void info(WMSessionHandle shandle,
                 java.lang.String channel,
                 java.lang.String msg,
                 java.lang.Exception ex)
Log a message object with the INFO Level.

Specified by:
info in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.
ex - the exception to log, including its stack trace.

debug

public void debug(WMSessionHandle shandle,
                  java.lang.String msg)
Log a message object with the DEBUG level.

Specified by:
debug in interface CallbackUtilities
Parameters:
msg - the message to log.

debug

public void debug(WMSessionHandle shandle,
                  java.lang.String msg,
                  java.lang.Exception ex)
Log a message object with the DEBUG level.

Specified by:
debug in interface CallbackUtilities
Parameters:
msg - the message to log.
ex - the exception to log, including its stack trace.

debug

public void debug(WMSessionHandle shandle,
                  java.lang.String channel,
                  java.lang.String msg)
Log a message object with the DEBUG level.

Specified by:
debug in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.

debug

public void debug(WMSessionHandle shandle,
                  java.lang.String channel,
                  java.lang.String msg,
                  java.lang.Exception ex)
Log a message object with the DEBUG level.

Specified by:
debug in interface CallbackUtilities
Parameters:
channel - the log channel to be used for logging.
msg - the message to log.
ex - the exception to log, including its stack trace.

methodStart

public long methodStart(WMSessionHandle shandle,
                        java.lang.String location)
Specified by:
methodStart in interface CallbackUtilities

methodEnd

public void methodEnd(WMSessionHandle shandle,
                      long stamp,
                      java.lang.String location,
                      java.lang.Object o)
Specified by:
methodEnd in interface CallbackUtilities

methodEnd

public void methodEnd(WMSessionHandle shandle,
                      long stamp,
                      java.lang.String location,
                      java.lang.Object o,
                      java.lang.String channel)
Specified by:
methodEnd in interface CallbackUtilities

lenght4location

protected long lenght4location(java.lang.String location)