1 10 package org.picocontainer.alternatives; 11 12 import org.picocontainer.ComponentAdapter; 13 import org.picocontainer.MutablePicoContainer; 14 import org.picocontainer.Parameter; 15 import org.picocontainer.PicoContainer; 16 import org.picocontainer.PicoException; 17 import org.picocontainer.PicoRegistrationException; 18 import org.picocontainer.PicoVerificationException; 19 import org.picocontainer.PicoVisitor; 20 21 import java.io.Serializable ; 22 import java.util.Collection ; 23 import java.util.List ; 24 25 29 public abstract class AbstractDelegatingMutablePicoContainer implements MutablePicoContainer, Serializable { 30 31 private MutablePicoContainer delegate; 32 33 public AbstractDelegatingMutablePicoContainer(MutablePicoContainer delegate) { 34 this.delegate = delegate; 35 } 36 37 protected MutablePicoContainer getDelegate() { 38 return delegate; 39 } 40 41 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException { 42 return delegate.registerComponentImplementation(componentKey, componentImplementation); 43 } 44 45 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException { 46 return delegate.registerComponentImplementation(componentKey, componentImplementation, parameters); 47 } 48 49 50 public ComponentAdapter registerComponentImplementation(Class componentImplementation) throws PicoRegistrationException { 51 return delegate.registerComponentImplementation(componentImplementation); 52 } 53 54 public ComponentAdapter registerComponentInstance(Object componentInstance) throws PicoRegistrationException { 55 return delegate.registerComponentInstance(componentInstance); 56 } 57 58 public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException { 59 return delegate.registerComponentInstance(componentKey, componentInstance); 60 } 61 62 public ComponentAdapter registerComponent(ComponentAdapter componentAdapter) throws PicoRegistrationException { 63 return delegate.registerComponent(componentAdapter); 64 } 65 66 public ComponentAdapter unregisterComponent(Object componentKey) { 67 return delegate.unregisterComponent(componentKey); 68 } 69 70 public ComponentAdapter unregisterComponentByInstance(Object componentInstance) { 71 return delegate.unregisterComponentByInstance(componentInstance); 72 } 73 74 public Object getComponentInstance(Object componentKey) { 75 return delegate.getComponentInstance(componentKey); 76 } 77 78 public Object getComponentInstanceOfType(Class componentType) { 79 return delegate.getComponentInstanceOfType(componentType); 80 } 81 82 public List getComponentInstances() { 83 return delegate.getComponentInstances(); 84 } 85 86 public PicoContainer getParent() { 87 return delegate.getParent(); 88 } 89 90 public ComponentAdapter getComponentAdapter(Object componentKey) { 91 return delegate.getComponentAdapter(componentKey); 92 } 93 94 public ComponentAdapter getComponentAdapterOfType(Class componentType) { 95 return delegate.getComponentAdapterOfType(componentType); 96 } 97 98 public Collection getComponentAdapters() { 99 return delegate.getComponentAdapters(); 100 } 101 102 public List getComponentAdaptersOfType(Class componentType) { 103 return delegate.getComponentAdaptersOfType(componentType); 104 } 105 106 109 public void verify() throws PicoVerificationException { 110 delegate.verify(); 111 } 112 113 public void start() { 114 delegate.start(); 115 } 116 117 public void stop() { 118 delegate.stop(); 119 } 120 121 public void dispose() { 122 delegate.dispose(); 123 } 124 125 public boolean addChildContainer(PicoContainer child) { 126 return delegate.addChildContainer(child); 127 } 128 129 public boolean removeChildContainer(PicoContainer child) { 130 return delegate.removeChildContainer(child); 131 } 132 133 public void accept(PicoVisitor visitor) { 134 delegate.accept(visitor); 135 } 136 137 public List getComponentInstancesOfType(Class type) throws PicoException { 138 return delegate.getComponentInstancesOfType(type); 139 } 140 141 public boolean equals(Object obj) { 142 final boolean result = delegate.equals(obj) || this == obj; 144 return result; 145 } 146 147 } 148 | Popular Tags |