aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java37
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java27
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java37
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java17
4 files changed, 65 insertions, 53 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java
index dcb1397..f477588 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLog.java
@@ -21,20 +21,17 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.logging;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import iaik.logging.TransactionId;
/**
- * An implementation of the <code>iaik.logging.Log</code>
- * interface that is based on Jakarta Commons-Logging.
- *
+ * An implementation of the <code>iaik.logging.Log</code> interface that is
+ * based on Jakarta Commons-Logging.
+ *
* @author Fatemeh Philippi
* @version $Id$
*/
@@ -45,11 +42,11 @@ public class IaikLog implements iaik.logging.Log {
private static Logger log = LoggerFactory.getLogger(IAIK_LOG_HIERARCHY);
/** The node ID to use. */
private String nodeId;
-
+
/**
* Create a new <code>IaikLog</code>.
- *
- * @param nodeId The node ID for this <code>Log</code> object.
+ *
+ * @param nodeId The node ID for this <code>Log</code> object.
*/
public IaikLog(String nodeId) {
this.nodeId = nodeId;
@@ -58,6 +55,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#isDebugEnabled()
*/
+ @Override
public boolean isDebugEnabled() {
return log.isDebugEnabled();
}
@@ -65,8 +63,9 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#debug(TransactionId, Object, Throwable)
*/
+ @Override
public void debug(TransactionId transactionId, Object message, Throwable t) {
- IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
+ final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
log.debug(msg.toString(), t);
}
@@ -74,6 +73,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#isInfoEnabled()
*/
+ @Override
public boolean isInfoEnabled() {
return log.isInfoEnabled();
}
@@ -81,8 +81,9 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#info(TransactionId, Object, Throwable)
*/
+ @Override
public void info(TransactionId transactionId, Object message, Throwable t) {
- IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
+ final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
log.info(msg.toString(), t);
}
@@ -90,6 +91,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#isWarnEnabled()
*/
+ @Override
public boolean isWarnEnabled() {
return log.isWarnEnabled();
}
@@ -97,8 +99,9 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#warn(TransactionId, Object, Throwable)
*/
+ @Override
public void warn(TransactionId transactionId, Object message, Throwable t) {
- IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
+ final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
log.warn(msg.toString(), t);
}
@@ -106,6 +109,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#isErrorEnabled()
*/
+ @Override
public boolean isErrorEnabled() {
return log.isErrorEnabled();
}
@@ -113,8 +117,9 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#error(TransactionId, Object, Throwable)
*/
+ @Override
public void error(TransactionId transactionId, Object message, Throwable t) {
- IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
+ final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
log.error(msg.toString(), t);
}
@@ -122,6 +127,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#isFatalEnabled()
*/
+ @Override
public boolean isFatalEnabled() {
return log.isErrorEnabled();
}
@@ -129,8 +135,9 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#fatal(TransactionId, Object, Throwable)
*/
+ @Override
public void fatal(TransactionId transactionId, Object message, Throwable t) {
- IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
+ final IaikLogMsg msg = new IaikLogMsg(transactionId, nodeId, message);
log.error(msg.toString(), t);
}
@@ -138,6 +145,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#setNodeId(String)
*/
+ @Override
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
@@ -145,6 +153,7 @@ public class IaikLog implements iaik.logging.Log {
/**
* @see iaik.logging.Log#getNodeId()
*/
+ @Override
public String getNodeId() {
return nodeId;
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
index 9989087..e0a4ea6 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogFactory.java
@@ -21,7 +21,6 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.logging;
import at.gv.egovernment.moaspss.logging.LoggingContext;
@@ -31,36 +30,40 @@ import iaik.logging.LogConfigurationException;
import iaik.logging.LogFactory;
/**
- * An implementation of the <code>iaik.logging.LogFactory</code> abstract
- * class to log messages to the MOA logging subsystem.
- *
+ * An implementation of the <code>iaik.logging.LogFactory</code> abstract class
+ * to log messages to the MOA logging subsystem.
+ *
* @author Patrick Peck
* @version $Id$
*/
public class IaikLogFactory extends LogFactory {
+ @Override
public Log getInstance(Class clazz) throws LogConfigurationException {
return getInstanceImpl(clazz.getName());
}
+ @Override
public Log getInstance(String name) throws LogConfigurationException {
return getInstanceImpl(name);
}
/**
* Return an instance of <code>iaik.logging.Log</code>.
- *
+ *
* @return The <code>iaik.logging.Log</code> object to log messages to.
- */
+ */
private Log getInstanceImpl(String name) {
- LoggingContext context = LoggingContextManager.getInstance().getLoggingContext();
- if (context != null)
- return new IaikLog(context.getNodeID());
- else
- return new IaikLog("Internal");
-
+ final LoggingContext context = LoggingContextManager.getInstance().getLoggingContext();
+ if (context != null) {
+ return new IaikLog(context.getNodeID());
+ } else {
+ return new IaikLog("Internal");
+ }
+
}
+ @Override
public void release() {
// we do not hold any resources
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java
index 7e4ff84..d096b2e 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/IaikLogMsg.java
@@ -21,34 +21,33 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.logging;
import iaik.logging.TransactionId;
/**
* A unified message type to log messages from the IAIK subsystem.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
public class IaikLogMsg {
-
+
/** The transaction ID of this message. */
- private TransactionId transactionId;
+ private final TransactionId transactionId;
/** The node ID of this message. */
- private String nodeId;
+ private final String nodeId;
/** The message to log. */
- private Object message;
-
+ private final Object message;
+
/**
* Create a <code>IaikLogMsg</code> object.
- *
- * @param transactionId The transaction id of the transaction which
- * generated this log message. May be <code>null</code>.
- * @param nodeId The node id where this message was generated. May be
- * <code>null</code>.
- * @param message The actual message to log. May be <code>null</code>.
+ *
+ * @param transactionId The transaction id of the transaction which generated
+ * this log message. May be <code>null</code>.
+ * @param nodeId The node id where this message was generated. May be
+ * <code>null</code>.
+ * @param message The actual message to log. May be <code>null</code>.
*/
public IaikLogMsg(TransactionId transactionId, String nodeId, Object message) {
this.transactionId = transactionId;
@@ -56,22 +55,22 @@ public class IaikLogMsg {
this.message = message;
}
-
/**
* Convert this log message to a <code>String</code>.
- *
- * @return The <code>String</code> representation of this log message.
+ *
+ * @return The <code>String</code> representation of this log message.
*/
+ @Override
public String toString() {
- StringBuffer msg = new StringBuffer();
-
+ final StringBuffer msg = new StringBuffer();
+
msg.append("TID=");
msg.append(transactionId != null ? transactionId.getLogID() : "<null>");
msg.append(" NID=");
msg.append(nodeId != null ? nodeId : "<null>");
msg.append(" MSG=");
msg.append(message != null ? message.toString() : "<null>");
-
+
return msg.toString();
}
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java
index ba76c0b..75623fd 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/logging/TransactionId.java
@@ -21,25 +21,24 @@
* that you distribute must include a readable copy of the "NOTICE" text file.
*/
-
package at.gv.egovernment.moa.spss.server.logging;
/**
* An implementation of the <code>iaik.logging.TransactionId</code> interface.
- *
+ *
* @author Patrick Peck
* @version $Id$
*/
public class TransactionId implements iaik.logging.TransactionId {
-
+
/** The String representation for logging the transaction ID. */
- private String logID;
-
+ private final String logID;
+
/**
* Create a <code>TransactionId</code> object.
- *
+ *
* @param logID The transaction id as it should be presented to the logging
- * subsystem.
+ * subsystem.
*/
public TransactionId(String logID) {
this.logID = logID;
@@ -48,13 +47,15 @@ public class TransactionId implements iaik.logging.TransactionId {
/**
* @see iaik.logging.TransactionId#getLogID()
*/
+ @Override
public String getLogID() {
return logID;
}
-
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getLogID();
}