directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <nik...@trillian.se>
Subject Re: MINA FactoryBeans
Date Wed, 21 Dec 2005 14:46:09 GMT
Ither Seed wrote:
>>From: Niklas Therning <niklas@trillian.se>
>>To: Apache Directory Developers List <dev@directory.apache.org>
>>Date: Wed, 21 Dec 2005 07:38:20 +0100
>>Subject: Re: [MINA] getting accesss to the IoSession from another Thread
>>Chris Allen wrote:
>>
>>>...
>>>
>>>In another topic, I'm curious about what you guys are doing in terms
>>>of Spring integration.  I saw that this was listed on your road map
>>>and I would like to learn more about it.
>>
>>Hi Chris,
>>
>>At the moment there are a number of Spring FactoryBeans in
>>org.apache.mina.integration.spring which simplifies the
>>configuration of
>>IoAcceptors and IoConnectors using Spring. There are also some
>>FactoryBeans which helps you set up KeyStores and SSLContexts for use
>>with the SSLFilter. Have a look at the Javadocs for
>>SocketAcceptorFactoryBean for a short example on how to use it. If you
>>have any further questions or suggestions for improvements please let me
>>know.
>>
>>BTW, the Spring integration package was introduced in 0.9.0.
>>
>>/Niklas
> 
> 
> Hi, people. I'm trying to use the FactoryBeans of MINA 0.9.0. I read
> the javadoc in the SocketAcceptorFactoryBean class and I successfully
> create a SocketAcceptor using it but I don't know how to make it wait
> for connections. All the examples use the ServiceRegistry interface
> for this. am I missing something? Thanks in advance.

You don't have to do anything! SocketAcceptor.bind() will be called for
each of the Bindings you set on your SocketAcceptor in your Spring file.
 Just make sure you have configured some bindings.

If you are using Spring's FileSystemApplicationContext to load you
Spring XML file all the beans you define will be automatically created
at load time. For other ApplicationContext implementations you may have
to call refresh() on it for the beans to be instantiated.

If you are using a BeanFactory such as XmlBeanFactory Spring will
instantiate your beans lazily when retrieved from the BeanFactory. In
that case you will have to call getBean() on the BeanFactory and supply
the id of the SocketAcceptorFactoryBean before Spring will create it.

HTH
/Niklas

Mime
View raw message