felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r233031 [1/21] - in /incubator/oscar/trunk: ./ etc/ lib/ src/ src/org/ src/org/apache/ src/org/apache/osgi/ src/org/apache/osgi/bundle/ src/org/apache/osgi/bundle/bundlerepository/ src/org/apache/osgi/bundle/bundlerepository/kxmlsax/ src/or...
Date Tue, 16 Aug 2005 18:34:41 GMT
Author: rickhall
Date: Tue Aug 16 11:33:34 2005
New Revision: 233031

URL: http://svn.apache.org/viewcvs?rev=233031&view=rev
Log:
Initial source commit.

Added:
    incubator/oscar/trunk/build.xml
    incubator/oscar/trunk/etc/
    incubator/oscar/trunk/etc/all.policy
    incubator/oscar/trunk/etc/config.properties.gui
    incubator/oscar/trunk/etc/config.properties.text
    incubator/oscar/trunk/etc/example.policy
    incubator/oscar/trunk/etc/felix.bat
    incubator/oscar/trunk/etc/felix.sh
    incubator/oscar/trunk/lib/
    incubator/oscar/trunk/lib/config.properties
    incubator/oscar/trunk/lib/kxml.jar   (with props)
    incubator/oscar/trunk/src/
    incubator/oscar/trunk/src/org/
    incubator/oscar/trunk/src/org/apache/
    incubator/oscar/trunk/src/org/apache/osgi/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Activator.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/BundleRepositoryImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/FileUtil.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/IteratorToEnumeration.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/LocalState.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/MapToDictionary.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/ObrCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/R4Attribute.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/R4Directive.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/R4Package.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/R4Version.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/RepositoryState.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Util.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/kxmlsax/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/kxmlsax/KXmlSAXHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/kxmlsax/KXmlSAXParser.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/manifest.mf
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/metadataparser/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/metadataparser/ClassUtility.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/metadataparser/KXmlMetadataHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/metadataparser/MultivalueMap.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/metadataparser/XmlCommonHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/Activator.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/BundleLevelCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/CdCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/HeadersCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/HelpCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/InstallCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/PackagesCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/PsCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/RefreshCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/ServicesCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/ShutdownCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/StartCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/StartLevelCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/StopCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/UninstallCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/UpdateCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/Util.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/VersionCommandImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shell/manifest.mf
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shelltui/
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shelltui/Activator.java
    incubator/oscar/trunk/src/org/apache/osgi/bundle/shelltui/manifest.mf
    incubator/oscar/trunk/src/org/apache/osgi/framework/
    incubator/oscar/trunk/src/org/apache/osgi/framework/BundleContextImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/BundleImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/BundleInfo.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/BundleURLConnection.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/BundleURLStreamHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/ExportedPackageImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/FakeURLStreamHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/Felix.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/FilterImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/FrameworkUtil.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/LogWrapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/Main.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/OSGiLibrarySource.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/OSGiURLPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/PackageAdminActivator.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/PackageAdminImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/ServiceReferenceImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/ServiceRegistrationImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/ServiceRegistry.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/StartLevelActivator.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/StartLevelImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/SystemBundle.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/SystemBundleActivator.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/SystemBundleArchive.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/cache/
    incubator/oscar/trunk/src/org/apache/osgi/framework/cache/BundleArchive.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/cache/BundleCache.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/cache/DefaultBundleArchive.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/cache/DefaultBundleCache.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/ext/
    incubator/oscar/trunk/src/org/apache/osgi/framework/ext/FelixBundleContext.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/Artifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/BooleanProperty.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/Install.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/Property.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/PropertyPanel.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/Status.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/StringProperty.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/AbstractArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/AbstractFileArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/AbstractJarArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/ResourceFileArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/ResourceJarArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/URLFileArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/artifact/URLJarArtifact.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/editor/
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/editor/BooleanEditor.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/editor/BooleanStringEditor.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/editor/FileEditor.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/editor/StringEditor.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/manifest.mf
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/property/
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/property/BooleanPropertyImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/property/BooleanStringPropertyImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/property/NotBooleanPropertyImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/property/StringPropertyImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/resource/
    incubator/oscar/trunk/src/org/apache/osgi/framework/installer/resource/ResourceLoader.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/manifest.mf
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4Attribute.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4Directive.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4Package.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4SearchPolicy.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4Version.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/searchpolicy/R4Wire.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/BundleListenerWrapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/CaseInsensitiveMap.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/DispatchQueue.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/Dispatcher.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/FelixConstants.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/FelixDispatchQueue.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/FrameworkListenerWrapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/IteratorToEnumeration.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/LibraryInfo.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ListenerWrapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/MapToDictionary.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/MutablePropertyResolver.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/MutablePropertyResolverImpl.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ObjectInputStreamX.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/PropertyResolver.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ServiceListenerWrapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/Util.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/AttributeNotFoundException.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Driver.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/EvaluationException.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Evaluator.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/LdapLexer.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Mapper.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Operator.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/ParseException.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Parser.java
    incubator/oscar/trunk/src/org/apache/osgi/framework/util/ldap/Unknown.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/DefaultURLPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/JarResourceSource.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/LibrarySource.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/Module.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleClassLoader.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleEvent.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleListener.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleManager.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleURLConnection.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ModuleURLStreamHandler.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ResourceNotFoundException.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/ResourceSource.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/SearchPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/URLPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/Util.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/CompatibilityPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ExhaustiveSearchPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ImportSearchPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ResolveException.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ResolveListener.java   (with props)
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/SelectionPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/SelfContainedSearchPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ValidationException.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/ValidationListener.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/compatibility/
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/compatibility/ExactCompatibilityPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/selection/
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/selection/InteractiveSelectionPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/moduleloader/search/selection/SimpleSelectionPolicy.java
    incubator/oscar/trunk/src/org/apache/osgi/service/
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/BundleRecord.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/BundleRepository.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/IAttribute.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/IDirective.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/IPackage.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/IVersion.java
    incubator/oscar/trunk/src/org/apache/osgi/service/bundlerepository/ResolveException.java
    incubator/oscar/trunk/src/org/apache/osgi/service/shell/
    incubator/oscar/trunk/src/org/apache/osgi/service/shell/CdCommand.java
    incubator/oscar/trunk/src/org/apache/osgi/service/shell/Command.java
    incubator/oscar/trunk/src/org/apache/osgi/service/shell/ShellService.java
    incubator/oscar/trunk/src/org/osgi/
    incubator/oscar/trunk/src/org/osgi/framework/
    incubator/oscar/trunk/src/org/osgi/framework/AdminPermission.java
    incubator/oscar/trunk/src/org/osgi/framework/AllServiceListener.java
    incubator/oscar/trunk/src/org/osgi/framework/Bundle.java
    incubator/oscar/trunk/src/org/osgi/framework/BundleActivator.java
    incubator/oscar/trunk/src/org/osgi/framework/BundleContext.java
    incubator/oscar/trunk/src/org/osgi/framework/BundleEvent.java
    incubator/oscar/trunk/src/org/osgi/framework/BundleException.java
    incubator/oscar/trunk/src/org/osgi/framework/BundleListener.java
    incubator/oscar/trunk/src/org/osgi/framework/BundlePermission.java
    incubator/oscar/trunk/src/org/osgi/framework/Configurable.java
    incubator/oscar/trunk/src/org/osgi/framework/Constants.java
    incubator/oscar/trunk/src/org/osgi/framework/Filter.java
    incubator/oscar/trunk/src/org/osgi/framework/FrameworkEvent.java
    incubator/oscar/trunk/src/org/osgi/framework/FrameworkListener.java
    incubator/oscar/trunk/src/org/osgi/framework/FrameworkUtil.java
    incubator/oscar/trunk/src/org/osgi/framework/InvalidSyntaxException.java
    incubator/oscar/trunk/src/org/osgi/framework/PackagePermission.java
    incubator/oscar/trunk/src/org/osgi/framework/ServiceEvent.java
    incubator/oscar/trunk/src/org/osgi/framework/ServiceFactory.java
    incubator/oscar/trunk/src/org/osgi/framework/ServiceListener.java
    incubator/oscar/trunk/src/org/osgi/framework/ServicePermission.java
    incubator/oscar/trunk/src/org/osgi/framework/ServiceReference.java
    incubator/oscar/trunk/src/org/osgi/framework/ServiceRegistration.java
    incubator/oscar/trunk/src/org/osgi/framework/SynchronousBundleListener.java
    incubator/oscar/trunk/src/org/osgi/framework/Version.java
    incubator/oscar/trunk/src/org/osgi/service/
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/BundleLocationCondition.java
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/BundleSignerCondition.java
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/Condition.java
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/ConditionInfo.java
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/ConditionalPermissionAdmin.java
    incubator/oscar/trunk/src/org/osgi/service/condpermadmin/ConditionalPermissionInfo.java
    incubator/oscar/trunk/src/org/osgi/service/packageadmin/
    incubator/oscar/trunk/src/org/osgi/service/packageadmin/ExportedPackage.java
    incubator/oscar/trunk/src/org/osgi/service/packageadmin/PackageAdmin.java
    incubator/oscar/trunk/src/org/osgi/service/packageadmin/RequiredBundle.java
    incubator/oscar/trunk/src/org/osgi/service/permissionadmin/
    incubator/oscar/trunk/src/org/osgi/service/permissionadmin/PermissionAdmin.java
    incubator/oscar/trunk/src/org/osgi/service/permissionadmin/PermissionInfo.java
    incubator/oscar/trunk/src/org/osgi/service/startlevel/
    incubator/oscar/trunk/src/org/osgi/service/startlevel/StartLevel.java
    incubator/oscar/trunk/src/org/osgi/service/url/
    incubator/oscar/trunk/src/org/osgi/service/url/AbstractURLStreamHandlerService.java
    incubator/oscar/trunk/src/org/osgi/service/url/URLConstants.java
    incubator/oscar/trunk/src/org/osgi/service/url/URLStreamHandlerService.java
    incubator/oscar/trunk/src/org/osgi/service/url/URLStreamHandlerSetter.java
    incubator/oscar/trunk/src/org/osgi/util/
    incubator/oscar/trunk/src/org/osgi/util/tracker/
    incubator/oscar/trunk/src/org/osgi/util/tracker/ServiceTracker.java
    incubator/oscar/trunk/src/org/osgi/util/tracker/ServiceTrackerCustomizer.java
    incubator/oscar/trunk/src/org/ungoverned/
    incubator/oscar/trunk/src/org/ungoverned/osgi/
    incubator/oscar/trunk/src/org/ungoverned/osgi/service/
    incubator/oscar/trunk/src/org/ungoverned/osgi/service/shell/
    incubator/oscar/trunk/src/org/ungoverned/osgi/service/shell/CdCommand.java
    incubator/oscar/trunk/src/org/ungoverned/osgi/service/shell/Command.java
    incubator/oscar/trunk/src/org/ungoverned/osgi/service/shell/ShellService.java

Added: incubator/oscar/trunk/build.xml
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/build.xml?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/build.xml (added)
+++ incubator/oscar/trunk/build.xml Tue Aug 16 11:33:34 2005
@@ -0,0 +1,118 @@
+<project name="felix" default="all" basedir=".">
+
+    <!-- Set our global properties -->
+    <property name="src.dir" value="src"/>
+    <property name="lib.dir" value="lib"/>
+    <property name="output.dir" value="classes"/>
+    <property name="bundle.dir" value="bundle"/>
+    <property name="etc.dir" value="etc"/>
+    <property name="doc.dir" value="doc"/>
+    <property name="apidoc.dir" value="${doc.dir}/api"/>
+    <property name="dist.dir" value="dist"/>
+    <property name="debug.value" value="on"/>
+
+    <!-- Create class path from lib and output directories. -->
+    <path id="classpath">
+        <pathelement location="${output.dir}"/>
+        <fileset dir="${lib.dir}">
+            <include name="*.jar"/>
+        </fileset>
+    </path>
+
+    <target name="init">
+        <!-- Create lib directory. -->
+        <mkdir dir="${lib.dir}"/>
+        <!-- Create output directory. -->
+        <mkdir dir="${output.dir}"/>
+        <!-- Create bundle directory. -->
+        <mkdir dir="${bundle.dir}"/>
+    </target>
+
+    <!-- Compile and JAR everything -->
+    <target name="all" depends="init">
+        <antcall target="compile"/>
+        <antcall target="moduleloader"/>
+        <antcall target="osgi"/>
+        <antcall target="felix"/>
+        <antcall target="bundle"/>
+    </target>
+
+    <!-- Compile everything. -->
+    <target name="compile" depends="init">
+        <javac srcdir="${src.dir}" destdir="${output.dir}"
+         debug="${debug.value}" verbose="no" deprecation="no">
+            <classpath refid="classpath"/>
+            <include name="**/*.java"/>
+        </javac>
+    </target>
+
+    <!-- Create module loader JAR file. -->
+    <target name="moduleloader" depends="compile">
+        <jar jarfile="${lib.dir}/moduleloader.jar"
+            basedir="${output.dir}">
+            <include name="org/apache/osgi/moduleloader/"/>
+        </jar>
+    </target>
+
+    <!-- Create OSGi JAR file. -->
+    <target name="osgi" depends="compile">
+        <jar jarfile="${lib.dir}/osgi.jar" basedir="${output.dir}">
+            <include name="org/osgi/framework/**"/>
+            <include name="org/osgi/service/packageadmin/**"/>
+            <include name="org/osgi/service/startlevel/**"/>
+        </jar>
+    </target>
+
+    <!-- Create Felix JAR file. -->
+    <target name="felix" depends="compile">
+        <jar manifest="${src.dir}/org/apache/osgi/framework/manifest.mf"
+            jarfile="${lib.dir}/felix.jar"
+            basedir="${output.dir}">
+            <include name="org/apache/osgi/framework/"/>
+            <exclude name="org/apache/osgi/framework/installer/"/>
+        </jar>
+    </target>
+
+    <!-- Create shell bundle JAR files. -->
+    <target name="bundle" depends="compile">
+
+        <!-- Shell -->
+        <jar manifest="${src.dir}/org/apache/osgi/bundle/shell/manifest.mf"
+            jarfile="${bundle.dir}/shell.jar"
+            basedir="${output.dir}">
+            <include name="org/apache/osgi/service/shell/**"/>
+            <include name="org/ungoverned/osgi/service/shell/**"/>
+            <include name="org/apache/osgi/bundle/shell/**"/>
+        </jar>
+
+        <!-- Shell TUI -->
+        <jar manifest="${src.dir}/org/apache/osgi/bundle/shelltui/manifest.mf"
+            jarfile="${bundle.dir}/shelltui.jar"
+            basedir="${output.dir}">
+            <include name="org/apache/osgi/bundle/shelltui/**"/>
+        </jar>
+
+        <!-- OBR -->
+        <copy file="${lib.dir}/kxml.jar"
+         todir="${output.dir}/org/apache/osgi/bundle/bundlerepository/"/>
+
+        <jar manifest="${src.dir}/org/apache/osgi/bundle/bundlerepository/manifest.mf"
+            jarfile="${bundle.dir}/bundlerepository.jar"
+            basedir="${output.dir}">
+            <include name="org/apache/osgi/bundle/bundlerepository/**"/>
+            <include name="org/apache/osgi/service/bundlerepository/**"/>
+        </jar>
+
+    </target>
+
+
+    <!-- Clean up everything. -->
+    <target name="clean">
+        <delete dir="${output.dir}"/>
+        <delete dir="${bundle.dir}"/>
+        <delete file="${lib.dir}/osgi.jar"/>
+        <delete file="${lib.dir}/moduleloader.jar"/>
+        <delete file="${lib.dir}/felix.jar"/>
+    </target>
+
+</project>

Added: incubator/oscar/trunk/etc/all.policy
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/all.policy?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/all.policy (added)
+++ incubator/oscar/trunk/etc/all.policy Tue Aug 16 11:33:34 2005
@@ -0,0 +1,3 @@
+grant {
+  permission java.security.AllPermission;
+};

Added: incubator/oscar/trunk/etc/config.properties.gui
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/config.properties.gui?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/config.properties.gui (added)
+++ incubator/oscar/trunk/etc/config.properties.gui Tue Aug 16 11:33:34 2005
@@ -0,0 +1,4 @@
+felix.auto.start.1=file:bundle/shell.jar file:bundle/tablelayout.jar \
+    file:bundle/shellgui.jar file:bundle/shellplugin.jar \
+    file:bundle/bundlerepository.jar
+

Added: incubator/oscar/trunk/etc/config.properties.text
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/config.properties.text?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/config.properties.text (added)
+++ incubator/oscar/trunk/etc/config.properties.text Tue Aug 16 11:33:34 2005
@@ -0,0 +1,3 @@
+felix.auto.start.1=file:bundle/shell.jar file:bundle/shelltui.jar \
+    file:bundle/bundlerepository.jar
+

Added: incubator/oscar/trunk/etc/example.policy
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/example.policy?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/example.policy (added)
+++ incubator/oscar/trunk/etc/example.policy Tue Aug 16 11:33:34 2005
@@ -0,0 +1,40 @@
+grant codeBase "file:bundle/shellgui.jar" {
+  permission org.osgi.framework.ServicePermission "org.ungoverned.osgi.bundle.shellgui.Plugin", "get";
+};
+
+grant codeBase "file:bundle/shelltui.jar" {
+  permission org.osgi.framework.ServicePermission "org.ungoverned.osgi.service.shell.ShellService", "get";
+};
+
+grant codeBase "file:bundle/shellplugin.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:bundle/bundlerepository.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:bundle/permissionmanager.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:bundle/shell.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:${lib.dir}/felix.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:${lib.dir}/osgi.jar" {
+  permission java.security.AllPermission;
+};
+
+grant codeBase "file:${lib.dir}/moduleloader.jar" {
+  permission java.security.AllPermission;
+};
+
+grant {
+  permission java.io.FilePermission "${user.home}${file.separator}.felix${file.separator}-", "read, write, delete";
+  permission org.osgi.framework.PackagePermission "*", "EXPORT";
+};

Added: incubator/oscar/trunk/etc/felix.bat
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/felix.bat?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/felix.bat (added)
+++ incubator/oscar/trunk/etc/felix.bat Tue Aug 16 11:33:34 2005
@@ -0,0 +1,16 @@
+@echo off
+
+rem
+rem The following 'set' command should be automatically
+rem assigned during install, if not, edit it to reflect
+rem your Java installation.
+rem
+
+set JAVA_HOME="%%Java directory%%"
+
+rem
+rem You do not need to edit the following.
+rem
+
+%JAVA_HOME%\bin\java -jar lib\felix.jar
+

Added: incubator/oscar/trunk/etc/felix.sh
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/etc/felix.sh?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/etc/felix.sh (added)
+++ incubator/oscar/trunk/etc/felix.sh Tue Aug 16 11:33:34 2005
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+#
+# The following variable should be automatically
+# assigned during install, if not, edit it to reflect
+# your Java installation.
+#
+
+java_home=%%Java directory%%
+
+#
+# You don't need to edit the following line
+#
+
+exec ${java_home}/bin/java -jar lib/felix.jar

Added: incubator/oscar/trunk/lib/config.properties
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/lib/config.properties?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/lib/config.properties (added)
+++ incubator/oscar/trunk/lib/config.properties Tue Aug 16 11:33:34 2005
@@ -0,0 +1,26 @@
+#
+# Framework config properties.
+#
+org.osgi.framework.system.packages=javax.swing; \
+ javax.swing.plaf; \
+ javax.swing.event; \
+ javax.swing.table; \
+ javax.swing.border; \
+ javax.swing.tree; \
+ javax.swing.text; \
+ version=1.4
+#felix.cache.profile=foo
+felix.auto.start.1= \
+ file:bundle/shell.jar \
+ file:bundle/shelltui.jar \
+ file:bundle/bundlerepository.jar 
+felix.startlevel.framework=1
+felix.startlevel.bundle=1
+
+#
+# Bundle config properties.
+#
+org.osgi.service.http.port=8080
+osgi.shell.telnet=on
+#osgi.repository.url=file:/home/rickhall/projects/apache/repository.xml
+#osgi.repository.url=file:/home/rickhall/projects/apache/repository.xml http://www.knopflerfish.org/repo/repository.xml

Added: incubator/oscar/trunk/lib/kxml.jar
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/lib/kxml.jar?rev=233031&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/oscar/trunk/lib/kxml.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Activator.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Activator.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Activator.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/Activator.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,57 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator
+{
+    private transient BundleContext m_context = null;
+    private transient BundleRepositoryImpl m_br = null;
+
+    public void start(BundleContext context)
+    {
+        m_context = context;
+
+        // Register bundle repository service.
+        m_br = new BundleRepositoryImpl(m_context);
+        context.registerService(
+            org.apache.osgi.service.bundlerepository.BundleRepository.class.getName(),
+            m_br, null);
+
+        // We dynamically import the shell service API, so it
+        // might not actually be available, so be ready to catch
+        // the exception when we try to register the command service.
+        try
+        {
+            // Register "obr" shell command service as a
+            // wrapper for the bundle repository service.
+            context.registerService(
+                org.apache.osgi.service.shell.Command.class.getName(),
+                new ObrCommandImpl(m_context, m_br), null);
+        }
+        catch (Throwable th)
+        {
+            // Ignore.
+        }
+    }
+
+    public void stop(BundleContext context)
+    {
+    }
+}
\ No newline at end of file

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/BundleRepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/BundleRepositoryImpl.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/BundleRepositoryImpl.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/BundleRepositoryImpl.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,274 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.osgi.service.bundlerepository.*;
+import org.osgi.framework.*;
+
+public class BundleRepositoryImpl implements BundleRepository
+{
+    private BundleContext m_context = null;
+    private RepositoryState m_repo = null;
+
+    public BundleRepositoryImpl(BundleContext context)
+    {
+        m_context = context;
+        m_repo = new RepositoryState(m_context);
+    }
+
+    public String[] getRepositoryURLs()
+    {
+        return m_repo.getURLs();
+    }
+
+    public synchronized void setRepositoryURLs(String[] urls)
+    {
+        m_repo.setURLs(urls);
+    }
+
+    /**
+     * Get the number of bundles available in the repository.
+     * @return the number of available bundles.
+    **/
+    public synchronized BundleRecord[] getBundleRecords()
+    {
+        return m_repo.getRecords();
+    }
+
+    /**
+     * Get the specified bundle record from the repository.
+     * @param i the bundle record index to retrieve.
+     * @return the associated bundle record or <tt>null</tt>.
+    **/
+    public synchronized BundleRecord[] getBundleRecords(String symName)
+    {
+        return m_repo.getRecords(symName);
+    }
+
+    /**
+     * Get bundle record for the bundle with the specified name
+     * and version from the repository.
+     * @param name the bundle record name to retrieve.
+     * @param version three-interger array of the version associated with
+     *        the name to retrieve.
+     * @return the associated bundle record or <tt>null</tt>.
+    **/
+    public synchronized BundleRecord getBundleRecord(String symName, int[] version)
+    {
+        return m_repo.getRecord(symName, version);
+    }
+
+    public boolean deployBundle(
+        PrintStream out, PrintStream err, String symName, int[] version,
+        boolean isResolve, boolean isStart)
+    {
+        // List to hold bundles that need to be started.
+        List startList = null;
+
+        // Get the bundle record of the remote bundle to be deployed.
+        BundleRecord targetRecord = m_repo.getRecord(symName, version);
+        if (targetRecord == null)
+        {
+            err.println("No such bundle in repository.");
+            return false;
+        }
+
+        // Create an editable snapshot of the current set of
+        // locally installed bundles.
+        LocalState localState = new LocalState(m_context);
+
+        // If the precise bundle is already deployed, then we are done.
+        if (localState.findBundle(symName, version) != null)
+        {
+            return true;
+        }
+
+        // Create the transitive closure all bundles that must be
+        // deployed as a result of deploying the target bundle;
+        // use a list because this will keep everything in order.
+        BundleRecord[] deployRecords = null;
+        // If the resolve flag is set, then get its imports to
+        // calculate the transitive closure of its dependencies.
+        if (isResolve)
+        {
+//            Package[] imports = (Package[])
+//                targetRecord.getAttribute(BundleRecord.IMPORT_PACKAGE);
+            Filter[] reqs = (Filter[])
+                targetRecord.getAttribute("requirement");
+            try
+            {
+                deployRecords = m_repo.resolvePackages(localState, reqs);
+            }
+            catch (ResolveException ex)
+            {
+                err.println("Resolve error: " + ex.getPackage());
+                return false;
+            }
+        }
+
+        // Add the target bundle since it will not be
+        // included in the array of records to deploy.
+        if (deployRecords == null)
+        {
+            deployRecords = new BundleRecord[] { targetRecord };
+        }
+        else
+        {
+            // Create a new array containing the target and put it first,
+            // since the array will be process in reverse order.
+            BundleRecord[] newRecs = new BundleRecord[deployRecords.length + 1];
+            newRecs[0] = targetRecord;
+            System.arraycopy(deployRecords, 0, newRecs, 1, deployRecords.length);
+            deployRecords = newRecs;
+        }
+
+        // Now iterate through all bundles in the deploy list
+        // in reverse order and deploy each; the order is not
+        // so important, but by reversing them at least the
+        // dependencies will be printed first and perhaps it
+        // will avoid some ordering issues when we are starting
+        // bundles.
+        for (int i = 0; i < deployRecords.length; i++)
+        {
+            LocalState.LocalBundleRecord updateRecord =
+                localState.findUpdatableBundle(deployRecords[i]);
+            if (updateRecord != null)
+            {
+// TODO: Should check to make sure that update bundle isn't already the
+// correct version.
+                // Modify our copy of the local state to reflect
+                // that the bundle is now updated.
+                localState.update(updateRecord, deployRecords[i]);
+
+                // Print out an "updating" message.
+                if (deployRecords[i] != targetRecord)
+                {
+                    out.print("Updating dependency: ");
+                }
+                else
+                {
+                    out.print("Updating: ");
+                }
+                out.println(Util.getBundleName(updateRecord.getBundle()));
+
+                // Actually perform the update.
+                try
+                {
+                    URL url = new URL(
+                        (String) deployRecords[i].getAttribute(BundleRecord.BUNDLE_URL));
+                    updateRecord.getBundle().update(url.openStream());
+
+                    // If necessary, save the updated bundle to be
+                    // started later.
+                    if (isStart)
+                    {
+                        if (startList == null)
+                        {
+                            startList = new ArrayList();
+                        }
+                        startList.add(updateRecord.getBundle());
+                    }
+                }
+                catch (Exception ex)
+                {
+                    err.println("Update error: " + Util.getBundleName(updateRecord.getBundle()));
+                    ex.printStackTrace(err);
+                    return false;
+                }
+            }
+            else
+            {
+                // Print out an "installing" message.
+                if (deployRecords[i] != targetRecord)
+                {
+                    out.print("Installing dependency: ");
+                }
+                else
+                {
+                    out.print("Installing: ");
+                }
+                out.println(deployRecords[i].getAttribute(BundleRecord.BUNDLE_NAME));
+
+                try
+                {
+                    // Actually perform the install, but do not use the actual
+                    // bundle JAR URL for the bundle location, since this will
+                    // limit OBR's ability to manipulate bundle versions. Instead,
+                    // use a unique timestamp as the bundle location.
+                    URL url = new URL(
+                        (String) deployRecords[i].getAttribute(BundleRecord.BUNDLE_URL));
+                    Bundle bundle = m_context.installBundle(
+                        "obr://"
+                        + deployRecords[i].getAttribute(BundleRecord.BUNDLE_NAME)
+                        + "/" + System.currentTimeMillis(),
+                        url.openStream());
+
+                    // If necessary, save the installed bundle to be
+                    // started later.
+                    if (isStart)
+                    {
+                        if (startList == null)
+                        {
+                            startList = new ArrayList();
+                        }
+                        startList.add(bundle);
+                    }
+                }
+                catch (Exception ex)
+                {
+                    err.println("Install error: "
+                        + deployRecords[i].getAttribute(BundleRecord.BUNDLE_NAME));
+                    ex.printStackTrace(err);
+                    return false;
+                }
+            }
+        }
+
+        // If necessary, start bundles after installing them all.
+        if (isStart)
+        {
+            for (int i = 0; (startList != null) && (i < startList.size()); i++)
+            {
+                Bundle bundle = (Bundle) startList.get(i);
+                try
+                {
+                    bundle.start();
+                }
+                catch (BundleException ex)
+                {
+                    err.println("Update error: " + Util.getBundleName(bundle));
+                    ex.printStackTrace();
+                }
+            }
+        }
+
+        return true;
+    }
+
+    public BundleRecord[] resolvePackages(IPackage[] pkgs)
+        throws ResolveException
+    {
+// TODO: FIX
+//        return m_repo.resolvePackages(new LocalState(m_context), pkgs);
+        return null;
+    }
+}
\ No newline at end of file

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/FileUtil.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/FileUtil.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/FileUtil.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/FileUtil.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,168 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import java.io.*;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+public class FileUtil
+{
+    public static void downloadSource(
+        PrintStream out, PrintStream err,
+        String srcURL, String dirStr, boolean extract)
+    {
+        // Get the file name from the URL.
+        String fileName = (srcURL.lastIndexOf('/') > 0)
+            ? srcURL.substring(srcURL.lastIndexOf('/') + 1)
+            : srcURL;
+
+        try
+        {
+            out.println("Connecting...");
+
+            File dir = new File(dirStr);
+            if (!dir.exists())
+            {
+                err.println("Destination directory does not exist.");
+            }
+            File file = new File(dir, fileName);
+
+            OutputStream os = new FileOutputStream(file);
+            URLConnection conn = new URL(srcURL).openConnection();
+            int total = conn.getContentLength();
+            InputStream is = conn.getInputStream();
+
+            if (total > 0)
+            {
+                out.println("Downloading " + fileName
+                    + " ( " + total + " bytes ).");
+            }
+            else
+            {
+                out.println("Downloading " + fileName + ".");
+            }
+            byte[] buffer = new byte[4096];
+            int count = 0;
+            for (int len = is.read(buffer); len > 0; len = is.read(buffer))
+            {
+                count += len;
+                os.write(buffer, 0, len);
+            }
+
+            os.close();
+            is.close();
+
+            if (extract)
+            {
+                is = new FileInputStream(file);
+                JarInputStream jis = new JarInputStream(is);
+                out.println("Extracting...");
+                unjar(jis, dir);
+                jis.close();
+                file.delete();
+            }
+        }
+        catch (Exception ex)
+        {
+            err.println(ex);
+        }
+    }
+
+    public static void unjar(JarInputStream jis, File dir)
+        throws IOException
+    {
+        // Reusable buffer.
+        byte[] buffer = new byte[4096];
+
+        // Loop through JAR entries.
+        for (JarEntry je = jis.getNextJarEntry();
+             je != null;
+             je = jis.getNextJarEntry())
+        {
+            if (je.getName().startsWith("/"))
+            {
+                throw new IOException("JAR resource cannot contain absolute paths.");
+            }
+
+            File target = new File(dir, je.getName());
+
+            // Check to see if the JAR entry is a directory.
+            if (je.isDirectory())
+            {
+                if (!target.exists())
+                {
+                    if (!target.mkdirs())
+                    {
+                        throw new IOException("Unable to create target directory: "
+                            + target);
+                    }
+                }
+                // Just continue since directories do not have content to copy.
+                continue;
+            }
+
+            int lastIndex = je.getName().lastIndexOf('/');
+            String name = (lastIndex >= 0) ?
+                je.getName().substring(lastIndex + 1) : je.getName();
+            String destination = (lastIndex >= 0) ?
+                je.getName().substring(0, lastIndex) : "";
+
+            // JAR files use '/', so convert it to platform separator.
+            destination = destination.replace('/', File.separatorChar);
+            copy(jis, dir, name, destination, buffer);
+        }
+    }
+
+    public static void copy(
+        InputStream is, File dir, String destName, String destDir, byte[] buffer)
+        throws IOException
+    {
+        if (destDir == null)
+        {
+            destDir = "";
+        }
+
+        // Make sure the target directory exists and
+        // that is actually a directory.
+        File targetDir = new File(dir, destDir);
+        if (!targetDir.exists())
+        {
+            if (!targetDir.mkdirs())
+            {
+                throw new IOException("Unable to create target directory: "
+                    + targetDir);
+            }
+        }
+        else if (!targetDir.isDirectory())
+        {
+            throw new IOException("Target is not a directory: "
+                + targetDir);
+        }
+
+        BufferedOutputStream bos = new BufferedOutputStream(
+            new FileOutputStream(new File(targetDir, destName)));
+        int count = 0;
+        while ((count = is.read(buffer)) > 0)
+        {
+            bos.write(buffer, 0, count);
+        }
+        bos.close();
+    }
+}
\ No newline at end of file

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/IteratorToEnumeration.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/IteratorToEnumeration.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/IteratorToEnumeration.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/IteratorToEnumeration.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,44 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+public class IteratorToEnumeration implements Enumeration
+{
+    private Iterator m_iter = null;
+
+    public IteratorToEnumeration(Iterator iter)
+    {
+        m_iter = iter;
+    }
+
+    public boolean hasMoreElements()
+    {
+        if (m_iter == null)
+            return false;
+        return m_iter.hasNext();
+    }
+
+    public Object nextElement()
+    {
+        if (m_iter == null)
+            return null;
+        return m_iter.next();
+    }
+}

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/LocalState.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/LocalState.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/LocalState.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/LocalState.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,378 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import java.util.*;
+
+import org.apache.osgi.service.bundlerepository.BundleRecord;
+import org.apache.osgi.service.bundlerepository.IPackage;
+import org.osgi.framework.*;
+
+public class LocalState
+{
+    private BundleContext m_context = null;
+    private List m_localRecordList = new ArrayList();
+
+    public LocalState(BundleContext context)
+    {
+        m_context = context;
+        initialize();
+    }
+
+    public BundleRecord findBundle(String symName, int[] version)
+    {
+        for (int i = 0; i < m_localRecordList.size(); i++)
+        {
+            BundleRecord brLocal = (BundleRecord) m_localRecordList.get(i);
+            String localSymName = (String)
+                brLocal.getAttribute(BundleRecord.BUNDLE_SYMBOLICNAME);
+            int[] localVersion = Util.parseVersionString((String)
+                brLocal.getAttribute(BundleRecord.BUNDLE_VERSION));
+            if ((localSymName != null) &&
+                localSymName.equals(symName) &&
+                (Util.compareVersion(localVersion, version) == 0))
+            {
+                return brLocal;
+            }
+        }
+        return null;
+    }
+
+    public BundleRecord[] findBundles(String symName)
+    {
+        List matchList = new ArrayList();
+        for (int i = 0; i < m_localRecordList.size(); i++)
+        {
+            BundleRecord brLocal = (BundleRecord) m_localRecordList.get(i);
+            String localSymName = (String)
+                brLocal.getAttribute(BundleRecord.BUNDLE_SYMBOLICNAME);
+            if ((localSymName != null) && localSymName.equals(symName))
+            {
+                matchList.add(brLocal);
+            }
+        }
+        return (BundleRecord[]) matchList.toArray(new BundleRecord[matchList.size()]);
+    }
+
+    public void update(BundleRecord oldRecord, BundleRecord newRecord)
+    {
+        // To update the old record we need to replace it with
+        // a new one, since BundleRecords are immutable. Make
+        // a new record that contains the attributes of the new
+        // record, but is associated with the local bundle of
+        // the old record.
+        if (oldRecord instanceof LocalBundleRecord)
+        {
+            String[] keys = newRecord.getAttributes();
+            Map map = new HashMap();
+            for (int i = 0; i < keys.length; i++)
+            {
+                map.put(keys, newRecord.getAttribute(keys[i]));
+            }
+            BundleRecord updatedRecord =
+                new LocalBundleRecord(
+                    map, ((LocalBundleRecord) oldRecord).getBundle());
+            int idx = m_localRecordList.indexOf(oldRecord);
+            if (idx >= 0)
+            {
+                m_localRecordList.set(idx, updatedRecord);
+            }
+        }
+    }
+
+    public LocalBundleRecord findUpdatableBundle(BundleRecord record)
+    {
+        // Determine if any bundles with the specified symbolic
+        // name are already installed locally.
+        BundleRecord[] localRecords = findBundles(
+            (String)record.getAttribute(BundleRecord.BUNDLE_SYMBOLICNAME));
+        if (localRecords != null)
+        {
+            // Since there are local bundles with the same symbolic
+            // name installed, then we must determine if we can
+            // update an existing bundle or if we must install
+            // another one. Loop through all local bundles with same
+            // symbolic name and find the first one that can be updated
+            // without breaking constraints of existing bundles.
+            for (int i = 0; i < localRecords.length; i++)
+            {
+                // Check to make sure that the version of the target
+                // record is greater than the local bundle version,
+                // since we do not want to perform a downgrade.
+//                int[] vLocal = Util.parseVersionString((String)
+//                    localRecords[i].getAttribute(BundleRecord.BUNDLE_VERSION));
+//                int[] vTarget = Util.parseVersionString((String)
+//                    record.getAttribute(BundleRecord.BUNDLE_VERSION));
+// TODO: VERIFY WHAT IS GOING ON HERE.
+                // If the target bundle is a newer version and it is
+                // export compatible with the local bundle, then return it.
+                if (isUpdatable(localRecords[i], record))
+                {
+                    return (LocalBundleRecord) localRecords[i];
+                }
+            }
+        }
+        return null;
+    }
+
+    public boolean isUpdatable(BundleRecord oldVersion, BundleRecord newVersion)
+    {
+        // First get all of the potentially resolvable package declarations
+        // from the local bundles for the old version of the bundle.
+        Filter[] reqFilters = getResolvableImportDeclarations(oldVersion);
+        if (reqFilters == null)
+        {
+            return true;
+        }
+        // Now make sure that all of the resolvable import declarations
+        // for the old version of the bundle  can also be satisfied by
+        // the new version of the bundle.
+        Map[] capMaps = (Map[])
+            newVersion.getAttribute("capability");
+        if (capMaps == null)
+        {
+            return false;
+        }
+        MapToDictionary mapDict = new MapToDictionary(null);
+        for (int reqIdx = 0; reqIdx < reqFilters.length; reqIdx++)
+        {
+            boolean satisfied = false;
+            for (int capIdx = 0; !satisfied && (capIdx < capMaps.length); capIdx++)
+            {
+                mapDict.setSourceMap(capMaps[capIdx]);
+                if (reqFilters[reqIdx].match(mapDict))
+                {
+                    satisfied = true;
+                }
+            }
+
+            // If any of the previously resolvable package declarations
+            // cannot be resolved, then the bundle is not updatable.
+            if (!satisfied)
+            {
+                return false;
+            }
+        }
+        return true;
+    }
+    
+    public Filter[] getResolvableImportDeclarations(BundleRecord record)
+    {
+        Map[] capMaps = (Map[])
+            record.getAttribute("capability");
+        if ((capMaps != null) && (capMaps.length > 0))
+        {
+            List filterList = new ArrayList();
+            // Use brute force to determine if any of the exports
+            // could possibly resolve any of the imports.
+            MapToDictionary mapDict = new MapToDictionary(null);
+            for (int capIdx = 0; capIdx < capMaps.length; capIdx++)
+            {
+                boolean added = false;
+                for (int recIdx = 0; !added && (recIdx < m_localRecordList.size()); recIdx++)
+                {
+                    BundleRecord brLocal = (BundleRecord) m_localRecordList.get(recIdx);
+                    Filter[] reqFilters = (Filter[])
+                        brLocal.getAttribute("requirement");
+                    for (int reqIdx = 0;
+                        (reqFilters != null) && (reqIdx < reqFilters.length);
+                        reqIdx++)
+                    {
+                        mapDict.setSourceMap(capMaps[capIdx]);
+                        if (reqFilters[reqIdx].match(mapDict))
+                        {
+                            added = true;
+                            filterList.add(reqFilters[reqIdx]);
+                        }
+                    }
+                }
+            }
+            return (Filter[])
+                filterList.toArray(new Filter[filterList.size()]);
+        }
+        return null;
+    }
+
+    public boolean isResolvable(Filter reqFilter)
+    {
+        MapToDictionary mapDict = new MapToDictionary(null);
+        for (int brIdx = 0; brIdx < m_localRecordList.size(); brIdx++)
+        {
+            BundleRecord brLocal = (BundleRecord) m_localRecordList.get(brIdx);
+            Map[] capMaps = (Map[]) brLocal.getAttribute("capability");
+            for (int capIdx = 0; (capMaps != null) && (capIdx < capMaps.length); capIdx++)
+            {
+                mapDict.setSourceMap(capMaps[capIdx]);
+                if (reqFilter.match(mapDict))
+                {
+                    return true;
+                }
+            }
+        }
+
+        return false;
+    }
+
+    private void initialize()
+    {
+        Bundle[] bundles = m_context.getBundles();
+        for (int i = 0; (bundles != null) && (i < bundles.length); i++)
+        {
+            Dictionary dict = bundles[i].getHeaders();
+            // Create a case-insensitive map.
+            Map bundleMap = new TreeMap(new Comparator() {
+                public int compare(Object o1, Object o2)
+                {
+                    return o1.toString().compareToIgnoreCase(o2.toString());
+                }
+            });
+
+            for (Enumeration keys = dict.keys(); keys.hasMoreElements(); )
+            {
+                Object key = keys.nextElement();
+                bundleMap.put(key, dict.get(key));
+            }
+            
+            // Remove and convert any import package declarations
+            // into requirement filters.
+            String target = (String) bundleMap.remove(BundleRecord.IMPORT_PACKAGE);
+            if (target != null)
+            {
+                IPackage[] pkgs = R4Package.parseImportOrExportHeader(target);
+                Filter[] filters = new Filter[(pkgs == null) ? 0 : pkgs.length];
+                for (int pkgIdx = 0; (pkgs != null) && (pkgIdx < pkgs.length); pkgIdx++)
+                {
+                    try
+                    {
+                        String low = pkgs[pkgIdx].getVersionLow().isInclusive()
+                            ? "(version>=" + pkgs[pkgIdx].getVersionLow() + ")"
+                            : "(!(version<=" + pkgs[pkgIdx].getVersionLow() + ")";
+
+                        if (pkgs[pkgIdx].getVersionHigh() != null)
+                        {
+                            String high = pkgs[pkgIdx].getVersionHigh().isInclusive()
+                                ? "(version<=" + pkgs[pkgIdx].getVersionHigh() + ")"
+                                : "(!(version>=" + pkgs[pkgIdx].getVersionHigh() + ")";
+                            filters[pkgIdx] = m_context.createFilter(
+                                "(&(type=Export-Package)(name="
+                                + pkgs[pkgIdx].getId() + ")"
+                                + low + high + ")");
+                        }
+                        else
+                        {
+                            filters[pkgIdx] = m_context.createFilter(
+                                "(&(type=Export-Package)(name="
+                                + pkgs[pkgIdx].getId() + ")"
+                                + low + ")");
+                        }
+                    }
+                    catch (InvalidSyntaxException ex)
+                    {
+                        // Ignore, since it should not happen.
+                    }
+                }
+                bundleMap.put("requirement", filters);
+            }
+
+            // Remove and convert any export package declarations
+            // into capability maps.
+            target = (String) bundleMap.remove(BundleRecord.EXPORT_PACKAGE);
+            if (target != null)
+            {
+                IPackage[] pkgs = R4Package.parseImportOrExportHeader(target);
+                Map[] capMaps = new Map[(pkgs == null) ? 0 : pkgs.length];
+                for (int pkgIdx = 0; (pkgs != null) && (pkgIdx < pkgs.length); pkgIdx++)
+                {
+                    // Create a case-insensitive map.
+                    capMaps[pkgIdx] = new TreeMap(new Comparator() {
+                        public int compare(Object o1, Object o2)
+                        {
+                            return o1.toString().compareToIgnoreCase(o2.toString());
+                        }
+                    });
+                    capMaps[pkgIdx].put("type", "Export-Package");
+                    capMaps[pkgIdx].put("name", pkgs[pkgIdx].getId());
+                    capMaps[pkgIdx].put("version", pkgs[pkgIdx].getVersionLow());
+                }
+                bundleMap.put("capability", capMaps);
+            }
+
+            // For the system bundle, add a special platform capability.
+            if (bundles[i].getBundleId() == 0)
+            {
+                // Create a case-insensitive map.
+                Map map = new TreeMap(new Comparator() {
+                    public int compare(Object o1, Object o2)
+                    {
+                        return o1.toString().compareToIgnoreCase(o2.toString());
+                    }
+                });
+                map.put(
+                    Constants.FRAMEWORK_VERSION,
+                    m_context.getProperty(Constants.FRAMEWORK_VERSION));
+                map.put(
+                    Constants.FRAMEWORK_VENDOR,
+                    m_context.getProperty(Constants.FRAMEWORK_VENDOR));
+                map.put(
+                    Constants.FRAMEWORK_LANGUAGE,
+                    m_context.getProperty(Constants.FRAMEWORK_LANGUAGE));
+                map.put(
+                    Constants.FRAMEWORK_OS_NAME,
+                    m_context.getProperty(Constants.FRAMEWORK_OS_NAME));
+                map.put(
+                    Constants.FRAMEWORK_OS_VERSION,
+                    m_context.getProperty(Constants.FRAMEWORK_OS_VERSION));
+                map.put(
+                    Constants.FRAMEWORK_PROCESSOR,
+                    m_context.getProperty(Constants.FRAMEWORK_PROCESSOR));
+//                map.put(
+//                    FelixConstants.FELIX_VERSION_PROPERTY,
+//                    m_context.getProperty(FelixConstants.FELIX_VERSION_PROPERTY));
+                Map[] capMaps = (Map[]) bundleMap.get("capability");
+                if (capMaps == null)
+                {
+                    capMaps = new Map[] { map };
+                }
+                else
+                {
+                    Map[] newCaps = new Map[capMaps.length + 1];
+                    newCaps[0] = map;
+                    System.arraycopy(capMaps, 0, newCaps, 1, capMaps.length);
+                    capMaps = newCaps;
+                }
+                bundleMap.put("capability", capMaps);
+            }
+            m_localRecordList.add(new LocalBundleRecord(bundleMap, bundles[i]));
+        }
+    }
+
+    public static class LocalBundleRecord extends BundleRecord
+    {
+        private Bundle m_bundle = null;
+
+        LocalBundleRecord(Map attrMap, Bundle bundle)
+        {
+            super(attrMap);
+            m_bundle = bundle;
+        }
+
+        public Bundle getBundle()
+        {
+            return m_bundle;
+        }
+    }
+}
\ No newline at end of file

Added: incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/MapToDictionary.java
URL: http://svn.apache.org/viewcvs/incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/MapToDictionary.java?rev=233031&view=auto
==============================================================================
--- incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/MapToDictionary.java (added)
+++ incubator/oscar/trunk/src/org/apache/osgi/bundle/bundlerepository/MapToDictionary.java Tue Aug 16 11:33:34 2005
@@ -0,0 +1,97 @@
+/*
+ *   Copyright 2005 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.osgi.bundle.bundlerepository;
+
+import java.util.*;
+
+
+/**
+ * This is a simple class that implements a <tt>Dictionary</tt>
+ * from a <tt>Map</tt>. The resulting dictionary is immutatable.
+**/
+public class MapToDictionary extends Dictionary
+{
+    /**
+     * Map source.
+    **/
+    private Map m_map = null;
+
+    public MapToDictionary(Map map)
+    {
+        m_map = map;
+    }
+
+    public void setSourceMap(Map map)
+    {
+        m_map = map;
+    }
+
+    public Enumeration elements()
+    {
+        if (m_map == null)
+        {
+            return null;
+        }
+        return new IteratorToEnumeration(m_map.values().iterator());
+    }
+
+    public Object get(Object key)
+    {
+        if (m_map == null)
+        {
+            return null;
+        }
+        return m_map.get(key);
+    }
+
+    public boolean isEmpty()
+    {
+        if (m_map == null)
+        {
+            return true;
+        }
+        return m_map.isEmpty();
+    }
+
+    public Enumeration keys()
+    {
+        if (m_map == null)
+        {
+            return null;
+        }
+        return new IteratorToEnumeration(m_map.keySet().iterator());
+    }
+
+    public Object put(Object key, Object value)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public Object remove(Object key)
+    {
+        throw new UnsupportedOperationException();
+    }
+
+    public int size()
+    {
+        if (m_map == null)
+        {
+            return 0;
+        }
+        return m_map.size();
+    }
+}
\ No newline at end of file



Mime
View raw message