commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject [proxy] InvocationRecorder?
Date Sat, 05 Apr 2008 15:08:36 GMT
What do you folks think about a new addition to Proxy which basically
allows you to record invocations made on proxy objects, similar to how
EasyMock does it.  Here's the idea...

public class InvocationRecorder
{
  public List<RecordedInvocation> getRecordedInvocations();
  public <T> proxy(Class<T> type);
}

public class RecordedInvocation
{
  public Method getInvokedMethod();
  public Object[] getArguments();
}

The Wicket folks are doing something similar to build up their
bindings for form components
(https://issues.apache.org/jira/browse/WICKET-1327):

SafePropertyModel<Person> p = new SafePropertyModel<Person>(new Person());
TextField field = new TextField("name", p.bind(p.property().getFirstName()));

With this addition to Proxy, we can handle all the "recording" for
them.  They just have to figure out what to do with the recorded
invocations.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message