[jboss-cvs] JBossAS SVN: r57134 - in projects/microcontainer/trunk/osgi-int: . src/main/org/jboss/vfs/bundle src/tests/org/jboss/test/bundle/support/jar2

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 25 09:42:01 EDT 2006


Author: adrian at jboss.org
Date: 2006-09-25 09:41:52 -0400 (Mon, 25 Sep 2006)
New Revision: 57134

Modified:
   projects/microcontainer/trunk/osgi-int/.classpath
   projects/microcontainer/trunk/osgi-int/build.sh
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/BundleClassLoader.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VFSBundle.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VersionRange.java
   projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/support/jar2/ClassInJar2.java
Log:
Make this compile, fix the eclipse build and tidyup the sourcecode.

Modified: projects/microcontainer/trunk/osgi-int/.classpath
===================================================================
--- projects/microcontainer/trunk/osgi-int/.classpath	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/.classpath	2006-09-25 13:41:52 UTC (rev 57134)
@@ -1,18 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" path="src/main"/>
-	<classpathentry output="output/eclipse-classes-tests" kind="src" path="src/tests"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/common/lib/jboss-common.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/javassist/lib/javassist.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/profiler/jvmti/lib/jboss-profiler-jvmti.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-	<classpathentry combineaccessrules="false" kind="src" path="/container"/>
-	<classpathentry kind="lib" path="/thirdparty/osgi/lib/osgi.compendium.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/osgi/lib/osgi.core.jar"/>
-	<classpathentry kind="output" path="output/eclipse-classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main"/>
+	<classpathentry kind="src" path="output/gen-parsers"/>
+	<classpathentry output="output/eclipse-classes-tests" kind="src" path="src/tests"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/common/lib/jboss-common.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/apache-log4j/lib/log4j.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/javassist/lib/javassist.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/profiler/jvmti/lib/jboss-profiler-jvmti.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/test/lib/jboss-test.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/container"/>
+	<classpathentry kind="lib" path="/thirdparty/osgi/lib/osgi.compendium.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/osgi/lib/osgi.core.jar"/>
+	<classpathentry kind="output" path="output/eclipse-classes"/>
+</classpath>

Modified: projects/microcontainer/trunk/osgi-int/build.sh
===================================================================
--- projects/microcontainer/trunk/osgi-int/build.sh	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/build.sh	2006-09-25 13:41:52 UTC (rev 57134)
@@ -1,172 +1,172 @@
-#!/bin/sh
-### ====================================================================== ###
-##                                                                          ##
-##  This is the main entry point for the build system.                      ##
-##                                                                          ##
-##  Users should be sure to execute this file rather than 'ant' to ensure   ##
-##  the correct version is being used with the correct configuration.       ##
-##                                                                          ##
-### ====================================================================== ###
-
-# $Id: build.sh 27983 2005-01-26 22:51:29Z ejort $
-
-PROGNAME=`basename $0`
-DIRNAME=`dirname $0`
-GREP="grep"
-ROOT="/"
-
-# Ignore user's ANT_HOME if it is set
-ANT_HOME=""
-
-# the default search path for ant
-ANT_SEARCH_PATH="\
-    tools
-    tools/ant \
-    tools/apache/ant \
-    ant"
-
-# the default build file name
-ANT_BUILD_FILE="build.xml"
-
-# the default arguments
-ANT_OPTIONS="-find $ANT_BUILD_FILE"
-
-# Use the maximum available, or set MAX_FD != -1 to use that
-MAX_FD="maximum"
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false;
-darwin=false;
-case "`uname`" in
-    CYGWIN*)
-        cygwin=true
-        ;;
-
-    Darwin*)
-        darwin=true
-        ;;
-esac
-
-#
-# Helper to complain.
-#
-die() {
-    echo "${PROGNAME}: $*"
-    exit 1
-}
-
-#
-# Helper to complain.
-#
-warn() {
-    echo "${PROGNAME}: $*"
-}
-
-#
-# Helper to source a file if it exists.
-#
-maybe_source() {
-    for file in $*; do
-	if [ -f "$file" ]; then
-	    . $file
-	fi
-    done
-}
-
-search() {
-    search="$*"
-    for d in $search; do
-	ANT_HOME="`pwd`/$d"
-	ANT="$ANT_HOME/bin/ant"
-	if [ -x "$ANT" ]; then
-	    # found one
-	    echo $ANT_HOME
-	    break
-	fi
-    done
-}
-
-#
-# Main function.
-#
-main() {
-    # if there is a build config file. then source it
-    maybe_source "$DIRNAME/build.conf" "$HOME/.build.conf"
-
-    # Increase the maximum file descriptors if we can
-    if [ $cygwin = "false" ]; then
-	MAX_FD_LIMIT=`ulimit -H -n`
-	if [ $? -eq 0 ]; then
-	    if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
-		# use the system max
-		MAX_FD="$MAX_FD_LIMIT"
-	    fi
-
-	    ulimit -n $MAX_FD
-	    if [ $? -ne 0 ]; then
-		warn "Could not set maximum file descriptor limit: $MAX_FD"
-	    fi
-	else
-	    warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
-	fi
-    fi
-
-    # try the search path
-    ANT_HOME=`search $ANT_SEARCH_PATH`
-
-    # try looking up to root
-    if [ "x$ANT_HOME" = "x" ]; then
-	target="build"
-	_cwd=`pwd`
-
-	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
-	    cd ..
-	    cwd=`pwd`
-	    ANT_HOME=`search $ANT_SEARCH_PATH`
-	done
-
-	# make sure we get back
-	cd $_cwd
-
-	if [ "$cwd" != "$ROOT" ]; then
-	    found="true"
-	fi
-
-	# complain if we did not find anything
-	if [ "$found" != "true" ]; then
-	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
-	fi
-    fi
-
-    # make sure we have one
-    ANT=$ANT_HOME/bin/ant
-    if [ ! -x "$ANT" ]; then
-	die "Ant file is not executable: $ANT"
-    fi
-
-    # need to specify planet57/buildmagic protocol handler package
-    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
-
-    # setup some build properties
-    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
-
-    # change to the directory where the script lives so users are not forced
-    # to be in the same directory as build.xml
-    cd $DIRNAME
-
-    # export some stuff for ant
-    export ANT ANT_HOME ANT_OPTS
-
-    # execute in debug mode, or simply execute
-    if [ "x$ANT_DEBUG" != "x" ]; then
-	/bin/sh -x $ANT $ANT_OPTIONS "$@"
-    else
-	exec $ANT $ANT_OPTIONS "$@"
-    fi
-}
-
-##
-## Bootstrap
-##
-
-main "$@"
+#!/bin/sh
+### ====================================================================== ###
+##                                                                          ##
+##  This is the main entry point for the build system.                      ##
+##                                                                          ##
+##  Users should be sure to execute this file rather than 'ant' to ensure   ##
+##  the correct version is being used with the correct configuration.       ##
+##                                                                          ##
+### ====================================================================== ###
+
+# $Id: build.sh 27983 2005-01-26 22:51:29Z ejort $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+GREP="grep"
+ROOT="/"
+
+# Ignore user's ANT_HOME if it is set
+ANT_HOME=""
+
+# the default search path for ant
+ANT_SEARCH_PATH="\
+    tools
+    tools/ant \
+    tools/apache/ant \
+    ant"
+
+# the default build file name
+ANT_BUILD_FILE="build.xml"
+
+# the default arguments
+ANT_OPTIONS="-find $ANT_BUILD_FILE"
+
+# Use the maximum available, or set MAX_FD != -1 to use that
+MAX_FD="maximum"
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false;
+darwin=false;
+case "`uname`" in
+    CYGWIN*)
+        cygwin=true
+        ;;
+
+    Darwin*)
+        darwin=true
+        ;;
+esac
+
+#
+# Helper to complain.
+#
+die() {
+    echo "${PROGNAME}: $*"
+    exit 1
+}
+
+#
+# Helper to complain.
+#
+warn() {
+    echo "${PROGNAME}: $*"
+}
+
+#
+# Helper to source a file if it exists.
+#
+maybe_source() {
+    for file in $*; do
+	if [ -f "$file" ]; then
+	    . $file
+	fi
+    done
+}
+
+search() {
+    search="$*"
+    for d in $search; do
+	ANT_HOME="`pwd`/$d"
+	ANT="$ANT_HOME/bin/ant"
+	if [ -x "$ANT" ]; then
+	    # found one
+	    echo $ANT_HOME
+	    break
+	fi
+    done
+}
+
+#
+# Main function.
+#
+main() {
+    # if there is a build config file. then source it
+    maybe_source "$DIRNAME/build.conf" "$HOME/.build.conf"
+
+    # Increase the maximum file descriptors if we can
+    if [ $cygwin = "false" ]; then
+	MAX_FD_LIMIT=`ulimit -H -n`
+	if [ $? -eq 0 ]; then
+	    if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
+		# use the system max
+		MAX_FD="$MAX_FD_LIMIT"
+	    fi
+
+	    ulimit -n $MAX_FD
+	    if [ $? -ne 0 ]; then
+		warn "Could not set maximum file descriptor limit: $MAX_FD"
+	    fi
+	else
+	    warn "Could not query system maximum file descriptor limit: $MAX_FD_LIMIT"
+	fi
+    fi
+
+    # try the search path
+    ANT_HOME=`search $ANT_SEARCH_PATH`
+
+    # try looking up to root
+    if [ "x$ANT_HOME" = "x" ]; then
+	target="build"
+	_cwd=`pwd`
+
+	while [ "x$ANT_HOME" = "x" ] && [ "$cwd" != "$ROOT" ]; do
+	    cd ..
+	    cwd=`pwd`
+	    ANT_HOME=`search $ANT_SEARCH_PATH`
+	done
+
+	# make sure we get back
+	cd $_cwd
+
+	if [ "$cwd" != "$ROOT" ]; then
+	    found="true"
+	fi
+
+	# complain if we did not find anything
+	if [ "$found" != "true" ]; then
+	    die "Could not locate Ant; check \$ANT or \$ANT_HOME."
+	fi
+    fi
+
+    # make sure we have one
+    ANT=$ANT_HOME/bin/ant
+    if [ ! -x "$ANT" ]; then
+	die "Ant file is not executable: $ANT"
+    fi
+
+    # need to specify planet57/buildmagic protocol handler package
+    ANT_OPTS="-Djava.protocol.handler.pkgs=org.jboss.net.protocol"
+
+    # setup some build properties
+    ANT_OPTS="$ANT_OPTS -Dbuild.script=$0"
+
+    # change to the directory where the script lives so users are not forced
+    # to be in the same directory as build.xml
+    cd $DIRNAME
+
+    # export some stuff for ant
+    export ANT ANT_HOME ANT_OPTS
+
+    # execute in debug mode, or simply execute
+    if [ "x$ANT_DEBUG" != "x" ]; then
+	/bin/sh -x $ANT $ANT_OPTIONS "$@"
+    else
+	exec $ANT $ANT_OPTIONS "$@"
+    fi
+}
+
+##
+## Bootstrap
+##
+
+main "$@"

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/BundleClassLoader.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/BundleClassLoader.java	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/BundleClassLoader.java	2006-09-25 13:41:52 UTC (rev 57134)
@@ -7,15 +7,11 @@
 
 import org.jboss.classloading.spi.ClassLoadingDomain;
 import org.jboss.classloading.spi.DomainClassLoader;
-import org.jboss.logging.Logger;
 import org.osgi.framework.Bundle;
 
 public class BundleClassLoader extends SecureClassLoader
    implements DomainClassLoader
 {
-
-   private static Logger log = Logger.getLogger(BundleClassLoader.class);
-
    public BundleClassLoader(Bundle bundle)
    {
 	   

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VFSBundle.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VFSBundle.java	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VFSBundle.java	2006-09-25 13:41:52 UTC (rev 57134)
@@ -28,26 +28,20 @@
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.Enumeration;
-import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
 import java.util.Map.Entry;
 import java.util.jar.Attributes;
 import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 
-import org.jboss.vfs.spi.ReadOnlyVFS;
-import org.jboss.vfs.spi.VirtualFile;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
 import org.osgi.framework.AdminPermission;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleException;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
 
 /**
  * An implementation of the OSGi bundle interface that uses a vfs to access the bundle contents.
@@ -57,7 +51,7 @@
  */
 public class VFSBundle implements Bundle
 {
-   private ReadOnlyVFS vfs;
+   private VFS vfs;
    private String vfsPath;
    private long bundleID;
    /** Is this an extension bundle */
@@ -76,8 +70,9 @@
     * 
     * @param vfs - the VFS holding the bundle
     * @param vfsPath - the path in the VFS for the bundle root
+    * @param bundleID the bundle id
     */
-   public VFSBundle(ReadOnlyVFS vfs, String vfsPath, long bundleID)
+   public VFSBundle(VFS vfs, String vfsPath, long bundleID)
    {
       this.vfs = vfs;
       this.vfsPath = vfsPath;
@@ -145,6 +140,36 @@
       return headers;
    }
 
+   /**
+    * Get the category.
+    * 
+    * @return the category.
+    */
+   public String getCategory()
+   {
+      return category;
+   }
+
+   /**
+    * Get the classpath.
+    * 
+    * @return the classpath.
+    */
+   public ArrayList<String> getClasspath()
+   {
+      return classpath;
+   }
+
+   /**
+    * Get the description.
+    * 
+    * @return the description.
+    */
+   public String getDescription()
+   {
+      return description;
+   }
+
    /*
     * (non-Javadoc)
     * 
@@ -333,7 +358,7 @@
 
       try
       {
-         VirtualFile bundleFile = vfs.resolveFile(this.vfsPath);
+         VirtualFile bundleFile = vfs.findChildFromRoot(this.vfsPath);
          update(bundleFile);
       }
       catch(IOException e)
@@ -386,7 +411,7 @@
    protected void validateFragmentHost()
    {
       String key = Constants.FRAGMENT_HOST.toLowerCase();
-      String value = headers.get(key);
+      headers.get(key); // TODO what?
       
    }
    /**
@@ -397,8 +422,8 @@
    protected void extractImports()
    {
       String key = Constants.IMPORT_PACKAGE;
-      String value = headers.get(key);
-      HeaderValue.PkgInfo pkgInfo = new HeaderValue.PkgInfo();
+      headers.get(key); // TODO what?
+      new HeaderValue.PkgInfo(); // TODO what?
    }
    protected void extractExports()
    {

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VersionRange.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VersionRange.java	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/vfs/bundle/VersionRange.java	2006-09-25 13:41:52 UTC (rev 57134)
@@ -22,8 +22,6 @@
 package org.jboss.vfs.bundle;
 
 import java.util.StringTokenizer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import org.osgi.framework.Version;
 

Modified: projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/support/jar2/ClassInJar2.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/support/jar2/ClassInJar2.java	2006-09-25 11:09:27 UTC (rev 57133)
+++ projects/microcontainer/trunk/osgi-int/src/tests/org/jboss/test/bundle/support/jar2/ClassInJar2.java	2006-09-25 13:41:52 UTC (rev 57134)
@@ -1,6 +1,6 @@
 package org.jboss.test.bundle.support.jar2;
 
-import org.jboss.test.vfs.support.CommonClass;
+import org.jboss.test.bundle.support.CommonClass;
 
 /**
  * @author Scott.Stark at jboss.org




More information about the jboss-cvs-commits mailing list