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