View Javadoc

1   /*
2    * $Id: SftpNamespaceHandler.java 21125 2011-01-26 21:21:10Z dzapata $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.transport.sftp.config;
12  
13  import org.mule.config.spring.handlers.AbstractMuleNamespaceHandler;
14  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
15  import org.mule.config.spring.parsers.generic.OrphanDefinitionParser;
16  import org.mule.endpoint.URIBuilder;
17  import org.mule.transport.file.ExpressionFilenameParser;
18  import org.mule.transport.sftp.SftpConnector;
19  
20  /**
21   * Registers a Bean Definition Parser for handling <code><sftp:connector></code>
22   * elements.
23   */
24  public class SftpNamespaceHandler extends AbstractMuleNamespaceHandler
25  {
26      public void init()
27      {
28          registerBeanDefinitionParser("connector", new OrphanDefinitionParser(SftpConnector.class, true));
29          registerBeanDefinitionParser("expression-filename-parser", new ChildDefinitionParser(
30              "filenameParser", ExpressionFilenameParser.class));
31          registerStandardTransportEndpoints("sftp", URIBuilder.SOCKET_ATTRIBUTES);
32          registerConnectorDefinitionParser(SftpConnector.class);
33      }
34  }