You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2009/03/04 23:18:13 UTC

svn commit: r750194 - /mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/

Author: ngn
Date: Wed Mar  4 22:18:12 2009
New Revision: 750194

URL: http://svn.apache.org/viewvc?rev=750194&view=rev
Log:
Adding Spring factory beans provided by Niklas Therning (FTPSERVER-276)

Added:
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ConnectionConfigFactoryBean.java
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/DataConnectionConfigurationFactoryBean.java
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/FtpServerFactoryBean.java
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ListenerFactoryBean.java
    mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/SslConfigurationFactoryBean.java

Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ConnectionConfigFactoryBean.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ConnectionConfigFactoryBean.java?rev=750194&view=auto
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ConnectionConfigFactoryBean.java (added)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ConnectionConfigFactoryBean.java Wed Mar  4 22:18:12 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ftpserver.config.spring.factorybeans;
+
+import org.apache.ftpserver.ConnectionConfig;
+import org.apache.ftpserver.ConnectionConfigFactory;
+import org.springframework.beans.factory.FactoryBean;
+
+/**
+ * Spring {@link FactoryBean} which extends {@link ConnectionConfigFactory}
+ * making it easier to use Spring's standard <bean> tag instead of 
+ * FtpServer's custom XML tags to configure things.
+ *
+ * @author The Apache MINA Project (dev@mina.apache.org)
+ * @version $Rev$, $Date$
+ * @see ConnectionConfigFactory
+ */
+public class ConnectionConfigFactoryBean extends ConnectionConfigFactory implements FactoryBean {
+
+    public Object getObject() throws Exception {
+        return createConnectionConfig();
+    }
+
+    public Class<?> getObjectType() {
+        return ConnectionConfig.class;
+    }
+
+    public boolean isSingleton() {
+        return false;
+    }
+
+}

Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/DataConnectionConfigurationFactoryBean.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/DataConnectionConfigurationFactoryBean.java?rev=750194&view=auto
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/DataConnectionConfigurationFactoryBean.java (added)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/DataConnectionConfigurationFactoryBean.java Wed Mar  4 22:18:12 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ftpserver.config.spring.factorybeans;
+
+import org.apache.ftpserver.DataConnectionConfiguration;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+import org.springframework.beans.factory.FactoryBean;
+
+/**
+ * Spring {@link FactoryBean} which extends {@link DataConnectionConfigurationFactory}
+ * making it easier to use Spring's standard &lt;bean&gt; tag instead of 
+ * FtpServer's custom XML tags to configure things.
+ *
+ * @author The Apache MINA Project (dev@mina.apache.org)
+ * @version $Rev$, $Date$
+ * @see DataConnectionConfigurationFactory
+ */
+public class DataConnectionConfigurationFactoryBean extends DataConnectionConfigurationFactory implements FactoryBean {
+
+    public Object getObject() throws Exception {
+        return createDataConnectionConfiguration();
+    }
+
+    public Class<?> getObjectType() {
+        return DataConnectionConfiguration.class;
+    }
+
+    public boolean isSingleton() {
+        return false;
+    }
+    
+}

Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/FtpServerFactoryBean.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/FtpServerFactoryBean.java?rev=750194&view=auto
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/FtpServerFactoryBean.java (added)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/FtpServerFactoryBean.java Wed Mar  4 22:18:12 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ftpserver.config.spring.factorybeans;
+
+import org.apache.ftpserver.FtpServer;
+import org.apache.ftpserver.FtpServerFactory;
+import org.springframework.beans.factory.FactoryBean;
+
+/**
+ * Spring {@link FactoryBean} which extends {@link FtpServerFactory}
+ * making it easier to use Spring's standard &lt;bean&gt; tag instead of 
+ * FtpServer's custom XML tags to configure things.
+ *
+ * @author The Apache MINA Project (dev@mina.apache.org)
+ * @version $Rev$, $Date$
+ * @see FtpServerFactory
+ */
+public class FtpServerFactoryBean extends FtpServerFactory implements FactoryBean {
+
+    public Object getObject() throws Exception {
+        return createServer();
+    }
+
+    public Class<?> getObjectType() {
+        return FtpServer.class;
+    }
+
+    public boolean isSingleton() {
+        return false;
+    }
+
+}
\ No newline at end of file

Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ListenerFactoryBean.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ListenerFactoryBean.java?rev=750194&view=auto
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ListenerFactoryBean.java (added)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/ListenerFactoryBean.java Wed Mar  4 22:18:12 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ftpserver.config.spring.factorybeans;
+
+import org.apache.ftpserver.listener.Listener;
+import org.apache.ftpserver.listener.ListenerFactory;
+import org.springframework.beans.factory.FactoryBean;
+
+/**
+ * Spring {@link FactoryBean} which extends {@link ListenerFactory}
+ * making it easier to use Spring's standard &lt;bean&gt; tag instead of 
+ * FtpServer's custom XML tags to configure things.
+ *
+ * @author The Apache MINA Project (dev@mina.apache.org)
+ * @version $Rev$, $Date$
+ * @see ListenerFactory
+ */
+public class ListenerFactoryBean extends ListenerFactory implements FactoryBean {
+
+    public Object getObject() throws Exception {
+        return createListener();
+    }
+
+    public Class<?> getObjectType() {
+        return Listener.class;
+    }
+
+    public boolean isSingleton() {
+        return false;
+    }
+
+}

Added: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/SslConfigurationFactoryBean.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/SslConfigurationFactoryBean.java?rev=750194&view=auto
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/SslConfigurationFactoryBean.java (added)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/config/spring/factorybeans/SslConfigurationFactoryBean.java Wed Mar  4 22:18:12 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ftpserver.config.spring.factorybeans;
+
+import org.apache.ftpserver.ssl.SslConfiguration;
+import org.apache.ftpserver.ssl.SslConfigurationFactory;
+import org.springframework.beans.factory.FactoryBean;
+
+/**
+ * Spring {@link FactoryBean} which extends {@link SslConfigurationFactory}
+ * making it easier to use Spring's standard &lt;bean&gt; tag instead of 
+ * FtpServer's custom XML tags to configure things.
+ *
+ * @author The Apache MINA Project (dev@mina.apache.org)
+ * @version $Rev$, $Date$
+ * @see SslConfigurationFactory
+ */
+public class SslConfigurationFactoryBean extends SslConfigurationFactory implements FactoryBean {
+
+    public Object getObject() throws Exception {
+        return createSslConfiguration();
+    }
+
+    public Class<?> getObjectType() {
+        return SslConfiguration.class;
+    }
+
+    public boolean isSingleton() {
+        return false;
+    }
+    
+}