xlawrence    2005/02/11 14:44:12 CET

  Added files:
    syncServer/src/java/org/jahia/suite/calendar/syncServer 
                                                            
CalendarManageableFactory.java 
                                                            
TransportSenderFactory.java 
  Log:
  Added Factory implementation classes
  
  Revision  Changes    Path
  1.1       +73 -0     
uwcal_JSR168/syncServer/src/java/org/jahia/suite/calendar/syncServer/CalendarManageableFactory.java
 (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/syncServer/src/java/org/jahia/suite/calendar/syncServer/CalendarManageableFactory.java?rev=1.1&content-type=text/plain
  1.1       +61 -0     
uwcal_JSR168/syncServer/src/java/org/jahia/suite/calendar/syncServer/TransportSenderFactory.java
 (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/uwcal_JSR168/syncServer/src/java/org/jahia/suite/calendar/syncServer/TransportSenderFactory.java?rev=1.1&content-type=text/plain
  
  
  
  Index: CalendarManageableFactory.java
  ====================================================================
  /*
   *                                   ____.
   *                       __/\ ______|    |__/\.     _______
   *            __   .____|    |       \   |    +----+       \
   *    _______|  /--|    |    |    -   \  _    |    :    -   \_________
   *   \\______: :---|    :    :           |    :    |         \________>
   *           |__\---\_____________:______:    :____|____:_____\
   *                                      /_____|
   *
   *              . . . i n   j a h i a   w e   t r u s t . . .
   *
   *
   *
   * ----- BEGIN LICENSE BLOCK -----
   * Version: JCSL 1.0
   *
   * The contents of this file are subject to the Jahia Community Source License
   * 1.0 or later (the "License"); you may not use this file except in
   * compliance with the License. You may obtain a copy of the License at
   * http://www.jahia.org/license
   *
   * Software distributed under the License is distributed on an "AS IS" basis,
   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   * for the rights, obligations and limitations governing use of the contents
   * of the file. The Original and Upgraded Code is the Jahia CMS and Portal
   * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
   * Ltd. owns the copyrights in the portions it created. All Rights Reserved.
   *
   * The Shared Modifications are Jahia View Helper.
   *
   * The Developer of the Shared Modifications is Jahia Solution S�rl.
   * Portions created by the Initial Developer are Copyright (C) 2002 by the
   * Initial Developer. All Rights Reserved.
   *
   * ----- END LICENSE BLOCK -----
   */
  
  package org.jahia.suite.calendar.syncServer;
  
  import org.jahia.suite.calendar.framework.CalendarManageableFactoryIF;
  import org.jahia.suite.calendar.framework.CalendarManageable;
  
  import sync4j.framework.engine.source.SyncSource;
  
  /**
   *
   * @author Xavier Lawrence
   */
  public class CalendarManageableFactory implements CalendarManageableFactoryIF 
{
      
      public static final String SYNC4J = "SYNC4J";
   
      /**
       * @see CalendarManageableFactoryIF
       */
      public CalendarManageable createCalendarManageable(String key) {
          if (SYNC4J.equals(key)) {
              return new CalendarManager();
          }
          throw new IllegalArgumentException("Unknown key value: "+key);
      }   
      
      /**
       *
       */
      public CalendarManageable createCalendarManageable(String key, 
              SyncSource source) {
          if (SYNC4J.equals(key)) {
              return new CalendarManager(source);
          }
          throw new IllegalArgumentException("Unknown key value: "+key);
      }
  }
  
  
  
  Index: TransportSenderFactory.java
  ====================================================================
  /*
   *                                   ____.
   *                       __/\ ______|    |__/\.     _______
   *            __   .____|    |       \   |    +----+       \
   *    _______|  /--|    |    |    -   \  _    |    :    -   \_________
   *   \\______: :---|    :    :           |    :    |         \________>
   *           |__\---\_____________:______:    :____|____:_____\
   *                                      /_____|
   *
   *              . . . i n   j a h i a   w e   t r u s t . . .
   *
   *
   *
   * ----- BEGIN LICENSE BLOCK -----
   * Version: JCSL 1.0
   *
   * The contents of this file are subject to the Jahia Community Source License
   * 1.0 or later (the "License"); you may not use this file except in
   * compliance with the License. You may obtain a copy of the License at
   * http://www.jahia.org/license
   *
   * Software distributed under the License is distributed on an "AS IS" basis,
   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   * for the rights, obligations and limitations governing use of the contents
   * of the file. The Original and Upgraded Code is the Jahia CMS and Portal
   * Server. The developer of the Original and Upgraded Code is JAHIA Ltd. JAHIA
   * Ltd. owns the copyrights in the portions it created. All Rights Reserved.
   *
   * The Shared Modifications are Jahia View Helper.
   *
   * The Developer of the Shared Modifications is Jahia Solution S�rl.
   * Portions created by the Initial Developer are Copyright (C) 2002 by the
   * Initial Developer. All Rights Reserved.
   *
   * ----- END LICENSE BLOCK -----
   */
  
  package org.jahia.suite.calendar.syncServer;
  
  import org.jahia.suite.calendar.framework.TransportSenderFactoryIF;
  import org.jahia.suite.calendar.framework.TransportSender;
  
  /**
   *
   * @author Xavier Lawrence
   */
  public class TransportSenderFactory implements TransportSenderFactoryIF {
      
      public static final String JMS = "JMS";
      
      /**
       * @see TransportSenderFactoryIF
       */
      public TransportSender createTransportSender(String key) {
          if (JMS.equals(key)) {
              return new JMSAgent(JMSAgent.CAL_SERVER_QUEUE, "syncServer",
                      "syncServer");
          }
          throw new IllegalArgumentException("Unknown key value: "+key);
      }
  }
  

Reply via email to