You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by KlausStake <kl...@web.de> on 2006/12/01 08:55:32 UTC

Re: Mina trunk and Spring support (changes)

Hi,

the changes affect the chat server example. Should I open a jira issue? Does
anybody adapt the changes? Can I do it?

The sample configuration still expects the following classes:
org.apache.mina.integration.spring.Binding
org.apache.mina.integration.spring.IoAcceptorFactoryBean
org.apache.mina.common.IoServiceConfig

Another issue are the spring context configuration files. Currently there is
jmxContext.xml and serverContext.xml. Both configuration files contain jmx
stuff. I suggest to merge the 2 configuration files to 1 file for ease of
understanding the example.


Regards
Klaus


Niklas Therning wrote:
> 
> 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Mina-trunk-and-Spring-support-%28changes%29-tf2681231.html#a7634760
Sent from the mina dev mailing list archive at Nabble.com.


Re: Mina trunk and Spring support (changes)

Posted by Trustin Lee <tr...@gmail.com>.
On 12/1/06, KlausStake <kl...@web.de> wrote:
>
>
> Hi,
>
> the changes affect the chat server example. Should I open a jira issue?
> Does
> anybody adapt the changes? Can I do it?
>
> The sample configuration still expects the following classes:
> org.apache.mina.integration.spring.Binding
> org.apache.mina.integration.spring.IoAcceptorFactoryBean
> org.apache.mina.common.IoServiceConfig
>
> Another issue are the spring context configuration files. Currently there
> is
> jmxContext.xml and serverContext.xml. Both configuration files contain jmx
> stuff. I suggest to merge the 2 configuration files to 1 file for ease of
> understanding the example.


Sure.  You can open a JIRA issue.  You can submit a patch moreover! :)

Thakns for pointing out.
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6