cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glynn, Eoghan" <eoghan.gl...@iona.com>
Subject Determining the Features applied to an endpoint, from ServerLifeCycleListener.startServer()
Date Tue, 08 May 2007 15:17:13 GMT


Folks,

I'd like to customize the behavior of a ServerLifeCycleListener on the
basis of the features applied to the corresponding endpoint.

Now the problem is how to determine which features have been applied to
the endpoint in question.

The problem sortta boils down to the way the feature mechanism is
specific to JAX-WS, as opposed to being common to all frontends. If I
could assume the endpoint was published via JAX-WS (as opposed to say
the simple frontend), then you'd think it would just be a simple case
of:

Public class FeatureAwareServerLifecycleListener
    implements ServerLifecycleListener {

    public void startServer(Server server) {
        List<AbstractFeature> appliedFeatures =
 
((org.apache.cxf.jaxws.EndpointImpl)server.getEndpoint()).getFeatures();
        //...
    }
    //...
}

Apart from the cast above being ugly and error-prone, it doesn't seem to
give me what I need anyway, as this endpoint is an instance of
org.apache.cxf.jaxws.support.JaxWsEndpointImpl (which doesn't expose the
applied Features) as opposed to org.apache.cxf.jaxws.EndpointImpl (which
does). 

I guess I could add something like
JaxWsEndpointImpl.setFrontendEndpoint() so as to allow navigation
between the two Endpoint impls, but this approach is beginning to look
really messy, not least because JaxWsEndpointImpl is used on the
client-side also.

So it would seem more logical that the feature mechanism be made
independent of JAX-WS, so we wouldn't have to resort to the above
hoop-jumping (as the applied features would then presumably be available
from org.apache.cxf.endpoint.EndpointImpl, or maybe via the Server
instance directly instead). 

So is there any reason why the <jaxws:endpoint> should be specific to
JAX-WS? 

For example, are there any aspects of <jaxws:endpoint> that don't
naturally map onto say the simple frontend? 

Cheers,
Eoghan

Mime
View raw message