public abstract class Stub extends Object implements WSBindingProvider, ResponseContextReceiver, ComponentRegistry
Tube
for processing.
This class implements the management of pipe instances,
and most of the BindingProvider
methods.
Modifier and Type | Field and Description |
---|---|
protected AddressingVersion |
addrVersion
represents AddressingVersion on binding if enabled, otherwise null;
|
protected BindingImpl |
binding |
protected WSEndpointReference |
endpointReference
Non-null if this stub is configured to talk to an EPR.
|
protected OperationDispatcher |
operationDispatcher |
protected WSServiceDelegate |
owner
The
WSServiceDelegate object that owns us. |
protected WSPortInfo |
portInfo |
protected QName |
portname |
static String |
PREVENT_SYNC_START_FOR_ASYNC_INVOKE
Internal flag indicating async dispatch should be used even when the
SyncStartForAsyncInvokeFeature is present on the binding associated
with a stub.
|
RequestContext |
requestContext |
protected WSDLPort |
wsdlPort |
ENDPOINT_ADDRESS_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, SOAPACTION_URI_PROPERTY, SOAPACTION_USE_PROPERTY, USERNAME_PROPERTY
Modifier | Constructor and Description |
---|---|
protected |
Stub(QName portname,
WSServiceDelegate owner,
Tube master,
BindingImpl binding,
WSDLPort wsdlPort,
EndpointAddress defaultEndPointAddress,
WSEndpointReference epr)
Deprecated.
|
protected |
Stub(WSPortInfo portInfo,
BindingImpl binding,
EndpointAddress defaultEndPointAddress,
WSEndpointReference epr) |
protected |
Stub(WSPortInfo portInfo,
BindingImpl binding,
Tube master,
EndpointAddress defaultEndPointAddress,
WSEndpointReference epr) |
protected |
Stub(WSServiceDelegate owner,
Tube master,
BindingImpl binding,
WSDLPort wsdlPort,
EndpointAddress defaultEndPointAddress,
WSEndpointReference epr)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
configureFiber(Fiber fiber) |
WSBinding |
getBinding() |
Set<Component> |
getComponents()
Returns the set of
Component s registered with this object |
W3CEndpointReference |
getEndpointReference() |
<T extends EndpointReference> |
getEndpointReference(Class<T> clazz) |
Executor |
getExecutor()
Gets the
Executor to be used for asynchronous method invocations. |
List<com.sun.xml.ws.api.message.Header> |
getInboundHeaders() |
org.glassfish.gmbal.ManagedObjectManager |
getManagedObjectManager()
Get the ManagedObjectManager for this provider.
|
OperationDispatcher |
getOperationDispatcher()
Nullable when there is no associated WSDL Model
|
WSPortInfo |
getPortInfo() |
protected abstract QName |
getPortName()
Gets the port name that this stub is configured to talk to.
|
Map<String,Object> |
getRequestContext() |
ResponseContext |
getResponseContext() |
WSService |
getService() |
protected QName |
getServiceName()
Gets the service name that this stub is configured to talk to.
|
<S> S |
getSPI(Class<S> spiType)
Gets the specified SPI.
|
Pool<Tube> |
getTubes() |
WSDLPort |
getWSDLPort() |
WSEndpointReference |
getWSEndpointReference()
Similar to {link BindingProvider#getEndpointReference(}, but returns WSEndpointReference that has more
convenience methods
|
protected com.sun.xml.ws.api.message.Packet |
process(com.sun.xml.ws.api.message.Packet packet,
RequestContext requestContext,
ResponseContextReceiver receiver)
Passes a message to a pipe for processing.
|
protected void |
processAsync(AsyncResponseImpl<?> receiver,
com.sun.xml.ws.api.message.Packet request,
RequestContext requestContext,
Fiber.CompletionCallback completionCallback)
Passes a message through a
Tube line for processing. |
void |
resetRequestContext() |
void |
setAddress(String address)
Sets the endpoint address for all the invocations that happen
from
BindingProvider . |
void |
setOutboundHeaders(com.sun.xml.ws.api.message.Header... headers)
Sets the out-bound headers to be added to messages sent from
this
BindingProvider . |
void |
setOutboundHeaders(List<com.sun.xml.ws.api.message.Header> headers)
Sets the out-bound headers to be added to messages sent from
this
BindingProvider . |
void |
setResponseContext(ResponseContext rc)
Called upon the completion of the invocation
to set a
ResponseContext . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setOutboundHeaders
public static final String PREVENT_SYNC_START_FOR_ASYNC_INVOKE
protected final WSServiceDelegate owner
WSServiceDelegate
object that owns us.@Nullable protected WSEndpointReference endpointReference
When this field is non-null, its reference parameters are sent as out-bound headers. This field can be null even when addressing is enabled, but if the addressing is not enabled, this field must be null.
Unlike endpoint address, we are not letting users to change the EPR, as it contains references to services and so on that we don't want to change.
protected final BindingImpl binding
protected final WSPortInfo portInfo
protected AddressingVersion addrVersion
public RequestContext requestContext
@Nullable protected final WSDLPort wsdlPort
protected QName portname
protected OperationDispatcher operationDispatcher
@Deprecated protected Stub(WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr)
master
- The created stub will send messages to this pipe.binding
- As a BindingProvider
, this object will
return this binding from BindingProvider.getBinding()
.defaultEndPointAddress
- The destination of the message. The actual destination
could be overridden by RequestContext
.epr
- To create a stub that sends out reference parameters
of a specific EPR, give that instance. Otherwise null.
Its address field will not be used, and that should be given
separately as the defaultEndPointAddress.@Deprecated protected Stub(QName portname, WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr)
portname
- The name of this portmaster
- The created stub will send messages to this pipe.binding
- As a BindingProvider
, this object will
return this binding from BindingProvider.getBinding()
.defaultEndPointAddress
- The destination of the message. The actual destination
could be overridden by RequestContext
.epr
- To create a stub that sends out reference parameters
of a specific EPR, give that instance. Otherwise null.
Its address field will not be used, and that should be given
separately as the defaultEndPointAddress.protected Stub(WSPortInfo portInfo, BindingImpl binding, Tube master, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr)
portInfo
- PortInfo for this stubbinding
- As a BindingProvider
, this object will
return this binding from BindingProvider.getBinding()
.master
- The created stub will send messages to this pipe.defaultEndPointAddress
- The destination of the message. The actual destination
could be overridden by RequestContext
.epr
- To create a stub that sends out reference parameters
of a specific EPR, give that instance. Otherwise null.
Its address field will not be used, and that should be given
separately as the defaultEndPointAddress.protected Stub(WSPortInfo portInfo, BindingImpl binding, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr)
portInfo
- PortInfo for this stubbinding
- As a BindingProvider
, this object will
return this binding from BindingProvider.getBinding()
.defaultEndPointAddress
- The destination of the message. The actual destination
could be overridden by RequestContext
.epr
- To create a stub that sends out reference parameters
of a specific EPR, give that instance. Otherwise null.
Its address field will not be used, and that should be given
separately as the defaultEndPointAddress.public WSDLPort getWSDLPort()
public WSService getService()
public WSPortInfo getPortInfo()
getPortInfo
in interface WSBindingProvider
@Nullable public OperationDispatcher getOperationDispatcher()
@NotNull protected abstract QName getPortName()
When wsdlPort
is non-null, the port name is always
the same as WSDLPort.getName()
, but this method
returns a port name even if no WSDL is available for this stub.
@NotNull protected final QName getServiceName()
When wsdlPort
is non-null, the service name is always
the same as the one that's inferred from WSDLPort.getOwner()
,
but this method returns a port name even if no WSDL is available for
this stub.
public final Executor getExecutor()
Executor
to be used for asynchronous method invocations.
Note that the value this method returns may different from invocations to invocations. The caller must not cache.
protected final com.sun.xml.ws.api.message.Packet process(com.sun.xml.ws.api.message.Packet packet, RequestContext requestContext, ResponseContextReceiver receiver)
Unlike Tube
instances,
this method is thread-safe and can be invoked from
multiple threads concurrently.
packet
- The message to be sent to the serverrequestContext
- The RequestContext
when this invocation is originally scheduled.
This must be the same object as requestContext
for synchronous
invocations, but for asynchronous invocations, it needs to be a snapshot
captured at the point of invocation, to correctly satisfy the spec requirement.receiver
- Receives the ResponseContext
. Since the spec requires
that the asynchronous invocations must not update response context,
depending on the mode of invocation they have to go to different places.
So we take a setter that abstracts that away.protected final void processAsync(AsyncResponseImpl<?> receiver, com.sun.xml.ws.api.message.Packet request, RequestContext requestContext, Fiber.CompletionCallback completionCallback)
Tube
line for processing. The processing happens
asynchronously and when the response is available, Fiber.CompletionCallback is
called. The processing could happen on multiple threads.
Unlike Tube
instances,
this method is thread-safe and can be invoked from
multiple threads concurrently.
receiver
- The Response
implementationrequest
- The message to be sent to the serverrequestContext
- The RequestContext
when this invocation is originally scheduled.
This must be the same object as requestContext
for synchronous
invocations, but for asynchronous invocations, it needs to be a snapshot
captured at the point of invocation, to correctly satisfy the spec requirement.completionCallback
- Once the processing is done, the callback is invoked.protected void configureFiber(Fiber fiber)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public final WSBinding getBinding()
getBinding
in interface BindingProvider
public final Map<String,Object> getRequestContext()
getRequestContext
in interface BindingProvider
public void resetRequestContext()
public final ResponseContext getResponseContext()
getResponseContext
in interface BindingProvider
public void setResponseContext(ResponseContext rc)
ResponseContextReceiver
ResponseContext
.
This method is invoked even when the invocation fails.
setResponseContext
in interface ResponseContextReceiver
public final WSEndpointReference getWSEndpointReference()
WSBindingProvider
getWSEndpointReference
in interface WSBindingProvider
public final W3CEndpointReference getEndpointReference()
getEndpointReference
in interface BindingProvider
public final <T extends EndpointReference> T getEndpointReference(Class<T> clazz)
getEndpointReference
in interface BindingProvider
@NotNull public org.glassfish.gmbal.ManagedObjectManager getManagedObjectManager()
WSBindingProvider
getManagedObjectManager
in interface WSBindingProvider
public final void setOutboundHeaders(List<com.sun.xml.ws.api.message.Header> headers)
WSBindingProvider
BindingProvider
.
Calling this method would discard any out-bound headers that were previously set.
A new Header
object can be created by using
one of the methods on Headers
.
setOutboundHeaders
in interface WSBindingProvider
headers
- The headers to be added to the future request messages.
To clear the outbound headers, pass in either null
or empty list.public final void setOutboundHeaders(com.sun.xml.ws.api.message.Header... headers)
WSBindingProvider
BindingProvider
.
Works like WSBindingProvider.setOutboundHeaders(List)
except
that it accepts a var arg array.
setOutboundHeaders
in interface WSBindingProvider
headers
- Can be null or empty.public final List<com.sun.xml.ws.api.message.Header> getInboundHeaders()
getInboundHeaders
in interface WSBindingProvider
public final void setAddress(String address)
WSBindingProvider
BindingProvider
. Instead of doing the following
((BindingProvider)proxy).getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...")
you could do this:
((WSBindingProvider)proxy).setAddress("...");
setAddress
in interface WSBindingProvider
address
- Address of the servicepublic <S> S getSPI(Class<S> spiType)
Component
This method works as a kind of directory service for SPIs, allowing various components to define private contract and talk to each other.
public Set<Component> getComponents()
ComponentRegistry
Component
s registered with this objectgetComponents
in interface ComponentRegistry
Copyright © 2015 Oracle Corporation. All rights reserved.