Methods Summary |
---|
private void | checkInvariants(org.jboss.aop.joinpoint.Invocation invocation, java.lang.Object ret)
if (verbose) System.out.println("[dbc] === checkInvariants() for " + ((method != null) ? method.toString() : constructor.toString()));
boolean isConstructor = (constructor != null);
for (int i = 0 ; i < invariants.length ; i++)
{
invariants[i].evaluateCondition(invocation, isStatic, isConstructor, ret);
}
|
private void | checkPostConditions(org.jboss.aop.joinpoint.Invocation invocation, java.lang.Object[] args, java.lang.Object ret)
if (verbose) System.out.println("[dbc] === checkPostconditions() for " + ((method != null) ? method.toString() : constructor.toString()));
for (int i = 0 ; i < postconditions.length ; i++)
{
postconditions[i].evaluateCondition(this, invocation, args, ret);
}
|
private void | checkPreConditions(org.jboss.aop.joinpoint.Invocation invocation, java.lang.Object[] args)
if (verbose) System.out.println("[dbc] === checkPreconditions() for " + ((method != null) ? method.toString() : constructor.toString()));
for (int i = 0 ; i < preconditions.length ; i++)
{
preconditions[i].evaluateCondition(this, invocation, args, null);
}
|
private java.lang.Object | doInvoke(org.jboss.aop.joinpoint.Invocation invocation, java.lang.Object[] args)
logStart();
Object ret = null;
boolean wasDone = ((Boolean)done.get()).booleanValue();
try
{
done.set(Boolean.TRUE);
if (!wasDone && isPublic && (constructor == null))
{
checkInvariants(invocation, null);
}
if (!wasDone)
{
checkPreConditions(invocation, args);
}
ret = invocation.invokeNext();
if (!wasDone && isPublic)
{
checkInvariants(invocation, ret);
checkPostConditions(invocation, args, ret);
}
}
finally
{
if (!wasDone)
{
done.set(Boolean.FALSE);
}
}
logEnd();
return ret;
|
public boolean | getVerbose()
return verbose;
|
private void | initialise(java.lang.reflect.Method m)
method = m;
int modifiers = m.getModifiers();
initialise(modifiers);
preconditions = MethodConditionManager.getPreConditions(m);
postconditions = MethodConditionManager.getPostConditions(m);
if (isPublic)
{
invariants = MethodConditionManager.getInvariants(m);
}
|
private void | initialise(java.lang.reflect.Constructor c)
constructor = c;
int modifiers = c.getModifiers();
initialise(modifiers);
preconditions = ConstructorConditionManager.getPreConditions(c);
postconditions = ConstructorConditionManager.getPostConditions(c);
if (isPublic)
{
invariants = ConstructorConditionManager.getInvariants(c);
}
|
private void | initialise(int modifiers)
isSynchronized = Modifier.isSynchronized(modifiers);
isStatic = Modifier.isStatic(modifiers);
isPublic = Modifier.isPublic(modifiers);
initialised = true;
|
private java.lang.Object | invoke(org.jboss.aop.joinpoint.Invocation invocation, java.lang.Object[] args)
if (isSynchronized)
{
if (isStatic)
{
synchronized (method.getDeclaringClass())
{
return doInvoke(invocation, args);
}
}
else
{
synchronized (invocation.getTargetObject())
{
return doInvoke(invocation, args);
}
}
}
return doInvoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.MethodInvocation invocation)
if (!initialised)
{
initialise(invocation.getMethod());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.MethodCalledByMethodInvocation invocation)
if (!initialised)
{
initialise(invocation.getCalledMethod());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.MethodCalledByConstructorInvocation invocation)
if (!initialised)
{
initialise(invocation.getCalledMethod());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.ConstructorInvocation invocation)
if (!initialised)
{
initialise(invocation.getConstructor());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.ConstructorCalledByMethodInvocation invocation)
if (!initialised)
{
initialise(invocation.getCalledConstructor());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.ConstructorCalledByConstructorInvocation invocation)
if (!initialised)
{
initialise(invocation.getCalledConstructor());
}
Object[] args = invocation.getArguments();
return invoke(invocation, args);
|
private void | logEnd()
if (verbose)
{
if (method != null)
{
System.out.println("[dbc] ======= Invoked method: " + method);
}
else
{
System.out.println("[dbc] ======= Invoked constructor: " + constructor);
}
}
|
private void | logStart()
if (verbose)
{
if (method != null)
{
System.out.println("[dbc] ======= Invoking method: " + method);
}
else
{
System.out.println("[dbc] ======= Invoking constructor: " + constructor);
}
}
|
public void | setVerbose(boolean vbs)
verbose = vbs;
|