/*
* @(#) $Id: DatagramAcceptorFactoryBean.java 351469 2005-12-01 21:05:16Z niklas $
*
* Copyright 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.mina.integration.spring;
import org.apache.mina.common.IoAcceptor;
import org.apache.mina.integration.spring.support.AbstractIoAcceptorFactoryBean;
import org.apache.mina.transport.socket.nio.DatagramAcceptor;
/**
* {@link AbstractIoAcceptorFactoryBean} implementation which allows for easy
* configuration of {@link DatagramAcceptor} instances using Spring. Example of
* usage:
* <p>
*
* <pre>
* <!-- My IoHandler implementation-->
* <bean id="myHandler" class="com.foo.bar.MyHandler">
* ...
*
* <!-- Create a thread pool filter -->
* <bean id="threadPoolFilter"
* class="org.apache.mina.filter.ThreadPoolFilter">
* <!-- Threads will be named IoWorker-1, IoWorker-2, etc -->
* <constructor-arg value="IoWorker"/>
* <property name="maximumPoolSize" value="10"/>
* </bean>
*
* <!-- Create the DatagramAcceptor -->
* <bean id="datagramAcceptor"
* class="org.apache.mina.integration.spring.DatagramAcceptorFactoryBean">
* <property name="filters">
* <list>
* <ref local="threadPoolFilter"/>
* </list>
* </property>
* <property name="bindings">
* <list>
* <bean class="org.apache.mina.integration.spring.Binding">
* <property name="address" value=":9287"/>
* <property name="handler" ref="myHandler"/>
* </bean>
* <bean class="org.apache.mina.integration.spring.Binding">
* <property name="address" value="192.168.0.1:6273"/>
* <property name="handler" ref="myHandler"/>
* </bean>
* </list>
* </property>
* </bean>
* </pre>
*
* </p>
*
* @author The Apache Directory Project (dev@directory.apache.org)
* @version $Rev: 351469 $, $Date: 2005-12-02 06:05:16 +0900 (Fri, 02 Dec 2005) $
*/
public class DatagramAcceptorFactoryBean extends
InetSocketAddressBindingIoAcceptorFactoryBean
{
protected IoAcceptor createIoAcceptor() throws Exception
{
return new DatagramAcceptor();
}
}