Michael Bauroth wrote:
> Hi,
>
> I have a Spring configured server online. The old config looks like
> this  (only small part):
>
> <bean id="sessionConfig" factory-bean="defaultAcceptorConfig"
> factory-method="getSessionConfig">
>   <property name="reuseAddress" value="false"/>
>   <property name="tcpNoDelay" value="true"/>
>   <property name="sendBufferSize" value="1024"/>
>   <property name="receiveBufferSize" value="1024"/>
>   <property name="soLinger" value="10"/>
>   <property name="oobInline" value="false"/>
>   <property name="keepAlive" value="true"/>
> </bean>
>
> <bean id="ioAcceptor"
> class="org.apache.mina.integration.spring.IoAcceptorFactoryBean">
>   <property name="target" ref="acceptor"/>
>   <property name="bindings">
>     <list>
>       <bean class="org.apache.mina.integration.spring.Binding">
>         <property name="address" value=":1234"/>
>         <property name="handler" ref="TcpServerSessionHandler"/>
>         <property name="serviceConfig" ref="defaultAcceptorConfig"/>
>       </bean>
>     </list>
>   </property>
> </bean>
>     
The API in trunk has been simplified a lot which is why ServiceCondig,
IoAcceptorFactoryBean and Binding aren't needed anymore. IoAcceptor now
binds to a single SocketAddress and you configure it directly using setters:

<bean id="ioAcceptor"
class="org.apache.mina.transport.socket.nio.SocketAcceptor"
init-method="bind" destroy-method="unbind">
  <property name="localAddress" value=":1234"/>
  <property name="handler" ref="TcpServerSessionHandler"/>
</bean>

<bean id="sessionConfig" factory-bean="ioAcceptor"
factory-method="getSessionConfig">
  <property name="reuseAddress" value="false"/>
  <property name="tcpNoDelay" value="true"/>
  <property name="sendBufferSize" value="1024"/>
  <property name="receiveBufferSize" value="1024"/>
  <property name="soLinger" value="10"/>
  <property name="oobInline" value="false"/>
  <property name="keepAlive" value="true"/>
</bean>

This should work. Please let us know.

BTW, the above would be a lot cleaner if we had setSessionConfig() on
SocketAcceptor, DatagramAcceptor, etc. What do people think about adding
such setters?

-- 
Niklas Therning
www.spamdrain.net

Reply via email to