Package org.apache.cxf.transport.http
Class AbstractHTTPDestination
- java.lang.Object
-
- org.apache.cxf.transport.AbstractObservable
-
- org.apache.cxf.transport.AbstractDestination
-
- org.apache.cxf.transport.AbstractMultiplexDestination
-
- org.apache.cxf.transport.http.AbstractHTTPDestination
-
- All Implemented Interfaces:
Configurable,Assertor,Destination,DestinationWithEndpoint,MultiplexDestination,Observable
- Direct Known Subclasses:
JAXWSHttpSpiDestination,NettyHttpDestination,ServletDestination
public abstract class AbstractHTTPDestination extends AbstractMultiplexDestination implements Configurable, Assertor
Common base for HTTP Destination implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractHTTPDestination.BackChannelConduitBackchannel conduit.static classAbstractHTTPDestination.PrincipalAuthorizationPolicy-
Nested classes/interfaces inherited from class org.apache.cxf.transport.AbstractDestination
AbstractDestination.AbstractBackChannelConduit
-
-
Field Summary
Fields Modifier and Type Field Description protected Busbusprotected CertConstraintscertConstraintsprotected StringcontextMatchStrategyprotected ContinuationProviderFactorycproviderFactorystatic StringCXF_ASYNC_CONTEXTstatic StringCXF_CONTINUATION_MESSAGEprotected booleandecodeBasicAuthWithIso8859protected booleanenableWebSocketprotected booleanfixedParameterOrderstatic StringHTTP_CONFIGstatic StringHTTP_CONTEXTstatic StringHTTP_CONTEXT_MATCH_STRATEGYstatic StringHTTP_REQUESTstatic StringHTTP_RESPONSEprotected booleanisServlet3protected booleanmultiplexWithAddressprotected Stringpathprotected DestinationRegistryregistrystatic StringREQUEST_REDIRECTEDstatic StringRESPONSE_COMMITEDstatic StringRESPONSE_HEADERS_COPIEDprotected HTTPServerPolicyserverPolicystatic StringSERVICE_REDIRECTION-
Fields inherited from class org.apache.cxf.transport.AbstractDestination
endpointInfo, reference
-
Fields inherited from class org.apache.cxf.transport.AbstractObservable
incomingObserver
-
-
Constructor Summary
Constructors Constructor Description AbstractHTTPDestination(Bus b, DestinationRegistry registry, EndpointInfo ei, String path, boolean dp)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate()Activate messages flow.voidassertMessage(Message message)booleancanAssert(QName type)protected booleancontextMatchOnExact()protected voiddeactivate()Deactivate messages flow.voidfinalizeConfig()protected OutputStreamflushHeaders(Message outMessage)protected OutputStreamflushHeaders(Message outMessage, boolean getStream)protected static EndpointInfogetAddressValue(EndpointInfo ei)protected static EndpointInfogetAddressValue(EndpointInfo ei, boolean dp)org.apache.cxf.ws.addressing.EndpointReferenceTypegetAddressWithId(String id)Builds an new endpoint reference using the current target reference as a template.protected StringgetBasePath(String contextPath)StringgetBeanName()Get the configurable object's Bean nameBusgetBus()StringgetContextMatchStrategy()StringgetId(Map<String,Object> context)Obtain id from reference parameters of the ws-a to address Requires the existance of ws-a interceptors on dispatch path to provide access to the ws-a headersprotected ConduitgetInbuiltBackChannel(Message inMessage)StringgetPath()HTTPServerPolicygetServer()voidinvoke(javax.servlet.ServletConfig config, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected voidinvokeComplete(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, Message m)booleanisFixedParameterOrder()booleanisMultiplexWithAddress()protected booleanisOneWay(Message message)voidreleaseRegistry()protected MessageretrieveFromContinuation(javax.servlet.http.HttpServletRequest req)protected MessageretrieveFromServlet3Async(javax.servlet.http.HttpServletRequest req)voidsetContextMatchStrategy(String contextMatchStrategy)voidsetFixedParameterOrder(boolean fixedParameterOrder)voidsetMultiplexWithAddress(boolean multiplexWithAddress)voidsetServer(HTTPServerPolicy server)protected voidsetupContinuation(Message inMessage, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected voidsetupMessage(Message inMessage, javax.servlet.ServletConfig config, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)voidshutdown()Shutdown the Destination, i.e.-
Methods inherited from class org.apache.cxf.transport.AbstractDestination
getAddress, getBackChannel, getEndpointInfo
-
Methods inherited from class org.apache.cxf.transport.AbstractObservable
getLogger, getMessageObserver, getTargetReference, getTargetReference, setMessageObserver
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cxf.transport.Destination
getAddress, getBackChannel, getMessageObserver
-
Methods inherited from interface org.apache.cxf.transport.Observable
setMessageObserver
-
-
-
-
Field Detail
-
HTTP_REQUEST
public static final String HTTP_REQUEST
- See Also:
- Constant Field Values
-
HTTP_RESPONSE
public static final String HTTP_RESPONSE
- See Also:
- Constant Field Values
-
HTTP_CONTEXT
public static final String HTTP_CONTEXT
- See Also:
- Constant Field Values
-
HTTP_CONFIG
public static final String HTTP_CONFIG
- See Also:
- Constant Field Values
-
HTTP_CONTEXT_MATCH_STRATEGY
public static final String HTTP_CONTEXT_MATCH_STRATEGY
- See Also:
- Constant Field Values
-
RESPONSE_HEADERS_COPIED
public static final String RESPONSE_HEADERS_COPIED
- See Also:
- Constant Field Values
-
RESPONSE_COMMITED
public static final String RESPONSE_COMMITED
- See Also:
- Constant Field Values
-
REQUEST_REDIRECTED
public static final String REQUEST_REDIRECTED
- See Also:
- Constant Field Values
-
CXF_CONTINUATION_MESSAGE
public static final String CXF_CONTINUATION_MESSAGE
- See Also:
- Constant Field Values
-
CXF_ASYNC_CONTEXT
public static final String CXF_ASYNC_CONTEXT
- See Also:
- Constant Field Values
-
SERVICE_REDIRECTION
public static final String SERVICE_REDIRECTION
- See Also:
- Constant Field Values
-
bus
protected final Bus bus
-
registry
protected DestinationRegistry registry
-
path
protected final String path
-
serverPolicy
protected volatile HTTPServerPolicy serverPolicy
-
contextMatchStrategy
protected String contextMatchStrategy
-
fixedParameterOrder
protected boolean fixedParameterOrder
-
multiplexWithAddress
protected boolean multiplexWithAddress
-
certConstraints
protected CertConstraints certConstraints
-
isServlet3
protected boolean isServlet3
-
decodeBasicAuthWithIso8859
protected boolean decodeBasicAuthWithIso8859
-
cproviderFactory
protected ContinuationProviderFactory cproviderFactory
-
enableWebSocket
protected boolean enableWebSocket
-
-
Constructor Detail
-
AbstractHTTPDestination
public AbstractHTTPDestination(Bus b, DestinationRegistry registry, EndpointInfo ei, String path, boolean dp) throws IOException
Constructor- Parameters:
b- the associated Busregistry- the destination registryei- the endpoint info of the destinationpath- the pathdp- true for adding the default port if it is missing- Throws:
IOException
-
-
Method Detail
-
getBus
public Bus getBus()
-
isOneWay
protected final boolean isOneWay(Message message)
- Parameters:
message- the message under consideration- Returns:
- true iff the message has been marked as oneway
-
invoke
public void invoke(javax.servlet.ServletConfig config, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException- Throws:
IOException
-
invokeComplete
protected void invokeComplete(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, Message m) throws IOException- Throws:
IOException
-
setupMessage
protected void setupMessage(Message inMessage, javax.servlet.ServletConfig config, javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException
- Throws:
IOException
-
retrieveFromContinuation
protected Message retrieveFromContinuation(javax.servlet.http.HttpServletRequest req)
-
retrieveFromServlet3Async
protected Message retrieveFromServlet3Async(javax.servlet.http.HttpServletRequest req)
-
setupContinuation
protected void setupContinuation(Message inMessage, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
-
getBasePath
protected String getBasePath(String contextPath) throws IOException
- Throws:
IOException
-
getAddressValue
protected static EndpointInfo getAddressValue(EndpointInfo ei)
-
getAddressValue
protected static EndpointInfo getAddressValue(EndpointInfo ei, boolean dp)
-
getInbuiltBackChannel
protected Conduit getInbuiltBackChannel(Message inMessage)
- Specified by:
getInbuiltBackChannelin classAbstractDestination- Parameters:
inMessage- the incoming message- Returns:
- the inbuilt backchannel
-
flushHeaders
protected OutputStream flushHeaders(Message outMessage) throws IOException
- Throws:
IOException
-
flushHeaders
protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException
- Throws:
IOException
-
contextMatchOnExact
protected boolean contextMatchOnExact()
-
finalizeConfig
public void finalizeConfig()
-
getBeanName
public String getBeanName()
Description copied from interface:ConfigurableGet the configurable object's Bean name- Specified by:
getBeanNamein interfaceConfigurable- Returns:
- the bean name
-
getAddressWithId
public org.apache.cxf.ws.addressing.EndpointReferenceType getAddressWithId(String id)
Description copied from class:AbstractMultiplexDestinationBuilds an new endpoint reference using the current target reference as a template. The supplied id is endcoded using a reference parameter. This requires the ws-a interceptors to propagate the reference parameters on subsequent invokes using the returned reference.- Specified by:
getAddressWithIdin interfaceMultiplexDestination- Overrides:
getAddressWithIdin classAbstractMultiplexDestination- Parameters:
id- the id to encode in the new reference- Returns:
- the new reference with the id encoded as a reference parameter
- See Also:
MultiplexDestination.getAddressWithId(java.lang.String)
-
getId
public String getId(Map<String,Object> context)
Description copied from class:AbstractMultiplexDestinationObtain id from reference parameters of the ws-a to address Requires the existance of ws-a interceptors on dispatch path to provide access to the ws-a headers- Specified by:
getIdin interfaceMultiplexDestination- Overrides:
getIdin classAbstractMultiplexDestination- Parameters:
context- the current invocation or message context- Returns:
- the id from the reference parameters of the ws-a-to address or null if not found
- See Also:
MultiplexDestination.getId(java.util.Map)
-
getContextMatchStrategy
public String getContextMatchStrategy()
-
setContextMatchStrategy
public void setContextMatchStrategy(String contextMatchStrategy)
-
isFixedParameterOrder
public boolean isFixedParameterOrder()
-
setFixedParameterOrder
public void setFixedParameterOrder(boolean fixedParameterOrder)
-
isMultiplexWithAddress
public boolean isMultiplexWithAddress()
-
setMultiplexWithAddress
public void setMultiplexWithAddress(boolean multiplexWithAddress)
-
getServer
public HTTPServerPolicy getServer()
-
setServer
public void setServer(HTTPServerPolicy server)
-
assertMessage
public void assertMessage(Message message)
- Specified by:
assertMessagein interfaceAssertor
-
releaseRegistry
public void releaseRegistry()
-
getPath
public String getPath()
-
activate
protected void activate()
Description copied from class:AbstractObservableActivate messages flow.- Overrides:
activatein classAbstractObservable
-
deactivate
protected void deactivate()
Description copied from class:AbstractObservableDeactivate messages flow.- Overrides:
deactivatein classAbstractObservable
-
shutdown
public void shutdown()
Description copied from class:AbstractDestinationShutdown the Destination, i.e. stop accepting incoming messages.- Specified by:
shutdownin interfaceDestination- Overrides:
shutdownin classAbstractDestination
-
-