You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ja...@apache.org on 2004/08/16 14:18:14 UTC

cvs commit: ws-fx/sandesha/src/org/apache/sandesha/server/dao ServerDAOFactory.java

jaliya      2004/08/16 05:18:14

  Added:       sandesha/src/org/apache/sandesha/server/dao
                        ServerDAOFactory.java
  Log:
  Factory to select between the Queue and the database. This will add more flexibility to the implementation.
  
  Revision  Changes    Path
  1.1                  ws-fx/sandesha/src/org/apache/sandesha/server/dao/ServerDAOFactory.java
  
  Index: ServerDAOFactory.java
  ===================================================================
  /*
   * Copyright  1999-2004 The Apache Software Foundation.
   *
   *  Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
   *
   *  Unless required by applicable law or agreed to in writing, software
   *  distributed under the License is distributed on an "AS IS" BASIS,
   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *  See the License for the specific language governing permissions and
   *  limitations under the License.
   *
   */
  package org.apache.sandesha.server.dao;
  
  import org.apache.sandesha.Constants;
  
  /**
   * @author Chamikara Jayalath
   * @author Jaliya Ekanayaka
   */
  
  public class ServerDAOFactory {
  	
      public static IServerDAO getStorageAccessor(int accessor){
      
      	if(accessor==Constants.SERVER_QUEUE_ACCESSOR)
      	    return new ServerQueueDAO();
      	else if (accessor==Constants.SERVER_DATABASE_ACCESSOR)
      	    return new ServerDatabaseDAO(); 
      	else
      	    return null;       
      
      }
  
  }