1 16 package org.apache.cocoon.transformation; 17 18 import java.io.IOException ; 19 import java.util.Map ; 20 21 import org.apache.avalon.framework.activity.Disposable; 22 import org.apache.avalon.framework.parameters.Parameters; 23 import org.apache.avalon.framework.service.ServiceException; 24 import org.apache.avalon.framework.service.ServiceManager; 25 import org.apache.avalon.framework.service.Serviceable; 26 import org.apache.cocoon.ProcessingException; 27 import org.apache.cocoon.environment.SourceResolver; 28 import org.xml.sax.SAXException ; 29 30 38 39 public abstract class ServiceableTransformer 40 extends AbstractTransformer 41 implements Serviceable, Disposable { 42 43 44 protected SourceResolver resolver; 45 46 protected Map objectModel; 47 48 protected Parameters parameters; 49 50 protected String source; 51 52 protected ServiceManager manager; 53 54 58 public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) 59 throws ProcessingException, SAXException , IOException { 60 this.resolver = resolver; 61 this.objectModel = objectModel; 62 this.source = src; 63 this.parameters = par; 64 } 65 66 69 public void recycle() { 70 super.recycle(); 71 this.resolver = null; 72 this.objectModel = null; 73 this.source = null; 74 this.parameters = null; 75 } 76 77 80 public void service(ServiceManager manager) throws ServiceException { 81 this.manager = manager; 82 } 83 84 87 public void dispose() { 88 this.manager = null; 89 } 90 91 } 92 | Popular Tags |