Skip to content

Commit

Permalink
3.0.0-47
Browse files Browse the repository at this point in the history
  • Loading branch information
topframe committed Sep 23, 2016
1 parent efb3f0d commit a6cb794
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 156 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* Converts a ProcessResult object to a APON object.
*
* <p>Created: 2015. 03. 16 PM 11:14:29</p>
*
* @author Juho Jeong
*/
public class ContentsAponAssembler {

Expand All @@ -47,7 +45,6 @@ public static Parameters assemble(ProcessResult processResult) throws Invocation
if (contentResult.getName() == null && contentResult.size() == 1) {
ActionResult actionResult = contentResult.get(0);
Object resultValue = actionResult.getResultValue();

if (actionResult.getActionId() == null) {
if (resultValue instanceof Parameters) {
return (Parameters)resultValue;
Expand Down Expand Up @@ -100,7 +97,6 @@ private static void putValue(Parameters container, String name, Object value) th
}
} else if (value.getClass().isArray()) {
int len = Array.getLength(value);

for (int i = 0; i < len; i++) {
Object o = Array.get(value, i);
if (o != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,35 +149,34 @@ private void register(TransletRule transletRule) {
}
}
}

//if (pointcut != null) {
// countMatchedTranslet(pointcut, transletRule.getName());
//}
}
}

@SuppressWarnings("unused")
private void countMatchedTranslet(Pointcut pointcut, String transletName) {
List<PointcutPatternRule> pointcutPatternRuleList = pointcut.getPointcutPatternRuleList();

if (pointcutPatternRuleList != null) {
for (PointcutPatternRule ppr : pointcutPatternRuleList) {
if (existsMatchedTranslet(pointcut, ppr, transletName)) {
ppr.increaseMatchedTransletCount();
}
}
// if (pointcut != null) {
// countMatchedTranslet(pointcut, transletRule.getName());
// }
}
}

private boolean existsMatchedTranslet(Pointcut pointcut, PointcutPatternRule pointcutPatternRule, String transletName) {
boolean matched = true;

if (pointcutPatternRule.getTransletNamePattern() != null) {
matched = pointcut.patternMatches(pointcutPatternRule.getTransletNamePattern(), transletName, ActivityContext.TRANSLET_NAME_SEPARATOR_CHAR);
}

return matched;
}

// private void countMatchedTranslet(Pointcut pointcut, String transletName) {
// List<PointcutPatternRule> pointcutPatternRuleList = pointcut.getPointcutPatternRuleList();
//
// if (pointcutPatternRuleList != null) {
// for (PointcutPatternRule ppr : pointcutPatternRuleList) {
// if (existsMatchedTranslet(pointcut, ppr, transletName)) {
// ppr.increaseMatchedTransletCount();
// }
// }
// }
// }
//
// private boolean existsMatchedTranslet(Pointcut pointcut, PointcutPatternRule pointcutPatternRule, String transletName) {
// boolean matched = true;
//
// if (pointcutPatternRule.getTransletNamePattern() != null) {
// matched = pointcut.patternMatches(pointcutPatternRule.getTransletNamePattern(), transletName, ActivityContext.TRANSLET_NAME_SEPARATOR_CHAR);
// }
//
// return matched;
// }

private boolean existsMatchedBean(Pointcut pointcut, String beanId, String className) {
List<PointcutPatternRule> pointcutPatternRuleList = pointcut.getPointcutPatternRuleList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,6 @@ public Object intercept(Object proxy, Method method, Object[] args, MethodProxy

try {
try {
if (log.isTraceEnabled()) {
StringBuilder sb = new StringBuilder();
sb.append("begin method ").append(methodName).append("(");
for (int i = 0; i < args.length; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(args[i].toString());
}
sb.append(")");
log.trace(sb.toString());
}

if (aarr.getBeforeAdviceRuleList() != null) {
activity.execute(aarr.getBeforeAdviceRuleList());
}
Expand All @@ -95,9 +82,6 @@ public Object intercept(Object proxy, Method method, Object[] args, MethodProxy
if (aarr.getFinallyAdviceRuleList() != null) {
activity.executeWithoutThrow(aarr.getFinallyAdviceRuleList());
}
if (log.isTraceEnabled()) {
log.trace("end method " + methodName);
}
}
} catch (Exception e) {
activity.setRaisedException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,6 @@ public Object invoke(Object self, Method overridden, Method proceed, Object[] ar

try {
try {
if (log.isTraceEnabled()) {
StringBuilder sb = new StringBuilder();
sb.append("begin method ").append(methodName).append("(");
for (int i = 0; i < args.length; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(args[i].toString());
}
sb.append(")");
log.trace(sb.toString());
}

if (aarr.getBeforeAdviceRuleList() != null) {
activity.execute(aarr.getBeforeAdviceRuleList());
}
Expand All @@ -94,9 +81,6 @@ public Object invoke(Object self, Method overridden, Method proceed, Object[] ar
if (aarr.getFinallyAdviceRuleList() != null) {
activity.executeWithoutThrow(aarr.getFinallyAdviceRuleList());
}
if (log.isTraceEnabled()) {
log.trace("end method " + methodName);
}
}
} catch (Exception e) {
activity.setRaisedException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl

try {
try {
if (log.isTraceEnabled()) {
StringBuilder sb = new StringBuilder();
sb.append("begin method ").append(methodName).append("(");
for (int i = 0; i < args.length; i++) {
if (i > 0) {
sb.append(", ");
}
sb.append(args[i].toString());
}
sb.append(")");
log.trace(sb.toString());
}

if (aarr.getBeforeAdviceRuleList() != null) {
activity.execute(aarr.getBeforeAdviceRuleList());
}
Expand All @@ -96,9 +83,6 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
if (aarr.getFinallyAdviceRuleList() != null) {
activity.executeWithoutThrow(aarr.getFinallyAdviceRuleList());
}
if (log.isTraceEnabled()) {
log.trace("end method " + methodName);
}
}
} catch (Exception e) {
activity.setRaisedException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ private void initAspectRuleRegistry(AspectRuleRegistry aspectRuleRegistry, BeanR
aspectRuleRegistry.setSessionAspectAdviceRuleRegistry(sessionScopeAspectAdviceRuleRegistry);
}

Importer resolveImporter(String rootContext) {
protected Importer resolveImporter(String rootContext) {
ImportFileType importFileType = rootContext.toLowerCase().endsWith(".apon") ? ImportFileType.APON : ImportFileType.XML;
return resolveImporter(rootContext, importFileType);
}
Importer resolveImporter(String rootContext, ImportFileType importFileType) {

protected Importer resolveImporter(String rootContext, ImportFileType importFileType) {
Importer importer;

if (rootContext.startsWith(ResourceUtils.CLASSPATH_URL_PREFIX)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ public void setHidden(Boolean hidden) {
public String toString() {
ToStringBuilder tsb = new ToStringBuilder();
tsb.append("id", actionId);
if (attributeItemRuleMap != null)
if (attributeItemRuleMap != null) {
tsb.append("attributes", attributeItemRuleMap.keySet());
}
tsb.append("hidden", hidden);
return tsb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class PointcutPatternRule {

private String methodNamePattern;

private int matchedTransletCount;
// private int matchedTransletCount;

private int matchedBeanCount;

Expand Down Expand Up @@ -118,13 +118,13 @@ public void addExcludePointcutPatternRule(PointcutPatternRule excludePointcutPat
excludePointcutPatternRuleList.add(excludePointcutPatternRule);
}

public int getMatchedTransletCount() {
return matchedTransletCount;
}

public void increaseMatchedTransletCount() {
matchedTransletCount++;
}
// public int getMatchedTransletCount() {
// return matchedTransletCount;
// }
//
// public void increaseMatchedTransletCount() {
// matchedTransletCount++;
// }

public int getMatchedBeanCount() {
return matchedBeanCount;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/com/aspectran/core/context/rule/RequestRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ public AspectAdviceRuleRegistry touchAspectAdviceRuleRegistry() {
}

public AspectAdviceRuleRegistry replicateAspectAdviceRuleRegistry() {
if (aspectAdviceRuleRegistry == null)
if (aspectAdviceRuleRegistry == null) {
return null;

}
return aspectAdviceRuleRegistry.replicate();
}

Expand All @@ -168,12 +168,14 @@ public static RequestRule newInstance(String allowedMethod, String characterEnco

if (allowedMethod != null) {
allowedethodType = MethodType.resolve(allowedMethod);
if (allowedethodType == null)
if (allowedethodType == null) {
throw new IllegalArgumentException("No request method type registered for '" + allowedMethod + "'.");
}
}

if (characterEncoding != null && !Charset.isSupported(characterEncoding))
if (characterEncoding != null && !Charset.isSupported(characterEncoding)) {
throw new IllegalCharsetNameException("Given charset name is illegal. charsetName: " + characterEncoding);
}

RequestRule requestRule = new RequestRule();
requestRule.setAllowedMethod(allowedethodType);
Expand Down

0 comments on commit a6cb794

Please sign in to comment.