Author: david.lloyd(a)jboss.com
Date: 2008-11-14 20:05:49 -0500 (Fri, 14 Nov 2008)
New Revision: 4690
Modified:
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/NamedServiceRegistry.java
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/QualifiedName.java
remoting3/trunk/build.xml
Log:
api no longer depends on util
Modified:
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/NamedServiceRegistry.java
===================================================================
---
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/NamedServiceRegistry.java 2008-11-15
00:46:59 UTC (rev 4689)
+++
remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/NamedServiceRegistry.java 2008-11-15
01:05:49 UTC (rev 4690)
@@ -23,11 +23,11 @@
package org.jboss.remoting.spi;
import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.Map;
import java.util.Set;
import java.util.Collections;
import java.io.IOException;
-import org.jboss.remoting.util.CollectionUtil;
import org.jboss.remoting.ServiceRegistrationException;
import org.jboss.remoting.CloseHandler;
import org.jboss.xnio.IoUtils;
@@ -39,7 +39,7 @@
public final class NamedServiceRegistry {
public static final Logger log =
Logger.getLogger("org.jboss.remoting.named-registry");
- private final ConcurrentMap<QualifiedName, Handle<RequestHandlerSource>>
map = CollectionUtil.concurrentMap();
+ private final ConcurrentMap<QualifiedName, Handle<RequestHandlerSource>>
map = new ConcurrentHashMap<QualifiedName, Handle<RequestHandlerSource>>();
public NamedServiceRegistry() {
}
Modified: remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/QualifiedName.java
===================================================================
--- remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/QualifiedName.java 2008-11-15
00:46:59 UTC (rev 4689)
+++ remoting3/trunk/api/src/main/java/org/jboss/remoting/spi/QualifiedName.java 2008-11-15
01:05:49 UTC (rev 4690)
@@ -30,7 +30,6 @@
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.io.UnsupportedEncodingException;
-import org.jboss.remoting.util.CollectionUtil;
/**
*
@@ -101,18 +100,20 @@
public static QualifiedName parse(String path) {
List<String> decoded = new ArrayList<String>();
- boolean first = true;
- for (String segment : CollectionUtil.split("/", path)) {
- if (first) {
- if (segment.length() > 0) {
- throw new IllegalArgumentException("Relative paths are not
allowed");
- }
- first = false;
- continue;
- } else {
- if (segment.length() == 0) {
- throw new IllegalArgumentException("Empty segment in
path");
- }
+ final int len = path.length();
+ if (len < 1) {
+ throw new IllegalArgumentException("Empty path");
+ }
+ if (path.charAt(0) != '/') {
+ throw new IllegalArgumentException("Relative paths are not
allowed");
+ }
+ int segStart = 0;
+ int segEnd;
+ do {
+ segEnd = path.indexOf('/', segStart + 1);
+ String segment = segEnd == -1 ? path.substring(segStart + 1) :
path.substring(segStart + 1, segEnd);
+ if (segment.length() == 0) {
+ throw new IllegalArgumentException(segEnd == -1 ? "Invalid trailing
slash" : "Empty segment in path");
}
try {
decoded.add(URLDecoder.decode(segment, "utf-8"));
@@ -120,7 +121,8 @@
// cannot happen
throw new IllegalStateException(e);
}
- }
+ segStart = segEnd;
+ } while (segEnd != -1);
return new QualifiedName(decoded.toArray(new String[decoded.size()]));
}
Modified: remoting3/trunk/build.xml
===================================================================
--- remoting3/trunk/build.xml 2008-11-15 00:46:59 UTC (rev 4689)
+++ remoting3/trunk/build.xml 2008-11-15 01:05:49 UTC (rev 4690)
@@ -252,7 +252,6 @@
<classpath>
<pathelement location="${lib.marshalling-api.local}"/>
<pathelement location="${lib.xnio-api.local}"/>
- <path refid="util.classpath"/>
</classpath>
</javac>
<touch file="api/target/main/.lastcompile"
verbose="false"/>
@@ -305,7 +304,6 @@
<classpath>
<path refid="api.classpath"/>
<path refid="testing-support.classpath"/>
- <path refid="util.classpath"/>
<pathelement location="api/target/test/classes"/>
<pathelement location="${lib.junit.local}"/>
<pathelement location="${lib.marshalling-api.local}"/>
@@ -337,7 +335,7 @@
<delete dir="api/target"/>
</target>
- <target name="api" description="Build the API module"
depends="lib.marshalling-api,lib.xnio-api,util,api.compile">
+ <target name="api" description="Build the API module"
depends="lib.marshalling-api,lib.xnio-api,api.compile">
<path id="api.classpath">
<pathelement location="api/target/main/classes"/>
</path>
@@ -1079,9 +1077,6 @@
<zipfileset dir="transporter/target/main/classes">
<include name="**/*.class"/>
</zipfileset>
- <zipfileset dir="util/target/main/classes">
- <include name="**/*.class"/>
- </zipfileset>
</jar>
</target>
Show replies by date