Thread: [Comsuite-svn] SF.net SVN: comsuite: [165] trunk/code/CSCommon/src/org/commsuite/aop/ SystemArchite
Brought to you by:
zduniak
|
From: <ma...@us...> - 2006-09-30 16:55:42
|
Revision: 165
http://svn.sourceforge.net/comsuite/?rev=165&view=rev
Author: marasm
Date: 2006-09-30 09:55:13 -0700 (Sat, 30 Sep 2006)
Log Message:
-----------
file omitted in last commit
Modified Paths:
--------------
trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
Modified: trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
===================================================================
--- trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-09-30 16:43:07 UTC (rev 164)
+++ trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-09-30 16:55:13 UTC (rev 165)
@@ -20,7 +20,7 @@
public Object doDataAccessOperation(ProceedingJoinPoint pjp)
throws Throwable {
- for (String methodNamePattern : AopUtils.NOT_LOGGED_METHODS) {
+ for (String methodNamePattern : AopUtils.NOT_LOGGED_PATTERNS) {
if (pjp.getSignature().toString().contains(methodNamePattern)) {
return pjp.proceed();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <zd...@us...> - 2006-10-04 00:48:11
|
Revision: 184
http://svn.sourceforge.net/comsuite/?rev=184&view=rev
Author: zduniak
Date: 2006-10-02 08:18:41 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
SystemArchitecture.java performance slightly improved (mainly due to improvements in strings concatenation mechanism)
Modified Paths:
--------------
trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
Modified: trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
===================================================================
--- trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-10-02 15:03:17 UTC (rev 183)
+++ trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-10-02 15:18:41 UTC (rev 184)
@@ -36,14 +36,14 @@
.getLogger(SystemArchitecture.class);
/**
- * TODO: JavaDoc
+ * TODO: JavaDoc
*/
@Pointcut("execution(* org.commsuite..*(..))")
public void dataAccessOperation() {
}
/**
- * TODO: JavaDoc
+ * TODO: JavaDoc
*/
@Around("dataAccessOperation()")
public Object doDataAccessOperation(ProceedingJoinPoint pjp)
@@ -63,17 +63,20 @@
// pass - do not bother if we can not get line number
}
- String parameters = "";
+ final StringBuilder parameters = new StringBuilder();
if (null != pjp.getArgs()) {
+ // TODO: consider using only one method invocation:
+ // Arrays.toString(pjp.getArgs())
+ // instead of below loop:
for (int i = 0; i < pjp.getArgs().length; i++) {
if (i != 0) {
- parameters += ", ";
+ parameters.append(", ");
}
try {
- parameters += pjp.getArgs()[i];
+ parameters.append(pjp.getArgs()[i]);
} catch (Exception e) {
- parameters += "???";
+ parameters.append("???");
// don't cate if we can NOT log some parameter
}
}
@@ -81,15 +84,15 @@
Object result = null;
- logger.debug(pjp.getSignature() + " " + lineNumber + " (" + parameters
- + ") START");
+ logger.debug(pjp.getSignature() + " " + lineNumber + " ("
+ + parameters.toString() + ") START");
try {
result = pjp.proceed();
} catch (Throwable e) {
logger.debug(pjp.getSignature().toString(), e);
throw e;
}
-
+
logger.debug(pjp.getSignature() + " " + result);
return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <zd...@us...> - 2006-10-04 01:46:29
|
Revision: 183
http://svn.sourceforge.net/comsuite/?rev=183&view=rev
Author: zduniak
Date: 2006-10-02 08:03:17 -0700 (Mon, 02 Oct 2006)
Log Message:
-----------
SystemArchitecture.java aspect slightly corrected (license header added, info about author added, handling returning from pointcut corrected)
Modified Paths:
--------------
trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
Modified: trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java
===================================================================
--- trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-10-02 13:26:17 UTC (rev 182)
+++ trunk/code/CSCommon/src/org/commsuite/aop/SystemArchitecture.java 2006-10-02 15:03:17 UTC (rev 183)
@@ -1,3 +1,23 @@
+/* $Id: $
+ *
+ * Communications Suite.
+ * Copyright (C) 2006 Szymon Kuzniak, Rafal Malinowski, Marek Musielak, Pawel Walkiewicz,
+ * Agnieszka Wisniewska, Marcin Zduniak, Liliana Ziolek.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ */
package org.commsuite.aop;
import org.apache.log4j.Logger;
@@ -6,16 +26,25 @@
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
+/**
+ * @author Marek Musielak
+ */
@Aspect
public class SystemArchitecture {
private static final Logger logger = Logger
.getLogger(SystemArchitecture.class);
+ /**
+ * TODO: JavaDoc
+ */
@Pointcut("execution(* org.commsuite..*(..))")
public void dataAccessOperation() {
}
+ /**
+ * TODO: JavaDoc
+ */
@Around("dataAccessOperation()")
public Object doDataAccessOperation(ProceedingJoinPoint pjp)
throws Throwable {
@@ -54,18 +83,14 @@
logger.debug(pjp.getSignature() + " " + lineNumber + " (" + parameters
+ ") START");
- Throwable exceptionToThrow = null;
try {
result = pjp.proceed();
} catch (Throwable e) {
- exceptionToThrow = e;
- throw exceptionToThrow;
- } finally {
- logger.debug(pjp.getSignature() + " " + result);
- if (exceptionToThrow != null) {
- throw exceptionToThrow;
- }
+ logger.debug(pjp.getSignature().toString(), e);
+ throw e;
}
+
+ logger.debug(pjp.getSignature() + " " + result);
return result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|