View Javadoc

    1   package org.codehaus.xfire.soap;
    2
    3   import java.util.HashMap;
    4   import java.util.Iterator;
    5   import java.util.Map;
    6
    7   /***
    8    * @author <a href="mailto:dan@envoisolutions.com">Dan Diephouse</a>
    9    */
    10  public class SoapVersionFactory
    11  {
    12      private static SoapVersionFactory factory = new SoapVersionFactory();
    13
    14      static
    15      {
    16          getInstance().register(Soap11.getInstance());
    17          getInstance().register(Soap12.getInstance());
    18      }
    19
    20      private Map versions = new HashMap();
    21
    22      public static SoapVersionFactory getInstance()
    23      {
    24          return factory;
    25      }
    26
    27      public SoapVersion getSoapVersion(String namespace)
    28      {
    29          return (SoapVersion) versions.get(namespace);
    30      }
    31
    32      public void register(SoapVersion version)
    33      {
    34          versions.put(version.getNamespace(), version);
    35      }
    36
    37      public Iterator getVersions()
    38      {
    39          return versions.values().iterator();
    40      }
    41  }