All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.spring.bundle-context.xml Maven / Gradle / Ivy

Go to download

Spring-DM based OSGi bundle that starts an FtpServer and looks for a published Ftplet service.

There is a newer version: 1.2.0
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
	<!--
		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.
	-->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
	xmlns:ftp="http://mina.apache.org/ftpserver/spring/v1"
	xsi:schemaLocation="http://www.springframework.org/schema/beans   
       http://www.springframework.org/schema/beans/spring-beans.xsd                      
       http://www.springframework.org/schema/osgi  
       http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://mina.apache.org/ftpserver/spring/v1 
       http://mina.apache.org/ftpserver/ftpserver-1.0.xsd
       ">
	<ftp:server id="server">
		<ftp:listeners>
			<ftp:nio-listener name="default" port="2222" />
		</ftp:listeners>
		<ftp:ftplets>
			<ftp:ftplet name="ftplet1">
				<ref bean="ftplet" />
			</ftp:ftplet>
		</ftp:ftplets>
		<ftp:file-user-manager
			url="org/apache/ftpserver/example/osgiservice/users.properties" />
	</ftp:server>
	
	<osgi:service interface="org.apache.ftpserver.FtpServer"
		ref="server">
	</osgi:service>

	<osgi:reference id="ftplet" interface="org.apache.ftpserver.ftplet.Ftplet" />
	
	<!-- Starts and stops the bean as the context is started and stopped -->
	<bean class="org.apache.ftpserver.example.osgiservice.impl.FtpServerLifecycle" 
	   init-method="init" destroy-method="destroy"
	>
	   <property name="server" ref="server" />
	</bean>
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy