http://cxf.apache.org/docs/
http://cxf.apache.org/docs/cxf-architecture.html
Transports:
http----------- [Servlet, Jetty]---------jaxws[SOAP], jaxrs[REST] JSON support
jms [tcp, Apache Camel]
udp
Conduit for outgoing message sending.
Destination for receiving incoming messages.
1.Message handling flow:
destination-->incomingObserver[ChainInitiationObserver].onMessage-->inChain[PhaseInterceptorChain, from Bus,Service,Endpoint,Binding,Databinding,InMessage's InInterceptors].doIntercept(inMessage) at InPhases[PhaseManagerImpl:inPhases and outPhases, Ordered In/Out list definition]-->ServiceInvokerInterceptor[Phase.INVOKE<----->PhaseInterceptor.getPhase, when initializeDefaultInterceptors for a Service, service.getInInterceptors().add(ServiceInvokerInterceptor,OutgoingChainInterceptor,OneWayProcessorInterceptor.], OutgoingChainInterceptor.handleMessage-->outChain[from Bus,Service,Endpoint,Binding,Databinding,In/OutMessage's OutInterceptors].doIntercept(outMessage).
2.Services publishing:
ServerFactoryBean[frontend, e.g: JaxWsServerFactoryBean:JaxWsServiceFactoryBean]-->create Service, Endpoint, Server[initDestination:create destination]-->server.start()-->bindingFactory.addListener(destination, endpoint)-->destination[AbstractHTTPDestination-AbstractObservable].setMessageObserver(ChainInitiationObserver)-->destination.activate().
One Bus for all services publishing-->new JaxWsServerFactoryBean:JaxWsServiceFactoryBean:Service:Endpoint:Destination:Server=1:1:1:1:1:1
Specially for Jetty standalone HTTP server:
1.JettyHTTPDestination:JettyHTTPServerEngine:JetterServer=1:1:1
But JettyHTTPServerEngine:Port:JetterServer=1:1:1, so one Port just one JettyHTTPServerEngine and one JettyServer.
2.ServerImpl.initDestination-->destinationFactory[HTTPTransportFactory, see bus.getExtension-->(bus-extensions.txt)].getDestination(ei)-->create JettyHTTPDestination-->d.finalizeConfig()-->d.retrieveEngine--> get the only one JettyHTTPServerEngine:JettyServer on the specific Port.
3.bus-extensions.txt:
org.apache.cxf.transport.http.HTTPTransportFactory::true
org.apache.cxf.transport.http_jetty.JettyDestinationFactory::true
4.JettyHTTPDestination.activate()-->engine[JettyHTTPServerEngine].addServant( ServiceUrl, new JettyHTTPHandler) [synchronized]-->the JettyServer's contexts[ContextHandlerCollection].addHandler(new ContextHandler:JettyHTTPHandler)
jaxws:endpoint and jaxws:server
First, they are all for the server side configuration.
Second, jaxws:endpoint is coming from JAXWS API, and it is used to
configure the org.apache.cxf.jaxws.EndpointImpl[not org.apache.cxf.endpoint.EndpointImpl] which extends javax.xml.ws.Endpoint.
jaxws:server is for configuring the JaxWsServerFactoryBean, which is
coming from the Xfire API.
For the user who has the Xfire using experience, I think they will
prefer to use jaxws:server tag.
For the JAXWS API fans, jaxws:endpoint will be they first choice.
There are not much difference between the jaxws:endpoint and
jaxws:server, since the EndpointImpl is a wrapper class for the
JaxWsServerFactoryBean.
CXF Continuation API [JettyContinuationWrapper-->Jetty Server Continuation NIO API,
Servlet3Continuation,JMSContinuation] Jax-ws UseAsyncMethod [ wsdl:enableAsyncMapping, https://jax-ws.java.net/nonav/customizations/http.java.sun.com.xml.n/element/enableasyncmapping.html]
The request handling process: on Phase.INVOKE ServiceInvokerInterceptor
AbstractJAXWSMethodInvoker.adjustMethodAndParams-->probe the @UseAsyncMethod and Async suffix and ContinuationProvider existing, Jetty continuation.suspend(0) and suspend the phaseChain[ Note:pls see PhaseInterceptorChain.doIntercept, if suspend, will rollback previous interceptor ,pause and throw SuspendedInvocationException, so the incomingObserver.onMessage will be interrupted, the Destination will catch and throw it to WebContext dispatch layer] , then return the UseAsyncMethod-->AbstractJAXWSMethodInvoker.invoke it and pass the JaxwsServerHandler[AsyncHandler] param, JaxwsServerHandler.waitFor the method invocation done[callback the JaxwsServerHandler.handleResponse to Jetty continuation.resume and notifyAll], when callback done,the phaseChain next loop pause and throw SuspendedInvocationException to interrupt the current request handling process. but the Jetty Server will re-dispatch this request, the phaseChain will resume[ incomingObserver.onMessage-->phaseChain.resume() ]
e.g: distribution\src\main\release\samples\jaxws_async\src\main\java\demo\hw\server\GreeterImpl
soap.udp-->publish service ws discovery
remove the cxf-services-ws-discovery-service-2.7.11.jar and cxf-services-ws-discovery-api-2.7.11.jar to disable it.
WS-Trust "Security Token Service" STS
Web Services Notification WSN
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交