Hi,
I'd like to register a type listener for warp-persistence's
SessionFactory provider. Which unfortunately is package private, so as
a workaround - armed with the knowledge that it is a provider, I
thought I'd do this:
bindListener(Matchers.only(TypeLiteral.get(Types
.providerOf(SessionFactory.class))), new
TypeListener() {
@Override
public <I> void hear(TypeLiteral<I> type,
TypeEncounter<I> encounter) {
log.info("Encountered type: " + type);
}
});
or:
bindListener(Matchers.only(new TypeLiteral<SessionFactory>() {
}), new TypeListener() {
@Override
public <I> void hear(TypeLiteral<I> type,
TypeEncounter<I> encounter) {
log.info("Encountered type: " + type);
}
});
That doesn't work, and I guess can't work due to type erasure?
Does anyone have a suggestion how I could do this?
Thanks,
Eelco
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.