hi igor,
i came up with a quick CustomConfig (basically i always want to use
DependencyInstrumentor for classes in my defined packages)....which
seems to work perfectly well. however i haven't deeply tested it. do
you think always returning Scope.ALL is ok in this case?
public class CustomTransformer extends AbstractTransformer {
String[] packages;
public CustomTransformer(String... packages) {
this.packages = packages;
}
@Override
protected Config getConfig(ClassLoader loader, String className) {
return new CustomConfig(packages);
}
}
class CustomConfig implements Config {
private Instrumentor instrumentor = new DependencyInstrumentor();
private List<String> packageList;
public CustomConfig(String... packages) {
packageList = Arrays.asList(packages);
}
@Override
public Collection<Instrumentor> getInstrumentors(String className) {
String name = className.replace('/', '.');
for (String pkg : packageList) {
if (name.startsWith(pkg)) {
return Arrays.asList(instrumentor);
}
}
return Collections.emptyList();
}
@Override
public Scope getScope(Instrumentor inst) {
return Scope.ALL;
}
}
thanks,
francisco
On Aug 25, 10:02 pm, "francisco treacy" <
francisco.tre...@gmail.com>
wrote:
> no worries; it's known people happen to go on vacations sometimes :)
>
> i'd love to test those changes right away, but my development laptop
> just died... so bare with me. in a few days i'll setup the dev
> environment again on a new computer and i'll let you know.
> anyway code you checked in will surely facilitate the task, basically
> implementing the abstract transformer i am good to go.
>
> the interest is actually to finish a part of a little utility i plan
> to commit shortly:
http://code.google.com/p/gluw/. this setup seems
> to work perfectly for me so i wanted to share it (btw i implemented a
> custom locator in front of guice's and works great).
>
> francisco
>