FileDocCategorySizeDatePackage
DirProvider.javaAPI DocApache Axis 1.47419Sat Apr 22 18:57:26 BST 2006org.apache.axis.configuration

DirProvider

public class DirProvider extends Object implements org.apache.axis.WSDDEngineConfiguration

Fields Summary
protected static Log
log
private org.apache.axis.deployment.wsdd.WSDDDeployment
deployment
private String
configFile
private File
dir
private static final String
SERVER_CONFIG_FILE
Constructors Summary
public DirProvider(String basepath)


      
          
        this(basepath, SERVER_CONFIG_FILE);
    
public DirProvider(String basepath, String configFile)

        File dir = new File(basepath);

        /*
         * If the basepath is not a readable directory, throw an internal
         * exception to make it easier to debug setup problems.
         */
        if (!dir.exists() || !dir.isDirectory() || !dir.canRead()) {
            throw new ConfigurationException(Messages.getMessage
                                             ("invalidConfigFilePath",
                                              basepath));
        }

        this.dir = dir;
        this.configFile = configFile;
    
Methods Summary
public voidconfigureEngine(org.apache.axis.AxisEngine engine)

        this.deployment = new WSDDDeployment();
        WSDDGlobalConfiguration config = new WSDDGlobalConfiguration();
        config.setOptionsHashtable(new Hashtable());
        this.deployment.setGlobalConfiguration(config);
        File [] dirs = this.dir.listFiles(new DirFilter());
        for (int i = 0; i < dirs.length; i++) {
            processWSDD(dirs[i]);
        }
        this.deployment.configureEngine(engine);
        engine.refreshGlobalOptions();
    
public java.util.IteratorgetDeployedServices()
Get an enumeration of the services deployed to this engine

        return this.deployment.getDeployedServices();
    
public org.apache.axis.deployment.wsdd.WSDDDeploymentgetDeployment()

        return this.deployment;
    
public java.util.HashtablegetGlobalOptions()
Returns the global configuration options.

        WSDDGlobalConfiguration globalConfig
            = this.deployment.getGlobalConfiguration();
            
        if (globalConfig != null)
            return globalConfig.getParametersTable();

        return null;
    
public org.apache.axis.HandlergetGlobalRequest()
Returns a global request handler.

        return this.deployment.getGlobalRequest();
    
public org.apache.axis.HandlergetGlobalResponse()
Returns a global response handler.

        return this.deployment.getGlobalResponse();
    
public org.apache.axis.HandlergetHandler(javax.xml.namespace.QName qname)
retrieve an instance of the named handler

param
qname XXX
return
XXX
throws
ConfigurationException XXX

        return this.deployment.getHandler(qname);
    
public java.util.ListgetRoles()
Get a list of roles that this engine plays globally. Services within the engine configuration may also add additional roles.

return
a List of the roles for this engine

        return this.deployment.getRoles();
    
public org.apache.axis.handlers.soap.SOAPServicegetService(javax.xml.namespace.QName qname)
retrieve an instance of the named service

param
qname XXX
return
XXX
throws
ConfigurationException XXX

        SOAPService service = this.deployment.getService(qname);
        if (service == null) {
            throw new ConfigurationException(Messages.getMessage("noService10",
                                                           qname.toString()));
        }
        return service;
    
public org.apache.axis.handlers.soap.SOAPServicegetServiceByNamespaceURI(java.lang.String namespace)
Get a service which has been mapped to a particular namespace

param
namespace a namespace URI
return
an instance of the appropriate Service, or null

        return this.deployment.getServiceByNamespaceURI(namespace);
    
public org.apache.axis.HandlergetTransport(javax.xml.namespace.QName qname)
retrieve an instance of the named transport

param
qname XXX
return
XXX
throws
ConfigurationException XXX

        return this.deployment.getTransport(qname);
    
public org.apache.axis.encoding.TypeMappingRegistrygetTypeMappingRegistry()

        return this.deployment.getTypeMappingRegistry();
    
private voidprocessWSDD(java.io.File dir)

        File file = new File(dir, this.configFile);
        if (!file.exists()) {
            return;
        }
        log.debug("Loading service configuration from file: " + file);
        InputStream in = null;
        try {
            in = new FileInputStream(file);
            WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(in));
            doc.deploy(this.deployment);
        } catch (Exception e) {
            throw new ConfigurationException(e);
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (IOException e) {}
            }
        }
    
public voidwriteEngineConfig(org.apache.axis.AxisEngine engine)
Save the engine configuration. In case there's a problem, we write it to a string before saving it out to the actual file so we don't screw up the file.

        // this is not implemented