bdelacretaz 2004/02/07 00:59:57
Modified: src/java/org/apache/cocoon/transformation
TraxTransformer.java
Log:
Composable => Serviceable (DeliTransformer did not compile)
Revision Changes Path
1.9 +17 -12
cocoon-2.1/src/java/org/apache/cocoon/transformation/TraxTransformer.java
Index: TraxTransformer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TraxTransformer.java 28 Oct 2003 19:53:57 -0000 1.8
+++ TraxTransformer.java 7 Feb 2004 08:59:57 -0000 1.9
@@ -66,11 +66,15 @@
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.Composable;
+import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.service.ServiceException;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.caching.CacheableProcessingComponent;
import org.apache.cocoon.components.source.SourceUtil;
@@ -166,10 +170,10 @@
* @version CVS $Id$
*/
public class TraxTransformer extends AbstractTransformer
-implements Transformer, Composable, Configurable,
CacheableProcessingComponent, Disposable {
+implements Transformer, Serviceable, Configurable,
CacheableProcessingComponent, Disposable {
- /** The component manager (protected because used by subclasses) */
- protected ComponentManager manager;
+ /** The service manager instance (protected because used by subclasses)
*/
+ protected ServiceManager manager;
/** The object model (protected because used by subclasses) */
protected Map objectModel;
@@ -267,7 +271,7 @@
if (traxFactory != null) {
this.xsltProcessor.setTransformerFactory(traxFactory);
}
- } catch (ComponentException e) {
+ } catch (ServiceException e) {
throw new ConfigurationException("Cannot load XSLT processor",
e);
}
@@ -283,10 +287,10 @@
}
/**
- * Set the current <code>ComponentManager</code> instance used by this
- * <code>Composable</code>.
+ * Set the current <code>ServiceManager</code> instance used by this
+ * <code>Serviceable</code>.
*/
- public void compose(ComponentManager manager) throws ComponentException {
+ public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
}
@@ -529,11 +533,12 @@
* Disposable
*/
public void dispose() {
- this.manager.release(this.xsltProcessor);
- this.xsltProcessor = null;
- this.manager = null;
+ if ( this.manager != null ) {
+ this.manager.release(this.xsltProcessor);
+ this.xsltProcessor = null;
+ this.manager = null;
+ }
}
-
/**
* Recyclable