Class Provider
- java.lang.Object
-
- jakarta.xml.ws.spi.Provider
-
public abstract class Provider extends Object
Service provider forServiceDelegateandEndpointobjects.- Since:
- 1.6, JAX-WS 2.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedProvider()Creates a new instance of Provider
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract EndpointcreateAndPublishEndpoint(String address, Object implementor)Creates and publishes an endpoint object with the specified address and implementation object.EndpointcreateAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features)Creates and publishes an endpoint object with the specified address, implementation object and web service features.EndpointcreateEndpoint(String bindingId, Class<?> implementorClass, Invoker invoker, WebServiceFeature... features)Creates an endpoint object with the provided binding, implementation class, invoker and web service features.abstract EndpointcreateEndpoint(String bindingId, Object implementor)Creates an endpoint object with the provided binding and implementation object.EndpointcreateEndpoint(String bindingId, Object implementor, WebServiceFeature... features)Creates an endpoint object with the provided binding, implementation object and web service features.abstract ServiceDelegatecreateServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass)Creates a service delegate object.ServiceDelegatecreateServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass, WebServiceFeature... features)Creates a service delegate object.abstract W3CEndpointReferencecreateW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters)Factory method to create aW3CEndpointReference.W3CEndpointReferencecreateW3CEndpointReference(String address, QName interfaceName, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters, List<Element> elements, Map<QName,String> attributes)Factory method to create aW3CEndpointReference.abstract <T> TgetPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)The getPort method returns a proxy.static Providerprovider()Creates a new provider object.abstract EndpointReferencereadEndpointReference(Source eprInfoset)read an EndpointReference from the infoset contained ineprInfoset.
-
-
-
Method Detail
-
provider
public static Provider provider()
Creates a new provider object.The algorithm used to locate the provider subclass to use consists of the following steps:
- If a system property with the name
jakarta.xml.ws.spi.Provideris defined, then its value is used as the name of the implementation class. This phase of the look up enables per-JVM override of the Jakarta XML Web Services implementation. - Use the service-provider loading facilities, defined by the
ServiceLoaderclass, to attempt to locate and load an implementation ofProviderservice using the default loading mechanism. - Finally, if all the steps above fail, then the rest of the lookup is unspecified. That said, the recommended behavior is to simply look for some hard-coded platform default Jakarta XML Web Services implementation. This phase of the lookup is so that the environment can have its own Jakarta XML Web Services implementation as the last resort.
- Returns:
- provider object
- If a system property with the name
-
createServiceDelegate
public abstract ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass)
Creates a service delegate object.- Parameters:
wsdlDocumentLocation- A URL pointing to the WSDL document for the service, ornullif there isn't one.serviceName- The qualified name of the service.serviceClass- The service class, which MUST be eitherjakarta.xml.ws.Serviceor a subclass thereof.- Returns:
- The newly created service delegate.
-
createServiceDelegate
public ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass, WebServiceFeature... features)
Creates a service delegate object.- Parameters:
wsdlDocumentLocation- A URL pointing to the WSDL document for the service, ornullif there isn't one.serviceName- The qualified name of the service.serviceClass- The service class, which MUST be eitherjakarta.xml.ws.Serviceor a subclass thereof.features- Web Service features that must be configured on the service. If the provider doesn't understand a feature, it must throw a WebServiceException.- Returns:
- The newly created service delegate.
- Since:
- 1.7, JAX-WS 2.2
-
createEndpoint
public abstract Endpoint createEndpoint(String bindingId, Object implementor)
Creates an endpoint object with the provided binding and implementation object.- Parameters:
bindingId- A URI specifying the desired binding (e.g. SOAP/HTTP)implementor- A service implementation object to which incoming requests will be dispatched. The corresponding class MUST be annotated with all the necessary Web service annotations.- Returns:
- The newly created endpoint.
-
createAndPublishEndpoint
public abstract Endpoint createAndPublishEndpoint(String address, Object implementor)
Creates and publishes an endpoint object with the specified address and implementation object.- Parameters:
address- A URI specifying the address and transport/protocol to use. A http: URI MUST result in the SOAP 1.1/HTTP binding being used. Implementations may support other URI schemes.implementor- A service implementation object to which incoming requests will be dispatched. The corresponding class MUST be annotated with all the necessary Web service annotations.- Returns:
- The newly created endpoint.
-
readEndpointReference
public abstract EndpointReference readEndpointReference(Source eprInfoset)
read an EndpointReference from the infoset contained ineprInfoset.- Parameters:
eprInfoset- infoset for EndpointReference- Returns:
- the
EndpointReferenceunmarshalled fromeprInfoset. This method never returnsnull. - Throws:
WebServiceException- If there is an error creating theEndpointReferencefrom the specifiedeprInfoset.NullPointerException- If thenulleprInfosetvalue is given.- Since:
- 1.6, JAX-WS 2.1
-
getPort
public abstract <T> T getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
The getPort method returns a proxy. If there are any reference parameters in theendpointReference, then those reference parameters MUST appear as SOAP headers, indicating them to be reference parameters, on all messages sent to the endpoint. The parameterserviceEndpointInterfacespecifies the service endpoint interface that is supported by the returned proxy. The parameterendpointReferencespecifies the endpoint that will be invoked by the returned proxy. In the implementation of this method, the Jakarta XML Web Services runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly from the WSDL metadata of theserviceEndpointInterfaceand theEndpointReference. For this method to successfully return a proxy, WSDL metadata MUST be available and theendpointReferenceMUST contain an implementation understoodserviceNamemetadata.- Type Parameters:
T- Service endpoint interface- Parameters:
endpointReference- the EndpointReference that will be invoked by the returned proxy.serviceEndpointInterface- Service endpoint interfacefeatures- A list of WebServiceFeatures to configure on the proxy. Supported features not in thefeaturesparameter will have their default values.- Returns:
- Object Proxy instance that supports the specified service endpoint interface
- Throws:
WebServiceException-- If there is an error during creation of the proxy
- If there is any missing WSDL metadata as required by this method}
- If this
endpointReferenceis illegal - If an illegal
serviceEndpointInterfaceis specified - If a feature is enabled that is not compatible with this port or is unsupported.
- Since:
- 1.6, JAX-WS 2.1
- See Also:
WebServiceFeature
-
createW3CEndpointReference
public abstract W3CEndpointReference createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters)
Factory method to create aW3CEndpointReference.This method can be used to create a
W3CEndpointReferencefor any endpoint by specifying theaddressproperty along with any other desired properties. This method can also be used to create aW3CEndpointReferencefor an endpoint that is published by the same Jakarta EE application. To do so theaddressproperty can be provided or this method can automatically determine theaddressof an endpoint that is published by the same Jakarta EE application and is identified by theserviceNameandportNameproperties. If theaddressisnulland theserviceNameandportNamedo not identify an endpoint published by the same Jakarta EE application, ajavax.lang.IllegalStateExceptionMUST be thrown.- Parameters:
address- Specifies the address of the target endpointserviceName- Qualified name of the service in the WSDL.portName- Qualified name of the endpoint in the WSDL.metadata- A list of elements that should be added to theW3CEndpointReferenceinstanceswsa:metadataelement.wsdlDocumentLocation- URL for the WSDL document location for the service.referenceParameters- Reference parameters to be associated with the returnedEndpointReferenceinstance.- Returns:
- the
W3CEndpointReferencecreated fromserviceName,portName,metadata,wsdlDocumentLocationandreferenceParameters. This method never returnsnull. - Throws:
IllegalStateException-- If the
address,serviceNameandportNameare allnull. - If the
serviceNameservice isnulland theportNameis NOTnull. - If the
addressproperty isnulland theserviceNameandportNamedo not specify a valid endpoint published by the same Jakarta EE application. - If the
serviceNameis NOTnulland is not present in the specified WSDL. - If the
portNameport is notnulland it is not present inserviceNameservice in the WSDL. - If the
wsdlDocumentLocationis NOTnulland does not represent a valid WSDL.
- If the
WebServiceException- If an error occurs while creating theW3CEndpointReference.- Since:
- 1.6, JAX-WS 2.1
-
createW3CEndpointReference
public W3CEndpointReference createW3CEndpointReference(String address, QName interfaceName, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters, List<Element> elements, Map<QName,String> attributes)
Factory method to create aW3CEndpointReference. Using this method, aW3CEndpointReferenceinstance can be created with extension elements, and attributes.Providerimplementations must override the default implementation.This method can be used to create a
W3CEndpointReferencefor any endpoint by specifying theaddressproperty along with any other desired properties. This method can also be used to create aW3CEndpointReferencefor an endpoint that is published by the same Jakarta EE application. To do so theaddressproperty can be provided or this method can automatically determine theaddressof an endpoint that is published by the same Jakarta EE application and is identified by theserviceNameandportNamepropeties. If theaddressisnulland theserviceNameandportNamedo not identify an endpoint published by the same Jakarta EE application, ajavax.lang.IllegalStateExceptionMUST be thrown.- Parameters:
address- Specifies the address of the target endpointinterfaceName- thewsam:InterfaceNameelement in thewsa:Metadataelement.serviceName- Qualified name of the service in the WSDL.portName- Qualified name of the endpoint in the WSDL.metadata- A list of elements that should be added to theW3CEndpointReferenceinstanceswsa:metadataelement.wsdlDocumentLocation- URL for the WSDL document location for the service.referenceParameters- Reference parameters to be associated with the returnedEndpointReferenceinstance.elements- extension elements to be associated with the returnedEndpointReferenceinstance.attributes- extension attributes to be associated with the returnedEndpointReferenceinstance.- Returns:
- the
W3CEndpointReferencecreated fromserviceName,portName,metadata,wsdlDocumentLocationandreferenceParameters. This method never returnsnull. - Throws:
IllegalStateException-- If the
address,serviceNameandportNameare allnull. - If the
serviceNameservice isnulland theportNameis NOTnull. - If the
addressproperty isnulland theserviceNameandportNamedo not specify a valid endpoint published by the same Jakarta EE application. - If the
serviceNameis NOTnulland is not present in the specified WSDL. - If the
portNameport is notnulland it is not present inserviceNameservice in the WSDL. - If the
wsdlDocumentLocationis NOTnulland does not represent a valid WSDL. - If the
wsdlDocumentLocationis NOTnullbut wsdli:wsdlLocation's namespace name cannot be got from the available metadata.
- If the
WebServiceException- If an error occurs while creating theW3CEndpointReference.- Since:
- 1.7, JAX-WS 2.2
-
createAndPublishEndpoint
public Endpoint createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features)
Creates and publishes an endpoint object with the specified address, implementation object and web service features.Providerimplementations must override the default implementation.- Parameters:
address- A URI specifying the address and transport/protocol to use. A http: URI MUST result in the SOAP 1.1/HTTP binding being used. Implementations may support other URI schemes.implementor- A service implementation object to which incoming requests will be dispatched. The corresponding class MUST be annotated with all the necessary Web service annotations.features- A list of WebServiceFeatures to configure on the endpoint. Supported features not in thefeaturesparameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- 1.7, JAX-WS 2.2
-
createEndpoint
public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature... features)
Creates an endpoint object with the provided binding, implementation object and web service features.Providerimplementations must override the default implementation.- Parameters:
bindingId- A URI specifying the desired binding (e.g. SOAP/HTTP)implementor- A service implementation object to which incoming requests will be dispatched. The corresponding class MUST be annotated with all the necessary Web service annotations.features- A list of WebServiceFeatures to configure on the endpoint. Supported features not in thefeaturesparameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- 1.7, JAX-WS 2.2
-
createEndpoint
public Endpoint createEndpoint(String bindingId, Class<?> implementorClass, Invoker invoker, WebServiceFeature... features)
Creates an endpoint object with the provided binding, implementation class, invoker and web service features. Containers typically use this to create Endpoint objects.Providerimplementations must override the default implementation.- Parameters:
bindingId- A URI specifying the desired binding (e.g. SOAP/HTTP). Can be null.implementorClass- A service implementation class that MUST be annotated with all the necessary Web service annotations.invoker- that does the actual invocation on the service instance.features- A list of WebServiceFeatures to configure on the endpoint. Supported features not in thefeaturesparameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- 1.7, JAX-WS 2.2
-
-