New issue 31 by mathieu.carbou: add method.setAccessible(true)
http://code.google.com/p/guiceyfruit/issues/detail?id=31
In the PreDestroyCloser class plus in the JSR250Module I would add
method.setAccessible(true);
I have a lot of classes in package local and also some method and some need
lifecycle management through jsr250.
Currently, calling non public methods or not in a public class fail... I
think it would be nice to allow best of both world.
Here is a failing use case:
final class PreDestroyInChildInjector {
public static void main(String... args) throws CloseFailedException {
Injector parent = Guice.createInjector(new Jsr250Module());
Injector child = parent.createChildInjector(new AbstractModule() {
@Override
protected void configure() {
bind(MyClass.class).in(Singleton.class);
}
});
child.getInstance(MyClass.class);
Injectors.close(child);
}
static class MyClass {
@PostConstruct
void start() { System.out.println("start called"); }
@PreDestroy
void stop() { System.out.println("stop called"); }
}
}
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings