Package javax.xml.rpc
Class ServiceFactory
java.lang.Object
javax.xml.rpc.ServiceFactory
The
javax.xml.rpc.ServiceFactory is an abstract class
that provides a factory for the creation of instances of the type
javax.xml.rpc.Service. This abstract class follows the
abstract static factory design pattern. This enables a J2SE based
client to create a Service instance in a portable manner
without using the constructor of the Service
implementation class.
The ServiceFactory implementation class is set using the
system property SERVICEFACTORY_PROPERTY.
- Version:
- 1.1
- Author:
- Rahul Sharma, Roberto Chinnici
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA constant representing the property used to lookup the name of aServiceFactoryimplementation class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ServicecreateService(URL wsdlDocumentLocation, QName serviceName) Create aServiceinstance.abstract ServicecreateService(QName serviceName) Create aServiceinstance.abstract ServiceloadService(Class serviceInterface) Create an instance of the generated service implementation class for a given service interface, if available.abstract ServiceloadService(URL wsdlDocumentLocation, Class serviceInterface, Properties properties) Create an instance of the generated service implementation class for a given service interface, if available.abstract ServiceloadService(URL wsdlDocumentLocation, QName serviceName, Properties properties) Create an instance of the generated service implementation class for a given service, if available.static ServiceFactoryGets an instance of theServiceFactory
-
Field Details
-
SERVICEFACTORY_PROPERTY
A constant representing the property used to lookup the name of aServiceFactoryimplementation class.- See Also:
-
-
Constructor Details
-
ServiceFactory
protected ServiceFactory()
-
-
Method Details
-
newInstance
Gets an instance of theServiceFactoryOnly one copy of a factory exists and is returned to the application each time this method is called.
The implementation class to be used can be overridden by setting the javax.xml.rpc.ServiceFactory system property.
- Returns:
- the ServiceFactory
- Throws:
ServiceException- if a ServiceFactory could not be created
-
createService
public abstract Service createService(URL wsdlDocumentLocation, QName serviceName) throws ServiceException Create aServiceinstance.- Parameters:
wsdlDocumentLocation- URL for the WSDL document location for the serviceserviceName- QName for the service- Returns:
- the new service
- Throws:
ServiceException- If any error in creation of the specified service
-
createService
Create aServiceinstance.- Parameters:
serviceName- QName for the service- Returns:
- the new service
- Throws:
ServiceException- If any error in creation of the specified service
-
loadService
Create an instance of the generated service implementation class for a given service interface, if available.- Parameters:
serviceInterface- Service interface- Returns:
- the new service
- Throws:
ServiceException- If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located
-
loadService
public abstract Service loadService(URL wsdlDocumentLocation, Class serviceInterface, Properties properties) throws ServiceException Create an instance of the generated service implementation class for a given service interface, if available. An implementation may use the providedwsdlDocumentLocationandpropertiesto help locate the generated implementation class. If no such class is present, aServiceExceptionwill be thrown.- Parameters:
wsdlDocumentLocation- URL for the WSDL document location for the service or nullserviceInterface- Service interfaceproperties- A set of implementation-specific properties to help locate the generated service implementation class- Returns:
- the new service
- Throws:
ServiceException- If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located
-
loadService
public abstract Service loadService(URL wsdlDocumentLocation, QName serviceName, Properties properties) throws ServiceException Create an instance of the generated service implementation class for a given service, if available. The service is uniquely identified by thewsdlDocumentLocationandserviceNamearguments. An implementation may use the providedpropertiesto help locate the generated implementation class. If no such class is present, aServiceExceptionwill be thrown.- Parameters:
wsdlDocumentLocation- URL for the WSDL document location for the service or nullserviceName- Qualified name for the serviceproperties- A set of implementation-specific properties to help locate the generated service implementation class- Returns:
- the new service
- Throws:
ServiceException- If there is any error while creating the specified service, including the case where a generated service implementation class cannot be located
-