CDO / Net4J socket connector [message #592283] |
Wed, 27 September 2006 08:01 |
Eclipse User |
|
|
|
Originally posted by: yannick.lizzi.silogic.fr
Hi all,
I want to develop a CDO/Net4J client that connects to a CDO/Net4J
server. When the client application starts, it doesn't know the server
host and port.
So comparing to the CDO examples, I have to customize the
ActiveSocketConnector programmatically (not via Spring) by setting host
and port, while the CDO client starts.
How can I do this?
I tried to set host and port before the resourceManager.start() by the
following code:
ActiveSocketConnector conn = (ActiveSocketConnector)
resourceManager.getChannel().getConnector();
conn.setHost(host);
conn.setPort(port);
The problem is that the connector have already started to connect with
the information taken from client.properties.
I also tried to comment the connector bean in client.xml and create it
programmatically with the following code:
ActiveSocketConnectorImpl connector = new ActiveSocketConnectorImpl();
connector.setHost(host);
connector.setPort(port);
connector.setProtocolManager(clientContainer.getBean("protocolManager "));
connector.setSelectorManager(clientContainer.getBean("selectorManager "));
connector.setBufferPool(clientContainer.getBean("bufferPool "));
resourceManager.setConnector(connector);
But in this case, I get a NoControlProtocolException when creating the
resource.
So what's the right way?
Thanks
Yannick Lizzi
|
|
|
Powered by
FUDForum. Page generated in 0.03341 seconds