You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Jason Pell <ja...@pellcorp.com> on 2015/06/18 01:30:49 UTC

Enhance ServerLifeCycleListener to include create server event

Hi,

As part of starting up my application I want to know when all services have
started.  Unfortunately in the case of cxf, the Endpoints have all been
created by the time I get the ApplicationListener<ContextRefreshedEvent>
but the servers may actually still be starting.

It would be useful to register a ServerLifeCycleListener which has a new
method:

void serverCreated(Server server);

I could then use this to correlated the corresponding startServer(Server
server) events to know exactly when the spring context is "really" ready.

I know this is a compatibility issue and wanted to know what other devs
thought of the idea and whether its ok if I implement it into 2.7, 3.x and
3.1?

Or any alternatives are welcome

Currently what I am doing is overriding the ServerLifeCycleManager and
intercepting any ManagedEndpoint registrations and sending them onto a
custom listener.

https://github.com/pellcorp/JavaFirst/blob/cxf27/JavaFirst/src/main/java/com/pellcorp/cxf/DelegateServerLifeCycleManagerImpl.java

Re: Enhance ServerLifeCycleListener to include create server event

Posted by Jason Pell <ja...@pellcorp.com>.
Ok I feel stupid.

seems another developer on my team added another spring context loader
which generated the premature event

Please ignore my last 2 emails :-(
On 18/06/2015 10:29 AM, "Jason Pell" <ja...@pellcorp.com> wrote:

> after further interrogation of the code the start should have been called
> before spring finished loading
>
> My issue is the ServerRegistry does not contain all the jaxws:endpoints
> when the spring application listener fires.
>
> Anyone got any thoughts as to why?
> On 18/06/2015 9:30 AM, "Jason Pell" <ja...@pellcorp.com> wrote:
>
>> Hi,
>>
>> As part of starting up my application I want to know when all services
>> have started.  Unfortunately in the case of cxf, the Endpoints have all
>> been created by the time I get the
>> ApplicationListener<ContextRefreshedEvent> but the servers may actually
>> still be starting.
>>
>> It would be useful to register a ServerLifeCycleListener which has a new
>> method:
>>
>> void serverCreated(Server server);
>>
>> I could then use this to correlated the corresponding startServer(Server
>> server) events to know exactly when the spring context is "really" ready.
>>
>> I know this is a compatibility issue and wanted to know what other devs
>> thought of the idea and whether its ok if I implement it into 2.7, 3.x and
>> 3.1?
>>
>> Or any alternatives are welcome
>>
>> Currently what I am doing is overriding the ServerLifeCycleManager and
>> intercepting any ManagedEndpoint registrations and sending them onto a
>> custom listener.
>>
>>
>> https://github.com/pellcorp/JavaFirst/blob/cxf27/JavaFirst/src/main/java/com/pellcorp/cxf/DelegateServerLifeCycleManagerImpl.java
>>
>>
>>

Re: Enhance ServerLifeCycleListener to include create server event

Posted by Jason Pell <ja...@pellcorp.com>.
after further interrogation of the code the start should have been called
before spring finished loading

My issue is the ServerRegistry does not contain all the jaxws:endpoints
when the spring application listener fires.

Anyone got any thoughts as to why?
On 18/06/2015 9:30 AM, "Jason Pell" <ja...@pellcorp.com> wrote:

> Hi,
>
> As part of starting up my application I want to know when all services
> have started.  Unfortunately in the case of cxf, the Endpoints have all
> been created by the time I get the
> ApplicationListener<ContextRefreshedEvent> but the servers may actually
> still be starting.
>
> It would be useful to register a ServerLifeCycleListener which has a new
> method:
>
> void serverCreated(Server server);
>
> I could then use this to correlated the corresponding startServer(Server
> server) events to know exactly when the spring context is "really" ready.
>
> I know this is a compatibility issue and wanted to know what other devs
> thought of the idea and whether its ok if I implement it into 2.7, 3.x and
> 3.1?
>
> Or any alternatives are welcome
>
> Currently what I am doing is overriding the ServerLifeCycleManager and
> intercepting any ManagedEndpoint registrations and sending them onto a
> custom listener.
>
>
> https://github.com/pellcorp/JavaFirst/blob/cxf27/JavaFirst/src/main/java/com/pellcorp/cxf/DelegateServerLifeCycleManagerImpl.java
>
>
>