Package javax.xml.rpc

Class ServiceFactory


  • public abstract class ServiceFactory
    extends java.lang.Object
    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
    See Also:
    Service
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String DEFAULT_SERVICEFACTORY
      A constant representing the name of the default ServiceFactory implementation class.
      static java.lang.String SERVICEFACTORY_PROPERTY
      A constant representing the property used to lookup the name of a ServiceFactory implementation class.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ServiceFactory()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract Service createService​(java.net.URL wsdlDocumentLocation, javax.xml.namespace.QName serviceName)
      Create a Service instance.
      abstract Service createService​(javax.xml.namespace.QName serviceName)
      Create a Service instance.
      abstract Service loadService​(java.lang.Class serviceInterface)
      Create an instance of the generated service implementation class for a given service interface, if available.
      abstract Service loadService​(java.net.URL wsdlDocumentLocation, java.lang.Class serviceInterface, java.util.Properties properties)
      Create an instance of the generated service implementation class for a given service interface, if available.
      abstract Service loadService​(java.net.URL wsdlDocumentLocation, javax.xml.namespace.QName serviceName, java.util.Properties properties)
      Create an instance of the generated service implementation class for a given service, if available.
      static ServiceFactory newInstance()
      Gets an instance of the ServiceFactory
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SERVICEFACTORY_PROPERTY

        public static final java.lang.String SERVICEFACTORY_PROPERTY
        A constant representing the property used to lookup the name of a ServiceFactory implementation class.
        See Also:
        Constant Field Values
      • DEFAULT_SERVICEFACTORY

        private static final java.lang.String DEFAULT_SERVICEFACTORY
        A constant representing the name of the default ServiceFactory implementation class.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ServiceFactory

        protected ServiceFactory()
    • Method Detail

      • newInstance

        public static ServiceFactory newInstance()
                                          throws ServiceException
        Gets an instance of the ServiceFactory

        Only 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​(java.net.URL wsdlDocumentLocation,
                                              javax.xml.namespace.QName serviceName)
                                       throws ServiceException
        Create a Service instance.
        Parameters:
        wsdlDocumentLocation - URL for the WSDL document location for the service
        serviceName - QName for the service
        Returns:
        the new service
        Throws:
        ServiceException - If any error in creation of the specified service
      • createService

        public abstract Service createService​(javax.xml.namespace.QName serviceName)
                                       throws ServiceException
        Create a Service instance.
        Parameters:
        serviceName - QName for the service
        Returns:
        the new service
        Throws:
        ServiceException - If any error in creation of the specified service
      • loadService

        public abstract Service loadService​(java.lang.Class serviceInterface)
                                     throws ServiceException
        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​(java.net.URL wsdlDocumentLocation,
                                            java.lang.Class serviceInterface,
                                            java.util.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 provided wsdlDocumentLocation and properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.
        Parameters:
        wsdlDocumentLocation - URL for the WSDL document location for the service or null
        serviceInterface - Service interface
        properties - 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​(java.net.URL wsdlDocumentLocation,
                                            javax.xml.namespace.QName serviceName,
                                            java.util.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 the wsdlDocumentLocation and serviceName arguments. An implementation may use the provided properties to help locate the generated implementation class. If no such class is present, a ServiceException will be thrown.
        Parameters:
        wsdlDocumentLocation - URL for the WSDL document location for the service or null
        serviceName - Qualified name for the service
        properties - 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