incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r798814 [1/2] - in /incubator/ace/trunk: core/ core/conf/dev-client/ server/src/org/apache/ace/client/repository/ server/src/org/apache/ace/client/repository/impl/ server/src/org/apache/ace/obr/servlet/ test/ test/src/org/apache/ace/client/...
Date Wed, 29 Jul 2009 08:59:49 GMT
Author: marrs
Date: Wed Jul 29 08:59:48 2009
New Revision: 798814

URL: http://svn.apache.org/viewvc?rev=798814&view=rev
Log:
ACE-29 Refactored the client related repository bundles to explicitly support sessions. For this we introduced a SessionFactory to manage these sessions. Furthermore, each service or event that is session specific has a property service.sid containing the session ID of the service or event.

Added:
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java   (with props)
    incubator/ace/trunk/webui/war/WEB-INF/lib/gwt-servlet.jar
Removed:
    incubator/ace/trunk/core/conf/dev-client/org.apache.ace.swingui.components.Application.cfg
    incubator/ace/trunk/core/conf/dev-client/org.apache.ace.swingui.externallicensemanager.cfg
    incubator/ace/trunk/webui/src/org/apache/ace/server/SessionFramework.java
Modified:
    incubator/ace/trunk/core/build.xml
    incubator/ace/trunk/core/conf/dev-client/org.apache.ace.scheduler.cfg
    incubator/ace/trunk/core/target-dev-server-webui.xml
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/Activator.java
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierImpl.java
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierManager.java
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java
    incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositorySet.java
    incubator/ace/trunk/server/src/org/apache/ace/obr/servlet/BundleServlet.java
    incubator/ace/trunk/test/   (props changed)
    incubator/ace/trunk/test/src/org/apache/ace/client/repository/impl/ModelTest.java
    incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/Activator.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/AssociationServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/BundleServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/CheckoutServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/GroupServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/LicenseServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/ObjectMapping.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/ObjectServiceImpl.java
    incubator/ace/trunk/webui/src/org/apache/ace/server/TargetServiceImpl.java
    incubator/ace/trunk/webui/war/webui.html

Modified: incubator/ace/trunk/core/build.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/core/build.xml?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/core/build.xml (original)
+++ incubator/ace/trunk/core/build.xml Wed Jul 29 08:59:48 2009
@@ -261,51 +261,51 @@
 
     <target name="package-server" unless="server.uptodate">
         <project-bundle 
-            bundlename="Deployment Servlet"                                                                                                                                                 
+            bundlename="Apache ACE Deployment Servlet"                                                                                                                                                 
             bundlesymbolicname="org.apache.ace.deployment.servlet"                                                                                                                         
             privatepackage="org.apache.ace.deployment.servlet"
             bundleactivator="org.apache.ace.deployment.servlet.Activator" />
         <project-bundle 
-            bundlename="HTTP Service Listener"                                                                                                                                                 
+            bundlename="Apache ACE HTTP Service Listener"                                                                                                                                                 
             bundlesymbolicname="org.apache.ace.http.listener"                                                                                                                         
             privatepackage="org.apache.ace.http.listener"                                                                                                                           
             bundleactivator="org.apache.ace.http.listener.Activator" />
         <project-bundle 
-            bundlename="File Based Deployment Provider"                                                                                                                                                 
+            bundlename="Apache ACE File Based Deployment Provider"                                                                                                                                                 
             bundlesymbolicname="org.apache.ace.deployment.provider.filebased"                                                                                                                         
             exportpackage="org.apache.ace.deployment.provider"                                                                                                                           
             privatepackage="org.apache.ace.deployment.provider.filebased, org.apache.ace.deployment.provider.impl"
             bundleactivator="org.apache.ace.deployment.provider.filebased.Activator" />
         <project-bundle 
-            bundlename="Repository Based Deployment Provider"                                                                                                                                                 
+            bundlename="Apache ACE Repository Based Deployment Provider"                                                                                                                                                 
             bundlesymbolicname="org.apache.ace.deployment.provider.repositorybased"                                                                                                                         
             exportpackage="org.apache.ace.deployment.provider"                                                                                                                           
             privatepackage="org.apache.ace.deployment.provider.repositorybased, org.apache.ace.deployment.provider.impl, org.apache.ace.repository.ext, org.apache.ace.repository.impl, org.apache.ace.repository.impl"
             bundleactivator="org.apache.ace.deployment.provider.repositorybased.Activator" />
         <project-bundle 
-            bundlename="Deployment Stream Generator"                                                                                                                                                 
+            bundlename="Apache ACE Deployment Stream Generator"                                                                                                                                                 
             bundlesymbolicname="org.apache.ace.deployment.streamgenerator"                                                                                                                         
             exportpackage="org.apache.ace.deployment.streamgenerator"                                                                                                                           
             privatepackage="org.apache.ace.deployment.streamgenerator.impl"                                                                                                                           
             bundleactivator="org.apache.ace.deployment.streamgenerator.impl.Activator" />
         <project-bundle
-            bundlename="Server Log Servlet"
+            bundlename="Apache ACE Server Log Servlet"
             bundlesymbolicname="org.apache.ace.server.log"
             privatepackage="org.apache.ace.server.log"
             bundleactivator="org.apache.ace.server.log.Activator" />
         <project-bundle
-            bundlename="Server Log Store"
+            bundlename="Apache ACE Server Log Store"
             bundlesymbolicname="org.apache.ace.server.log.store"
             exportpackage="org.apache.ace.server.log.store, org.apache.ace.log"
             privatepackage="org.apache.ace.server.log.store.impl, org.apache.ace.util"
             bundleactivator="org.apache.ace.server.log.store.impl.Activator" />
         <project-bundle
-            bundlename="Server Log Task"
+            bundlename="Apache ACE Server Log Task"
             bundlesymbolicname="org.apache.ace.server.log.task"
             privatepackage="org.apache.ace.server.log.task"
             bundleactivator="org.apache.ace.server.log.task.Activator" />
         <project-bundle 
-            bundlename="OBR Metadata Generator"
+            bundlename="Apache ACE OBR Metadata Generator"
             bundlesymbolicname="org.apache.ace.obr.metadata"
             exportpackage="org.apache.ace.obr.metadata"
             privatepackage="org.apache.ace.obr.metadata.bindex, org.osgi.impl.bundle.bindex, org.osgi.impl.bundle.obr.resource, org.osgi.service.obr"
@@ -313,106 +313,100 @@
     		bundleclasspath="kxml2-min.jar,."
             bundleactivator="org.apache.ace.obr.metadata.bindex.Activator" />
         <project-bundle 
-            bundlename="OBR Storage"
+            bundlename="Apache ACE OBR Storage"
             bundlesymbolicname="org.apache.ace.obr.storage"
             exportpackage="org.apache.ace.obr.storage"
             privatepackage="org.apache.ace.obr.storage.file"
             bundleactivator="org.apache.ace.obr.storage.file.Activator" />
         <project-bundle 
-            bundlename="OBR Servlet"
+            bundlename="Apache ACE OBR Servlet"
             bundlesymbolicname="org.apache.ace.obr.servlet"
             privatepackage="org.apache.ace.obr.servlet"
             bundleactivator="org.apache.ace.obr.servlet.Activator" />
         <project-bundle 
-            bundlename="Object Repository"
+            bundlename="Apache ACE Object Repository"
             bundlesymbolicname="org.apache.ace.repository"
             exportpackage="org.apache.ace.repository"
             privatepackage="org.apache.ace.repository.ext, org.apache.ace.repository.impl, org.apache.ace.util"
             bundleactivator="org.apache.ace.repository.impl.Activator" />
         <project-bundle 
-            bundlename="Object Repository Servlet"
+            bundlename="Apache ACE Object Repository Servlet"
             bundlesymbolicname="org.apache.ace.repository.servlet"
             privatepackage="org.apache.ace.repository.servlet"
             bundleactivator="org.apache.ace.repository.servlet.Activator" />
         <project-bundle 
-            bundlename="Object Repository Task"
+            bundlename="Apache ACE Object Repository Replication Task"
             bundlesymbolicname="org.apache.ace.repository.task"
             privatepackage="org.apache.ace.repository.task"
             bundleactivator="org.apache.ace.repository.task.Activator" />
+        <!-- note: this bundle needs to export org.apache.ace.server.log.store since it does
+             not require a log to be present, but does need the interface, which is not define in core,
+             since it is not java 1.3 compatible. -->
         <project-bundle
-            bundlename="Repository Model"
+            bundlename="Apache ACE Client Repository and Stateful Gateway Model"
             bundlesymbolicname="org.apache.ace.client.repository"
-            exportpackage="org.apache.ace.client.repository, org.apache.ace.client.repository.object, org.apache.ace.client.repository.repository, org.apache.ace.client.repository.helper"
-            privatepackage="org.apache.ace.client.repository.impl, org.apache.ace.util, org.apache.ace.repository.ext, org.apache.ace.repository.impl"
+            exportpackage="org.apache.ace.client.repository, org.apache.ace.client.repository.object, org.apache.ace.client.repository.repository, org.apache.ace.client.repository.helper, org.apache.ace.client.repository.stateful, org.apache.ace.server.log.store"
+            privatepackage="org.apache.ace.client.repository.impl, org.apache.ace.util, org.apache.ace.repository.ext, org.apache.ace.repository.impl, org.apache.ace.client.repository.stateful.impl"
             bundleactivator="org.apache.ace.client.repository.impl.Activator"/>
-        <!-- note: the StatefulGatewayModel needs to export org.apache.ace.server.log.store since it does
-        not require a log to be present, but does need the interface, which is not define in core,
-        since it is not java 1.3 compatible. -->
         <project-bundle
-            bundlename="Stateful Gateway Model"
-            bundlesymbolicname="org.apache.ace.client.repository.stateful"
-            exportpackage="org.apache.ace.client.repository.stateful, org.apache.ace.server.log.store"
-            privatepackage="org.apache.ace.client.repository.stateful.impl"
-            bundleactivator="org.apache.ace.client.repository.stateful.impl.Activator"/>
-        <project-bundle
-            bundlename="Artifact Helper Resources"
+            bundlename="Apache ACE Client Artifact Helper Resources"
             bundlesymbolicname="org.apache.ace.client.repository.helper.base"
     		includeresource="ext/velocity-dep-1.5.jar"
     		bundleclasspath="velocity-dep-1.5.jar,."
     		importpackage="org.apache.ace.client.repository, org.apache.ace.client.repository.object, org.apache.ace.client.repository.helper, *;resolution:=optional"
             exportpackage="org.apache.ace.client.repository, org.apache.ace.client.repository.object, org.apache.ace.client.repository.helper, org.apache.ace.client.repository.helper.base"/>
         <project-bundle
-            bundlename="Bundle Artifact Helper"
+            bundlename="Apache ACE Client Bundle Artifact Helper"
             bundlesymbolicname="org.apache.ace.client.repository.helper.bundle"
             exportpackage="org.apache.ace.client.repository.helper.bundle"
             privatepackage="org.apache.ace.client.repository.helper.bundle.impl, org.apache.ace.util"
             bundleactivator="org.apache.ace.client.repository.helper.bundle.impl.Activator"/>
         <project-bundle
-            bundlename="Configuration Artifact Helper"
+            bundlename="Apache ACE Client Configuration Artifact Helper"
             bundlesymbolicname="org.apache.ace.client.repository.helper.configuration"
             exportpackage="org.apache.ace.client.repository.helper.configuration"
             privatepackage="org.apache.ace.client.repository.helper.configuration.impl"
             bundleactivator="org.apache.ace.client.repository.helper.configuration.impl.Activator"/>
         <project-bundle
-            bundlename="UserAdmin Artifact Helper"
+            bundlename="Apache ACE Client UserAdmin Artifact Helper"
             bundlesymbolicname="org.apache.ace.client.repository.helper.user"
             exportpackage="org.apache.ace.client.repository.helper.user"
             privatepackage="org.apache.ace.client.repository.helper.user.impl"
             bundleactivator="org.apache.ace.client.repository.helper.user.impl.Activator"/>
         <project-bundle 
-            bundlename="Serverside UserAdmin Configurator"
+            bundlename="Apache ACE Serverside UserAdmin Configurator"
             bundlesymbolicname="org.apache.ace.configurator.serveruseradmin"
             privatepackage="org.apache.ace.configurator.serveruseradmin"
             bundleactivator="org.apache.ace.configurator.serveruseradmin.Activator" />
         <!-- Note that the privatepackage below is not exactly clean; for now, we don't have another way to this,
     	but we might want to clean this up (i.e., everybody should be able to ask for a remote repository) -->
         <project-bundle 
-            bundlename="Repository Based UserAdmin Configuration Task"
+            bundlename="Apache ACE Repository Based UserAdmin Configuration Task"
             bundlesymbolicname="org.apache.ace.configurator.useradmin.task"
             privatepackage="org.apache.ace.configurator.useradmin.task, org.apache.ace.repository.impl, org.apache.ace.repository.ext"
             bundleactivator="org.apache.ace.configurator.useradmin.task.Activator" />
         <project-bundle 
-            bundlename="Repository UserAdmin Editor"
+            bundlename="Apache ACE Client Repository UserAdmin Editor"
             bundlesymbolicname="org.apache.ace.client.repositoryuseradmin"
             exportpackage="org.apache.ace.client.repositoryuseradmin"
             privatepackage="org.apache.ace.client.repositoryuseradmin.impl, org.apache.ace.client.repository, org.apache.ace.repository.impl, org.apache.ace.repository.ext"
             bundleactivator="org.apache.ace.client.repositoryuseradmin.impl.Activator" />
         <project-bundle 
-            bundlename="Server Action Interfaces"
+            bundlename="Apache ACE Server Action Interfaces"
             bundlesymbolicname="org.apache.ace.server.action"
             exportpackage="org.apache.ace.server.action" />
         <project-bundle 
-            bundlename="Popup Action"
+            bundlename="Apache ACE Server Popup Action"
             bundlesymbolicname="org.apache.ace.server.action.popupmessage"
             privatepackage="org.apache.ace.server.action.popupmessage"
             bundleactivator="org.apache.ace.server.action.popupmessage.Activator" />
         <project-bundle 
-            bundlename="Auto Gateway Operator"
+            bundlename="Apache ACE Auto Gateway Operator"
             bundlesymbolicname="org.apache.ace.client.automation"
             privatepackage="org.apache.ace.client.automation"
             bundleactivator="org.apache.ace.client.automation.Activator" />
         <project-bundle 
-            bundlename="UserAdmin Resource Processor"
+            bundlename="Apache ACE UserAdmin Resource Processor"
             bundlesymbolicname="org.apache.ace.resourceprocessor.useradmin" 
             exportpackage="org.apache.ace.resourceprocessor.useradmin" 
             privatepackage="org.apache.ace.resourceprocessor.useradmin.impl"
@@ -422,7 +416,7 @@
             </manifest>
         </project-bundle>
         <project-bundle 
-            bundlename="Luminis Conf Resource Processor"
+            bundlename="Apache ACE AutoConf Resource Processor"
             bundlesymbolicname="org.apache.felix.deployment.rp.autoconf" 
             privatepackage="org.apache.felix.deployment.rp.autoconf.impl, org.apache.felix.metatype.*, org.kxml2.io;-split-package:=merge-first, org.xmlpull.v1;-split-package:=merge-first, org.osgi.service.metatype;-split-package:=merge-first"
 			exportpackage="org.apache.felix.deployment.rp.autoconf"
@@ -432,7 +426,7 @@
             </manifest>
         </project-bundle>
         <project-bundle 
-            bundlename="UPnP Based Location Service"
+            bundlename="Apache ACE UPnP Based Location Service"
             bundlesymbolicname="org.apache.ace.location.upnp"
             exportpackage="org.apache.ace.location"
             privatepackage="org.apache.ace.location.upnp, org.apache.ace.location.upnp.actions, org.apache.ace.location.upnp.util"
@@ -454,69 +448,67 @@
             org.apache.felix.deploymentadmin, org.apache.felix.deploymentadmin.spi, org.apache.felix.eventadmin.impl, org.apache.felix.eventadmin.impl.*"
             bundleactivator="org.apache.ace.ma.webstart.Activator" />
         <project-bundle 
-            bundlename="Configurator"
+            bundlename="Apache ACE Configurator"
             bundlesymbolicname="org.apache.ace.configurator"
             privatepackage="org.apache.ace.configurator, org.apache.ace.gateway.constants"
             bundleactivator="org.apache.ace.configurator.Activator" />
         <project-bundle 
-            bundlename="Scheduler"
+            bundlename="Apache ACE Scheduler"
             bundlesymbolicname="org.apache.ace.scheduler"
             privatepackage="org.apache.ace.scheduler, org.apache.ace.gateway.constants"
             bundleactivator="org.apache.ace.scheduler.Activator" />
         <project-bundle 
-            bundlename="Deployment"
+            bundlename="Apache ACE Deployment"
             bundlesymbolicname="org.apache.ace.deployment"
             exportpackage="org.apache.ace.deployment"
             privatepackage="org.apache.ace.deployment.deploymentadmin"
             bundleactivator="org.apache.ace.deployment.deploymentadmin.Activator" />
         <project-bundle 
-            bundlename="Deployment Task"
+            bundlename="Apache ACE Deployment Task"
             bundlesymbolicname="org.apache.ace.deployment.task"
             exportpackage="org.apache.ace.deployment"
             privatepackage="org.apache.ace.deployment.task"
             bundleactivator="org.apache.ace.deployment.task.Activator" />
         <project-bundle 
-            bundlename="Property Based Discovery"
+            bundlename="Apache ACE Property Based Discovery"
             bundlesymbolicname="org.apache.ace.discovery.property"
             exportpackage="org.apache.ace.discovery"
             privatepackage="org.apache.ace.discovery.property"
             bundleactivator="org.apache.ace.discovery.property.Activator" />
         <project-bundle 
-            bundlename="Property Based Identification"
+            bundlename="Apache ACE Property Based Identification"
             bundlesymbolicname="org.apache.ace.identification.property"
             exportpackage="org.apache.ace.identification"
             privatepackage="org.apache.ace.identification.property"
             bundleactivator="org.apache.ace.identification.property.Activator" />
         <project-bundle 
-            bundlename="Ifconfig/mac-address Based Identification"
+            bundlename="Apache ACE ifconfig/MAC Address Based Identification"
             bundlesymbolicname="org.apache.ace.identification.ifconfig"
             exportpackage="org.apache.ace.identification"
             privatepackage="org.apache.ace.identification.ifconfig"
             bundleactivator="org.apache.ace.identification.ifconfig.Activator" />
         <project-bundle 
-            bundlename="Log Listener"
+            bundlename="Apache ACE Log Listener"
             bundlesymbolicname="org.apache.ace.log.listener"
             privatepackage="org.apache.ace.log.listener"
             bundleactivator="org.apache.ace.log.listener.Activator" />
         <project-bundle 
-            bundlename="Gateway Log"
+            bundlename="Apache ACE Gateway Log"
             bundlesymbolicname="org.apache.ace.gateway.log"
             privatepackage="org.apache.ace.gateway.log, org.apache.ace.gateway.log.task"
             bundleactivator="org.apache.ace.gateway.log.Activator" />
         <project-bundle
-            bundlename="Gateway Log Store"
+            bundlename="Apache ACE Gateway Log Store"
             bundlesymbolicname="org.apache.ace.gateway.log.store"
             privatepackage="org.apache.ace.gateway.log.store.impl, org.apache.ace.util"
             bundleactivator="org.apache.ace.gateway.log.store.impl.Activator"
             exportpackage="org.apache.ace.gateway.log.store, org.apache.ace.log"/>
-    	
         <project-bundle 
-            bundlename="UPnP Based Discovery"
+            bundlename="Apache ACE UPnP Based Discovery"
             bundlesymbolicname="org.apache.ace.discovery.upnp"
             exportpackage="org.apache.ace.discovery"
             privatepackage="org.apache.ace.discovery.upnp"
             bundleactivator="org.apache.ace.discovery.upnp.Activator" />
-
         <mkdir dir="deploy/target/dev-multigateway"/>
         <jar destfile="deploy/target/dev-multigateway/multigatewaybootstrap.jar" basedir="../gateway/classes" includes="org/apache/ace/bootstrap/multigateway/**">
             <manifest>
@@ -529,8 +521,9 @@
     <target name="package-webui" unless="webui.uptodate">
     	<!-- TODO add an activator to bridge between OSGi and GWT -->
         <copy file="../webui/webui.war" tofile="deploy/bundle/org.apache.ace.webui-1.0.0.jar"/>
-    	<echo file="org.apache.ace.webui-1.0.0.bnd">Import-Package: junit.framework;resolution:=optional, com.google.gwt.benchmarks;resolution:=optional, *
-Bundle-Name: Web UI
+    	<echo file="org.apache.ace.webui-1.0.0.bnd">Import-Package: org.apache.ace.log,org.apache.ace.client.repository,org.apache.ace.client.repository.object,org.apache.ace.client.repository.repository,org.apache.ace.client.repository.stateful,org.apache.ace.client.repository.helper,org.apache.ace.client.repository.helper.bundle,org.xml.sax, javax.xml.parsers, junit.framework;resolution:=optional, com.google.gwt.benchmarks;resolution:=optional, *
+Dynamic-ImportPackage: *
+Bundle-Name: Apache ACE Client Web UI
 Bundle-ClassPath: WEB-INF/classes, WEB-INF/lib/gwt-servlet.jar
 Bundle-SymbolicName: org.apache.ace.webui
 Webapp-Context: webui
@@ -539,7 +532,7 @@
         <bnd-wrap jars="deploy/bundle/org.apache.ace.webui-1.0.0.jar" output="deploy/bundle/org.apache.ace.webui-1.0.0.jar"/>
     	<jar file="deploy/bundle/org.apache.ace.webui-1.0.0.jar" update="true">
     	<manifest>
-            <attribute name="Bundle-ClassPath" value="WEB-INF/classes, WEB-INF/lib/gwt-servlet.jar, ."/>
+            <attribute name="Bundle-ClassPath" value="WEB-INF/classes, WEB-INF/lib/gwt-servlet.jar, WEB-INF/lib/felix.jar, ."/>
     	</manifest>
     	</jar>
     	<delete file="org.apache.ace.webui-1.0.0.bnd"/>
@@ -547,42 +540,42 @@
 
     <target name="package-test" unless="test.uptodate">
         <test-bundle 
-            bundlename="Test Deployment"                                                                                                                                          
+            bundlename="Apache ACE Test Deployment"                                                                                                                                          
             bundlesymbolicname="org.apache.ace.test.deployment" 
             privatepackage="org.apache.ace.test.deployment,org.apache.ace.test.osgi.dm,org.apache.ace.deployment.provider.impl,org.apache.ace.deployment.provider.filebased;-split-package:=merge-last,org.apache.ace.test.utils, org.apache.ace.test.utils.deployment"
             bundleactivator="org.apache.ace.test.deployment.Activator" />
         <test-bundle 
-            bundlename="Test Log"                                                                                                                                          
+            bundlename="Apache ACE Test Log"                                                                                                                                          
             bundlesymbolicname="org.apache.ace.test.log" 
             privatepackage="org.apache.ace.test.log,org.apache.ace.test.osgi.dm"
             bundleactivator="org.apache.ace.test.log.Activator" />
         <test-bundle 
-            bundlename="Test Http Servlet Listener"
+            bundlename="Apache ACE Test HTTP Servlet Listener"
             bundlesymbolicname="org.apache.ace.test.http.listener" 
             privatepackage="org.apache.ace.test.http.listener,org.apache.ace.test.osgi.dm"
             bundleactivator="org.apache.ace.test.http.listener.Activator" />
         <test-bundle 
-            bundlename="Test Repository"
+            bundlename="Apache ACE Test Repository"
             bundlesymbolicname="org.apache.ace.test.repository" 
             privatepackage="org.apache.ace.test.repository, org.apache.ace.test.utils, org.apache.ace.test.osgi.dm"
             bundleactivator="org.apache.ace.test.repository.Activator" />
         <test-bundle 
-            bundlename="Test Repository Admin"
+            bundlename="Apache ACE Test Repository Admin"
             bundlesymbolicname="org.apache.ace.test.repositoryadmin" 
             privatepackage="org.apache.ace.test.repositoryadmin, org.apache.ace.test.utils, org.apache.ace.test.osgi.dm"
             bundleactivator="org.apache.ace.test.repositoryadmin.Activator" />
         <test-bundle 
-            bundlename="Test UserAdmin Configurator"
+            bundlename="Apache ACE Test UserAdmin Configurator"
             bundlesymbolicname="org.apache.ace.test.useradminconfigurator" 
             privatepackage="org.apache.ace.test.useradminconfigurator, org.apache.ace.test.utils, org.apache.ace.test.osgi.dm"
             bundleactivator="org.apache.ace.test.useradminconfigurator.Activator" />
         <test-bundle 
-    	    bundlename="Test SystemBundle Stopper"
+    	    bundlename="Apache ACE Test System Bundle Stopper"
     	    bundlesymbolicname="org.apache.ace.test.bundlestop" 
     	    privatepackage="org.apache.ace.test.bundlestop"
     	    bundleactivator="org.apache.ace.test.bundlestop.Activator" />
         <test-bundle 
-    	    bundlename="Test Mock Autoconf"
+    	    bundlename="Apache ACE Test Mock AutoConf"
     	    bundlesymbolicname="org.apache.ace.test.mockautoconf" 
     	    privatepackage="org.apache.ace.test.mockautoconf"
     	    bundleactivator="org.apache.ace.test.mockautoconf.Activator" >

Modified: incubator/ace/trunk/core/conf/dev-client/org.apache.ace.scheduler.cfg
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/core/conf/dev-client/org.apache.ace.scheduler.cfg?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/core/conf/dev-client/org.apache.ace.scheduler.cfg (original)
+++ incubator/ace/trunk/core/conf/dev-client/org.apache.ace.scheduler.cfg Wed Jul 29 08:59:48 2009
@@ -1,4 +1 @@
-org.apache.ace.client.processauditlog = 2000
-org.apache.ace.client.updatestatusbar = 5000
-org.apache.ace.swingui.externallicensemanager.updatestatusbar = 5000
 org.apache.ace.configurator.useradmin.task.UpdateUserAdminTask = 2000
\ No newline at end of file

Modified: incubator/ace/trunk/core/target-dev-server-webui.xml
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/core/target-dev-server-webui.xml?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/core/target-dev-server-webui.xml (original)
+++ incubator/ace/trunk/core/target-dev-server-webui.xml Wed Jul 29 08:59:48 2009
@@ -1,6 +1,6 @@
 <project name="dev-server-webui" default="warning">
     <property name="deploy-dir" value="deploy/target/${ant.project.name}" />
-	<property name="app-name" value="L-iQ PS server" />
+	<property name="app-name" value="Apache ACE Server WebUI" />
 
     <target name="warning">
         <echo message="Please run top level build." />
@@ -30,7 +30,6 @@
             	<include name="org.apache.ace.scheduler-1.0.0.jar" />
             	<include name="org.apache.ace.repository-1.0.0.jar" />
             	<include name="org.apache.ace.repository.servlet-1.0.0.jar" />
-                <include name="org.apache.ace.client.repository.stateful-1.0.0.jar" />
                 <include name="org.apache.ace.client.repository-1.0.0.jar" />
                 <include name="org.apache.ace.client.repository.helper.base-1.0.0.jar" />
                 <include name="org.apache.ace.client.repository.helper.bundle-1.0.0.jar" />
@@ -38,10 +37,6 @@
                 <include name="org.apache.ace.obr.storage-1.0.0.jar" />
                 <include name="org.apache.ace.obr.metadata-1.0.0.jar" />
                 <include name="org.apache.ace.webui-1.0.0.jar" />
-                <!-- for testing -->
-                <!--
-                <include name="org.apache.ace.http.echo.servlet-1.0.0.jar" />
-                -->
             </fileset>
             <fileset dir="ext">
             	<include name="org.osgi.compendium.jar" />
@@ -54,8 +49,8 @@
                 <include name="org.apache.ace.xstream-1.3.jar" />
                 <include name="org.apache.felix.configadmin.jar" />
                 <include name="org.apache.felix.eventadmin.jar" />
-                <include name="log_all-2.0.0.jar" />
             	<include name="useradmin_all-2.0.0.jar" />
+                <include name="log_all-2.0.0.jar" />
             	<include name="org.apache.felix.prefs.jar" />
             	<include name="pax-web-service-0.6.0.jar" />
                 <include name="pax-web-extender-war-0.7.0-SNAPSHOT.jar" />
@@ -66,6 +61,7 @@
                 <include name="**/*.cfg" />
             </fileset>
         </copy>
+    	
         <copy file="${deploy-dir}/conf/dev-config.properties" overwrite="true" tofile="${deploy-dir}/conf/config.properties" />
         <delete file="${deploy-dir}/conf/test-config.properties" />
         <property name="bundles-noshell" value="
@@ -91,7 +87,6 @@
             file:bundle/org.apache.ace.scheduler-1.0.0.jar
             file:bundle/org.apache.ace.repository-1.0.0.jar
             file:bundle/org.apache.ace.repository.servlet-1.0.0.jar
-    	    file:bundle/org.apache.ace.client.repository.stateful-1.0.0.jar
     	    file:bundle/org.apache.ace.client.repository-1.0.0.jar
             file:bundle/org.apache.ace.client.repository.helper.base-1.0.0.jar
             file:bundle/org.apache.ace.client.repository.helper.bundle-1.0.0.jar

Added: incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java?rev=798814&view=auto
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java (added)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java Wed Jul 29 08:59:48 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.ace.client.repository;
+
+/**
+ * Factory service for creating and destroying sessions. Sessions are identified by some kind
+ * of identification. This identification is also used as a service property in case there is
+ * one service for each session. The property name for this is <code>service.sid</code>, the
+ * service session ID. It is also used to listen to session specific events, in which case this
+ * same property is part of the actual event so it can be used in event filters.
+ */
+public interface SessionFactory {
+    /** Session ID for session specific service or event. */
+    public static final String SERVICE_SID = "service.sid";
+    /**
+     * Create a new session based on the supplied session ID.
+     *
+     * @param sessionID the session ID
+     */
+    public void createSession(String sessionID);
+    /**
+     * Destroy an existing session supplied on the supplied session ID.
+     *
+     * @param sessionID the session ID
+     */
+    public void destroySession(String sessionID);
+}

Propchange: incubator/ace/trunk/server/src/org/apache/ace/client/repository/SessionFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/Activator.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/Activator.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/Activator.java Wed Jul 29 08:59:48 2009
@@ -18,18 +18,14 @@
  */
 package org.apache.ace.client.repository.impl;
 
-import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Dictionary;
-import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
+import java.util.Set;
 
-import org.apache.ace.client.repository.ObjectRepository;
 import org.apache.ace.client.repository.RepositoryAdmin;
-import org.apache.ace.client.repository.RepositoryObject;
-import org.apache.ace.client.repository.helper.ArtifactHelper;
+import org.apache.ace.client.repository.SessionFactory;
+import org.apache.ace.client.repository.helper.bundle.BundleHelper;
 import org.apache.ace.client.repository.object.Artifact2GroupAssociation;
 import org.apache.ace.client.repository.object.ArtifactObject;
 import org.apache.ace.client.repository.object.DeploymentVersionObject;
@@ -38,19 +34,17 @@
 import org.apache.ace.client.repository.object.GroupObject;
 import org.apache.ace.client.repository.object.License2GatewayAssociation;
 import org.apache.ace.client.repository.object.LicenseObject;
-import org.apache.ace.client.repository.repository.Artifact2GroupAssociationRepository;
 import org.apache.ace.client.repository.repository.ArtifactRepository;
 import org.apache.ace.client.repository.repository.DeploymentVersionRepository;
 import org.apache.ace.client.repository.repository.GatewayRepository;
-import org.apache.ace.client.repository.repository.Group2LicenseAssociationRepository;
-import org.apache.ace.client.repository.repository.GroupRepository;
-import org.apache.ace.client.repository.repository.License2GatewayAssociationRepository;
-import org.apache.ace.client.repository.repository.LicenseRepository;
+import org.apache.ace.client.repository.stateful.StatefulGatewayRepository;
+import org.apache.ace.client.repository.stateful.impl.StatefulGatewayRepositoryImpl;
+import org.apache.ace.server.log.store.LogStore;
 import org.apache.felix.dependencymanager.DependencyActivatorBase;
 import org.apache.felix.dependencymanager.DependencyManager;
 import org.apache.felix.dependencymanager.Service;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Constants;
 import org.osgi.service.event.EventAdmin;
 import org.osgi.service.event.EventConstants;
 import org.osgi.service.event.EventHandler;
@@ -58,150 +52,96 @@
 import org.osgi.service.prefs.PreferencesService;
 
 /**
- * Activator for the RepositoryAdmin bundle. Creates and registers the necessary repositories,
- * plus the repository admin.
+ * Activator for the RepositoryAdmin bundle. Creates the repository admin, which internally
+ * creates all required repositories.
  */
-public class Activator extends DependencyActivatorBase {
-    private DependencyManager m_manager;
-    List<Service[]> m_services;
-
-    private RepositoryAdminImpl m_repositoryAdminImpl;
-    private ChangeNotifierManager m_changeNotifierManager;
-
-    private ArtifactRepositoryImpl m_artifactRepositoryImpl;
-    private GroupRepositoryImpl m_groupRepositoryImpl;
-    private Artifact2GroupAssociationRepositoryImpl m_artifact2GroupAssociationRepositoryImpl;
-    private LicenseRepositoryImpl m_licenseRepositoryImpl;
-    private Group2LicenseAssociationRepositoryImpl m_group2LicenseAssociationRepositoryImpl;
-    private GatewayRepositoryImpl m_gatewayRepositoryImpl;
-    private License2GatewayAssociationRepositoryImpl m_license2GatewayAssociationRepositoryImpl;
-    private DeploymentVersionRepositoryImpl m_deploymentVersionRepositoryImpl;
+public class Activator extends DependencyActivatorBase implements SessionFactory {
+    private DependencyManager m_dependencyManager;
 
     @Override
     public synchronized void init(BundleContext context, DependencyManager manager) throws Exception {
-        m_manager = manager;
-
-        m_changeNotifierManager = new ChangeNotifierManager();
-        manager.add(createService()
-            .setImplementation(m_changeNotifierManager)
-            .add(createServiceDependency().setService(EventAdmin.class).setRequired(true)));
-
-        m_repositoryAdminImpl = new RepositoryAdminImpl(this, m_changeNotifierManager.getConfiguredNotifier(RepositoryAdmin.PRIVATE_TOPIC_ROOT, RepositoryAdmin.PUBLIC_TOPIC_ROOT, RepositoryAdmin.TOPIC_ENTITY_ROOT));
+        m_dependencyManager = manager;
         manager.add(createService()
-            .setInterface(RepositoryAdmin.class.getName(), null)
-            .setImplementation(m_repositoryAdminImpl)
-            .add(createServiceDependency().setService(PreferencesService.class).setRequired(true))
-            .add(createServiceDependency().setService(LogService.class).setRequired(false)));
+            .setInterface(SessionFactory.class.getName(), null)
+            .setImplementation(this)
+        );
     }
 
-    private <T extends RepositoryObject> Service[] registerRepository(Class<? extends ObjectRepository<T>> iface, ObjectRepositoryImpl<?, T> imp, String[] topics) {
-        Service repositoryService = createService()
-            .setInterface(iface.getName(), null)
-            .setImplementation(imp)
-            .add(createServiceDependency().setService(LogService.class).setRequired(false));
-        Dictionary<String, String[]> topic = new Hashtable<String, String[]>();
-        topic.put(EventConstants.EVENT_TOPIC, topics);
-        Service handlerService = createService()
-            .setInterface(EventHandler.class.getName(), topic)
-            .setImplementation(imp);
-
-        m_manager.add(repositoryService);
-        m_manager.add(handlerService);
-        return new Service[] {repositoryService, handlerService};
+    @Override
+    public synchronized void destroy(BundleContext context, DependencyManager manager) throws Exception {
     }
 
-    @SuppressWarnings("unchecked")
-    synchronized Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> publishRepositories() {
-        // create the repository objects, if this is the first time this method is called.
-        if (m_artifactRepositoryImpl == null) {
-            m_artifactRepositoryImpl = new ArtifactRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, ArtifactObject.TOPIC_ENTITY_ROOT));
-            m_groupRepositoryImpl = new GroupRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, GroupObject.TOPIC_ENTITY_ROOT));
-            m_artifact2GroupAssociationRepositoryImpl = new Artifact2GroupAssociationRepositoryImpl(m_artifactRepositoryImpl, m_groupRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, Artifact2GroupAssociation.TOPIC_ENTITY_ROOT));
-            m_licenseRepositoryImpl = new LicenseRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, LicenseObject.TOPIC_ENTITY_ROOT));
-            m_group2LicenseAssociationRepositoryImpl = new Group2LicenseAssociationRepositoryImpl(m_groupRepositoryImpl, m_licenseRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, Group2LicenseAssociation.TOPIC_ENTITY_ROOT));
-            m_gatewayRepositoryImpl = new GatewayRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, GatewayObject.TOPIC_ENTITY_ROOT));
-            m_license2GatewayAssociationRepositoryImpl = new License2GatewayAssociationRepositoryImpl(m_licenseRepositoryImpl, m_gatewayRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, License2GatewayAssociation.TOPIC_ENTITY_ROOT));
-            m_deploymentVersionRepositoryImpl = new DeploymentVersionRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, DeploymentVersionObject.TOPIC_ENTITY_ROOT));
-        }
-        // first, register the artifact repository manually; it needs some special care.
-        Service artifactRepoService = createService()
-            .setInterface(ArtifactRepository.class.getName(), null)
-            .setImplementation(m_artifactRepositoryImpl)
-            .add(createServiceDependency().setService(LogService.class).setRequired(false))
-            .add(createServiceDependency().setService(ArtifactHelper.class).setRequired(false).setAutoConfig(false).setCallbacks(this, "addArtifactHelper", "removeArtifactHelper"));
-        Dictionary<String, String[]> topic = new Hashtable<String, String[]>();
-        topic.put(EventConstants.EVENT_TOPIC, new String[] {});
-        Service artifactHandlerService = createService()
-            .setInterface(EventHandler.class.getName(), topic)
-            .setImplementation(m_artifactRepositoryImpl);
-        m_manager.add(artifactRepoService);
-        m_manager.add(artifactHandlerService);
-
-        m_services = new ArrayList<Service[]>();
-        m_services.add(new Service[] {artifactRepoService, artifactHandlerService});
-
-        // register all repositories are services. Keep the service objects around, we need them to pull the services later.
-        m_services.add(registerRepository(Artifact2GroupAssociationRepository.class, m_artifact2GroupAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(ArtifactObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(GroupObject.TOPIC_ENTITY_ROOT)}));
-        m_services.add(registerRepository(GroupRepository.class, m_groupRepositoryImpl, new String[] {}));
-        m_services.add(registerRepository(Group2LicenseAssociationRepository.class, m_group2LicenseAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(GroupObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(LicenseObject.TOPIC_ENTITY_ROOT)}));
-        m_services.add(registerRepository(LicenseRepository.class, m_licenseRepositoryImpl, new String[] {}));
-        m_services.add(registerRepository(License2GatewayAssociationRepository.class, m_license2GatewayAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(LicenseObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(GatewayObject.TOPIC_ENTITY_ROOT)}));
-        m_services.add(registerRepository(GatewayRepository.class, m_gatewayRepositoryImpl, new String[] {}));
-        m_services.add(registerRepository(DeploymentVersionRepository.class, m_deploymentVersionRepositoryImpl, new String[] {}));
-
-        // prepare the results.
-        Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> result = new HashMap<Class<? extends ObjectRepository>, ObjectRepositoryImpl>();
-
-        result.put(ArtifactRepository.class, m_artifactRepositoryImpl);
-        result.put(Artifact2GroupAssociationRepository.class, m_artifact2GroupAssociationRepositoryImpl);
-        result.put(GroupRepository.class, m_groupRepositoryImpl);
-        result.put(Group2LicenseAssociationRepository.class, m_group2LicenseAssociationRepositoryImpl);
-        result.put(LicenseRepository.class, m_licenseRepositoryImpl);
-        result.put(License2GatewayAssociationRepository.class, m_license2GatewayAssociationRepositoryImpl);
-        result.put(GatewayRepository.class, m_gatewayRepositoryImpl);
-        result.put(DeploymentVersionRepository.class, m_deploymentVersionRepositoryImpl);
-
-        return result;
-    }
-
-    /**
-     * Helper method for use in publishRepositories
-     */
-    private static String createPrivateObjectTopic(String entityRoot) {
-        return RepositoryObject.PRIVATE_TOPIC_ROOT + entityRoot + RepositoryObject.TOPIC_ALL_SUFFIX;
-    }
-
-    /**
-     * Pulls all repository services; is used to make sure the repositories go away before the RepositoryAdmin does.
-     */
-    synchronized void pullRepositories() {
-        for (Service[] services : m_services) {
-            for (Service service : services) {
-                m_manager.remove(service);
+    private Set<String> m_sessions = new HashSet<String>();
+    private Service m_service;
+    private Service m_service2;
+
+    public void createSession(String sessionID) {
+        boolean create = false;
+        synchronized (m_sessions) {
+            if (!m_sessions.contains(sessionID)) {
+                m_sessions.add(sessionID);
+                create = true;
             }
         }
+        if (create) {
+            createSessionServices(sessionID);
+        }
     }
 
-    @Override
-    public synchronized void destroy(BundleContext context, DependencyManager manager) throws Exception {
-        if (m_repositoryAdminImpl.loggedIn()) {
-            try {
-                m_repositoryAdminImpl.logout(true);
-            }
-            catch (IOException ioe) {
-                // Not much to do about this. We could log it?
-            }
+    public void destroySession(String sessionID) {
+        boolean destroy = false;
+        synchronized (m_sessions) {
+            destroy = m_sessions.remove(sessionID);
+        }
+        if (destroy) {
+            destroySessionServices(sessionID);
         }
-        m_repositoryAdminImpl = null;
     }
 
-    public void addArtifactHelper(ServiceReference ref, ArtifactHelper helper) {
-        String mimetype = (String) ref.getProperty(ArtifactHelper.KEY_MIMETYPE);
-        m_artifactRepositoryImpl.addHelper(mimetype, helper);
+    @SuppressWarnings("unchecked")
+    private void createSessionServices(String sessionID) {
+        RepositoryAdminImpl rai = new RepositoryAdminImpl(sessionID);
+        m_service = createService()
+            .setInterface(RepositoryAdmin.class.getName(), rai.getSessionProps())
+            .setImplementation(rai)
+            .setComposition("getInstances")
+            .add(createServiceDependency().setService(PreferencesService.class).setRequired(true))
+            .add(createServiceDependency().setService(EventAdmin.class).setRequired(true))
+            .add(createServiceDependency().setService(LogService.class).setRequired(false));
+        m_dependencyManager.add(m_service);
+
+        Dictionary topic = new Hashtable();
+        topic.put(EventConstants.EVENT_TOPIC, new String[] {
+            ArtifactObject.TOPIC_ALL,
+            Artifact2GroupAssociation.TOPIC_ALL,
+            GroupObject.TOPIC_ALL,
+            Group2LicenseAssociation.TOPIC_ALL,
+            LicenseObject.TOPIC_ALL,
+            License2GatewayAssociation.TOPIC_ALL,
+            GatewayObject.TOPIC_ALL,
+            DeploymentVersionObject.TOPIC_ALL,
+            RepositoryAdmin.TOPIC_REFRESH, RepositoryAdmin.TOPIC_LOGIN});
+        String filter = "(" + SessionFactory.SERVICE_SID + "=" + sessionID + ")";
+        topic.put(EventConstants.EVENT_FILTER, filter);
+        topic.put(SessionFactory.SERVICE_SID, sessionID);
+        StatefulGatewayRepositoryImpl statefulGatewayRepositoryImpl = new StatefulGatewayRepositoryImpl();
+        m_service2 = createService()
+            .setInterface(new String[] { StatefulGatewayRepository.class.getName(), EventHandler.class.getName() }, topic)
+            .setImplementation(statefulGatewayRepositoryImpl)
+            .add(createServiceDependency().setService(ArtifactRepository.class, filter).setRequired(true))
+            .add(createServiceDependency().setService(GatewayRepository.class, filter).setRequired(true))
+            .add(createServiceDependency().setService(DeploymentVersionRepository.class, filter).setRequired(true))
+            .add(createServiceDependency().setService(LogStore.class, "(&("+Constants.OBJECTCLASS+"="+LogStore.class.getName()+")(name=auditlog))").setRequired(false))
+            .add(createServiceDependency().setService(BundleHelper.class).setRequired(true))
+            .add(createServiceDependency().setService(EventAdmin.class).setRequired(true))
+            .add(createServiceDependency().setService(LogService.class).setRequired(false));
+        m_dependencyManager.add(m_service2);
     }
 
-    public synchronized void removeArtifactHelper(ServiceReference ref, ArtifactHelper helper) {
-        String mimetype = (String) ref.getProperty(ArtifactHelper.KEY_MIMETYPE);
-        m_artifactRepositoryImpl.removeHelper(mimetype, helper);
+    private void destroySessionServices(String sessionID) {
+        m_dependencyManager.remove(m_service2);
+        m_dependencyManager.remove(m_service);
+        m_service2 = null;
+        m_service = null;
     }
 }

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierImpl.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierImpl.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierImpl.java Wed Jul 29 08:59:48 2009
@@ -20,6 +20,7 @@
 
 import java.util.Properties;
 
+import org.apache.ace.client.repository.SessionFactory;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
 
@@ -42,6 +43,7 @@
     private final String m_privateTopicRoot;
     private final String m_publicTopicRoot;
     private final String m_entityRoot;
+    private final String m_sessionID;
 
     /**
      * Creates a new ChangeNotifierImpl.
@@ -50,14 +52,24 @@
      * @param publicTopicRoot The root of all public topics; see TopicRoot in the description of this class.
      * @param entityRoot A class-specific root for the class which will use this ChangeNotifierImpl.
      */
-    ChangeNotifierImpl(EventAdmin eventAdmin, String privateTopicRoot, String publicTopicRoot, String entityRoot) {
+    ChangeNotifierImpl(EventAdmin eventAdmin, String privateTopicRoot, String publicTopicRoot, String entityRoot, String sessionID) {
         m_eventAdmin = eventAdmin;
         m_privateTopicRoot = privateTopicRoot;
         m_publicTopicRoot = publicTopicRoot;
         m_entityRoot = entityRoot;
+        m_sessionID = sessionID;
+    }
+
+    private Properties addSession(Properties props) {
+        if (props == null) {
+            props = new Properties();
+        }
+        props.put(SessionFactory.SERVICE_SID, m_sessionID);
+        return props;
     }
 
     public void notifyChanged(String topic, Properties props, boolean internalOnly) {
+        props = addSession(props);
         m_eventAdmin.sendEvent(new Event(m_privateTopicRoot + m_entityRoot + topic, props));
         if (!internalOnly) {
             m_eventAdmin.postEvent(new Event(m_publicTopicRoot + m_entityRoot + topic, props));

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierManager.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierManager.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierManager.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/ChangeNotifierManager.java Wed Jul 29 08:59:48 2009
@@ -37,8 +37,8 @@
      * @param entityRoot A class-specific root for the class which will use this ChangeNotifierImpl.
      * @return The newly configured ChangeNotifier.
      */
-    public ChangeNotifier getConfiguredNotifier(String privateTopicRoot, String publicTopicRoot, String entityRoot) {
-        return new ChangeNotifierImpl(this, privateTopicRoot, publicTopicRoot, entityRoot);
+    public ChangeNotifier getConfiguredNotifier(String privateTopicRoot, String publicTopicRoot, String entityRoot, String sessionID) {
+        return new ChangeNotifierImpl(this, privateTopicRoot, publicTopicRoot, entityRoot, sessionID);
     }
 
     public void postEvent(Event event) {

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminImpl.java Wed Jul 29 08:59:48 2009
@@ -21,22 +21,53 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.ace.client.repository.ObjectRepository;
 import org.apache.ace.client.repository.RepositoryAdmin;
 import org.apache.ace.client.repository.RepositoryAdminLoginContext;
 import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.SessionFactory;
 import org.apache.ace.client.repository.RepositoryObject.WorkingState;
+import org.apache.ace.client.repository.helper.ArtifactHelper;
 import org.apache.ace.client.repository.impl.RepositoryAdminLoginContextImpl.RepositorySetDescriptor;
+import org.apache.ace.client.repository.object.Artifact2GroupAssociation;
+import org.apache.ace.client.repository.object.ArtifactObject;
+import org.apache.ace.client.repository.object.DeploymentVersionObject;
+import org.apache.ace.client.repository.object.GatewayObject;
+import org.apache.ace.client.repository.object.Group2LicenseAssociation;
+import org.apache.ace.client.repository.object.GroupObject;
+import org.apache.ace.client.repository.object.License2GatewayAssociation;
+import org.apache.ace.client.repository.object.LicenseObject;
+import org.apache.ace.client.repository.repository.Artifact2GroupAssociationRepository;
 import org.apache.ace.client.repository.repository.ArtifactRepository;
+import org.apache.ace.client.repository.repository.DeploymentVersionRepository;
+import org.apache.ace.client.repository.repository.GatewayRepository;
+import org.apache.ace.client.repository.repository.Group2LicenseAssociationRepository;
+import org.apache.ace.client.repository.repository.GroupRepository;
+import org.apache.ace.client.repository.repository.License2GatewayAssociationRepository;
+import org.apache.ace.client.repository.repository.LicenseRepository;
 import org.apache.ace.repository.Repository;
 import org.apache.ace.repository.ext.BackupRepository;
 import org.apache.ace.repository.ext.CachedRepository;
 import org.apache.ace.repository.impl.CachedRepositoryImpl;
 import org.apache.ace.repository.impl.FilebasedBackupRepository;
 import org.apache.ace.repository.impl.RemoteRepository;
+import org.apache.felix.dependencymanager.DependencyManager;
+import org.apache.felix.dependencymanager.Logger;
+import org.apache.felix.dependencymanager.Service;
+import org.apache.felix.dependencymanager.ServiceDependency;
+import org.apache.felix.dependencymanager.ServiceImpl;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
 import org.osgi.service.log.LogService;
 import org.osgi.service.prefs.Preferences;
 import org.osgi.service.prefs.PreferencesService;
@@ -69,11 +100,42 @@
     private final static String PREFS_LOCAL_FILE_BACKUP = "backup";
     private User m_user;
     private RepositorySet[] m_repositorySets;
-    private final Activator m_repositoryFactory;
 
-    RepositoryAdminImpl(Activator factory, ChangeNotifier changeNotifier) {
-        m_repositoryFactory = factory;
-        m_changeNotifier = changeNotifier;
+    private volatile DependencyManager m_manager;
+    List<Service[]> m_services;
+    private ArtifactRepositoryImpl m_artifactRepositoryImpl;
+    private GroupRepositoryImpl m_groupRepositoryImpl;
+    private Artifact2GroupAssociationRepositoryImpl m_artifact2GroupAssociationRepositoryImpl;
+    private LicenseRepositoryImpl m_licenseRepositoryImpl;
+    private Group2LicenseAssociationRepositoryImpl m_group2LicenseAssociationRepositoryImpl;
+    private GatewayRepositoryImpl m_gatewayRepositoryImpl;
+    private License2GatewayAssociationRepositoryImpl m_license2GatewayAssociationRepositoryImpl;
+    private DeploymentVersionRepositoryImpl m_deploymentVersionRepositoryImpl;
+    private Logger m_logger;
+    private ChangeNotifierManager m_changeNotifierManager;
+    private final String m_sessionID;
+    private final Properties m_sessionProps;
+
+    public RepositoryAdminImpl(String sessionID) {
+        m_sessionID = sessionID;
+        m_sessionProps = new Properties();
+        m_sessionProps.put(SessionFactory.SERVICE_SID, sessionID);
+        m_changeNotifierManager = new ChangeNotifierManager();
+        m_changeNotifier = m_changeNotifierManager.getConfiguredNotifier(RepositoryAdmin.PRIVATE_TOPIC_ROOT, RepositoryAdmin.PUBLIC_TOPIC_ROOT, RepositoryAdmin.TOPIC_ENTITY_ROOT, m_sessionID);
+    }
+
+    public Properties getSessionProps() {
+        return m_sessionProps;
+    }
+
+    /**
+     * Returns a list of instances that make up this composition. Instances are used to
+     * inject dependencies into.
+     *
+     * @return list of instances
+     */
+    public Object[] getInstances() {
+        return new Object[] { this, m_changeNotifierManager };
     }
 
     @SuppressWarnings("unchecked")
@@ -83,13 +145,131 @@
 
     @SuppressWarnings("unchecked")
     public void start() {
-        initialize(m_repositoryFactory.publishRepositories());
+        initialize(publishRepositories());
     }
 
     public void stop() {
-        m_repositoryFactory.pullRepositories();
+        pullRepositories();
+        if (loggedIn()) {
+            try {
+                logout(true);
+            }
+            catch (IOException ioe) {
+                m_log.log(LogService.LOG_ERROR, "Failed to log out of the repositories.", ioe);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    synchronized Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> publishRepositories() {
+        // create the repository objects, if this is the first time this method is called.
+        if (m_artifactRepositoryImpl == null) {
+            m_artifactRepositoryImpl = new ArtifactRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, ArtifactObject.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_groupRepositoryImpl = new GroupRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, GroupObject.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_artifact2GroupAssociationRepositoryImpl = new Artifact2GroupAssociationRepositoryImpl(m_artifactRepositoryImpl, m_groupRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, Artifact2GroupAssociation.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_licenseRepositoryImpl = new LicenseRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, LicenseObject.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_group2LicenseAssociationRepositoryImpl = new Group2LicenseAssociationRepositoryImpl(m_groupRepositoryImpl, m_licenseRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, Group2LicenseAssociation.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_gatewayRepositoryImpl = new GatewayRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, GatewayObject.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_license2GatewayAssociationRepositoryImpl = new License2GatewayAssociationRepositoryImpl(m_licenseRepositoryImpl, m_gatewayRepositoryImpl, m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, License2GatewayAssociation.TOPIC_ENTITY_ROOT, m_sessionID));
+            m_deploymentVersionRepositoryImpl = new DeploymentVersionRepositoryImpl(m_changeNotifierManager.getConfiguredNotifier(RepositoryObject.PRIVATE_TOPIC_ROOT, RepositoryObject.PUBLIC_TOPIC_ROOT, DeploymentVersionObject.TOPIC_ENTITY_ROOT, m_sessionID));
+        }
+        // first, register the artifact repository manually; it needs some special care.
+        Service artifactRepoService = createService()
+            .setInterface(ArtifactRepository.class.getName(), m_sessionProps)
+            .setImplementation(m_artifactRepositoryImpl)
+            .add(createServiceDependency().setService(LogService.class).setRequired(false))
+            .add(createServiceDependency().setService(ArtifactHelper.class).setRequired(false).setAutoConfig(false).setCallbacks(this, "addArtifactHelper", "removeArtifactHelper"));
+        Dictionary topic = new Hashtable();
+        topic.put(EventConstants.EVENT_TOPIC, new String[] {});
+        topic.put(EventConstants.EVENT_FILTER, "(" + SessionFactory.SERVICE_SID + "=" + m_sessionID + ")");
+        Service artifactHandlerService = createService()
+            .setInterface(EventHandler.class.getName(), topic)
+            .setImplementation(m_artifactRepositoryImpl);
+        m_manager.add(artifactRepoService);
+        m_manager.add(artifactHandlerService);
+
+        m_services = new ArrayList<Service[]>();
+        m_services.add(new Service[] {artifactRepoService, artifactHandlerService});
+
+        // register all repositories are services. Keep the service objects around, we need them to pull the services later.
+        m_services.add(registerRepository(Artifact2GroupAssociationRepository.class, m_artifact2GroupAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(ArtifactObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(GroupObject.TOPIC_ENTITY_ROOT)}));
+        m_services.add(registerRepository(GroupRepository.class, m_groupRepositoryImpl, new String[] {}));
+        m_services.add(registerRepository(Group2LicenseAssociationRepository.class, m_group2LicenseAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(GroupObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(LicenseObject.TOPIC_ENTITY_ROOT)}));
+        m_services.add(registerRepository(LicenseRepository.class, m_licenseRepositoryImpl, new String[] {}));
+        m_services.add(registerRepository(License2GatewayAssociationRepository.class, m_license2GatewayAssociationRepositoryImpl, new String[] {createPrivateObjectTopic(LicenseObject.TOPIC_ENTITY_ROOT), createPrivateObjectTopic(GatewayObject.TOPIC_ENTITY_ROOT)}));
+        m_services.add(registerRepository(GatewayRepository.class, m_gatewayRepositoryImpl, new String[] {}));
+        m_services.add(registerRepository(DeploymentVersionRepository.class, m_deploymentVersionRepositoryImpl, new String[] {}));
+
+        // prepare the results.
+        Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> result = new HashMap<Class<? extends ObjectRepository>, ObjectRepositoryImpl>();
+
+        result.put(ArtifactRepository.class, m_artifactRepositoryImpl);
+        result.put(Artifact2GroupAssociationRepository.class, m_artifact2GroupAssociationRepositoryImpl);
+        result.put(GroupRepository.class, m_groupRepositoryImpl);
+        result.put(Group2LicenseAssociationRepository.class, m_group2LicenseAssociationRepositoryImpl);
+        result.put(LicenseRepository.class, m_licenseRepositoryImpl);
+        result.put(License2GatewayAssociationRepository.class, m_license2GatewayAssociationRepositoryImpl);
+        result.put(GatewayRepository.class, m_gatewayRepositoryImpl);
+        result.put(DeploymentVersionRepository.class, m_deploymentVersionRepositoryImpl);
+
+        return result;
+    }
+    private ServiceDependency createServiceDependency() {
+        return new ServiceDependency(m_context, createLogger());
+    }
+
+    private synchronized Logger createLogger() {
+        if (m_logger == null) {
+            m_logger = new Logger(m_context);
+        }
+        return m_logger;
+    }
+
+    private Service createService() {
+        return new ServiceImpl(m_context, m_manager, createLogger());
     }
 
+    /**
+     * Pulls all repository services; is used to make sure the repositories go away before the RepositoryAdmin does.
+     */
+    synchronized void pullRepositories() {
+        for (Service[] services : m_services) {
+            for (Service service : services) {
+                m_manager.remove(service);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private <T extends RepositoryObject> Service[] registerRepository(Class<? extends ObjectRepository<T>> iface, ObjectRepositoryImpl<?, T> imp, String[] topics) {
+        Service repositoryService = createService()
+            .setInterface(iface.getName(), m_sessionProps)
+            .setImplementation(imp)
+            .add(createServiceDependency().setService(LogService.class).setRequired(false));
+        Dictionary topic = new Hashtable();
+        topic.put(EventConstants.EVENT_TOPIC, topics);
+        topic.put(EventConstants.EVENT_FILTER, "(" + SessionFactory.SERVICE_SID + "=" + m_sessionID + ")");
+        Service handlerService = createService()
+            .setInterface(EventHandler.class.getName(), topic)
+            .setImplementation(imp);
+
+        m_manager.add(repositoryService);
+        m_manager.add(handlerService);
+        return new Service[] {repositoryService, handlerService};
+    }
+
+    /**
+     * Helper method for use in publishRepositories
+     */
+    private static String createPrivateObjectTopic(String entityRoot) {
+        return RepositoryObject.PRIVATE_TOPIC_ROOT + entityRoot + RepositoryObject.TOPIC_ALL_SUFFIX;
+    }
+
+
+
+
+
+
     public void checkout() throws IOException {
         synchronized (m_lock) {
             ensureLogin();
@@ -155,7 +335,7 @@
         if (user == null) {
             throw new IllegalArgumentException("User may not be null.");
         }
-        return new RepositoryAdminLoginContextImpl(user);
+        return new RepositoryAdminLoginContextImpl(user, m_sessionID);
     }
 
     public void login(RepositoryAdminLoginContext context) throws IOException {
@@ -277,7 +457,7 @@
                 topics[nRepo] = impls[nRepo].getTopicAll(true);
             }
             result[nRsd] = loadRepositorySet(context.getUser(), rsd, impls);
-            result[nRsd].registerHandler(m_context, topics);
+            result[nRsd].registerHandler(m_context, m_sessionID, topics);
         }
 
         return result;
@@ -299,7 +479,8 @@
      * @throws IOException
      */
     private File getFileFromPreferences(Preferences repositoryPrefs, String type) throws IOException {
-        String directory = repositoryPrefs.get(PREFS_LOCAL_FILE_LOCATION, "");
+        String sessionLocation = PREFS_LOCAL_FILE_LOCATION + m_sessionID;
+        String directory = repositoryPrefs.get(sessionLocation, "");
 
         if ((directory == "") || !m_context.getDataFile(PREFS_LOCAL_FILE_ROOT + "/" + directory).isDirectory()) {
             if (!m_context.getDataFile(PREFS_LOCAL_FILE_ROOT + "/" + directory).isDirectory() && (directory != "")) {
@@ -325,7 +506,7 @@
             if (!directoryFile.mkdir()) {
                 throw new IOException("Error creating the local repository storage directory.");
             }
-            repositoryPrefs.put(PREFS_LOCAL_FILE_LOCATION, directoryFile.getName());
+            repositoryPrefs.put(sessionLocation, directoryFile.getName());
             return new File(directoryFile, type);
         }
         else {
@@ -386,4 +567,18 @@
         }
         return WorkingState.Unchanged;
     }
+
+
+
+
+    public void addArtifactHelper(ServiceReference ref, ArtifactHelper helper) {
+        String mimetype = (String) ref.getProperty(ArtifactHelper.KEY_MIMETYPE);
+        m_artifactRepositoryImpl.addHelper(mimetype, helper);
+    }
+
+    public synchronized void removeArtifactHelper(ServiceReference ref, ArtifactHelper helper) {
+        String mimetype = (String) ref.getProperty(ArtifactHelper.KEY_MIMETYPE);
+        m_artifactRepositoryImpl.removeHelper(mimetype, helper);
+    }
+
 }

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositoryAdminLoginContextImpl.java Wed Jul 29 08:59:48 2009
@@ -38,9 +38,11 @@
     private final User m_user;
     private final List<RepositorySetDescriptor> m_descriptors = new ArrayList<RepositorySetDescriptor>();
     private URL m_obrBase;
+    private final String m_sessionid;
 
-    RepositoryAdminLoginContextImpl(User user) {
+    RepositoryAdminLoginContextImpl(User user, String sessionid) {
         m_user = user;
+        m_sessionid = sessionid;
     }
 
     @SuppressWarnings("unchecked")

Modified: incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositorySet.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositorySet.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositorySet.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/client/repository/impl/RepositorySet.java Wed Jul 29 08:59:48 2009
@@ -31,6 +31,7 @@
 import org.apache.ace.client.repository.ObjectRepository;
 import org.apache.ace.client.repository.RepositoryAdmin;
 import org.apache.ace.client.repository.RepositoryObject;
+import org.apache.ace.client.repository.SessionFactory;
 import org.apache.ace.client.repository.RepositoryObject.WorkingState;
 import org.apache.ace.repository.ext.CachedRepository;
 import org.osgi.framework.BundleContext;
@@ -256,12 +257,13 @@
      * Event handling
      * ********/
 
-    void registerHandler(BundleContext context, String... topics) {
+    void registerHandler(BundleContext context, String sessionID, String... topics) {
         if (m_modifiedHandler != null) {
             throw new IllegalStateException("A handler is already registered; only one can be used at a time.");
         }
-        Dictionary<String, String[]> topic = new Hashtable<String, String[]>();
+        Dictionary topic = new Hashtable();
         topic.put(EventConstants.EVENT_TOPIC, topics);
+        topic.put(EventConstants.EVENT_FILTER, "(" + SessionFactory.SERVICE_SID + "=" + sessionID + ")");
         m_modifiedHandler = context.registerService(EventHandler.class.getName(), new ModifiedHandler(), topic);
     }
 

Modified: incubator/ace/trunk/server/src/org/apache/ace/obr/servlet/BundleServlet.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/server/src/org/apache/ace/obr/servlet/BundleServlet.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/server/src/org/apache/ace/obr/servlet/BundleServlet.java (original)
+++ incubator/ace/trunk/server/src/org/apache/ace/obr/servlet/BundleServlet.java Wed Jul 29 08:59:48 2009
@@ -153,13 +153,14 @@
                             fileStream.close();
                         }
                         catch (IOException ioe) {
-                            m_log.log(LogService.LOG_WARNING, "Exception closing the stream" + request.getRequestURL(), ioe);
+                            m_log.log(LogService.LOG_WARNING, "Exception closing the stream " + request.getRequestURL(), ioe);
                         }
                     }
                 }
             }
             catch (IOException ex) {
                 m_log.log(LogService.LOG_WARNING, "Exception in request: " + request.getRequestURL(), ex);
+                // TODO sending an error response after we've already started writing data does not work,
                 sendResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
             }
             finally {

Propchange: incubator/ace/trunk/test/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Jul 29 08:59:48 2009
@@ -1 +1,3 @@
 classes
+
+test-output

Modified: incubator/ace/trunk/test/src/org/apache/ace/client/repository/impl/ModelTest.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/test/src/org/apache/ace/client/repository/impl/ModelTest.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/test/src/org/apache/ace/client/repository/impl/ModelTest.java (original)
+++ incubator/ace/trunk/test/src/org/apache/ace/client/repository/impl/ModelTest.java Wed Jul 29 08:59:48 2009
@@ -106,7 +106,7 @@
         m_deploymentVersionRepository = new DeploymentVersionRepositoryImpl(notifier);
         TestUtils.configureObject(m_deploymentVersionRepository, BundleContext.class, bc);
 
-        m_repositoryAdmin = new RepositoryAdminImpl(null, TestUtils.createNullObject(ChangeNotifier.class));
+        m_repositoryAdmin = new RepositoryAdminImpl("testSessionID");
 
         Map<Class<? extends ObjectRepository>, ObjectRepositoryImpl> repos = new HashMap<Class<? extends ObjectRepository>, ObjectRepositoryImpl>();
         repos.put(ArtifactRepository.class, m_artifactRepository);

Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java?rev=798814&r1=798813&r2=798814&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java Wed Jul 29 08:59:48 2009
@@ -26,6 +26,11 @@
 import org.apache.ace.client.services.AssociationService;
 import org.apache.ace.client.services.AssociationServiceAsync;
 import org.apache.ace.client.services.Descriptor;
+import org.apache.ace.client.services.GroupDescriptor;
+import org.apache.ace.client.services.LicenseDescriptor;
+import org.apache.ace.client.services.TargetDescriptor;
+import org.apache.ace.client.services.TargetService;
+import org.apache.ace.client.services.TargetServiceAsync;
 
 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.core.client.GWT;
@@ -41,7 +46,7 @@
 import com.google.gwt.user.client.ui.ScrollPanel;
 
 /**
- * Entry point for the web ui.
+ * Entry point for the web UI.
  */
 public class Main implements EntryPoint {
     private static final int REFRESH_INTERVAL = 2000;
@@ -66,6 +71,33 @@
      * This is the entry point method.
      */
     public void onModuleLoad() {
+        // Session test, makes sure we trigger the creation of a single session
+        // before we continue asynchronously getting stuff from the server.
+        // This ensures we don't end up with 4 or 5 sessions per client. Still
+        // test code because we invoke an arbitrary service. ;)
+        TargetServiceAsync ts = GWT.create(TargetService.class);
+        ts.getTargets(new AsyncCallback<TargetDescriptor[]>() {
+
+            public void onFailure(Throwable caught) {
+                Window.alert("Callback failed, not creating UI...");
+            }
+
+            public void onSuccess(TargetDescriptor[] result) {
+                createUI();
+                // Set a timer to regularly update the UI
+                Timer refreshTimer = new Timer() {
+                    @Override
+                    public void run() {
+                        updateUI();
+                    }
+                };
+                refreshTimer.scheduleRepeating(REFRESH_INTERVAL);
+            }});
+        
+        
+    }
+
+    private void createUI() {
         // Add the header panels
         Button addBundleButton = new Button("+");
         addBundleButton.addStyleDependentName("add");
@@ -132,7 +164,9 @@
         RootPanel.get("g2lButton").add(g2l);
         g2l.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
-                m_assocationService.link(m_groupTable.getCheckedObject(), m_licenseTable.getCheckedObject(), new AsyncCallback<Void>() {
+                GroupDescriptor group = m_groupTable.getCheckedObject();
+                LicenseDescriptor license = m_licenseTable.getCheckedObject();
+                m_assocationService.link(group, license, new AsyncCallback<Void>() {
                     public void onFailure(Throwable caught) {
                         Window.alert("Error creating association: " + caught);
                     }
@@ -157,15 +191,6 @@
             }
         });
         
-        // Set a timer to regularly update the UI
-        Timer refreshTimer = new Timer() {
-            @Override
-            public void run() {
-                updateUI();
-            }
-        };
-        refreshTimer.scheduleRepeating(REFRESH_INTERVAL);
-        
         // Put our status label in the lower left corner
         RootPanel.get("serverStatusLabel").add(m_statusLabel);
         
@@ -190,6 +215,7 @@
         m_assocationService.getRelated(getSelectedObject(), new AsyncCallback<Descriptor[]>() {
             public void onFailure(Throwable caught) {
                 // Too bad...
+                Window.alert("Error updating highlights: " + caught);
             }
             public void onSuccess(Descriptor[] result) {
                 highlight(Arrays.asList(result));



Mime
View raw message