Well, I finally got it :) Those two methods in core EAR do the trick:
@Override
public void registerResources(Set<String> resources) {
for (String resource : resources) {
getRestEasyRegistry().addJndiResource(resource);
}
}
@Override
public void unregisterResources(Set<String> resources) {
try {
for (String resource : resources) {
Object pepe = ctx.lookup(resource);
Class<?> mici = pepe.getClass();
getRestEasyRegistry().removeRegistrations(mici);
}
} catch (NamingException e) {
throw new RuntimeException(e);
}
}
While registering is done via JNDI names, unregistering must be done via
removeRegistrations method, which takes Class<?> for the argument. While
passing Set<Class<?>> from a sub EAR to the core EAR is not possible, I can
pass JNDI names (exactly the same as when registering) and then use
ctx.lookup to get the actual class types to unregister. And the best part:
it works! :)
------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of
discussion for anyone considering optimizing the pricing and packaging model
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Resteasy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/resteasy-users