org.jboss.wsf.spi.util
Class ServiceLoader

java.lang.Object
  extended by org.jboss.wsf.spi.util.ServiceLoader

public abstract class ServiceLoader
extends java.lang.Object

Load a service class using this ordered lookup procedure

Since:
14-Dec-2006
Author:
Thomas.Diesler@jboss.com

Constructor Summary
ServiceLoader()
           
 
Method Summary
static java.lang.Object loadFromPropertiesFile(java.lang.String propertyName, java.lang.String defaultFactory)
          Use the properties file "${java.home}/lib/jaxws.properties" in the JRE directory.
static java.lang.Object loadFromServices(java.lang.String propertyName, java.lang.String defaultFactory)
          Use the Services API (as detailed in the JAR specification), if available, to determine the classname.
static java.lang.Object loadFromSystemProperty(java.lang.String propertyName, java.lang.String defaultFactory)
          Use the system property
static java.lang.Object loadService(java.lang.String propertyName, java.lang.String defaultFactory)
          This method uses the algorithm below using the JAXWS Provider as an example.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceLoader

public ServiceLoader()
Method Detail

loadService

public static java.lang.Object loadService(java.lang.String propertyName,
                                           java.lang.String defaultFactory)
This method uses the algorithm below using the JAXWS Provider as an example. 1. 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. 2. 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 is javax.xml.ws.spi.Provider, then the value of that entry is used as the name of the implementation class. 3. 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. 4. Finally, a default implementation class name is used.


loadFromServices

public static java.lang.Object loadFromServices(java.lang.String propertyName,
                                                java.lang.String defaultFactory)
Use the Services API (as detailed in the JAR specification), if available, to determine the classname.


loadFromSystemProperty

public static java.lang.Object loadFromSystemProperty(java.lang.String propertyName,
                                                      java.lang.String defaultFactory)
Use the system property


loadFromPropertiesFile

public static java.lang.Object loadFromPropertiesFile(java.lang.String propertyName,
                                                      java.lang.String defaultFactory)
Use the properties file "${java.home}/lib/jaxws.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.



Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.