1 15 package org.apache.hivemind.impl; 16 17 import java.util.AbstractMap ; 18 import java.util.Map ; 19 import java.util.Set ; 20 21 import org.apache.hivemind.HiveMind; 22 import org.apache.hivemind.events.RegistryShutdownListener; 23 24 33 public final class ElementsProxyMap extends AbstractMap implements RegistryShutdownListener 34 { 35 private Map _inner; 36 37 private boolean _shutdown; 38 39 public void registryDidShutdown() 40 { 41 _shutdown = true; 42 _inner = null; 43 } 44 45 private void checkShutdown() 46 { 47 if (_shutdown) 48 throw HiveMind.createRegistryShutdownException(); 49 } 50 51 public Set entrySet() 52 { 53 checkShutdown(); 54 55 return _inner.entrySet(); 56 } 57 58 public String toString() 59 { 60 return _inner.toString(); 61 } 62 63 public boolean equals(Object o) 64 { 65 return _inner.equals(o); 66 } 67 68 public int hashCode() 69 { 70 return _inner.hashCode(); 71 } 72 73 public void setInner(Map map) 74 { 75 _inner = map; 76 } 77 78 } | Popular Tags |