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