⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wsdddeployment.java

📁 Java有关XML编程需要用到axis 的源代码 把里面bin下的包导入相应的Java工程 进行使用
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            // that does this for us.            //log.debug("start creating sf and df");            if (mapping.getSerializerName() != null &&                    !mapping.getSerializerName().equals("")) {                ser = BaseSerializerFactory.createFactory(mapping.getSerializer(),                        mapping.getLanguageSpecificType(),                        mapping.getQName());            }            if ((mapping instanceof WSDDArrayMapping) && (ser instanceof ArraySerializerFactory)) {                WSDDArrayMapping am = (WSDDArrayMapping) mapping;                ArraySerializerFactory factory = (ArraySerializerFactory) ser;                factory.setComponentType(am.getInnerType());            }            //log.debug("set ser factory");            if (mapping.getDeserializerName() != null &&                    !mapping.getDeserializerName().equals("")) {                deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(),                        mapping.getLanguageSpecificType(),                        mapping.getQName());            }            //log.debug("set dser factory");            tm.register(mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser);            //log.debug("registered");        } catch (ClassNotFoundException e) {            log.error(Messages.getMessage("unabletoDeployTypemapping00", mapping.getQName().toString()), e);            throw new WSDDNonFatalException(e);        } catch (Exception e) {            throw new WSDDException(e);        }    }    public void writeToContext(SerializationContext context)            throws IOException {        context.registerPrefixForURI(NS_PREFIX_WSDD, URI_WSDD);        context.registerPrefixForURI(NS_PREFIX_WSDD_JAVA, URI_WSDD_JAVA);        context.startElement(QNAME_DEPLOY, null);        if (globalConfig != null) {            globalConfig.writeToContext(context);        }        Iterator i = handlers.values().iterator();        while (i.hasNext()) {            WSDDHandler handler = (WSDDHandler) i.next();            handler.writeToContext(context);        }        i = services.values().iterator();        while (i.hasNext()) {            WSDDService service = (WSDDService) i.next();            service.writeToContext(context);        }        i = transports.values().iterator();        while (i.hasNext()) {            WSDDTransport transport = (WSDDTransport) i.next();            transport.writeToContext(context);        }        i = typeMappings.values().iterator();        while (i.hasNext()) {            WSDDTypeMapping mapping = (WSDDTypeMapping) i.next();            mapping.writeToContext(context);        }        context.endElement();    }    /**     * Get our global configuration     *     * @return a global configuration object     */    public WSDDGlobalConfiguration getGlobalConfiguration() {        return globalConfig;    }    public void setGlobalConfiguration(WSDDGlobalConfiguration globalConfig) {        this.globalConfig = globalConfig;    }    /**     * @return an array of type mappings in this deployment     */    public WSDDTypeMapping[] getTypeMappings() {        WSDDTypeMapping[] t = new WSDDTypeMapping[typeMappings.size()];        typeMappings.values().toArray(t);        return t;    }    /**     * Return an array of the services in this deployment     */    public WSDDService[] getServices() {        WSDDService [] serviceArray = new WSDDService[services.size()];        services.values().toArray(serviceArray);        return serviceArray;    }    /**     * Return the WSDD description for a given named service     */    public WSDDService getWSDDService(QName qname) {        return (WSDDService) services.get(qname);    }    /**     * Return an instance of the named handler.     *     * @param name the name of the handler to get     * @return an Axis handler with the specified QName or null of not found     */    public Handler getHandler(QName name) throws ConfigurationException {        WSDDHandler h = (WSDDHandler) handlers.get(name);        if (h != null) {            return h.getInstance(this);        }        return null;    }    /**     * Retrieve an instance of the named transport.     *     * @param name the <code>QName</code> of the transport     * @return a <code>Handler</code> implementing the transport     * @throws ConfigurationException if there was an error resolving the     *                                transport     */    public Handler getTransport(QName name) throws ConfigurationException {        WSDDTransport t = (WSDDTransport) transports.get(name);        if (t != null) {            return t.getInstance(this);        }        return null;    }    /**     * Retrieve an instance of the named service.     *     * @param name the <code>QName</code> identifying the     *             <code>Service</code>     * @return the <code>Service</code> associated with <code>qname</code>     * @throws ConfigurationException if there was an error resolving the     *                                qname     */    public SOAPService getService(QName name) throws ConfigurationException {        WSDDService s = (WSDDService) services.get(name);        if (s != null) {            return (SOAPService) s.getInstance(this);        }        return null;    }    public SOAPService getServiceByNamespaceURI(String namespace)            throws ConfigurationException {        WSDDService s = (WSDDService) namespaceToServices.get(namespace);        if (s != null) {            return (SOAPService) s.getInstance(this);        }        return null;    }    public void configureEngine(AxisEngine engine)            throws ConfigurationException {        this.engine = engine;    }    public void writeEngineConfig(AxisEngine engine) throws ConfigurationException {    }    TypeMappingRegistry tmr = new TypeMappingRegistryImpl();    public TypeMapping getTypeMapping(String encodingStyle) throws ConfigurationException {        return (TypeMapping) getTypeMappingRegistry().getTypeMapping(encodingStyle);    }    private boolean tmrDeployed = false;    public TypeMappingRegistry getTypeMappingRegistry() throws ConfigurationException {        if (false == tmrDeployed) {            Iterator i = typeMappings.values().iterator();            while (i.hasNext()) {                WSDDTypeMapping mapping = (WSDDTypeMapping) i.next();                deployMapping(mapping);            }            tmrDeployed = true;        }        return tmr;    }    public Handler getGlobalRequest() throws ConfigurationException {        if (globalConfig != null) {            WSDDRequestFlow reqFlow = globalConfig.getRequestFlow();            if (reqFlow != null)                return reqFlow.getInstance(this);        }        return null;    }    public Handler getGlobalResponse() throws ConfigurationException {        if (globalConfig != null) {            WSDDResponseFlow respFlow = globalConfig.getResponseFlow();            if (respFlow != null)                return respFlow.getInstance(this);        }        return null;    }    public Hashtable getGlobalOptions() throws ConfigurationException {        return globalConfig.getParametersTable();    }    public List getRoles() {        return globalConfig == null ? new ArrayList() : globalConfig.getRoles();    }    /**     * Get an enumeration of the services deployed to this engine     */    public Iterator  getDeployedServices() throws ConfigurationException {        ArrayList serviceDescs = new ArrayList();        for (Iterator i = services.values().iterator(); i.hasNext();) {            WSDDService service = (WSDDService) i.next();            try {                service.makeNewInstance(this);                serviceDescs.add(service.getServiceDesc());            } catch (WSDDNonFatalException ex) {                // If it's non-fatal, just keep on going                log.info(Messages.getMessage("ignoringNonFatalException00"), ex);            }        }        return serviceDescs.iterator();    }    /**     * Register a particular namepsace which maps to a given WSDDService.     * This will be used for namespace-based dispatching.     *     * @param namespace a namespace URI     * @param service   the target WSDDService     */    public void registerNamespaceForService(String namespace,                                            WSDDService service) {        namespaceToServices.put(namespace, service);    }    /**     * Remove a namespace -> WSDDService mapping.     *     * @param namespace the namespace URI to unmap     */    public void removeNamespaceMapping(String namespace) {        namespaceToServices.remove(namespace);    }    public AxisEngine getEngine() {        return engine;    }    public WSDDDeployment getDeployment() {        return this;    }    public WSDDHandler[] getHandlers() {        WSDDHandler [] handlerArray = new WSDDHandler[handlers.size()];        handlers.values().toArray(handlerArray);        return handlerArray;    }    public WSDDHandler getWSDDHandler(QName qname) {        return (WSDDHandler) handlers.get(qname);    }    public WSDDTransport[] getTransports() {        WSDDTransport [] transportArray = new WSDDTransport[transports.size()];        transports.values().toArray(transportArray);        return transportArray;    }    public WSDDTransport getWSDDTransport(QName qname) {        return (WSDDTransport) transports.get(qname);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -