You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "O'Callaghan, Sean" <se...@iona.com> on 2007/01/08 16:37:08 UTC
Registering a listener to server events
Hi,
I'd like to be able to recieve notification of when an endpoints server starts and stops, and get info on that server instance.
At the moment there does not appear to be anyway to hook into such lifecycle so would like to propose adding in a ServerLifeCycleManager and ServerLifeCycleListener to the api's.
Something along the lines of :
org.apache.cxf.endpoint.ServerLifeCycleManager {
startServer(org.apache.cxf.endpoint.Server server)
stopServer(org.apache.cxf.endpoint.Server server)
registerListener(ServerLifeCycleListener listener)
unRegisterListener(ServerLifeCycleListener listener)
}
org.apache.cxf.endpoint.ServerLifeCycleListener {
startServer(org.apache.cxf.endpoint.Server server)
stopServer(org.apache.cxf.endpoint.Server server)
}
where the ServerImpl would be modified to access the ServerLifeCycleManager.
Does this approach seem okay to people or is there another mechanism already within CXF that can do this.
Thanks,
Seán.
RE: Registering a listener to server events
Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
Hi
The modification of the API is OK for me.
The CXF management use the event for notification of the managed component creatation and removing.
You can look into cxf-common-utilitise project's org.apache.cxf.event package and cxf-rt-management project for more information.
And in the cxf-rt-core's workqueue , you can find the code for sending event.
IMO, we can set the EventProcessImpl as the ServerLifeCycleListener, so the management can get the server start and stop notification.
But for more general considreation , I think event would be a better way.
Any thoughts?
Willem.
-----Original Message-----
From: Daniel Kulp [mailto:daniel.kulp@iona.com]
Sent: Tue 1/9/2007 23:00
To: cxf-dev@incubator.apache.org
Subject: Re: Registering a listener to server events
Sean,
Whatever is done, the JMX management stuff should definitely be changed over
to using the same mechanism. Actually, I'm not sure what mechanism is
currently used for the JMX stuff. Did you look at that to see how it knows
when services are added/removed?
Dan
On Monday 08 January 2007 10:37, O'Callaghan, Sean wrote:
> Hi,
>
> I'd like to be able to recieve notification of when an endpoints server
> starts and stops, and get info on that server instance.
>
> At the moment there does not appear to be anyway to hook into such
> lifecycle so would like to propose adding in a ServerLifeCycleManager and
> ServerLifeCycleListener to the api's.
>
> Something along the lines of :
>
> org.apache.cxf.endpoint.ServerLifeCycleManager {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> registerListener(ServerLifeCycleListener listener)
> unRegisterListener(ServerLifeCycleListener listener)
> }
>
> org.apache.cxf.endpoint.ServerLifeCycleListener {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> }
>
> where the ServerImpl would be modified to access the
> ServerLifeCycleManager.
>
> Does this approach seem okay to people or is there another mechanism
> already within CXF that can do this.
>
> Thanks,
>
> Seán.
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
daniel.kulp@iona.com
Re: Registering a listener to server events
Posted by Daniel Kulp <da...@iona.com>.
Sean,
Whatever is done, the JMX management stuff should definitely be changed over
to using the same mechanism. Actually, I'm not sure what mechanism is
currently used for the JMX stuff. Did you look at that to see how it knows
when services are added/removed?
Dan
On Monday 08 January 2007 10:37, O'Callaghan, Sean wrote:
> Hi,
>
> I'd like to be able to recieve notification of when an endpoints server
> starts and stops, and get info on that server instance.
>
> At the moment there does not appear to be anyway to hook into such
> lifecycle so would like to propose adding in a ServerLifeCycleManager and
> ServerLifeCycleListener to the api's.
>
> Something along the lines of :
>
> org.apache.cxf.endpoint.ServerLifeCycleManager {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> registerListener(ServerLifeCycleListener listener)
> unRegisterListener(ServerLifeCycleListener listener)
> }
>
> org.apache.cxf.endpoint.ServerLifeCycleListener {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> }
>
> where the ServerImpl would be modified to access the
> ServerLifeCycleManager.
>
> Does this approach seem okay to people or is there another mechanism
> already within CXF that can do this.
>
> Thanks,
>
> Seán.
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194
daniel.kulp@iona.com
Re: Registering a listener to server events
Posted by Andrea Smyth <an...@iona.com>.
Hi Sean,
Sounds good to me. There is no such mechanism at the moment, all we have
is the BusLifeCycleListener and BusLifeCyclemanager APIs. The latter
are not widely used yet and may be replaced by support for JSR 250
@PreDestroy, see https://issues.apache.org/jira/browse/CXF-259, which is
not suitable for on-demand servers.
Endpoint.stop would be the better point to release resources associated
with a server endpoint in RM then Bus.shutdown.
It may even be useful to have a similar thing on the client side (proxy
creation would be OK, but there is no such thing as proxy destroy in the
JAX-WS APIs, not in the underlying CXF APIs. Maybe we can think about
that to at some time, but for server side endpoint a mechanisms like the
below definitely seems useful to me.
BTW getEndpoint should be added to the Server API - currently its only a
public method in ServerImpl, requiring annoying casts.
Andrea.
O'Callaghan, Sean wrote:
>Hi,
>
>I'd like to be able to recieve notification of when an endpoints server starts and stops, and get info on that server instance.
>
>At the moment there does not appear to be anyway to hook into such lifecycle so would like to propose adding in a ServerLifeCycleManager and ServerLifeCycleListener to the api's.
>
>Something along the lines of :
>
>org.apache.cxf.endpoint.ServerLifeCycleManager {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> registerListener(ServerLifeCycleListener listener)
> unRegisterListener(ServerLifeCycleListener listener)
> }
>
> org.apache.cxf.endpoint.ServerLifeCycleListener {
> startServer(org.apache.cxf.endpoint.Server server)
> stopServer(org.apache.cxf.endpoint.Server server)
> }
>
>where the ServerImpl would be modified to access the ServerLifeCycleManager.
>
>Does this approach seem okay to people or is there another mechanism already within CXF that can do this.
>
>Thanks,
>
>Seán.
>
>
>
>