View Javadoc

1   /*
2    * Copyright (c) 2001 Peter Antman, Teknik i Media  <peter.antman@tim.se>
3    *
4    * $Id: DirProtocolHandlerFactory.java,v 1.1.1.1 2004/05/19 12:26:42 pra Exp $
5    *
6    * This library is free software; you can redistribute it and/or
7    * modify it under the terms of the GNU Lesser General Public
8    * License as published by the Free Software Foundation; either
9    * version 2 of the License, or (at your option) any later version
10   * 
11   * This library is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14   * Lesser General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Lesser General Public
17   * License along with this library; if not, write to the Free Software
18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19   */
20  package org.backsource.amsterdam.plugins.file;
21  
22  import org.backsource.amsterdam.service.ServiceException;
23  import org.backsource.amsterdam.service.protocol.ProtocolHandler;
24  import org.backsource.amsterdam.service.protocol.ProtocolConfigure;
25  import org.backsource.amsterdam.service.protocol.ProtocolHandlerFactorySupport;
26  
27  /***
28   * A factory to get DIR protocol handlers from, that is: protocol handlers that fetched data from a directory.. 
29   *
30   * @author Peter Antman
31   * @version $version$
32   */
33  
34  public class DirProtocolHandlerFactory extends ProtocolHandlerFactorySupport {
35     private ProtocolConfigure conf;
36     public static final String PROTOCOL = "DIR";
37     
38     public DirProtocolHandlerFactory() {
39        
40     }
41     public String getSupportedProtocol() {
42        return PROTOCOL;
43     }
44     public void initialize(ProtocolConfigure config) {
45        conf = config;
46     }
47     public  ProtocolHandler getProtocolHandler() throws ServiceException {
48        DirProtocolHandler d = new DirProtocolHandler(conf);
49        d.setServiceInvoker( invoker);
50        return d;
51      }
52  } // DirProtocolHandlerFactory