PageRenderTime 53ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/gcc-3.2.3-20040701/libjava/java/security/Provider.java

#
Java | 167 lines | 44 code | 13 blank | 110 comment | 0 complexity | ad2ad4d0a2116d97e9d90c1aa61f31bc MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, LGPL-2.0, CC-BY-SA-3.0
  1. /* Provider.java -- Security provider information
  2. Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package java.security;
  32. import java.io.Serializable;
  33. import java.util.Properties;
  34. /**
  35. * This class represents a Java security architecture service provider.
  36. * The services provided by a such a provider can range from security
  37. * algorithms to key generation.
  38. * <p>
  39. * Providers are installed by name and verion number. There is one
  40. * standard provider supplied with the class library. This is the
  41. * "GNU" provider, which can also be accessed by the alias "SUN" for
  42. * compatibility with the JDK.
  43. *
  44. * @version 0.0
  45. *
  46. * @author Aaron M. Renn (arenn@urbanophile.com)
  47. */
  48. public abstract class Provider extends Properties implements Serializable
  49. {
  50. /**
  51. * This is a textual description of the provider
  52. */
  53. private String info;
  54. /**
  55. * This is the name of the provider
  56. */
  57. private String name;
  58. /**
  59. * This is the version number of the provider
  60. */
  61. private double version;
  62. /**
  63. * This method initializes a new instance of <code>Provider</code> to have
  64. * the specified name, version, and description information.
  65. *
  66. * @param name The name to assign to this <code>Provider</code>.
  67. * @param version The version number for this <code>Provider</code>.
  68. * @param info A textual description of this provider.
  69. */
  70. protected Provider(String name, double version, String info)
  71. {
  72. this.name = name;
  73. this.version = version;
  74. this.info = info;
  75. }
  76. /**
  77. * This method returns the name assigned to this <code>Provider</code>.
  78. *
  79. * @return The <code>Provider</code>'s name.
  80. */
  81. public String getName()
  82. {
  83. return (name);
  84. }
  85. /**
  86. * This method retunrs the version number of this <code>Provider</code>.
  87. *
  88. * @return The <code>Provider</code>'s version number.
  89. */
  90. public double getVersion()
  91. {
  92. return (version);
  93. }
  94. /**
  95. * This method returns a textual description of the <code>Provider</code>.
  96. *
  97. * @return A description of the <code>Provider</code>.
  98. */
  99. public String getInfo()
  100. {
  101. return (info);
  102. }
  103. /**
  104. * This method sets the specified key to have the specified value.
  105. *
  106. * @param key The property key
  107. * @param value The property value
  108. *
  109. * @return The previous value for this key, or <code>null</code> if no previous value.
  110. */
  111. public Object put(Object key, Object value)
  112. {
  113. return (super.put(key, value));
  114. }
  115. /**
  116. * This method removes the specified key entry (and its associated value)
  117. * from the property mapping list.
  118. *
  119. * @param key The key to remove
  120. *
  121. * @return The previous value for this key, or <code>null</code> if no previous value.
  122. */
  123. public Object remove(Object key)
  124. {
  125. return (super.remove(key));
  126. }
  127. /**
  128. * This method clears the entire property list such that it no longer
  129. * contains the properties used to look up the services provided by
  130. * the <code>Provider</code>.
  131. */
  132. public void clear()
  133. {
  134. super.clear();
  135. }
  136. /**
  137. * This method returns a <code>String</code> representation of this
  138. * object. This will include the <code>Provider</code> name and
  139. * version number.
  140. *
  141. * @return A <code>String</code> representation of this object.
  142. */
  143. public String toString()
  144. {
  145. return (getClass().getName() + ": name=" + getName() + " version=" +
  146. version);
  147. }
  148. }