cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r360121 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal: coplet/ layout/ layout/impl/ persistence/castor/ profile/impl/
Date Fri, 30 Dec 2005 17:33:49 GMT
Author: cziegeler
Date: Fri Dec 30 09:33:06 2005
New Revision: 360121

URL: http://svn.apache.org/viewcvs?rev=360121&view=rev
Log:
Finally found solution to prevent castor from checking for default constructors

Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletbasedata.xml
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletdata.xml
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletinstancedata.xml
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/layout.xml
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java Fri
Dec 30 09:33:06 2005
@@ -35,17 +35,6 @@
 	private String copletAdapterName;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #CopletBaseData(String)} instead.
-     */
-	public CopletBaseData() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        this.id = null;
-        throw new IllegalArgumentException("Only instantiate a coplet base data with the
id constructor.");
-    }
-
-    /**
      * Create a new coplet base data object. 
      * @param id The unique id of the object.
      */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java Fri Dec
30 09:33:06 2005
@@ -47,17 +47,6 @@
     protected transient List allowedRolesList;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #CopletData(String)} instead.
-     */
-    public CopletData() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        this.id = null;
-        throw new IllegalArgumentException("Only instantiate a coplet data with the id constructor.");
-    }
-
-    /**
      * Constructor to instantiate a new coplet data object.
      * @param id The unique id of the object.
      */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
Fri Dec 30 09:33:06 2005
@@ -66,17 +66,6 @@
     protected int size = SIZE_NORMAL;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #CopletInstanceData(String)} instead.
-     */
-    public CopletInstanceData() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        this.id = null;
-        throw new IllegalArgumentException("Only instantiate a coplet instance data with
the id constructor.");
-    }
-
-    /**
 	 * Constructor to create a new coplet instance data object.
      * Never create a coplet instance data object directly. Use the
      * {@link CopletFactory} instead.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/AbstractLayout.java Fri
Dec 30 09:33:06 2005
@@ -56,24 +56,13 @@
     protected Boolean isStatic;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #AbstractLayout(String, String)} instead.
-     */
-    public AbstractLayout() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        this.id = null;
-        throw new IllegalArgumentException("Only instantiate a layout with the id/string
constructor.");
-    }
-
-    /**
      * Create a new layout object.
      * Never create a layout object directly. Use the
      * {@link LayoutFactory} instead.
      * @param id The unique identifier of the layout object or null.
      * @param name The name of the layout.
      */
-    public AbstractLayout (String id, String name) {
+    public AbstractLayout(String id, String name) {
         this.id = id;
         this.name = name;
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
Fri Dec 30 09:33:06 2005
@@ -40,17 +40,6 @@
     protected List items = new ArrayList();
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #CompositeLayoutImpl(String, String)} instead.
-     */
-    public CompositeLayoutImpl() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        super(null, null);
-        throw new IllegalArgumentException("Only instantiate a composite layout with the
id/name constructor.");
-    }
-
-    /**
      * Create a new composite layout object.
      * Never create a layout object directly. Use the
      * {@link LayoutFactory} instead.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
Fri Dec 30 09:33:06 2005
@@ -31,17 +31,6 @@
     protected CopletInstanceData copletInstanceData;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #CopletLayout(String, String)} instead.
-     */
-    public CopletLayout() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        super(null, null);
-        throw new IllegalArgumentException("Only instantiate a coplet layout with the id/string
constructor.");
-    }
-
-    /**
      * Create a new coplet layout object.
      * Never create a layout object directly. Use the
      * {@link LayoutFactory} instead.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
Fri Dec 30 09:33:06 2005
@@ -30,17 +30,6 @@
     protected String source;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #FrameLayout(String, String)} instead.
-     */
-    public FrameLayout() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        super(null, null);
-        throw new IllegalArgumentException("Only instantiate a frame layout with the id/String
constructor.");
-    }
-
-    /**
      * Create a new frame layout object.
      * Never create a layout object directly. Use the
      * {@link LayoutFactory} instead.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java Fri
Dec 30 09:33:06 2005
@@ -31,17 +31,6 @@
     protected String linkedLayoutId;
 
     /**
-     * DO NOT USE THIS CONSTRUCTOR - it's just here to keep Castor happy.
-     * Use {@link #LinkLayout(String, String)} instead.
-     */
-    public LinkLayout() {
-        // this constructor is just to keep Castor happy (version 0.9.9)
-        // we can remove it in later versions
-        super(null, null);
-        throw new IllegalArgumentException("Only instantiate a link layout with the id/string
constructor.");
-    }
-
-    /**
      * Create a new link layout object.
      * Never create a layout object directly. Use the
      * {@link LayoutFactory} instead.

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletbasedata.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletbasedata.xml?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletbasedata.xml
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletbasedata.xml
Fri Dec 30 09:33:06 2005
@@ -28,7 +28,7 @@
     </field>
   </class>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletBaseData">
+  <class name="org.apache.cocoon.portal.coplet.CopletBaseData" verify-constructable="false">
     <map-to xml="coplet-base-data" />
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletdata.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletdata.xml?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletdata.xml
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletdata.xml
Fri Dec 30 09:33:06 2005
@@ -18,7 +18,7 @@
 <mapping>
   <description>Coplet data mapping file</description>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletBaseData" identity="id">
+  <class name="org.apache.cocoon.portal.coplet.CopletBaseData" identity="id" verify-constructable="false">
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
       <bind-xml name="id" node="attribute" />
     </field>
@@ -34,7 +34,7 @@
     </field>
   </class>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletData">
+  <class name="org.apache.cocoon.portal.coplet.CopletData" verify-constructable="false">
     <map-to xml="coplet-data" />
     
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletinstancedata.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletinstancedata.xml?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletinstancedata.xml
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/copletinstancedata.xml
Fri Dec 30 09:33:06 2005
@@ -18,7 +18,7 @@
 <mapping>
   <description>Coplet instance data mapping file</description>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletData" identity="id">
+  <class name="org.apache.cocoon.portal.coplet.CopletData" identity="id" verify-constructable="false">
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
       <bind-xml name="id" node="attribute" />
     </field>
@@ -52,7 +52,7 @@
     </field>
   </class>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletInstanceData">
+  <class name="org.apache.cocoon.portal.coplet.CopletInstanceData" verify-constructable="false">
     <map-to xml="coplet-instance-data"/>
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/layout.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/layout.xml?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/layout.xml
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/persistence/castor/layout.xml
Fri Dec 30 09:33:06 2005
@@ -18,7 +18,9 @@
 <mapping>
   <description>Portalprofile mapping file</description>
 
-  <class name="org.apache.cocoon.portal.coplet.CopletInstanceData" identity="id">
+  <class name="org.apache.cocoon.portal.coplet.CopletInstanceData"
+         identity="id"
+         verify-constructable="false">
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
       <bind-xml name="id" node="attribute" />
     </field>
@@ -32,7 +34,8 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.AbstractLayout"
-         extends="org.apache.cocoon.portal.layout.AbstractParameters">
+         extends="org.apache.cocoon.portal.layout.AbstractParameters"
+         verify-constructable="false">
 
     <field name="layoutRendererName" type="java.lang.String">
       <bind-xml name="layout-renderer-name" node="attribute"/>
@@ -49,7 +52,8 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.LinkLayout"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout">
+         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         verify-constructable="false">
     <map-to xml="link-layout"/>
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
@@ -69,7 +73,8 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout">
+         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         verify-constructable="false">
     <map-to xml="composite-layout"/>
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
@@ -88,7 +93,8 @@
 
   <class name="org.apache.cocoon.portal.layout.impl.CopletLayout"
          auto-complete="false"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout">
+         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         verify-constructable="false">
     <map-to xml="coplet-layout"/>
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">
@@ -105,7 +111,8 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.FrameLayout"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout">
+         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         verify-constructable="false">
     <map-to xml="frame-layout"/>
 
     <field name="id" type="java.lang.String" set-method="%1" get-method="getId">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java?rev=360121&r1=360120&r2=360121&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/profile/impl/MapProfileLS.java
Fri Dec 30 09:33:06 2005
@@ -42,7 +42,8 @@
 import org.w3c.dom.Element;
 
 /**
- * This implementation uses Castor to load/save the profiles.
+ * This implementation uses a {@link Converter} component to load/save
+ * the profile.
  *
  * @version $Id$
  */
@@ -50,12 +51,18 @@
     extends AbstractLogEnabled
     implements Serviceable, ProfileLS, ThreadSafe, Disposable {
 
-    /** The component manager */
+    /** The service manager. */
     protected ServiceManager manager;
 
-    /** The XPath Processor */
+    /** The XPath Processor. */
     protected XPathProcessor xpathProcessor;
 
+    /** The converter component. */
+    protected Converter converter;
+
+    /** The source resolver. */
+    protected SourceResolver resolver;
+
     /**
      * @see org.apache.avalon.framework.activity.Disposable#dispose()
      */
@@ -63,6 +70,10 @@
         if ( this.manager != null ) {
             this.manager.release( this.xpathProcessor );
             this.xpathProcessor = null;
+            this.manager.release( this.converter );
+            this.converter = null;
+            this.manager.release( this.resolver );
+            this.resolver = null;
             this.manager = null;
         }
     }
@@ -73,6 +84,8 @@
     public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
         this.xpathProcessor = (XPathProcessor)this.manager.lookup(XPathProcessor.ROLE);
+        this.converter = (Converter)this.manager.lookup(Converter.ROLE);
+        this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE);
     }
 
     protected String getURI(Map keyMap) 
@@ -130,22 +143,15 @@
         final String uri = this.getURI( keyMap );
 
 		Source source = null;
-		Converter converter = null;
-        SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
 		try {
-			source = resolver.resolveURI(uri);
-            converter = (Converter) this.manager.lookup(Converter.ROLE);
+			source = this.resolver.resolveURI(uri);
 
-			return converter.getObject(source.getInputStream(),
+			return this.converter.getObject(source.getInputStream(),
                                        (String)parameters.get(PARAMETER_PROFILETYPE),
                                        (Map)parameters.get(PARAMETER_OBJECTMAP),
                                        null);
 		} finally {
-            if ( resolver != null ) {
-                resolver.release(source);
-            }
-			manager.release(converter);
-			manager.release(resolver);
+            resolver.release(source);
 		}
     }
 
@@ -158,39 +164,26 @@
         final String uri = this.getURI( keyMap );
 
         // first test: modifiable source?
-        SourceResolver resolver = null;
-        Converter converter = null;
         Source source = null;
         try {
-            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-            source = resolver.resolveURI(uri);
+            source = this.resolver.resolveURI(uri);
             if ( source instanceof ModifiableSource ) {
-                converter = (Converter) this.manager.lookup(Converter.ROLE);
-                converter.storeObject( ((ModifiableSource)source).getOutputStream(),
+                this.converter.storeObject( ((ModifiableSource)source).getOutputStream(),
                                         (String)parameters.get(PARAMETER_PROFILETYPE),
                                         profile,
                                         parameters);
                 return;
             }
         } finally {
-            if ( resolver != null ) {
-                resolver.release(source);
-            }
-            manager.release(converter);
-            manager.release(resolver);
+            resolver.release(source);
             source = null;
-            converter = null;
-            resolver = null;
         }
 
         final StringBuffer buffer = this.getSaveURI( keyMap );
 		SAXParser parser = null;
 		try {
-            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-            converter = (Converter) this.manager.lookup(Converter.ROLE);
-
             ByteArrayOutputStream writer = new ByteArrayOutputStream();
-            converter.storeObject(writer,
+            this.converter.storeObject(writer,
                                   (String)parameters.get(PARAMETER_PROFILETYPE),
                                   profile,
                                   parameters);
@@ -202,7 +195,7 @@
                 // ignore this as utf-8 is always supported
             }
 
-            source = resolver.resolveURI(buffer.toString());
+            source = this.resolver.resolveURI(buffer.toString());
 
             parser = (SAXParser)this.manager.lookup(SAXParser.ROLE);
             Element element = DOMUtil.getDocumentFragment(parser, new InputStreamReader(source.getInputStream())).getOwnerDocument().getDocumentElement();
@@ -211,12 +204,8 @@
             }
 
 		} finally {
-            if ( resolver != null ) {
-                resolver.release(source);
-            }
+            resolver.release(source);
 			manager.release(parser);
-			manager.release(converter);
-			manager.release(resolver);
 		}
     }
 
@@ -224,24 +213,19 @@
      * @see org.apache.cocoon.portal.profile.ProfileLS#getValidity(java.lang.Object, java.util.Map)
      */
     public SourceValidity getValidity(Object key, Map parameters) {
-		SourceResolver resolver = null;
 		Source source = null;
 		try {
             final Map keyMap = (Map) key;
 
             final String uri = this.getURI( keyMap );
 
-			resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-			source = resolver.resolveURI(uri);
+			source = this.resolver.resolveURI(uri);
 			return source.getValidity();
 		} catch (Exception e) {
 			getLogger().warn(e.getMessage(), e);
 			return null;
 		} finally {
-			if (resolver != null) {
-                resolver.release(source);
-			}
-			manager.release(resolver);
+            resolver.release(source);
 		}
     }
 }



Mime
View raw message