use of org.jboss.resteasy.plugins.server.Cleanable in project resteasy by resteasy.
the class SseEventOutputImpl method clearContextData.
public void clearContextData() {
Map<Class<?>, Object> map = ResteasyContext.getContextDataMap(false);
Cleanables cleanables = map != null ? (Cleanables) map.get(Cleanables.class) : null;
if (cleanables != null) {
for (Iterator<Cleanable> it = cleanables.getCleanables().iterator(); it.hasNext(); ) {
try {
it.next().clean();
} catch (Exception e) {
// Empty
}
}
ResteasyContext.clearContextData();
}
}
use of org.jboss.resteasy.plugins.server.Cleanable in project resteasy by resteasy.
the class SynchronousDispatcher method clearContextData.
public void clearContextData() {
Map<Class<?>, Object> map = ResteasyContext.getContextDataMap(false);
Cleanables cleanables = map != null ? (Cleanables) map.get(Cleanables.class) : null;
if (cleanables != null) {
for (Iterator<Cleanable> it = cleanables.getCleanables().iterator(); it.hasNext(); ) {
try {
it.next().clean();
} catch (Exception e) {
// Empty
}
}
ResteasyContext.clearContextData();
}
// just in case there were internalDispatches that need to be cleaned up
MessageBodyParameterInjector.clearBodies();
}
Aggregations