Methods Summary |
---|
public java.lang.String | dumpInvocation(org.jboss.aop.joinpoint.Invocation invocation)Display useful information about the invocation
StringBuffer buffer = new StringBuffer();
if (invocation instanceof MethodInvocation)
{
org.jboss.aop.joinpoint.MethodInvocation methodInvocation = (org.jboss.aop.joinpoint.MethodInvocation)invocation;
buffer.append("Method@").append(System.identityHashCode(invocation)).append("{");
buffer.append("method=").append(methodInvocation.getMethod());
// TODO fix this, null arguments screws this up
// buffer.append(" args=").append(Arrays.asList(methodInvocation.arguments));
}
else if (invocation instanceof FieldReadInvocation)
{
org.jboss.aop.joinpoint.FieldReadInvocation fieldInvocation = (org.jboss.aop.joinpoint.FieldReadInvocation)invocation;
buffer.append("FieldRead@").append(System.identityHashCode(invocation)).append("{");
buffer.append("field=").append(fieldInvocation.getField());
}
else if (invocation instanceof FieldWriteInvocation)
{
org.jboss.aop.joinpoint.FieldWriteInvocation fieldInvocation = (org.jboss.aop.joinpoint.FieldWriteInvocation)invocation;
buffer.append("FieldWrite@").append(System.identityHashCode(invocation)).append("{");
buffer.append("field=").append(fieldInvocation.getField());
buffer.append(" value=").append(fieldInvocation.getValue());
}
else if (invocation instanceof ConstructorInvocation)
{
org.jboss.aop.joinpoint.ConstructorInvocation cInvocation = (org.jboss.aop.joinpoint.ConstructorInvocation)invocation;
buffer.append("Construct@").append(System.identityHashCode(invocation)).append("{");
buffer.append("constructor=").append(cInvocation.getConstructor());
buffer.append(" args=").append(Arrays.asList(cInvocation.getArguments()));
}
else
{
return "Unknown " + invocation;
}
buffer.append("}");
return buffer.toString();
|
public java.lang.String | dumpInvocationResponse(java.lang.Object response)Display useful information about the invocation response
if (response == null)
return "null";
StringBuffer buffer = new StringBuffer();
buffer.append(response);
return buffer.toString();
|
public java.lang.String | getName()
return "CallLoggingInterceptor";
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.Invocation invocation)
boolean callLogging = log.isDebugEnabled();
if (callLogging)
callLogging = Boolean.valueOf((String)invocation.getMetaData(LOGGING, CALL_LOGGING)).booleanValue();
if (callLogging)
log.debug("Invoking: " + dumpInvocation(invocation));
Object response = null;
try
{
response = invocation.invokeNext();
return response;
}
catch (Throwable t)
{
if (callLogging)
log.debug("Throwing: " + dumpInvocation(invocation), t);
throw t;
}
finally
{
if (callLogging)
log.debug("Response: " + dumpInvocationResponse(response) + " for " + dumpInvocation(invocation));
}
|