001: package org.enhydra.shark.api.internal.logging;
002:
003: import org.enhydra.shark.api.client.wfmc.wapi.WMSessionHandle;
004: import org.enhydra.shark.api.internal.working.CallbackUtilities;
005:
006: /**
007: * LoggingManager handles logging in Shark.
008: *
009: * @author Sasa Bojanic
010: * @author Vladimir Puskas
011: * @author Tanja Jovanovic
012: */
013: public interface LoggingManager {
014:
015: public static final int DEBUG_LEVEL = 1;
016: public static final int INFO_LEVEL = 2;
017: public static final int WARN_LEVEL = 3;
018: public static final int ERROR_LEVEL = 4;
019: public static final int FATAL_LEVEL = 5;
020:
021: /**
022: * Method configure is called at Shark start up, to configure
023: * implementation of LoggingManager.
024: *
025: * @param cus an instance of CallbackUtilities used to get
026: * properties for configuring logging in Shark.
027: *
028: * @exception Exception Thrown if configuring doesn't succeed.
029: */
030: void configure(CallbackUtilities cus) throws Exception;
031:
032: /**
033: * Returns if the specified logging level is enabled for the default channel.
034: */
035: boolean isEnabled(WMSessionHandle shandle, int level)
036: throws Exception;
037:
038: /**
039: * Returns if the specified logging level is enabled for the specified channel.
040: */
041: boolean isEnabled(WMSessionHandle shandle, String channel, int level)
042: throws Exception;
043:
044: /**
045: * Log a message object with the <i>ERROR</i> Level.
046: *
047: * @param msg the message to log.
048: *
049: * @exception Exception If something unexpected happens.
050: *
051: */
052: void error(WMSessionHandle shandle, String msg) throws Exception;
053:
054: /**
055: * Log a message object with the <i>ERROR</i> Level.
056: *
057: * @param msg the message to log.
058: * @param ex the exception to log, including its stack trace.
059: *
060: * @exception Exception If something unexpected happens.
061: *
062: */
063: void error(WMSessionHandle shandle, String msg, Exception ex)
064: throws Exception;
065:
066: /**
067: * Log a message object with the <i>ERROR</i> Level.
068: *
069: * @param channel the log channel to be used for logging.
070: * @param msg the message to log.
071: *
072: * @exception Exception If something unexpected happens.
073: *
074: */
075: void error(WMSessionHandle shandle, String channel, String msg)
076: throws Exception;
077:
078: /**
079: * Log a message object with the <i>ERROR</i> Level.
080: *
081: * @param channel the log channel to be used for logging.
082: * @param msg the message to log.
083: * @param ex the exception to log, including its stack trace.
084: *
085: * @exception Exception If something unexpected happens.
086: *
087: */
088: void error(WMSessionHandle shandle, String channel, String msg,
089: Exception ex) throws Exception;
090:
091: /**
092: * Log a message object with the <i>WARN</i> Level.
093: *
094: * @param msg the message to log.
095: *
096: * @exception Exception If something unexpected happens.
097: *
098: */
099: void warn(WMSessionHandle shandle, String msg) throws Exception;
100:
101: /**
102: * Log a message object with the <i>WARN</i> Level.
103: *
104: * @param msg the message to log.
105: * @param ex the exception to log, including its stack trace.
106: *
107: * @exception Exception If something unexpected happens.
108: *
109: */
110: void warn(WMSessionHandle shandle, String msg, Exception ex)
111: throws Exception;
112:
113: /**
114: * Log a message object with the <i>WARN</i> Level.
115: *
116: * @param channel the log channel to be used for logging.
117: * @param msg the message to log.
118: *
119: * @exception Exception If something unexpected happens.
120: *
121: */
122: void warn(WMSessionHandle shandle, String channel, String msg)
123: throws Exception;
124:
125: /**
126: * Log a message object with the <i>WARN</i> Level.
127: *
128: * @param channel the log channel to be used for logging.
129: * @param msg the message to log.
130: * @param ex the exception to log, including its stack trace.
131: *
132: * @exception Exception If something unexpected happens.
133: *
134: */
135: void warn(WMSessionHandle shandle, String channel, String msg,
136: Exception ex) throws Exception;
137:
138: /**
139: * Log a message object with the <i>INFO</i> Level.
140: *
141: * @param msg the message to log.
142: *
143: * @exception Exception If something unexpected happens.
144: *
145: */
146: void info(WMSessionHandle shandle, String msg) throws Exception;
147:
148: /**
149: * Log a message object with the <i>INFO</i> Level.
150: *
151: * @param msg the message to log.
152: * @param ex the exception to log, including its stack trace.
153: *
154: * @exception Exception If something unexpected happens.
155: *
156: */
157: void info(WMSessionHandle shandle, String msg, Exception ex)
158: throws Exception;
159:
160: /**
161: * Log a message object with the <i>INFO</i> Level.
162: *
163: * @param channel the log channel to be used for logging.
164: * @param msg the message to log.
165: *
166: * @exception Exception If something unexpected happens.
167: *
168: */
169: void info(WMSessionHandle shandle, String channel, String msg)
170: throws Exception;
171:
172: /**
173: * Log a message object with the <i>INFO</i> Level.
174: *
175: * @param channel the log channel to be used for logging.
176: * @param msg the message to log.
177: * @param ex the exception to log, including its stack trace.
178: *
179: * @exception Exception If something unexpected happens.
180: *
181: */
182: void info(WMSessionHandle shandle, String channel, String msg,
183: Exception ex) throws Exception;
184:
185: /**
186: * Log a message object with the <i>DEBUG</i> level.
187: *
188: * @param msg the message to log.
189: *
190: * @exception Exception If something unexpected happens.
191: *
192: */
193: void debug(WMSessionHandle shandle, String msg) throws Exception;
194:
195: /**
196: * Log a message object with the <i>DEBUG</i> level.
197: *
198: * @param msg the message to log.
199: * @param ex the exception to log, including its stack trace.
200: *
201: * @exception Exception If something unexpected happens.
202: *
203: */
204: void debug(WMSessionHandle shandle, String msg, Exception ex)
205: throws Exception;
206:
207: /**
208: * Log a message object with the <i>DEBUG</i> level.
209: *
210: * @param channel the log channel to be used for logging.
211: * @param msg the message to log.
212: *
213: * @exception Exception If something unexpected happens.
214: *
215: */
216: void debug(WMSessionHandle shandle, String channel, String msg)
217: throws Exception;
218:
219: /**
220: * Log a message object with the <i>DEBUG</i> level.
221: *
222: * @param channel the log channel to be used for logging.
223: * @param msg the message to log.
224: * @param ex the exception to log, including its stack trace.
225: *
226: * @exception Exception If something unexpected happens.
227: *
228: */
229: void debug(WMSessionHandle shandle, String channel, String msg,
230: Exception ex) throws Exception;
231:
232: }
|