Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17596 Modified Files: ActionThread.java Log.java LogAsyncQueue.java LogAsyncThread.java LogAttributes.java LogFactory.java LogImpl.java LogImplAsyncWrapper.java LogLevel.java LogMessage.java LogRegistration.java LogRemote.java LogSF.java LogToFileImpl.java LogToNothingImpl.java LogToPrim.java LogToPrimImpl.java LogToStreamsImpl.java SFLogImpl.java SFLogRegistrationImpl.java SFLogStdStreamImpl.java Log Message: Fixed java docs for release Index: LogAsyncQueue.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogAsyncQueue.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LogAsyncQueue.java 10 Feb 2006 00:51:39 -0000 1.2 --- LogAsyncQueue.java 3 Jul 2006 07:36:34 -0000 1.3 *************** *** 41,44 **** --- 41,51 ---- private Method method; private Object[] params; + + /** + * Constructor + * @param logImpl the applicable log + * @param method the method to invoke + * @param params the parameters for the method + */ public LogRequest(Log logImpl, Method method, Object[] params) { this.logImpl = logImpl; *************** *** 46,49 **** --- 53,60 ---- this.params = params; } + + /** + * Invoke the log method + */ public void invoke() { try { *************** *** 58,61 **** --- 69,76 ---- } + /** + * Return the string representation + * @return String + */ public String toString() { String str = "LOG=" + logImpl.toString() + " METHOD=" + method.toString() + " PARAMS=["; Index: SFLogImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/SFLogImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SFLogImpl.java 21 Feb 2006 01:33:50 -0000 1.3 --- SFLogImpl.java 3 Jul 2006 07:36:34 -0000 1.4 *************** *** 34,37 **** --- 34,40 ---- import org.smartfrog.sfcore.common.*; + /** + * Implementation for SFLog component. + */ public class SFLogImpl extends PrimImpl implements Prim, SFLog, Log { *************** *** 47,51 **** * Constructor for the SFLogImpl object. * ! *@exception RemoteException In case of network/rmi error */ public SFLogImpl() throws RemoteException { --- 50,54 ---- * Constructor for the SFLogImpl object. * ! *@throws RemoteException In case of network/rmi error */ public SFLogImpl() throws RemoteException { *************** *** 56,61 **** /** * ! * @exception SmartFrogException In case of error in deploying ! * @exception RemoteException In case of network/rmi error */ public synchronized void sfDeploy() throws SmartFrogException, RemoteException { --- 59,64 ---- /** * ! * @throws SmartFrogException In case of error in deploying ! * @throws RemoteException In case of network/rmi error */ public synchronized void sfDeploy() throws SmartFrogException, RemoteException { *************** *** 68,73 **** /** * ! * @exception SmartFrogException In case of error while starting ! * @exception RemoteException In case of network/rmi error */ public synchronized void sfStart() throws SmartFrogException, RemoteException { --- 71,76 ---- /** * ! * @throws SmartFrogException In case of error while starting ! * @throws RemoteException In case of network/rmi error */ public synchronized void sfStart() throws SmartFrogException, RemoteException { *************** *** 157,160 **** --- 160,164 ---- * (for example, <code>String</code> concatenation) * when the log level is more than debug. </p> + * @return boolean true if debug level is currently enabled */ public boolean isDebugEnabled() { *************** *** 169,172 **** --- 173,177 ---- * (for example, <code>String</code> concatenation) * when the log level is more than error. </p> + * @return boolean true if error level is currently enabled */ public boolean isErrorEnabled(){ *************** *** 181,184 **** --- 186,190 ---- * (for example, <code>String</code> concatenation) * when the log level is more than fatal. </p> + * @return boolean true if fatal level is currently enabled */ public boolean isFatalEnabled(){ *************** *** 193,196 **** --- 199,203 ---- * (for example, <code>String</code> concatenation) * when the log level is more than info. </p> + * @return boolean true if info level is currently enabled */ public boolean isInfoEnabled(){ *************** *** 205,208 **** --- 212,216 ---- * (for example, <code>String</code> concatenation) * when the log level is more than trace. </p> + * @return boolean true if trace level is currently enabled */ public boolean isTraceEnabled(){ *************** *** 217,220 **** --- 225,229 ---- * (for example, <code>String</code> concatenation) * when the log level is more than warn. </p> + * @return boolean true if warn level is currently enabled */ public boolean isWarnEnabled(){ *************** *** 362,365 **** --- 371,375 ---- * @throws SmartFrogResolutionException illegal reference or reference * not resolvable + * @throws RemoteException in cae of Remote/Network error * */ *************** *** 401,404 **** --- 411,415 ---- * @throws SmartFrogResolutionException illegal reference or reference * not resolvable + * @throws RemoteException in cae of Remote/Network error * */ Index: LogAsyncThread.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogAsyncThread.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LogAsyncThread.java 13 Jan 2005 12:04:22 -0000 1.1 --- LogAsyncThread.java 3 Jul 2006 07:36:34 -0000 1.2 *************** *** 32,35 **** --- 32,39 ---- private LogAsyncQueue queue; + /** + * Constructor + * @param queue queue of methods to be invoked + */ public LogAsyncThread(LogAsyncQueue queue) { super(); *************** *** 37,40 **** --- 41,47 ---- } + /** + * Run method for the thread + */ public void run() { active = true; *************** *** 50,53 **** --- 57,63 ---- } + /** + * Terminate the thread + */ public void terminate() { active = false; Index: SFLogRegistrationImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/SFLogRegistrationImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SFLogRegistrationImpl.java 21 Feb 2006 01:35:41 -0000 1.1 --- SFLogRegistrationImpl.java 3 Jul 2006 07:36:35 -0000 1.2 *************** *** 109,113 **** // Main component action methods ! //Log Registration interface public void register(String name,Log log) throws SmartFrogLogException , RemoteException{ if (logreg!=null) { --- 109,121 ---- // Main component action methods ! ! /** ! * Log Registration interface ! * ! * @param name log name ! * @param log logger to register ! * @throws SmartFrogLogException if failed to register ! * @throws RemoteException in case of remote/network error ! */ public void register(String name,Log log) throws SmartFrogLogException , RemoteException{ if (logreg!=null) { *************** *** 116,119 **** --- 124,135 ---- } + /** + * Log Registration interface + * @param name log name + * @param log logger to register + * @param logLevel log level + * @throws RemoteException in case of remote/network error + * @throws SmartFrogLogException if failed to register + */ public void register(String name,Log log, int logLevel) throws RemoteException, SmartFrogLogException{ if (logreg!=null) { *************** *** 122,125 **** --- 138,148 ---- } + /** + * Log Deregistration interface + * @param name log name + * @return boolean success/failure + * @throws SmartFrogLogException if failed to deregister + * @throws RemoteException in case of remote/network error + */ public boolean deregister(String name) throws SmartFrogLogException, RemoteException { if (logreg!=null) { Index: ActionThread.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/ActionThread.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ActionThread.java 24 Jun 2004 15:57:58 -0000 1.2 --- ActionThread.java 3 Jul 2006 07:36:34 -0000 1.3 *************** *** 33,37 **** /** ! * Methos to invoke */ private Method method; --- 33,37 ---- /** ! * Method to invoke */ private Method method; *************** *** 46,52 **** * Action launched constructor and executor * ! *@param action Description of the Parameter ! *@param method Description of the Parameter ! *@param args Description of the Parameter */ ActionThread(Log[] action, Method method, Object[] args) { --- 46,52 ---- * Action launched constructor and executor * ! *@param action Action object in where to invoke method in a separate thread ! *@param method method to invoke ! *@param args Arguments of the method to invoke */ ActionThread(Log[] action, Method method, Object[] args) { *************** *** 58,67 **** } ! public void run() { } ! public ActionThread executeAction(Method method){ this.method=method; --- 58,73 ---- } ! /** ! * Run method for Action thread ! */ public void run() { } ! /** ! * Thread body launches method with arguments given from object specified ! * @param method method to invoke ! * @return ActionThread ! */ public ActionThread executeAction(Method method){ this.method=method; *************** *** 71,74 **** --- 77,81 ---- /** * Thread body launches method with arguments given from object specified + * @return ActionThread */ public ActionThread executeAction() { *************** *** 86,90 **** } ! public ActionThread setAction(Log[] actions){ this.actions = actions; --- 93,101 ---- } ! /** ! * Set the Action object ! * @param actions Action object in where to invoke method in a separate thread ! * @return ActionThread ! */ public ActionThread setAction(Log[] actions){ this.actions = actions; *************** *** 92,95 **** --- 103,112 ---- } + /** + * Set the method to invoke + * @param method method to invoke + * @param args Action object in where to invoke method in a separate thread + * @return ActionThread + */ public ActionThread setMethod(Method method, Object[] args){ this.method = method; Index: LogLevel.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogLevel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LogLevel.java 17 Aug 2004 15:16:42 -0000 1.4 --- LogLevel.java 3 Jul 2006 07:36:34 -0000 1.5 *************** *** 62,65 **** --- 62,66 ---- /** * <p> Get logging level. </p> + * @return int log level */ public int getLevel(); *************** *** 69,72 **** --- 70,74 ---- * * @param logLevel is this level enabled? + * @return boolean if given log currently enabled */ public boolean isLevelEnabled(int logLevel); Index: LogToStreamsImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogToStreamsImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LogToStreamsImpl.java 21 Feb 2006 01:33:50 -0000 1.10 --- LogToStreamsImpl.java 3 Jul 2006 07:36:34 -0000 1.11 *************** *** 157,160 **** --- 157,161 ---- * @param initialLogLevel level to log at * @param out output stream to log to + * @param err error stream to log to */ *************** *** 171,174 **** --- 172,176 ---- * @param initialLogLevel level to log at * @param out output stream to log to + * @param err error stream to log to */ public LogToStreamsImpl(String name,ComponentDescription componentComponentDescription, Integer initialLogLevel, PrintStream out, PrintStream err) { *************** *** 203,207 **** /** * Reads optional and mandatory attributes. ! * * @throws SmartFrogException error while reading attributes */ --- 205,209 ---- /** * Reads optional and mandatory attributes. ! * @param cd cd ComponentDescription A component description to read attributes from * @throws SmartFrogException error while reading attributes */ *************** *** 230,234 **** * set the output stream for logging. must not be null * ! * @param outstream */ public void setOutstream(PrintStream outstream) { --- 232,236 ---- * set the output stream for logging. must not be null * ! * @param outstream output stream to log to */ public void setOutstream(PrintStream outstream) { *************** *** 240,244 **** * set the output stream for logging. must not be null * ! * @param errstream */ public void setErrstream(PrintStream errstream) { --- 242,246 ---- * set the output stream for logging. must not be null * ! * @param errstream error stream to log to */ public void setErrstream(PrintStream errstream) { *************** *** 259,262 **** --- 261,265 ---- /** * <p> Get logging level. </p> + * @return int log level */ public int getLevel() { *************** *** 298,301 **** --- 301,312 ---- } + /** + * <p>Do the logging. + * Uses String buffer to assemble the message.</p> + * @param type One of the LOG_LEVE_XXX constants defining the log level + * @param message The message itself (typically a String) + * @param t The exception whose stack trace should be logged + * @return StringBuffer + */ protected StringBuffer logToText(int type, Object message, Throwable t) { StringBuffer buf = new StringBuffer(); *************** *** 404,407 **** --- 415,419 ---- * * @param logLevel is this level enabled? + * @return boolean true if given log level is currently enabled */ public boolean isLevelEnabled(int logLevel) { *************** *** 419,422 **** --- 431,435 ---- /** * <p> Log a message with debug log level.</p> + * @param message log this message */ public void debug(Object message) { *************** *** 429,432 **** --- 442,447 ---- /** * <p> Log an error with debug log level.</p> + * @param message log this message + * @param t log this cause */ public void debug(Object message, Throwable t) { *************** *** 439,442 **** --- 454,458 ---- /** * <p> Log a message with trace log level.</p> + * @param message log this message */ public void trace(Object message) { *************** *** 449,452 **** --- 465,470 ---- /** * <p> Log an error with trace log level.</p> + * @param message log this message + * @param t log this cause */ public void trace(Object message, Throwable t) { *************** *** 459,462 **** --- 477,481 ---- /** * <p> Log a message with info log level.</p> + * @param message log this message */ public void info(Object message) { *************** *** 469,472 **** --- 488,493 ---- /** * <p> Log an error with info log level.</p> + * @param message log this message + * @param t log this cause */ public void info(Object message, Throwable t) { *************** *** 479,482 **** --- 500,504 ---- /** * <p> Log a message with warn log level.</p> + * @param message log this message */ public void warn(Object message) { *************** *** 489,492 **** --- 511,516 ---- /** * <p> Log an error with warn log level.</p> + * @param message log this message + * @param t log this cause */ public void warn(Object message, Throwable t) { *************** *** 499,502 **** --- 523,527 ---- /** * <p> Log a message with error log level.</p> + * @param message log this message */ public void error(Object message) { *************** *** 509,512 **** --- 534,539 ---- /** * <p> Log an error with error log level.</p> + * @param message log this message + * @param t log this cause */ public void error(Object message, Throwable t) { *************** *** 519,522 **** --- 546,550 ---- /** * <p> Log a message with fatal log level.</p> + * @param message log this message */ public void fatal(Object message) { *************** *** 529,532 **** --- 557,562 ---- /** * <p> Log an error with fatal log level.</p> + * @param message log this message + * @param t log this cause */ public void fatal(Object message, Throwable t) { *************** *** 543,546 **** --- 573,577 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if debug level is currently enabled */ public boolean isDebugEnabled() { *************** *** 556,559 **** --- 587,591 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if error level is currently enabled */ public boolean isErrorEnabled() { *************** *** 569,572 **** --- 601,605 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if fatal level is currently enabled */ public boolean isFatalEnabled() { *************** *** 582,585 **** --- 615,619 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if info level is currently enabled */ public boolean isInfoEnabled() { *************** *** 594,597 **** --- 628,632 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if trace level is currently enabled */ public boolean isTraceEnabled() { *************** *** 606,609 **** --- 641,645 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if warn level is currently enabled */ public boolean isWarnEnabled() { Index: LogAttributes.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogAttributes.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LogAttributes.java 26 Aug 2005 13:03:03 -0000 1.3 --- LogAttributes.java 3 Jul 2006 07:36:34 -0000 1.4 *************** *** 86,90 **** /** * <p> To change a property in all registered loggers </p> ! * * @param value new status value * @return if it was sucessfull applaying this attribute to any of the registered loggers --- 86,90 ---- /** * <p> To change a property in all registered loggers </p> ! * @param name attribute name * @param value new status value * @return if it was sucessfull applaying this attribute to any of the registered loggers Index: LogToFileImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogToFileImpl.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** LogToFileImpl.java 9 Feb 2006 23:16:04 -0000 1.17 --- LogToFileImpl.java 3 Jul 2006 07:36:34 -0000 1.18 *************** *** 143,148 **** /** * Reads optional and mandatory attributes. ! * ! * @exception SmartFrogException error while reading attributes */ protected void readSFFileAttributes(ComponentDescription cd) throws SmartFrogException { --- 143,148 ---- /** * Reads optional and mandatory attributes. ! * @param cd ComponentDescription A component description to read attributes from ! * @throws SmartFrogException error while reading attributes */ protected void readSFFileAttributes(ComponentDescription cd) throws SmartFrogException { *************** *** 172,176 **** /** * Creates the file using attributes. ! * * @return filename * @throws Exception error while creating file --- 172,176 ---- /** * Creates the file using attributes. ! * @param fileExtension file extension * @return filename * @throws Exception error while creating file *************** *** 245,248 **** --- 245,253 ---- } + /** + * Correct the file name + * @param filename file name + * @return String + */ private String correctFilename(String filename) { final int length = filename.length(); Index: LogToNothingImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogToNothingImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** LogToNothingImpl.java 6 Feb 2006 17:53:09 -0000 1.8 --- LogToNothingImpl.java 3 Jul 2006 07:36:34 -0000 1.9 *************** *** 35,41 **** public class LogToNothingImpl implements LogToNothing, Log, LogMessage, LogLevel { ! //Configuration for class protected ComponentDescription classComponentDescription = null; ! //Configuration for component protected ComponentDescription componentComponentDescription = null; --- 35,41 ---- public class LogToNothingImpl implements LogToNothing, Log, LogMessage, LogLevel { ! /** Configuration for class */ protected ComponentDescription classComponentDescription = null; ! /** Configuration for component */ protected ComponentDescription componentComponentDescription = null; *************** *** 135,142 **** } ! /** ! * Reads optional and mandatory attributes. ! * ! * @exception SmartFrogException error while reading attributes */ protected void readSFNothingAttributes(ComponentDescription cd) throws SmartFrogException { --- 135,142 ---- } ! /** ! * Reads optional and mandatory attributes. ! * @param cd cd ComponentDescription A component description to read attributes from ! * @throws SmartFrogException error while reading attributes */ protected void readSFNothingAttributes(ComponentDescription cd) throws SmartFrogException { *************** *** 153,157 **** /** * set the output stream for logging. must not be null ! * @param outstream */ public void setOutstream(PrintStream outstream) { --- 153,157 ---- /** * set the output stream for logging. must not be null ! * @param outstream Output stream to set */ public void setOutstream(PrintStream outstream) { *************** *** 162,166 **** /** * set the output stream for logging. must not be null ! * @param errstream */ public void setErrstream(PrintStream errstream) { --- 162,166 ---- /** * set the output stream for logging. must not be null ! * @param errstream Error stream to set */ public void setErrstream(PrintStream errstream) { *************** *** 182,185 **** --- 182,186 ---- /** * <p> Get logging level. </p> + * @return int log level */ public int getLevel() { *************** *** 194,197 **** --- 195,199 ---- * * @param logLevel is this level enabled? + * @return boolean true if given log level is currently enabled */ public boolean isLevelEnabled(int logLevel) { *************** *** 207,210 **** --- 209,213 ---- /** * <p> Log a message with debug log level.</p> + * @param message log this message */ public void debug(Object message) { *************** *** 215,218 **** --- 218,223 ---- /** * <p> Log an error with debug log level.</p> + * @param message log this message + * @param t log this cause */ public void debug(Object message, Throwable t) { *************** *** 223,226 **** --- 228,232 ---- /** * <p> Log a message with trace log level.</p> + * @param message log this message */ public void trace(Object message) { *************** *** 231,234 **** --- 237,242 ---- /** * <p> Log an error with trace log level.</p> + * @param message log this message + * @param t log this cause */ public void trace(Object message, Throwable t) { *************** *** 239,242 **** --- 247,251 ---- /** * <p> Log a message with info log level.</p> + * @param message log this message */ public void info(Object message) { *************** *** 247,250 **** --- 256,261 ---- /** * <p> Log an error with info log level.</p> + * @param message log this message + * @param t log this cause */ public void info(Object message, Throwable t) { *************** *** 255,258 **** --- 266,270 ---- /** * <p> Log a message with warn log level.</p> + * @param message log this message */ public void warn(Object message) { *************** *** 263,266 **** --- 275,280 ---- /** * <p> Log an error with warn log level.</p> + * @param message log this message + * @param t log this cause */ public void warn(Object message, Throwable t) { *************** *** 271,274 **** --- 285,289 ---- /** * <p> Log a message with error log level.</p> + * @param message log this message */ public void error(Object message) { *************** *** 279,282 **** --- 294,299 ---- /** * <p> Log an error with error log level.</p> + * @param message log this message + * @param t log this cause */ public void error(Object message, Throwable t) { *************** *** 287,290 **** --- 304,308 ---- /** * <p> Log a message with fatal log level.</p> + * @param message log this message */ public void fatal(Object message) { *************** *** 295,298 **** --- 313,318 ---- /** * <p> Log an error with fatal log level.</p> + * @param message log this message + * @param t log this cause */ public void fatal(Object message, Throwable t) { *************** *** 307,310 **** --- 327,331 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if debug level is currently enabled */ public boolean isDebugEnabled() { *************** *** 319,322 **** --- 340,344 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if error level is currently enabled */ public boolean isErrorEnabled() { *************** *** 331,334 **** --- 353,357 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if fatal level is currently enabled */ public boolean isFatalEnabled() { *************** *** 343,346 **** --- 366,370 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if info level is currently enabled */ public boolean isInfoEnabled() { *************** *** 354,357 **** --- 378,382 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if trace level is currently enabled */ public boolean isTraceEnabled() { *************** *** 365,368 **** --- 390,394 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if warn level is currently enabled */ public boolean isWarnEnabled() { *************** *** 414,417 **** --- 440,445 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void err(Object message, SmartFrogException t, TerminationRecord tr) { Index: LogFactory.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogFactory.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LogFactory.java 31 Mar 2005 18:51:21 -0000 1.12 --- LogFactory.java 3 Jul 2006 07:36:34 -0000 1.13 *************** *** 12,16 **** import java.util.Hashtable; ! public class LogFactory { --- 12,18 ---- import java.util.Hashtable; ! /** ! * Log Factory ! */ public class LogFactory { *************** *** 54,58 **** /** * get a named log. ! * @param name * @return a log from cache or new. * --- 56,60 ---- /** * get a named log. ! * @param name log name * @return a log from cache or new. * *************** *** 75,80 **** * @param clazz Class from which a log name will be derived * ! * @exception SmartFrogLogException if suitable Log instance cannot be ! * returned */ public static Log getLog(Class clazz) { --- 77,81 ---- * @param clazz Class from which a log name will be derived * ! * @return Log */ public static Log getLog(Class clazz) { *************** *** 86,90 **** * * @param prim component to use ! * @param registerWithCoreLog * @return a log * @throws SmartFrogLogException if the prim name could not be completed, or when registration failed. --- 87,91 ---- * * @param prim component to use ! * @param registerWithCoreLog flag to enable registration with the core * @return a log * @throws SmartFrogLogException if the prim name could not be completed, or when registration failed. *************** *** 130,135 **** * To get the sfCore logger * @return Logger implementing LogSF and Log - * @exception SmartFrogLogException if a suitable <code>Log</code> - * instance cannot be returned */ public static LogSF sfGetProcessLog() { --- 131,134 ---- *************** *** 144,150 **** /** * register a log with the core ! * @param name ! * @param log ! * @throws SmartFrogLogException * @todo what happens when it changes its log level - needs to be fixed! */ --- 143,149 ---- /** * register a log with the core ! * @param name log name ! * @param log logger to be registered ! * @throws SmartFrogLogException if failed to register * @todo what happens when it changes its log level - needs to be fixed! */ Index: LogRegistration.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogRegistration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LogRegistration.java 24 Jun 2004 15:57:58 -0000 1.2 --- LogRegistration.java 3 Jul 2006 07:36:34 -0000 1.3 *************** *** 29,36 **** public interface LogRegistration extends Remote { public void register(String name,Log log) throws RemoteException, SmartFrogLogException; ! public void register(String name,Log log, int logLevel) throws RemoteException, SmartFrogLogException; public boolean deregister(String name) throws RemoteException, SmartFrogLogException; --- 29,59 ---- public interface LogRegistration extends Remote { + /** + * Log Registration interface + * + * @param name log name + * @param log logger to register + * @throws SmartFrogLogException if failed to register + * @throws RemoteException in case of remote/network error + */ public void register(String name,Log log) throws RemoteException, SmartFrogLogException; ! /** ! * Log Registration interface ! * @param name log name ! * @param log logger to register ! * @param logLevel log level ! * @throws RemoteException in case of remote/network error ! * @throws SmartFrogLogException if failed to register ! */ ! public void register(String name,Log log, int logLevel) throws RemoteException, SmartFrogLogException; + /** + * Log Deregistration interface + * @param name log name + * @return boolean success/failure + * @throws SmartFrogLogException if failed to deregister + * @throws RemoteException in case of remote/network error + */ public boolean deregister(String name) throws RemoteException, SmartFrogLogException; Index: LogImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogImpl.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** LogImpl.java 20 Feb 2006 19:09:33 -0000 1.40 --- LogImpl.java 3 Jul 2006 07:36:34 -0000 1.41 *************** *** 45,51 **** import java.util.Vector; - /** - * - */ public class LogImpl implements LogSF, LogRegistration, Serializable { --- 45,48 ---- *************** *** 248,253 **** * @param configurationCodeBase String * @param loggersConfiguration Vector ! * @throws RemoteException ! * @throws SmartFrogLogException */ --- 245,250 ---- * @param configurationCodeBase String * @param loggersConfiguration Vector ! * @throws RemoteException in case of remote/network failure ! * @throws SmartFrogLogException if failed to register logger */ *************** *** 292,297 **** * @param configurationComponentDescription ComponentDescription Where to find the configuration * @param configurationClass Object String or Vector which configuration is to be found ! * @param loggersConfiguration Vector default Configuration/s for configurationClass/es ! * @throws SmartFrogResolutionException */ private Vector getLoggersConfigurationForConfigurationClass( ComponentDescription configurationComponentDescription, --- 289,294 ---- * @param configurationComponentDescription ComponentDescription Where to find the configuration * @param configurationClass Object String or Vector which configuration is to be found ! * @param defaultLoggersConfiguration Vector default Configuration/s for configurationClass/es ! * @throws SmartFrogResolutionException if failed to resolve */ private Vector getLoggersConfigurationForConfigurationClass( ComponentDescription configurationComponentDescription, *************** *** 328,334 **** * * @param componentDescription ComponentDescription ! * @param default configurationClass Object * @return Object (Vector or String) ! * @throws SmartFrogResolutionException */ private Object getConfigurationClass(ComponentDescription componentDescription, Object configurationClass) throws SmartFrogResolutionException { --- 325,331 ---- * * @param componentDescription ComponentDescription ! * @param configurationClass configurationClass Object * @return Object (Vector or String) ! * @throws SmartFrogResolutionException if failed to resolve */ private Object getConfigurationClass(ComponentDescription componentDescription, Object configurationClass) throws SmartFrogResolutionException { *************** *** 346,353 **** * default classname.sf files * @param componentDescription ComponentDescription where to find the configuration ! * @param default configuration Object returned if nothing is found * @return componentdescription configuration found or default value if nothing was found or null if * a problem ocurred ! * @throws SmartFrogResolutionException */ private Object getConfigurationForClass(ComponentDescription componentDescription, String configurationClass, ComponentDescription defaultConfig) throws SmartFrogResolutionException { --- 343,351 ---- * default classname.sf files * @param componentDescription ComponentDescription where to find the configuration ! * @param configurationClass configurationClass Object ! * @param defaultConfig configuration Object returned if nothing is found * @return componentdescription configuration found or default value if nothing was found or null if * a problem ocurred ! * @throws SmartFrogResolutionException if failed to resolve */ private Object getConfigurationForClass(ComponentDescription componentDescription, String configurationClass, ComponentDescription defaultConfig) throws SmartFrogResolutionException { *************** *** 363,369 **** * * @param componentDescription ComponentDescription ! * @param default configurationLevel int * @return int ! * @throws SmartFrogResolutionException */ private int getConfigurationLevel(ComponentDescription componentDescription, int configurationLevel) throws SmartFrogResolutionException { --- 361,367 ---- * * @param componentDescription ComponentDescription ! * @param configurationLevel int * @return int ! * @throws SmartFrogResolutionException if failed to resolve */ private int getConfigurationLevel(ComponentDescription componentDescription, int configurationLevel) throws SmartFrogResolutionException { *************** *** 376,382 **** * * @param componentDescription ComponentDescription ! * @param default configurationCodeBase String * @return String ! * @throws SmartFrogResolutionException */ private String getConfigurationCodeBase(ComponentDescription componentDescription,String configurationCodeBase) throws SmartFrogResolutionException { --- 374,380 ---- * * @param componentDescription ComponentDescription ! * @param configurationCodeBase String * @return String ! * @throws SmartFrogResolutionException if failed to resolve */ private String getConfigurationCodeBase(ComponentDescription componentDescription,String configurationCodeBase) throws SmartFrogResolutionException { *************** *** 394,404 **** /** ! * Dinamically loads the class that implements the selected logger * @param name String * @param logLevel Integer * @param targetClassName String * @param targetCodeBase String * @return Log logger implementing Log interface. ! * @throws SmartFrogLogException */ --- 392,403 ---- /** ! * Dynamically loads the class that implements the selected logger * @param name String + * @param configuration ComponentDescription * @param logLevel Integer * @param targetClassName String * @param targetCodeBase String * @return Log logger implementing Log interface. ! * @throws SmartFrogLogException if failed to load */ *************** *** 485,488 **** --- 484,488 ---- /** * <p> Get logging level. </p> + * @return int log level */ public int getLevel() { *************** *** 494,497 **** --- 494,498 ---- * * @param logger + * @return int log level */ public static int getLevel(Log logger) { *************** *** 516,519 **** --- 517,521 ---- * * @param logLevel is this level enabled? + * @return boolean true if given log level is currently enabled */ public boolean isLevelEnabled(int logLevel) { *************** *** 535,538 **** --- 537,541 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if debug level is currently enabled */ public final boolean isDebugEnabled() { *************** *** 547,550 **** --- 550,554 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if error level is currently enabled */ public final boolean isErrorEnabled() { *************** *** 559,562 **** --- 563,567 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if fatal level is currently enabled */ public final boolean isFatalEnabled() { *************** *** 571,574 **** --- 576,580 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if info level is currently enabled */ public final boolean isInfoEnabled() { *************** *** 583,586 **** --- 589,593 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if trace level is currently enabled */ public final boolean isTraceEnabled() { *************** *** 595,598 **** --- 602,606 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if warn level is currently enabled */ public final boolean isWarnEnabled() { *************** *** 614,618 **** } ! private boolean isCurrentLevelEnabled(Log log) { if (currentLogLevel >=LOG_LEVEL_OFF) { --- 622,632 ---- } ! /** ! * ! * Is current log level enabled? ! * ! * @param log logger ! * @return boolean ! */ private boolean isCurrentLevelEnabled(Log log) { if (currentLogLevel >=LOG_LEVEL_OFF) { *************** *** 802,805 **** --- 816,820 ---- * (for example, <code>String</code> concatenation) * when the log level is more than ignore. </p> + * @return boolean */ public boolean isIgnoreEnabled(){ *************** *** 838,841 **** --- 853,858 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void ignore(Object message, SmartFrogException t, TerminationRecord tr) { *************** *** 968,971 **** --- 985,990 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void err(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 990,993 **** --- 1009,1014 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void trace(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1011,1014 **** --- 1032,1037 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void debug(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1032,1035 **** --- 1055,1060 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void info(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1053,1056 **** --- 1078,1083 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void warn(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1074,1077 **** --- 1101,1106 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void error(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1095,1098 **** --- 1124,1129 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord */ public void fatal(Object message, SmartFrogException t, TerminationRecord tr){ *************** *** 1112,1116 **** ! //Log Registration interface public void register(String name,Log log) throws SmartFrogLogException , RemoteException{ try { --- 1143,1154 ---- ! /** ! * Log Registration interface ! * ! * @param name log name ! * @param log logger to register ! * @throws SmartFrogLogException if failed to register ! * @throws RemoteException in case of remote/network error ! */ public void register(String name,Log log) throws SmartFrogLogException , RemoteException{ try { *************** *** 1121,1124 **** --- 1159,1170 ---- } + /** + * Log Registration interface + * @param name log name + * @param log logger to register + * @param logLevel log level + * @throws RemoteException in case of remote/network error + * @throws SmartFrogLogException if failed to register + */ public void register(String name,Log log, int logLevel) throws RemoteException, SmartFrogLogException{ register(name,log); *************** *** 1128,1131 **** --- 1174,1184 ---- } + /** + * Log Deregistration interface + * @param name log name + * @return boolean success/failure + * @throws SmartFrogLogException if failed to deregister + * @throws RemoteException in case of remote/network error + */ public boolean deregister(String name) throws SmartFrogLogException, RemoteException { try { Index: LogSF.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogSF.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** LogSF.java 10 Feb 2006 01:13:34 -0000 1.9 --- LogSF.java 3 Jul 2006 07:36:34 -0000 1.10 *************** *** 65,68 **** --- 65,69 ---- * (for example, <code>String</code> concatenation) * when the log level is more than ignore. </p> + * @return boolean true if ignore level is currently enabled */ public boolean isIgnoreEnabled(); *************** *** 90,93 **** --- 91,97 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void ignore(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 107,110 **** --- 111,117 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void trace(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 124,127 **** --- 131,137 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void debug(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 141,144 **** --- 151,157 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void info(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 158,161 **** --- 171,177 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void warn(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 175,178 **** --- 191,197 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void error(Object message, SmartFrogException t, TerminationRecord tr); *************** *** 192,195 **** --- 211,217 ---- * * @param message log this message + * @param t log this cause + * @param tr log this TerminationRecord + * */ public void fatal(Object message, SmartFrogException t, TerminationRecord tr); Index: LogToPrimImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogToPrimImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** LogToPrimImpl.java 24 May 2006 11:04:55 -0000 1.8 --- LogToPrimImpl.java 3 Jul 2006 07:36:34 -0000 1.9 *************** *** 27,31 **** import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.common.SmartFrogResolutionException; ! import java.rmi.*; import org.smartfrog.sfcore.processcompound.ProcessCompound; import org.smartfrog.sfcore.common.Logger; --- 27,31 ---- import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.common.SmartFrogResolutionException; ! import java.rmi.RemoteException; import org.smartfrog.sfcore.processcompound.ProcessCompound; import org.smartfrog.sfcore.common.Logger; *************** *** 61,64 **** --- 61,65 ---- * @param name log name * @param initialLogLevel level to log at + * @throws SmartFrogException if failed to construct the log */ public LogToPrimImpl (String name, Integer initialLogLevel) throws SmartFrogException{ *************** *** 72,75 **** --- 73,77 ---- * @param componentComponentDescription A component description to overwrite class configuration * @param initialLogLevel level to log at + * @throws SmartFrogException if failed to construct the log */ public LogToPrimImpl (String name, ComponentDescription componentComponentDescription, Integer initialLogLevel) throws SmartFrogException { *************** *** 97,100 **** --- 99,106 ---- } + /** + * Set the destination log + * @param logTo destination log to set + */ public void setLogTo(LogRemote logTo) { this.logTo = logTo; *************** *** 103,108 **** /** * Reads optional and mandatory attributes. ! * ! * @exception SmartFrogResolutionException error while reading attributes */ protected void readSFPrimAttributes(ComponentDescription cd) throws SmartFrogResolutionException { --- 109,114 ---- /** * Reads optional and mandatory attributes. ! * @param cd cd ComponentDescription A component description to read attributes from ! * @throws SmartFrogResolutionException error while reading attributes */ protected void readSFPrimAttributes(ComponentDescription cd) throws SmartFrogResolutionException { *************** *** 119,122 **** --- 125,132 ---- } + /** + * Set the log + * @return log + */ private LogRemote logTo() { *************** *** 166,169 **** --- 176,180 ---- /** * <p> Log a message with debug log level.</p> + * @param message log this message */ public void debug(Object message) { *************** *** 179,182 **** --- 190,195 ---- /** * <p> Log an error with debug log level.</p> + * @param message log this message + * @param t log this cause */ public void debug(Object message, Throwable t) { *************** *** 190,193 **** --- 203,207 ---- /** * <p> Log a message with trace log level.</p> + * @param message log this message */ public void trace(Object message) { *************** *** 205,208 **** --- 219,224 ---- /** * <p> Log an error with trace log level.</p> + * @param message log this message + * @param t log this cause */ public void trace(Object message, Throwable t) { *************** *** 219,222 **** --- 235,239 ---- /** * <p> Log a message with info log level.</p> + * @param message log this message */ public void info(Object message) { *************** *** 236,239 **** --- 253,258 ---- /** * <p> Log an error with info log level.</p> + * @param message log this message + * @param t log this cause */ public void info(Object message, Throwable t) { *************** *** 250,253 **** --- 269,273 ---- /** * <p> Log a message with warn log level.</p> + * @param message log this message */ public void warn(Object message) { *************** *** 265,268 **** --- 285,290 ---- /** * <p> Log an error with warn log level.</p> + * @param message log this message + * @param t log this cause */ public void warn(Object message, Throwable t) { *************** *** 279,282 **** --- 301,305 ---- /** * <p> Log a message with error log level.</p> + * @param message log this message */ public void error(Object message) { *************** *** 294,297 **** --- 317,322 ---- /** * <p> Log an error with error log level.</p> + * @param message log this message + * @param t log this cause */ public void error(Object message, Throwable t) { *************** *** 308,311 **** --- 333,337 ---- /** * <p> Log a message with fatal log level.</p> + * @param message log this message */ public void fatal(Object message) { *************** *** 323,326 **** --- 349,354 ---- /** * <p> Log an error with fatal log level.</p> + * @param message log this message + * @param t log this cause */ public void fatal(Object message, Throwable t) { *************** *** 341,344 **** --- 369,373 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if debug level is currently enabled */ public boolean isDebugEnabled() { *************** *** 357,360 **** --- 386,390 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if error level is currently enabled */ public boolean isErrorEnabled() { *************** *** 373,376 **** --- 403,407 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if fatal level is currently enabled */ public boolean isFatalEnabled() { *************** *** 390,393 **** --- 421,425 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if info level is currently enabled */ public boolean isInfoEnabled() { *************** *** 406,409 **** --- 438,442 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if trace level is currently enabled */ public boolean isTraceEnabled() { *************** *** 422,425 **** --- 455,459 ---- * concatenation to be avoided when the message will be ignored by the * logger. </p> + * @return boolean true if warn level is currently enabled */ public boolean isWarnEnabled() { Index: LogRemote.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/logging/LogRemote.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LogRemote.java 10 Feb 2006 00:55:49 -0000 1.3 --- LogRemote.java 3 Jul 2006 07:36:34 -0000 1.4 *************** *** 41,44 **** --- 41,46 ---- * (for example, <code>String</code> concatenation) * when the log level is more than debug. </p> + * @return boolean true if debug level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isDebugEnabled() throws RemoteException; *************** *** 51,54 **** --- 53,58 ---- * (for example, <code>String</code> concatenation) * when the log level is more than error. </p> + * @return boolean true if error level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isErrorEnabled() throws RemoteException; *************** *** 61,64 **** --- 65,70 ---- * (for example, <code>String</code> concatenation) * when the log level is more than fatal. </p> + * @return boolean true if fatal level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isFatalEnabled() throws RemoteException; *************** *** 71,74 **** --- 77,82 ---- * (for example, <code>String</code> concatenation) * when the log level is more than info. </p> + * @return boolean true if info level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isInfoEnabled() throws RemoteException; *************** *** 81,84 **** --- 89,94 ---- * (for example, <code>String</code> concatenation) * when the log level is more than trace. </p> + * @return boolean true if trace level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isTraceEnabled() throws RemoteException; *************** *** 91,94 **** --- 101,106 ---- * (for example, <code>String</code> concatenation) * when the log level is more than warn. </p> + * @return boolean true if warn level is currently enabled + * @throws RemoteException in case of remote/network error */ public boolean isWarnEnabled() throws RemoteException; *************** *** 101,104 **** --- 113,117 ---- * * @param message log this message + * @throws RemoteException in case of remote/network error */ public void trace(Object message) throws RemoteException; *************** *** 110,113 **** --- 123,127 ---- * @param message log this message * @param t log this cause + * @throws RemoteException in case of remote/network error */ public void trace(Object message, Throwable t) throws RemoteException; *************** *** 118,121 **** --- 132,136 ---- * * @param message log this message + * @throws RemoteException in case of remote/network error */ public void debug(Object message) throws RemoteException; *************** *** 127,130 **** --- 142,146 ---- * @param message log this message * @param t log this cause + * @throws RemoteException in case of remote... [truncated message content] |