You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2012/11/23 14:42:18 UTC

CXF-DOSGI: Default address and default host and port

I will start the issue "Provide a default address for services " (see
https://issues.apache.org/jira/browse/DOSGI-127) soon.
The idea is to provide a default servlet transport based address in case
no address service property is defined.

I found that currently we already provide a default address based on the
jetty transport. The disadvantage is that this needs a host and port
number that have to be configured either on the service or for the cxf
dosgi dsw bundle.

So two questions:
1) Is it ok to switch to the servlet transport as the new default?
2) How much backwards compatibility do we need?

About 2) I found that we have default.host and default.port that were to
be configured using the config admin service. When looking closer into
the code I found that the code supporting this is not attached to the
config admin service. So it looks like the default settings currently
can not be configured at all. So only the hard coded defaults of
"localhost" and "9090" work.
For the service we have the
Constants.WS_PORT_PROPERTY(org.apache.cxf.ws.port) that can be set in
the service.
So do we need to support these configs or can I simply remove the whole
code concerning this when I switch to the servlet transport?

If no backwards compatibility is needed then a lot of code could be
removed. For example the code for determining the localhost address and
the whole handlerProperties for the configTypeHandlers.

Christian


Re: CXF-DOSGI: Default address and default host and port

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Christian,


On 23/11/12 13:42, Christian Schneider wrote:
> I will start the issue "Provide a default address for services " (see
> https://issues.apache.org/jira/browse/DOSGI-127) soon.
> The idea is to provide a default servlet transport based address in case
> no address service property is defined.
>
> I found that currently we already provide a default address based on the
> jetty transport. The disadvantage is that this needs a host and port
> number that have to be configured either on the service or for the cxf
> dosgi dsw bundle.
>
> So two questions:
> 1) Is it ok to switch to the servlet transport as the new default?
> 2) How much backwards compatibility do we need?
>
> About 2) I found that we have default.host and default.port that were to
> be configured using the config admin service. When looking closer into
> the code I found that the code supporting this is not attached to the
> config admin service. So it looks like the default settings currently
> can not be configured at all. So only the hard coded defaults of
> "localhost" and "9090" work.
> For the service we have the
> Constants.WS_PORT_PROPERTY(org.apache.cxf.ws.port) that can be set in
> the service.
> So do we need to support these configs or can I simply remove the whole
> code concerning this when I switch to the servlet transport?
>
> If no backwards compatibility is needed then a lot of code could be
> removed. For example the code for determining the localhost address and
> the whole handlerProperties for the configTypeHandlers.

IMHO 2) (using HTTP Service by default) is the best option for teh 
auto-detection case. Note that the "get default address" is only used on 
the "ws.address" or "rs.address" path, from POJO handers which create 
Jetty-transport based endpoints.

If we have "ws.http.context" or "rs.http.context" properties, 
HttpService configuration handers are invoked and this Jetty-transport 
default address construction is bypassed.

So I propose that in case of the auto-detection simply use HttpService 
handlers, they have the code for constructing the default servlet 
context root too from the name of the class.

Cheers, Sergey

>
> Christian
>