So I tried a little different approach which works but requires that I create
my own JAXWS/JAXRS factory which is OK.
As a basic outline I have a factory for setting up SOAP/REST services that
will the interface/implementation it finds. Right now that basic
Microservice interface just has three methods on it for getting the
interface, implementation and a unique identifier.
One problem I ran into was that if I used the interface on the actual
implementation object itself it would get proxied and CXF didn't seem to
work with it. The easiest and preferrable solution was to simply create a
MicroserviceRegistration object that implements the Microservice interface
and then when I boot up I just register a service.
But now that listening factory can have providers, interceptors, security,
etc. setup and I only need to do it once. Later if I end up with multiples
of these on the same platform I can filter on the Microservice as well to
only register/unregister certain ones with a given port. A lot more testing
to go with this obviously and at this point I'm likely going to look into
Camel/CXF source and perhaps extend some of those.
//Register a service to be exposed as SOAP/REST
<service interface="org.enjekt.osgi.microservice.api.Microservice">
<bean
class="org.enjekt.osgi.microservice.impl.MicroserviceRegistration">
<argument value="org.enjekt.osgi.echo.api.TestService"/>
<argument ref="testBean"/>
</bean>
</service>
//The listener then receives notification of the registration and sets the
interface and implementation up on the endpoint.
<bean id="factory"
class="org.enjekt.osgi.microservice.internal.MicroserviceWebfactory"
init-method="init" destroy-method="destroy">
<property name="baseAddress" value="http://localhost:9000" />
</bean>
<reference id="microserviceListener"
interface="org.enjekt.osgi.microservice.api.Microservice">
<reference-listener bind-method="register"
unbind-method="unregister">
<ref component-id="factory" />
</reference-listener>
</reference>
--
View this message in context:
http://camel.465427.n5.nabble.com/CXF-cross-cutting-concerns-tp5778798p5778937.html
Sent from the Camel - Users mailing list archive at Nabble.com.