}
public void close() {
if (state != null && state.size() > 0) {
for (Iterator<Scoped> i = state.values().iterator();i.hasNext();) {
Scoped scoped = i.next();
i.remove();
try {
scoped.destroy();
}
catch (Throwable t) {
log.info("Error when destroying object", t);
}
}