Class Stub
- All Implemented Interfaces:
Component,ComponentRegistry,ResponseContextReceiver,WSBindingProvider,BindingProvider,Closeable,AutoCloseable
- Direct Known Subclasses:
DispatchImpl,SEIStub
Tube
for processing.
This class implements the management of pipe instances,
and most of the BindingProvider methods.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AddressingVersionrepresents AddressingVersion on binding if enabled, otherwise null;protected final BindingImplprotected WSEndpointReferenceNon-null if this stub is configured to talk to an EPR.protected OperationDispatcherprotected final WSServiceDelegateTheWSServiceDelegateobject that owns us.protected final WSPortInfoprotected QNamestatic final StringInternal flag indicating async dispatch should be used even when the SyncStartForAsyncInvokeFeature is present on the binding associated with a stub.protected final WSDLPortFields inherited from interface jakarta.xml.ws.BindingProvider
ENDPOINT_ADDRESS_PROPERTY, PASSWORD_PROPERTY, SESSION_MAINTAIN_PROPERTY, SOAPACTION_URI_PROPERTY, SOAPACTION_USE_PROPERTY, USERNAME_PROPERTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStub(WSPortInfo portInfo, BindingImpl binding, EndpointAddress defaultEndPointAddress, WSEndpointReference epr) protectedStub(WSPortInfo portInfo, BindingImpl binding, Tube master, EndpointAddress defaultEndPointAddress, WSEndpointReference epr) protectedStub(WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, WSEndpointReference epr) Deprecated.protectedStub(QName portname, WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, WSEndpointReference epr) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voidconfigureFiber(Fiber fiber) final WSBindingReturns the set ofComponents registered with this objectfinal W3CEndpointReferencefinal <T extends EndpointReference>
TgetEndpointReference(Class<T> clazz) final ExecutorGets theExecutorto be used for asynchronous method invocations.org.glassfish.gmbal.ManagedObjectManagerGet the ManagedObjectManager for this provider.Nullable when there is no associated WSDL Modelprotected abstract QNameGets the port name that this stub is configured to talk to.final ResponseContextprotected final QNameGets the service name that this stub is configured to talk to.<S> SGets the specified SPI.getTubes()final WSEndpointReferenceSimilar to {link BindingProvider#getEndpointReference(}, but returns WSEndpointReference that has more convenience methodsprotected final Packetprocess(Packet packet, RequestContext requestContext, ResponseContextReceiver receiver) Passes a message to a pipe for processing.protected final voidprocessAsync(AsyncResponseImpl<?> receiver, Packet request, RequestContext requestContext, Fiber.CompletionCallback completionCallback) Passes a message through aTubeline for processing.voidfinal voidsetAddress(String address) Sets the endpoint address for all the invocations that happen fromBindingProvider.final voidsetOutboundHeaders(Header... headers) Sets the out-bound headers to be added to messages sent from thisBindingProvider.final voidsetOutboundHeaders(List<Header> headers) Sets the out-bound headers to be added to messages sent from thisBindingProvider.voidCalled upon the completion of the invocation to set aResponseContext.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sun.xml.ws.developer.WSBindingProvider
setOutboundHeaders
-
Field Details
-
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. There is no type associated with this property on the request context. Its presence is what triggers the 'prevent' behavior.- See Also:
-
owner
TheWSServiceDelegateobject that owns us. -
endpointReference
Non-null if this stub is configured to talk to an EPR.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.
-
binding
-
portInfo
-
addrVersion
represents AddressingVersion on binding if enabled, otherwise null; -
requestContext
-
wsdlPort
-
portname
-
operationDispatcher
-
-
Constructor Details
-
Stub
@Deprecated protected Stub(WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) Deprecated.- Parameters:
master- The created stub will send messages to this pipe.binding- As aBindingProvider, this object will return this binding fromBindingProvider.getBinding().defaultEndPointAddress- The destination of the message. The actual destination could be overridden byRequestContext.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 thedefaultEndPointAddress.
-
Stub
@Deprecated protected Stub(QName portname, WSServiceDelegate owner, Tube master, BindingImpl binding, WSDLPort wsdlPort, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) Deprecated.- Parameters:
portname- The name of this portmaster- The created stub will send messages to this pipe.binding- As aBindingProvider, this object will return this binding fromBindingProvider.getBinding().defaultEndPointAddress- The destination of the message. The actual destination could be overridden byRequestContext.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 thedefaultEndPointAddress.
-
Stub
protected Stub(WSPortInfo portInfo, BindingImpl binding, Tube master, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) - Parameters:
portInfo- PortInfo for this stubbinding- As aBindingProvider, this object will return this binding fromBindingProvider.getBinding().master- The created stub will send messages to this pipe.defaultEndPointAddress- The destination of the message. The actual destination could be overridden byRequestContext.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 thedefaultEndPointAddress.
-
Stub
protected Stub(WSPortInfo portInfo, BindingImpl binding, EndpointAddress defaultEndPointAddress, @Nullable WSEndpointReference epr) - Parameters:
portInfo- PortInfo for this stubbinding- As aBindingProvider, this object will return this binding fromBindingProvider.getBinding().defaultEndPointAddress- The destination of the message. The actual destination could be overridden byRequestContext.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 thedefaultEndPointAddress.
-
-
Method Details
-
getWSDLPort
-
getService
-
getTubes
-
getPortInfo
- Specified by:
getPortInfoin interfaceWSBindingProvider- Returns:
- WSPortInfo object that captures the port information for which the stub is created.
-
getOperationDispatcher
Nullable when there is no associated WSDL Model -
getPortName
Gets the port name that this stub is configured to talk to.When
wsdlPortis non-null, the port name is always the same asWSDLPort.getName(), but this method returns a port name even if no WSDL is available for this stub. -
getServiceName
Gets the service name that this stub is configured to talk to.When
wsdlPortis non-null, the service name is always the same as the one that's inferred fromWSDLPort.getOwner(), but this method returns a port name even if no WSDL is available for this stub. -
getExecutor
Gets theExecutorto be used for asynchronous method invocations.Note that the value this method returns may different from invocations to invocations. The caller must not cache.
- Returns:
- always non-null.
-
process
protected final Packet process(Packet packet, RequestContext requestContext, ResponseContextReceiver receiver) Passes a message to a pipe for processing.Unlike
Tubeinstances, this method is thread-safe and can be invoked from multiple threads concurrently.- Parameters:
packet- The message to be sent to the serverrequestContext- TheRequestContextwhen this invocation is originally scheduled. This must be the same object asrequestContextfor 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 theResponseContext. 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.
-
processAsync
protected final void processAsync(AsyncResponseImpl<?> receiver, Packet request, RequestContext requestContext, Fiber.CompletionCallback completionCallback) Passes a message through aTubeline for processing. The processing happens asynchronously and when the response is available, Fiber.CompletionCallback is called. The processing could happen on multiple threads.Unlike
Tubeinstances, this method is thread-safe and can be invoked from multiple threads concurrently.- Parameters:
receiver- TheResponseimplementationrequest- The message to be sent to the serverrequestContext- TheRequestContextwhen this invocation is originally scheduled. This must be the same object asrequestContextfor 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.
-
configureFiber
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getBinding
- Specified by:
getBindingin interfaceBindingProvider
-
getRequestContext
- Specified by:
getRequestContextin interfaceBindingProvider
-
resetRequestContext
public void resetRequestContext() -
getResponseContext
- Specified by:
getResponseContextin interfaceBindingProvider
-
setResponseContext
Description copied from interface:ResponseContextReceiverCalled upon the completion of the invocation to set aResponseContext.This method is invoked even when the invocation fails.
- Specified by:
setResponseContextin interfaceResponseContextReceiver
-
toString
-
getWSEndpointReference
Description copied from interface:WSBindingProviderSimilar to {link BindingProvider#getEndpointReference(}, but returns WSEndpointReference that has more convenience methods- Specified by:
getWSEndpointReferencein interfaceWSBindingProvider- Returns:
- WSEndpointReference of the target servcie endpoint
-
getEndpointReference
- Specified by:
getEndpointReferencein interfaceBindingProvider
-
getEndpointReference
- Specified by:
getEndpointReferencein interfaceBindingProvider
-
getManagedObjectManager
@NotNull public org.glassfish.gmbal.ManagedObjectManager getManagedObjectManager()Description copied from interface:WSBindingProviderGet the ManagedObjectManager for this provider.- Specified by:
getManagedObjectManagerin interfaceWSBindingProvider
-
setOutboundHeaders
Description copied from interface:WSBindingProviderSets the out-bound headers to be added to messages sent from thisBindingProvider.Calling this method would discard any out-bound headers that were previously set.
A new
Headerobject can be created by using one of the methods onHeaders.- Specified by:
setOutboundHeadersin interfaceWSBindingProvider- Parameters:
headers- The headers to be added to the future request messages. To clear the outbound headers, pass in either null or empty list.
-
setOutboundHeaders
Description copied from interface:WSBindingProviderSets the out-bound headers to be added to messages sent from thisBindingProvider.Works like
WSBindingProvider.setOutboundHeaders(List)except that it accepts a var arg array.- Specified by:
setOutboundHeadersin interfaceWSBindingProvider- Parameters:
headers- Can be null or empty.
-
getInboundHeaders
- Specified by:
getInboundHeadersin interfaceWSBindingProvider
-
setAddress
Description copied from interface:WSBindingProviderSets the endpoint address for all the invocations that happen fromBindingProvider. Instead of doing the following((BindingProvider)proxy).getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "...")
you could do this:
((WSBindingProvider)proxy).setAddress("...");
- Specified by:
setAddressin interfaceWSBindingProvider- Parameters:
address- Address of the service
-
getSPI
Description copied from interface:ComponentGets the specified SPI.This method works as a kind of directory service for SPIs, allowing various components to define private contract and talk to each other.
-
getComponents
Description copied from interface:ComponentRegistryReturns the set ofComponents registered with this object- Specified by:
getComponentsin interfaceComponentRegistry- Returns:
- set of registered components
-