Author: gtrasuk
Date: Mon Jul 4 04:47:44 2011
New Revision: 1142542
URL: http://svn.apache.org/viewvc?rev=1142542&view=rev
Log:
Some ongoing work on classloading.
Modified:
river/jtsk/skunk/surrogate/nbproject/project.properties
river/jtsk/skunk/surrogate/src/org/apache/river/container/classloading/ClasspathFilter.java
river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java
river/jtsk/skunk/surrogate/test/org/apache/river/container/classloading/ClasspathFilterParserTest.java
Modified: river/jtsk/skunk/surrogate/nbproject/project.properties
URL:
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/nbproject/project.properties?rev=1142542&r1=1142541&r2=1142542&view=diff
==============================================================================
--- river/jtsk/skunk/surrogate/nbproject/project.properties (original)
+++ river/jtsk/skunk/surrogate/nbproject/project.properties Mon Jul 4 04:47:44
2011
@@ -1,91 +1,92 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=surrogate
-application.vendor=trasukg
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/RiverSurrogate.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-#endorsed.classpath=\
-# ${libs.JAXB-ENDORSED.classpath}
-excludes=
-includes=**
-jar.archive.disabled=${jnlp.enabled}
-jar.compress=false
-jar.index=${jnlp.enabled}
-javac.classpath=\
- ${libs.ApacheRiverPlatform.classpath}:\
- ${libs.ApacheRiverLib.classpath}:\
- ${libs.ApacheCommonsLogging-1_1_1.classpath}:\
- ${libs.ApacheCommonsVFS-1_0.classpath}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}:\
- ${libs.JavaCC.classpath}:\
- ${libs.jaxb.classpath}
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}:\
- ${libs.junit_4.classpath}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-jaxbwiz.gensrc.classpath=${libs.jaxb.classpath}
-jaxbwiz.xjcdef.classpath=${libs.jaxb.classpath}
-jaxbwiz.xjcrun.classpath=${libs.jaxb.classpath}
-jnlp.codebase.type=no.codebase
-jnlp.descriptor=application
-jnlp.enabled=false
-jnlp.mixed.code=defaut
-jnlp.offline-allowed=false
-jnlp.signed=false
-main.class=org.apache.river.container.Bootstrap
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-platform.active=default_platform
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value
instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-run.jvmargs=
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
+annotation.processing.enabled=true
+annotation.processing.enabled.in.editor=false
+annotation.processing.run.all.processors=true
+annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
+application.title=surrogate
+application.vendor=trasukg
+build.classes.dir=${build.dir}/classes
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/RiverSurrogate.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+#endorsed.classpath=\
+# ${libs.JAXB-ENDORSED.classpath}
+excludes=
+includes=**
+jar.archive.disabled=${jnlp.enabled}
+jar.compress=false
+jar.index=${jnlp.enabled}
+javac.classpath=\
+ ${libs.ApacheRiverPlatform.classpath}:\
+ ${libs.ApacheRiverLib.classpath}:\
+ ${libs.ApacheCommonsLogging-1_1_1.classpath}:\
+ ${libs.ApacheCommonsVFS-1_0.classpath}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.processorpath=\
+ ${javac.classpath}:\
+ ${libs.JavaCC.classpath}:\
+ ${libs.jaxb.classpath}
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit_4.classpath}
+javac.test.processorpath=\
+ ${javac.test.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jaxbwiz.gensrc.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcdef.classpath=${libs.jaxb.classpath}
+jaxbwiz.xjcrun.classpath=${libs.jaxb.classpath}
+jnlp.codebase.type=no.codebase
+jnlp.descriptor=application
+jnlp.enabled=false
+jnlp.mixed.code=defaut
+jnlp.offline-allowed=false
+jnlp.signed=false
+main.class=org.apache.river.container.Bootstrap
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+platform.active=default_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.ApacheRiverServices.classpath}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value
instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
Modified:
river/jtsk/skunk/surrogate/src/org/apache/river/container/classloading/ClasspathFilter.java
URL:
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/classloading/ClasspathFilter.java?rev=1142542&r1=1142541&r2=1142542&view=diff
==============================================================================
---
river/jtsk/skunk/surrogate/src/org/apache/river/container/classloading/ClasspathFilter.java
(original)
+++
river/jtsk/skunk/surrogate/src/org/apache/river/container/classloading/ClasspathFilter.java
Mon Jul 4 04:47:44 2011
@@ -41,4 +41,13 @@ public class ClasspathFilter {
public List<String> getAcceptConditions() {
return acceptConditions;
}
+
+ public boolean acceptsClass(String className) {
+ for (String s:acceptConditions ) {
+ if (s.equals(className)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified:
river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java
URL:
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java?rev=1142542&r1=1142541&r2=1142542&view=diff
==============================================================================
---
river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java
(original)
+++
river/jtsk/skunk/surrogate/src/org/apache/river/container/hsm/StateMachineImpl.java
Mon Jul 4 04:47:44 2011
@@ -69,6 +69,13 @@ class StateMachineImpl implements StateM
populateClassInfo(classInfo);
processSubstates(classInfo, eventInterface);
buildMethodMap(eventInterface, classInfo);
+ /*
+ TODO: We can modify the state table build process so that we verify
+ that for any state or combination of states, if the interface method
+ returns a value, there should be only one event handler method that
+ returns a value,even though there may be others that are flagged
+ as void.
+ */
}
private void buildMethodMap(Class eventInterface, ClassInfo classInfo)
throws SecurityException {
Modified:
river/jtsk/skunk/surrogate/test/org/apache/river/container/classloading/ClasspathFilterParserTest.java
URL:
http://svn.apache.org/viewvc/river/jtsk/skunk/surrogate/test/org/apache/river/container/classloading/ClasspathFilterParserTest.java?rev=1142542&r1=1142541&r2=1142542&view=diff
==============================================================================
---
river/jtsk/skunk/surrogate/test/org/apache/river/container/classloading/ClasspathFilterParserTest.java
(original)
+++
river/jtsk/skunk/surrogate/test/org/apache/river/container/classloading/ClasspathFilterParserTest.java
Mon Jul 4 04:47:44 2011
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.river.container.classloading;
import java.util.List;
@@ -51,13 +50,51 @@ public class ClasspathFilterParserTest {
public void tearDown() {
}
+ /**
+ Does basic test on parsing of the jar specification.
+ Syntax is name.jar(classToServe).
+ @throws Exception
+ */
@Test
public void testParser() throws Exception {
- ClasspathFilterBuilder UUT=new ClasspathFilterBuilder();
- ClasspathFilter cpf=UUT.parseToFilter("reggie.jar(org.apache.Abc)");
+ ClasspathFilterBuilder UUT = new ClasspathFilterBuilder();
+ ClasspathFilter cpf = UUT.parseToFilter("reggie.jar(org.apache.Abc)");
assertEquals("reggie.jar", cpf.getJarName());
- List<String> actual=cpf.getAcceptConditions();
+ List<String> actual = cpf.getAcceptConditions();
assertEquals("Wrong number of filter clauses.", 1, actual.size());
assertEquals("Filter condition", "org.apache.Abc", actual.get(0));
}
-}
\ No newline at end of file
+
+ /**
+ Does basic test on parsing of the jar specification.
+ Syntax is name.jar(classToServe).
+ @throws Exception
+ */
+ @Test
+ public void testParserOnMultipleClasses() throws Exception {
+ ClasspathFilterBuilder UUT = new ClasspathFilterBuilder();
+ String jarSpec = "reggie.jar(org.apache.ABC, org.apache.DEF)";
+ ClasspathFilter cpf = UUT.parseToFilter(jarSpec);
+ assertEquals("reggie.jar", cpf.getJarName());
+ List<String> actual = cpf.getAcceptConditions();
+ assertEquals("Wrong number of filter clauses.", 2, actual.size());
+ assertEquals("Filter condition", "org.apache.ABC", actual.get(0));
+ assertEquals("Filter condition", "org.apache.DEF", actual.get(1));
+ }
+
+ /**
+ Does basic test on parsing of the jar specification.
+ Syntax is name.jar(classToServe).
+ @throws Exception
+ */
+ @Test
+ public void testFilterAcceptance() throws Exception {
+ ClasspathFilterBuilder UUT = new ClasspathFilterBuilder();
+ String jarSpec = "reggie.jar(org.apache.ABC, org.apache.DEF)";
+ ClasspathFilter cpf = UUT.parseToFilter(jarSpec);
+ assertEquals("reggie.jar", cpf.getJarName());
+ assertTrue(cpf.acceptsClass("org.apache.ABC"));
+ assertFalse(cpf.acceptsClass("org,apache.XYZ"));
+ assertTrue(cpf.acceptsClass("org.apache.DEF"));
+ }
+}