- java.lang.Object
-
- javax.xml.ws.spi.Provider
-
public abstract class Provider extends Object
Service provider forServiceDelegate
andEndpoint
objects.- Since:
- JAX-WS 2.0
-
-
Field Summary
Fields Modifier and Type Field and Description static String
JAXWSPROVIDER_PROPERTY
A constant representing the property used to lookup the name of aProvider
implementation class.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
Provider()
Creates a new instance of Provider
-
Method Summary
Methods Modifier and Type Method and Description abstract Endpoint
createAndPublishEndpoint(String address, Object implementor)
Creates and publishes an endpoint object with the specified address and implementation object.Endpoint
createAndPublishEndpoint(String address, Object implementor, WebServiceFeature... features)
Creates and publishes an endpoint object with the specified address, implementation object and web service features.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.abstract Endpoint
createEndpoint(String bindingId, Object implementor)
Creates an endpoint object with the provided binding and implementation object.Endpoint
createEndpoint(String bindingId, Object implementor, WebServiceFeature... features)
Creates an endpoint object with the provided binding, implementation object and web service features.abstract ServiceDelegate
createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass)
Creates a service delegate object.ServiceDelegate
createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class<? extends Service> serviceClass, WebServiceFeature... features)
Creates a service delegate object.abstract W3CEndpointReference
createW3CEndpointReference(String address, QName serviceName, QName portName, List<Element> metadata, String wsdlDocumentLocation, List<Element> referenceParameters)
Factory method to create aW3CEndpointReference
.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
.abstract <T> T
getPort(EndpointReference endpointReference, Class<T> serviceEndpointInterface, WebServiceFeature... features)
The getPort method returns a proxy.static Provider
provider()
Creates a new provider object.abstract EndpointReference
readEndpointReference(Source eprInfoset)
read an EndpointReference from the infoset contained ineprInfoset
.
-
-
-
Field Detail
-
JAXWSPROVIDER_PROPERTY
public static final String JAXWSPROVIDER_PROPERTY
A constant representing the property used to lookup the name of aProvider
implementation class.- See Also:
- Constant Field Values
-
-
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 resource with the name of
META-INF/services/javax.xml.ws.spi.Provider
exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class. -
If the $java.home/lib/jaxws.properties file exists and it is readable by
the
java.util.Properties.load(InputStream)
method and it contains an entry whose key isjavax.xml.ws.spi.Provider
, then the value of that entry is used as the name of the implementation class. -
If a system property with the name
javax.xml.ws.spi.Provider
is defined, then its value is used as the name of the implementation class. - Finally, a default implementation class name is used.
-
If a resource with the name of
-
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, ornull
if there isn't one.serviceName
- The qualified name of the service.serviceClass
- The service class, which MUST be eitherjavax.xml.ws.Service
or 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, ornull
if there isn't one.serviceName
- The qualified name of the service.serviceClass
- The service class, which MUST be eitherjavax.xml.ws.Service
or 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:
- 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
EndpointReference
unmarshalled fromeprInfoset
. This method never returnsnull
. - Throws:
WebServiceException
- If there is an error creating theEndpointReference
from the specifiedeprInfoset
.NullPointerException
- If thenull
eprInfoset
value is given.- Since:
- 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 parameterserviceEndpointInterface
specifies the service endpoint interface that is supported by the returned proxy. The parameterendpointReference
specifies the endpoint that will be invoked by the returned proxy. In the implementation of this method, the JAX-WS runtime system takes the responsibility of selecting a protocol binding (and a port) and configuring the proxy accordingly from the WSDL metadata of theserviceEndpointInterface
and theEndpointReference
. For this method to successfully return a proxy, WSDL metadata MUST be available and theendpointReference
MUST contain an implementation understoodserviceName
metadata.- 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 thefeatures
parameter 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
endpointReference
is illegal - If an illegal
serviceEndpointInterface
is specified - If a feature is enabled that is not compatible with this port or is unsupported.
- Since:
- 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
W3CEndpointReference
for any endpoint by specifying theaddress
property along with any other desired properties. This method can also be used to create aW3CEndpointReference
for an endpoint that is published by the same Java EE application. To do so theaddress
property can be provided or this method can automatically determine theaddress
of an endpoint that is published by the same Java EE application and is identified by theserviceName
andportName
propeties. If theaddress
isnull
and theserviceName
andportName
do not identify an endpoint published by the same Java EE application, ajavax.lang.IllegalStateException
MUST 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 theW3CEndpointReference
instanceswsa:metadata
element.wsdlDocumentLocation
- URL for the WSDL document location for the service.referenceParameters
- Reference parameters to be associated with the returnedEndpointReference
instance.- Returns:
- the
W3CEndpointReference
created fromserviceName
,portName
,metadata
,wsdlDocumentLocation
andreferenceParameters
. This method never returnsnull
. - Throws:
IllegalStateException
-- If the
address
,serviceName
andportName
are allnull
. - If the
serviceName
service isnull
and theportName
is NOTnull
. - If the
address
property isnull
and theserviceName
andportName
do not specify a valid endpoint published by the same Java EE application. - If the
serviceName
is NOTnull
and is not present in the specified WSDL. - If the
portName
port is notnull
and it is not present inserviceName
service in the WSDL. - If the
wsdlDocumentLocation
is NOTnull
and does not represent a valid WSDL.
- If the
WebServiceException
- If an error occurs while creating theW3CEndpointReference
.- Since:
- 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, aW3CEndpointReference
instance can be created with extension elements, and attributes.Provider
implementations must override the default implementation.This method can be used to create a
W3CEndpointReference
for any endpoint by specifying theaddress
property along with any other desired properties. This method can also be used to create aW3CEndpointReference
for an endpoint that is published by the same Java EE application. To do so theaddress
property can be provided or this method can automatically determine theaddress
of an endpoint that is published by the same Java EE application and is identified by theserviceName
andportName
propeties. If theaddress
isnull
and theserviceName
andportName
do not identify an endpoint published by the same Java EE application, ajavax.lang.IllegalStateException
MUST be thrown.- Parameters:
address
- Specifies the address of the target endpointinterfaceName
- thewsam:InterfaceName
element in thewsa:Metadata
element.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 theW3CEndpointReference
instanceswsa:metadata
element.wsdlDocumentLocation
- URL for the WSDL document location for the service.referenceParameters
- Reference parameters to be associated with the returnedEndpointReference
instance.elements
- extension elements to be associated with the returnedEndpointReference
instance.attributes
- extension attributes to be associated with the returnedEndpointReference
instance.- Returns:
- the
W3CEndpointReference
created fromserviceName
,portName
,metadata
,wsdlDocumentLocation
andreferenceParameters
. This method never returnsnull
. - Throws:
IllegalStateException
-- If the
address
,serviceName
andportName
are allnull
. - If the
serviceName
service isnull
and theportName
is NOTnull
. - If the
address
property isnull
and theserviceName
andportName
do not specify a valid endpoint published by the same Java EE application. - If the
serviceName
is NOTnull
and is not present in the specified WSDL. - If the
portName
port is notnull
and it is not present inserviceName
service in the WSDL. - If the
wsdlDocumentLocation
is NOTnull
and does not represent a valid WSDL. - If the
wsdlDocumentLocation
is NOTnull
but wsdli:wsdlLocation's namespace name cannot be got from the available metadata.
- If the
WebServiceException
- If an error occurs while creating theW3CEndpointReference
.- Since:
- 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.Provider
implementations 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 thefeatures
parameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- 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.Provider
implementations 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 thefeatures
parameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- 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.Provider
implementations 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 thefeatures
parameter will have their default values.- Returns:
- The newly created endpoint.
- Since:
- JAX-WS 2.2
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-javax/xml/ws/spi/Provider.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.