[jboss-svn-commits] JBoss Portal SVN: r5398 - in trunk/core/src: main/org/jboss/portal/core/controller/command/mapper resources/portal-cms-sar/META-INF resources/portal-core-sar/META-INF

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Oct 10 09:49:10 EDT 2006


Author: julien at jboss.com
Date: 2006-10-10 09:49:02 -0400 (Tue, 10 Oct 2006)
New Revision: 5398

Modified:
   trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/CommandFactoryDelegate.java
   trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactory.java
   trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactoryService.java
   trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
   trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- in command factories changed prefix with path for the variable name that hook delegating command factory with delegate command factories.

Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/CommandFactoryDelegate.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/CommandFactoryDelegate.java	2006-10-10 13:31:15 UTC (rev 5397)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/CommandFactoryDelegate.java	2006-10-10 13:49:02 UTC (rev 5398)
@@ -38,16 +38,16 @@
    protected CommandFactory delegateFactory;
 
    /** . */
-   protected String prefix;
+   protected String path;
 
-   public String getPrefix()
+   public String getPath()
    {
-      return prefix;
+      return path;
    }
 
-   public void setPrefix(String prefix)
+   public void setPath(String path)
    {
-      this.prefix = prefix;
+      this.path = path;
    }
 
    public DelegatingCommandFactory getDelegatingFactory()
@@ -72,12 +72,12 @@
 
    protected void startService() throws Exception
    {
-      delegatingFactory.register(prefix, this);
+      delegatingFactory.register(path, this);
    }
 
    protected void stopService() throws Exception
    {
-      delegatingFactory.unregister(prefix);
+      delegatingFactory.unregister(path);
    }
 
    public ControllerCommand doMapping(ServerInvocation invocation, String portalContextPath, String portalRequestPath)

Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactory.java	2006-10-10 13:31:15 UTC (rev 5397)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactory.java	2006-10-10 13:49:02 UTC (rev 5398)
@@ -30,19 +30,19 @@
 public interface DelegatingCommandFactory extends CommandFactory
 {
    /**
-    * Register a command mapper with the specified prefix
+    * Register a command mapper with the specified path
     *
-    * @param prefix the prefix to associate with
+    * @param path the path to associate with
     * @param factory the mapper
-    * @throws IllegalArgumentException if any argument is null or another mapper is already registered with the prefix
+    * @throws IllegalArgumentException if any argument is null or another mapper is already registered with the path
     */
-   void register(String prefix, CommandFactory factory) throws IllegalArgumentException;
+   void register(String path, CommandFactory factory) throws IllegalArgumentException;
 
    /**
-    * Unregister a mapper for a given prefix.
+    * Unregister a mapper for a given path.
     *
-    * @param prefix the prefix
-    * @throws IllegalArgumentException if the argument is null or no mapper is registered under that prefix
+    * @param path the path
+    * @throws IllegalArgumentException if the argument is null or no mapper is registered under that path
     */
-   void unregister(String prefix) throws IllegalArgumentException;
+   void unregister(String path) throws IllegalArgumentException;
 }

Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactoryService.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactoryService.java	2006-10-10 13:31:15 UTC (rev 5397)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/mapper/DelegatingCommandFactoryService.java	2006-10-10 13:49:02 UTC (rev 5398)
@@ -79,11 +79,11 @@
       this.nextFactory = nextFactory;
    }
 
-   public void register(String prefix, CommandFactory factory)
+   public void register(String path, CommandFactory factory)
    {
-      if (prefix == null)
+      if (path == null)
       {
-         throw new IllegalArgumentException("no prefix");
+         throw new IllegalArgumentException("no path");
       }
       if (factory == null)
       {
@@ -91,30 +91,32 @@
       }
       synchronized(this)
       {
-         if (factories.containsKey(prefix))
+         path = path.substring(1);
+         if (factories.containsKey(path))
          {
-            throw new IllegalArgumentException("prefix already registered");
+            throw new IllegalArgumentException("path already registered");
          }
          Map copy = new HashMap(factories);
-         copy.put(prefix, factory);
+         copy.put(path, factory);
          factories = copy;
       }
    }
 
-   public void unregister(String prefix)
+   public void unregister(String path)
    {
-      if (prefix == null)
+      if (path == null)
       {
-         throw new IllegalArgumentException("no prefix");
+         throw new IllegalArgumentException("no path");
       }
       synchronized(this)
       {
-         if (!factories.containsKey(prefix))
+         path = path.substring(1);
+         if (!factories.containsKey(path))
          {
-            throw new IllegalArgumentException("prefix already registered");
+            throw new IllegalArgumentException("path not registered");
          }
          Map copy = new HashMap(factories);
-         copy.remove(prefix);
+         copy.remove(path);
          factories = copy;
       }
    }

Modified: trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml	2006-10-10 13:31:15 UTC (rev 5397)
+++ trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml	2006-10-10 13:49:02 UTC (rev 5398)
@@ -190,11 +190,11 @@
    </mbean>
    <mbean
       code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
-      name="portal:commandFactory=Delegate,prefix=content"
+      name="portal:commandFactory=Delegate,path=content"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
       <xmbean/>
-      <attribute name="Prefix">content</attribute>
+      <attribute name="Path">/content</attribute>
       <depends
          optional-attribute-name="DelegatingFactory"
          proxy-type="attribute">portal:commandFactory=Delegating</depends>

Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml	2006-10-10 13:31:15 UTC (rev 5397)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml	2006-10-10 13:49:02 UTC (rev 5398)
@@ -560,11 +560,11 @@
    </mbean>
    <mbean
       code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
-      name="portal:commandFactory=Delegate,prefix=portal"
+      name="portal:commandFactory=Delegate,path=portal"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
       <xmbean/>
-      <attribute name="Prefix">portal</attribute>
+      <attribute name="Path">/portal</attribute>
       <depends
          optional-attribute-name="DelegatingFactory"
          proxy-type="attribute">portal:commandFactory=Delegating</depends>
@@ -582,11 +582,11 @@
    </mbean>
    <mbean
       code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
-      name="portal:commandFactory=Delegate,prefix=signout"
+      name="portal:commandFactory=Delegate,path=signout"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
       <xmbean/>
-      <attribute name="Prefix">signout</attribute>
+      <attribute name="Path">/signout</attribute>
       <depends
          optional-attribute-name="DelegatingFactory"
          proxy-type="attribute">portal:commandFactory=Delegating</depends>
@@ -604,11 +604,11 @@
    </mbean>
    <mbean
       code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
-      name="portal:commandFactory=Delegate,prefix=dashboard"
+      name="portal:commandFactory=Delegate,path=dashboard"
       xmbean-dd=""
       xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
       <xmbean/>
-      <attribute name="Prefix">dashboard</attribute>
+      <attribute name="Path">/dashboard</attribute>
       <depends
          optional-attribute-name="DelegatingFactory"
          proxy-type="attribute">portal:commandFactory=Delegating</depends>




More information about the jboss-svn-commits mailing list