cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frizz <frizzthe...@googlemail.com>
Subject How to install a CXF ServerLifeCycleListener when app is running in Apache Tomcat?
Date Sun, 07 Jun 2015 14:40:06 GMT
I have published a Web-Service in Tomcat with cxf-servlet.xml

   <jaxws:endpoint id="myService"
        implementor="#MyServiceImpl" address="/MyService">
   </jaxws:endpoint>

So far, so god.

Now I wanted to add a CXF ServerLifeCycleListener, but it seems this has to
be done BEFORE the service is published in order to have an effect.

How can I do this with Tomcat / Spring?


When I run my app in pure Java I do it this way:

        Bus cxfBus = BusFactory.getDefaultBus();
        ServerLifeCycleManager mgr =
cxfBus.getExtension(ServerLifeCycleManager.class);
        mgr.registerListener(new MyListener());

        MyServiceImpl fri = new MyServiceImpl();
        Endpoint ep = Endpoint.publish("http://localhost:8080/apps/MyService",
service);

This works.

- But how do I get access to the *correct* bus when deployed in Tomcat?
- And how can I set my ServerLicefycleListener *before* services get
published by the cxf-servlet.xml?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message