001: /*****************************************************************************
002: * Copyright (C) PicoContainer Organization. All rights reserved. *
003: * ------------------------------------------------------------------------- *
004: * The software in this package is published under the terms of the BSD *
005: * style license a copy of which has been included with this distribution in *
006: * the LICENSE.txt file. *
007: * *
008: * Original code by the committers *
009: *****************************************************************************/package org.picocontainer.containers;
010:
011: import java.util.Properties;
012: import java.lang.annotation.Annotation;
013:
014: import org.picocontainer.ComponentAdapter;
015: import org.picocontainer.MutablePicoContainer;
016: import org.picocontainer.Parameter;
017: import org.picocontainer.PicoCompositionException;
018: import org.picocontainer.PicoContainer;
019:
020: /**
021: * abstract base class for delegating to mutable containers
022: * @author Paul Hammant
023: */
024: public abstract class AbstractDelegatingMutablePicoContainer extends
025: AbstractDelegatingPicoContainer implements MutablePicoContainer {
026:
027: public AbstractDelegatingMutablePicoContainer(
028: MutablePicoContainer delegate) {
029: super (delegate);
030: }
031:
032: public MutablePicoContainer addComponent(Object componentKey,
033: Object componentImplementationOrInstance,
034: Parameter... parameters) throws PicoCompositionException {
035: return getDelegate().addComponent(componentKey,
036: componentImplementationOrInstance, parameters);
037: }
038:
039: public MutablePicoContainer addComponent(Object implOrInstance)
040: throws PicoCompositionException {
041: return getDelegate().addComponent(implOrInstance);
042: }
043:
044: public MutablePicoContainer addConfig(String name, Object val) {
045: return getDelegate().addConfig(name, val);
046: }
047:
048: public MutablePicoContainer addAdapter(
049: ComponentAdapter<?> componentAdapter)
050: throws PicoCompositionException {
051: return getDelegate().addAdapter(componentAdapter);
052: }
053:
054: public <T> ComponentAdapter<T> removeComponent(Object componentKey) {
055: return getDelegate().removeComponent(componentKey);
056: }
057:
058: public <T> ComponentAdapter<T> removeComponentByInstance(
059: T componentInstance) {
060: return getDelegate().removeComponentByInstance(
061: componentInstance);
062: }
063:
064: public MutablePicoContainer addChildContainer(PicoContainer child) {
065: return getDelegate().addChildContainer(child);
066: }
067:
068: public boolean removeChildContainer(PicoContainer child) {
069: return getDelegate().removeChildContainer(child);
070: }
071:
072: public MutablePicoContainer change(Properties... properties) {
073: return getDelegate().change(properties);
074: }
075:
076: public MutablePicoContainer as(Properties... properties) {
077: return getDelegate().as(properties);
078: }
079:
080: public void dispose() {
081: getDelegate().dispose();
082: }
083:
084: public MutablePicoContainer makeChildContainer() {
085:
086: return null;
087: }
088:
089: public void start() {
090: getDelegate().start();
091: }
092:
093: public void stop() {
094: getDelegate().stop();
095: }
096:
097: public MutablePicoContainer getDelegate() {
098: return (MutablePicoContainer) super.getDelegate();
099: }
100: }
|