You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Sky-Tiger <da...@gmail.com> on 2009/06/22 03:56:46 UTC

Delay activing web services

Hi all,
     I have a requirement that delaying registration ws until HTTP server
received  the first request.
     Firstly, i dont want make jetty as we container, it should be embedded
into CXF as default.
     Second ,i need a jetty handler to intercept the request. But CXF always
create jetty server instance after you really call the Endpoint.publish
method.
     So i need to create the JettyHTTPServerEngine instance myself and put
it into the portMap which was in JettyHTTPServerEngineFactory. Each
JettyHTTPServerEngine contains a jetty server instance which i need to add
my handler on it.
     But when i subclass the JettyHTTPServerEngine, i found some issues that
JettyHTTPServerEngine makes all numbers as private and not all of them have
get/set method.  JettyHTTPServerEngineFactory also.
    Why we need to make all things private? protected is not ok? If you dont
want to someone subclass your class, you can make it as final. But private
should be more considered, maybe protected is enough.

    I want to know the soluton is ok or not. I tried ,it works well.
    Can we change the private to protected?

Regards

Hubert.
-- 
View this message in context: http://www.nabble.com/Delay-activing--web-services-tp24140781p24140781.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Delay activing web services

Posted by Sky-Tiger <da...@gmail.com>.
Thanks Dan!



dkulp wrote:
> 
> 
> I have no problem making things protected.   Log a jira and submit a
> patch.
> 
> Dan
> 
> 
> On Sun June 21 2009 9:56:46 pm Sky-Tiger wrote:
>> Hi all,
>>      I have a requirement that delaying registration ws until HTTP server
>> received  the first request.
>>      Firstly, i dont want make jetty as we container, it should be
>> embedded
>> into CXF as default.
>>      Second ,i need a jetty handler to intercept the request. But CXF
>> always create jetty server instance after you really call the
>> Endpoint.publish method.
>>      So i need to create the JettyHTTPServerEngine instance myself and
>> put
>> it into the portMap which was in JettyHTTPServerEngineFactory. Each
>> JettyHTTPServerEngine contains a jetty server instance which i need to
>> add
>> my handler on it.
>>      But when i subclass the JettyHTTPServerEngine, i found some issues
>> that JettyHTTPServerEngine makes all numbers as private and not all of
>> them
>> have get/set method.  JettyHTTPServerEngineFactory also.
>>     Why we need to make all things private? protected is not ok? If you
>> dont want to someone subclass your class, you can make it as final. But
>> private should be more considered, maybe protected is enough.
>>
>>     I want to know the soluton is ok or not. I tried ,it works well.
>>     Can we change the private to protected?
>>
>> Regards
>>
>> Hubert.
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Delay-activing--web-services-tp24140781p24158208.html
Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Delay activing web services

Posted by Daniel Kulp <dk...@apache.org>.
I have no problem making things protected.   Log a jira and submit a patch.

Dan


On Sun June 21 2009 9:56:46 pm Sky-Tiger wrote:
> Hi all,
>      I have a requirement that delaying registration ws until HTTP server
> received  the first request.
>      Firstly, i dont want make jetty as we container, it should be embedded
> into CXF as default.
>      Second ,i need a jetty handler to intercept the request. But CXF
> always create jetty server instance after you really call the
> Endpoint.publish method.
>      So i need to create the JettyHTTPServerEngine instance myself and put
> it into the portMap which was in JettyHTTPServerEngineFactory. Each
> JettyHTTPServerEngine contains a jetty server instance which i need to add
> my handler on it.
>      But when i subclass the JettyHTTPServerEngine, i found some issues
> that JettyHTTPServerEngine makes all numbers as private and not all of them
> have get/set method.  JettyHTTPServerEngineFactory also.
>     Why we need to make all things private? protected is not ok? If you
> dont want to someone subclass your class, you can make it as final. But
> private should be more considered, maybe protected is enough.
>
>     I want to know the soluton is ok or not. I tried ,it works well.
>     Can we change the private to protected?
>
> Regards
>
> Hubert.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog