[Mulgara-svn] r1343 - trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed
ronald at mulgara.org
ronald at mulgara.org
Thu Oct 23 13:11:10 UTC 2008
Author: ronald
Date: 2008-10-23 06:11:09 -0700 (Thu, 23 Oct 2008)
New Revision: 1343
Modified:
trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java
Log:
Simplify building of set of supported protocols.
Modified: trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java 2008-10-23 13:11:01 UTC (rev 1342)
+++ trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java 2008-10-23 13:11:09 UTC (rev 1343)
@@ -48,16 +48,8 @@
private Collection<DistributedResolver> openResolvers = new HashSet<DistributedResolver>();
/** Protocols which are handled by the served resolver. */
- private static final String[] protocols = new String[] { "rmi" };
+ private static final Set<String> protocols = new HashSet<String>(Arrays.asList("rmi"));
- /** Set of the handled protocols. */
- private static Set<String> protocolSet = new HashSet<String>();
-
- // initialize the set to contain the elements of the array
- static {
- for (String p: protocols) protocolSet.add(p);
- }
-
/**
* Instantiate a {@link DistributedResolverFactory}.
* @param initializer The system initializer to be registered with.
@@ -72,7 +64,6 @@
// Claim the protocols supported by the resolver, and initialize the local protocol set
for (String p: protocols) {
initializer.addProtocol(p, this);
- protocolSet.add(p);
}
}
@@ -147,6 +138,6 @@
* @return A set of the recognized protocols.
*/
public static Set<String> getProtocols() {
- return protocolSet;
+ return protocols;
}
}
More information about the Mulgara-svn
mailing list