You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/23 02:20:13 UTC
svn commit: r587321 - in /cocoon/trunk/blocks/cocoon-fop:
cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java
cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java
Author: vgritsenko
Date: Mon Oct 22 17:20:11 2007
New Revision: 587321
URL: http://svn.apache.org/viewvc?rev=587321&view=rev
Log:
cleanup
Modified:
cocoon/trunk/blocks/cocoon-fop/cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java
cocoon/trunk/blocks/cocoon-fop/cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java
Modified: cocoon/trunk/blocks/cocoon-fop/cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-fop/cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java?rev=587321&r1=587320&r2=587321&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-fop/cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java (original)
+++ cocoon/trunk/blocks/cocoon-fop/cocoon-fop-impl/src/main/java/org/apache/cocoon/serialization/FOPSerializer.java Mon Oct 22 17:20:11 2007
@@ -49,6 +49,8 @@
import org.apache.cocoon.util.ClassUtils;
/**
+ * FOP 0.20.5 (and older) based serializer.
+ *
* @version $Id$
*/
public class FOPSerializer extends AbstractSerializer
Modified: cocoon/trunk/blocks/cocoon-fop/cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-fop/cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java?rev=587321&r1=587320&r2=587321&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-fop/cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java (original)
+++ cocoon/trunk/blocks/cocoon-fop/cocoon-fop-ng-impl/src/main/java/org/apache/cocoon/blocks/fop/FOPNGSerializer.java Mon Oct 22 17:20:11 2007
@@ -46,10 +46,13 @@
import org.apache.fop.apps.FopFactory;
/**
+ * FOP 0.93 (and newer) based serializer.
+ *
* @version $Id$
*/
-public class FOPNGSerializer extends AbstractSerializer implements
- Configurable, CacheableProcessingComponent, Serviceable, URIResolver, Disposable {
+public class FOPNGSerializer extends AbstractSerializer
+ implements Configurable, CacheableProcessingComponent,
+ Serviceable, URIResolver, Disposable {
protected SourceResolver resolver;
@@ -57,6 +60,7 @@
* Factory to create fop objects
*/
protected FopFactory fopfactory = FopFactory.newInstance();
+
/**
* The FOP instance.
*/
@@ -73,28 +77,20 @@
protected boolean setContentLength = true;
/**
- * It is used to make sure that default Options loaded only once.
- */
- private static boolean configured = false;
-
- /**
* Manager to get URLFactory from.
*/
protected ServiceManager manager;
private Map rendererOptions;
+
/**
* Set the component manager for this serializer.
*/
public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
- this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
+ this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
}
-/*
- public void dispose() {
- this.manager.release(this.resolver);
- }
-*/
+
/**
* Set the configurations for this serializer.
*/
@@ -151,6 +147,24 @@
}
/**
+ * Recycle serializer by removing references
+ */
+ public void recycle() {
+ super.recycle();
+ this.fop = null;
+ }
+
+ public void dispose() {
+ if (this.resolver != null) {
+ this.manager.release(this.resolver);
+ this.resolver = null;
+ }
+ this.manager = null;
+ }
+
+ // -----------------------------------------------------------------
+
+ /**
* Return the MIME type.
*/
public String getMimeType() {
@@ -205,14 +219,6 @@
}
/**
- * Recycle serializer by removing references
- */
- public void recycle() {
- super.recycle();
- this.fop = null;
- }
-
- /**
* Test if the component wants to set the content length
*/
public boolean shouldSetContentLength() {
@@ -286,14 +292,6 @@
return streamSource;
}
- public void dispose() {
- if (null != manager) {
- this.manager.release(this.resolver);
- this.manager = null;
- }
- this.resolver = null;
- }
-
/**
* An InputStream which releases the Cocoon/Avalon source from which the InputStream
* has been retrieved when the stream is closed.
@@ -346,5 +344,4 @@
return delegate.markSupported();
}
}
-
-}
\ No newline at end of file
+}