cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r376261 - in /cocoon: branches/BRANCH_2_1_X/status.xml trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java
Date Thu, 09 Feb 2006 11:11:46 GMT
Author: jbq
Date: Thu Feb  9 03:11:43 2006
New Revision: 376261

URL: http://svn.apache.org/viewcvs?rev=376261&view=rev
Log:
Java event listeners can now implement Serviceable to get a ServiceManager

Reported by Philippe Gassmann <phil@anyware-tech.com>

Modified:
    cocoon/branches/BRANCH_2_1_X/status.xml
    cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=376261&r1=376260&r2=376261&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Feb  9 03:11:43 2006
@@ -180,6 +180,9 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.9" date="TBD">
+    <action dev="JBQ" type="add" due-to="Philippe Gassmann" due-to-email="phil@anyware-tech.com">
+      CForms: Java event listeners can now implement Serviceable to get a ServiceManager
+    </action>
     <action dev="JBQ" type="fix" due-to="Philippe Gassmann" due-to-email="phil@anyware-tech.com">
       CForms: when building the query string in AJAX mode, do not include &lt;input type="button"&gt;
     </action>
@@ -203,7 +206,7 @@
       <strong>Please change corresponding classes and use getXpath() to create the
relative context yourself</strong>.
     </action>
     <action dev="JBQ" type="add" fixes-bug="COCOON-1238" due-to="Bart Molenkamp" due-to-email="b.molenkamp@bizzdesign.nl">
-      CForms: Classes used in &lt;fb:custom&gt; can now implement Serviceable to
get a ServiceManager
+      CForms: Java classes used in &lt;fb:custom&gt; can now implement Serviceable
to get a ServiceManager
     </action>
     <action dev="JBQ" type="fix" fixes-bug="COCOON-1558" due-to="Jochen Kuhnle" due-to-email="werbung@kuhnle.net">
       CForms: fix &lt;ft:validation-error&gt; handling when used with FormsTemplateTransformer

Modified: cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java?rev=376261&r1=376260&r2=376261&view=diff
==============================================================================
--- cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java
(original)
+++ cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/event/impl/JavaClassWidgetListenerBuilder.java
Thu Feb  9 03:11:43 2006
@@ -15,10 +15,14 @@
  */
 package org.apache.cocoon.forms.event.impl;
 
+import org.apache.cocoon.components.LifecycleHelper;
 import org.apache.cocoon.forms.event.WidgetListener;
 import org.apache.cocoon.forms.event.WidgetListenerBuilder;
 import org.apache.cocoon.forms.util.DomHelper;
 import org.apache.cocoon.util.ClassUtils;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.w3c.dom.Element;
 
@@ -32,15 +36,20 @@
  *
  * @version $Id$
  */
-public class JavaClassWidgetListenerBuilder implements WidgetListenerBuilder, ThreadSafe
{
+public class JavaClassWidgetListenerBuilder implements WidgetListenerBuilder, ThreadSafe,
Serviceable {
+	ServiceManager manager;
 
-    public WidgetListener buildListener(Element element, Class listenerClass) throws Exception
{
+	public void service(ServiceManager manager) throws ServiceException {
+		this.manager = manager;
+	}
+
+	public WidgetListener buildListener(Element element, Class listenerClass) throws Exception
{
 
         String name = DomHelper.getAttribute(element, "class");
 
         Object listener = ClassUtils.newInstance(name);
         if (listenerClass.isAssignableFrom(listener.getClass())) {
-            // FIXME : apply filecyclehelper
+            LifecycleHelper.setupComponent(listener, null, null, manager, null);
             return (WidgetListener)listener;
         } else {
             throw new Exception("Class " + listener.getClass() + " is not a " + listenerClass);



Mime
View raw message