Class TransportTubeFactory
- java.lang.Object
-
- com.sun.xml.ws.api.pipe.TransportTubeFactory
-
- Direct Known Subclasses:
TCPTransportPipeFactory
public abstract class TransportTubeFactory extends Object
Factory for transport tubes that enables transport pluggability.At runtime, on the client side, JAX-WS (more specifically the default
TubelineAssemblerof JAX-WS client runtime) relies on this factory to create a suitable transportTubethat can handle the givenendpoint address.JAX-WS extensions that provide additional transport support can extend this class and implement the
doCreate(com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)method. They are expected to check the scheme of the endpoint address (and possibly some other settings from bindings), and create their transport tube implementations accordingly. For example,class MyTransportTubeFactoryImpl { Tube doCreate(...) { String scheme = address.getURI().getScheme(); if(scheme.equals("foo")) return new MyTransport(...); else return null; } }TransportTubeFactorylook-up follows the standard service discovery mechanism, so you needMETA-INF/services/com.sun.xml.ws.api.pipe.BasicTransportTubeFactory.- Author:
- Jitendra Kotamraju
- See Also:
StandaloneTubeAssembler
-
-
Constructor Summary
Constructors Constructor Description TransportTubeFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Tubecreate(ClassLoader classLoader, ClientTubeAssemblerContext context)LocatesTransportTubeFactorys and create a suitable transportTube.protected TubecreateDefault(ClientTubeAssemblerContext context)protected TubecreateHttpTransport(ClientTubeAssemblerContext context)abstract TubedoCreate(ClientTubeAssemblerContext context)Creates a transportTubefor the given port, if this factory can do so, or return null.
-
-
-
Method Detail
-
doCreate
public abstract Tube doCreate(@NotNull ClientTubeAssemblerContext context)
Creates a transportTubefor the given port, if this factory can do so, or return null.- Parameters:
context- Object that captures various contextual information that can be used to determine the tubeline to be assembled.- Returns:
- null to indicate that this factory isn't capable of creating a transport
for this port (which causes the caller to search for other
TransportTubeFactorys that can. Or non-null. - Throws:
jakarta.xml.ws.WebServiceException- if this factory is capable of creating a transport tube but some fatal error prevented it from doing so. This exception will be propagated back to the user application, and no furtherTransportTubeFactorys are consulted.
-
create
public static Tube create(@Nullable ClassLoader classLoader, @NotNull ClientTubeAssemblerContext context)
LocatesTransportTubeFactorys and create a suitable transportTube.- Parameters:
classLoader- used to locateMETA-INF/servcesfiles.- Returns:
- Always non-null, since we fall back to our default
Tube.
-
createDefault
protected Tube createDefault(ClientTubeAssemblerContext context)
-
createHttpTransport
protected Tube createHttpTransport(ClientTubeAssemblerContext context)
-
-