[jboss-cvs] jboss-portal/core/src/main/org/jboss/portal/core/command/mapper ...

Julien Viet julien at jboss.com
Thu Jul 20 19:48:39 EDT 2006


  User: julien  
  Date: 06/07/20 19:48:39

  Modified:    core/src/main/org/jboss/portal/core/command/mapper 
                        CommandFactoryDelegate.java
  Log:
  more flexibility in command factories : PortalObjectCommandFactory and CMSObjectCommandFactory do not extend the delegate. Rather the delegate command factory is used standalone to delegate then
  
  Revision  Changes    Path
  1.3       +30 -9     jboss-portal/core/src/main/org/jboss/portal/core/command/mapper/CommandFactoryDelegate.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CommandFactoryDelegate.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/core/src/main/org/jboss/portal/core/command/mapper/CommandFactoryDelegate.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- CommandFactoryDelegate.java	31 Jan 2006 01:04:26 -0000	1.2
  +++ CommandFactoryDelegate.java	20 Jul 2006 23:48:38 -0000	1.3
  @@ -21,15 +21,21 @@
   */
   package org.jboss.portal.core.command.mapper;
   
  +import org.jboss.portal.core.command.ControllerCommand;
  +import org.jboss.portal.server.ServerInvocation;
  +
   /**
    * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
  -public abstract class CommandFactoryDelegate extends AbstractCommandFactory
  +public class CommandFactoryDelegate extends AbstractCommandFactory
   {
   
      /** . */
  -   protected DelegatingCommandFactory factory;
  +   protected DelegatingCommandFactory delegatingFactory;
  +
  +   /** . */
  +   protected CommandFactory delegateFactory;
   
      /** . */
      protected String prefix;
  @@ -44,23 +50,38 @@
         this.prefix = prefix;
      }
   
  -   public DelegatingCommandFactory getFactory()
  +   public DelegatingCommandFactory getDelegatingFactory()
  +   {
  +      return delegatingFactory;
  +   }
  +
  +   public void setDelegatingFactory(DelegatingCommandFactory delegatingFactory)
      {
  -      return factory;
  +      this.delegatingFactory = delegatingFactory;
      }
   
  -   public void setFactory(DelegatingCommandFactory factory)
  +   public CommandFactory getDelegateFactory()
      {
  -      this.factory = factory;
  +      return delegateFactory;
  +   }
  +
  +   public void setDelegateFactory(CommandFactory delegateFactory)
  +   {
  +      this.delegateFactory = delegateFactory;
      }
   
      protected void startService() throws Exception
      {
  -      factory.register(prefix, this);
  +      delegatingFactory.register(prefix, this);
      }
   
      protected void stopService() throws Exception
      {
  -      factory.unregister(prefix);
  +      delegatingFactory.unregister(prefix);
  +   }
  +
  +   public ControllerCommand doMapping(ServerInvocation invocation, String portalContextPath, String portalRequestPath)
  +   {
  +      return delegateFactory.doMapping(invocation, portalContextPath, portalRequestPath);
      }
   }
  
  
  



More information about the jboss-cvs-commits mailing list