1 16 package org.apache.cocoon.components; 17 18 import org.apache.avalon.framework.component.Component; 19 import org.apache.avalon.framework.component.ComponentException; 20 import org.apache.avalon.framework.component.ComponentManager; 21 22 29 public class ComponentLocatorImpl 30 implements ComponentLocator { 31 32 protected ComponentManager manager; 33 protected String role; 34 35 public ComponentLocatorImpl(ComponentManager manager, String role) { 36 this.manager = manager; 37 this.role = role; 38 } 39 40 public Object lookup() 41 throws ComponentException { 42 return this.manager.lookup( this.role ); 43 } 44 45 public void release(Object parent) { 46 this.manager.release( (Component) parent); 47 } 48 } 49 | Popular Tags |