FileDocCategorySizeDatePackage
WSDDProvider.javaAPI DocApache Axis 1.46520Sat Apr 22 18:57:28 BST 2006org.apache.axis.deployment.wsdd

WSDDProvider

public abstract class WSDDProvider extends Object
WSDD provider element Represents the liason to the application being exposed as a Web Service. Specific provider extension classes must be registered by namespace URI.
author
James Snell
author
Vishy Kasar

Fields Summary
protected static Log
log
private static final String
PLUGABLE_PROVIDER_FILENAME
private static Hashtable
providers
XXX
Constructors Summary
Methods Summary
public static org.apache.axis.HandlergetInstance(javax.xml.namespace.QName providerType, WSDDService service, org.apache.axis.EngineConfiguration registry)

param
registry XXX
return
XXX
throws
Exception XXX

        if (providerType == null)
            throw new WSDDException(Messages.getMessage("nullProvider00"));
        
        WSDDProvider provider = (WSDDProvider)providers.get(providerType);
        if (provider == null) {
            throw new WSDDException(Messages.getMessage("noMatchingProvider00",
                                    providerType.toString()));
        }
        
        return provider.newProviderInstance(service, registry);
    
public abstract java.lang.StringgetName()

public WSDDOperationgetOperation(java.lang.String name)

param
name XXX
return
XXX

        return null;
    
public WSDDOperation[]getOperations()

return
XXX

        return null;
    
private static voidloadPluggableProviders()
Look for file META-INF/services/org.apache.axis.deployment.wsdd.Provider in all the JARS, get the classes listed in those files and add them to providers list if they are valid providers. Here is how the scheme would work. A company providing a new provider will jar up their provider related classes in a JAR file. The following file containing the name of the new provider class is also made part of this JAR file. META-INF/services/org.apache.axis.deployment.wsdd.Provider By making this JAR part of the webapp, the new provider will be automatically discovered.


     
        providers.put(WSDDConstants.QNAME_JAVARPC_PROVIDER, new WSDDJavaRPCProvider());
        providers.put(WSDDConstants.QNAME_JAVAMSG_PROVIDER, new WSDDJavaMsgProvider());
        providers.put(WSDDConstants.QNAME_HANDLER_PROVIDER, new WSDDHandlerProvider());
        providers.put(WSDDConstants.QNAME_EJB_PROVIDER, new WSDDJavaEJBProvider());
        providers.put(WSDDConstants.QNAME_COM_PROVIDER, new WSDDComProvider());
        providers.put(WSDDConstants.QNAME_BSF_PROVIDER, new WSDDBsfProvider());
        providers.put(WSDDConstants.QNAME_CORBA_PROVIDER, new WSDDJavaCORBAProvider());
        providers.put(WSDDConstants.QNAME_RMI_PROVIDER, new WSDDJavaRMIProvider());
        try {
            loadPluggableProviders();
        } catch (Throwable t){
            String msg=t + JavaUtils.LS + JavaUtils.stackToString(t);
            log.info(Messages.getMessage("exception01",msg));
        }
    
        ClassLoader clzLoader = WSDDProvider.class.getClassLoader();
        ClassLoaders loaders = new ClassLoaders();
        loaders.put(clzLoader);
        DiscoverServiceNames dsn = new DiscoverServiceNames(loaders);
        ResourceNameIterator iter = dsn.findResourceNames(PLUGABLE_PROVIDER_FILENAME);
        while (iter.hasNext()) {
            String className = iter.nextResourceName();
            try {
                Object o = Class.forName(className).newInstance();
                if (o instanceof WSDDProvider) {
                    WSDDProvider provider = (WSDDProvider) o;
                    String providerName = provider.getName();
                    QName q = new QName(WSDDConstants.URI_WSDD_JAVA, providerName);
                    providers.put(q, provider);
                }
            } catch (Exception e) {
                String msg=e + JavaUtils.LS + JavaUtils.stackToString(e);
                log.info(Messages.getMessage("exception01",msg));
                continue;
            }
        }
    
public abstract org.apache.axis.HandlernewProviderInstance(WSDDService service, org.apache.axis.EngineConfiguration registry)

param
registry XXX
return
XXX
throws
Exception XXX

public static voidregisterProvider(javax.xml.namespace.QName uri, org.apache.axis.deployment.wsdd.WSDDProvider prov)

param
uri XXX
param
prov XXX

        providers.put(uri, prov);