incubator-ace-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ange...@apache.org
Subject svn commit: r820744 - in /incubator/ace/trunk/webui/src/org/apache/ace: client/Main.java server/Activator.java server/AssociationServiceImpl.java server/CheckoutServiceImpl.java
Date Thu, 01 Oct 2009 18:36:32 GMT
Author: angelos
Date: Thu Oct  1 18:36:32 2009
New Revision: 820744

URL: http://svn.apache.org/viewvc?rev=820744&view=rev
Log:
ACE-40 Retrieving associations does not make sense for StatefulGatewayObjects which are not
backed by a GatewayObject, so these are ignored now.

Modified:
    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/CheckoutServiceImpl.java

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=820744&r1=820743&r2=820744&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 Thu Oct  1 18:36:32 2009
@@ -42,8 +42,6 @@
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.FlexTable;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.ScrollPanel;

Modified: incubator/ace/trunk/webui/src/org/apache/ace/server/Activator.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/Activator.java?rev=820744&r1=820743&r2=820744&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/Activator.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/Activator.java Thu Oct  1 18:36:32
2009
@@ -38,6 +38,7 @@
     private static volatile Activator m_instance;
     
     private volatile SessionFactory m_sessionFactory;
+    private volatile LogService m_log;
 
     static Activator instance() {
         return m_instance;
@@ -47,6 +48,10 @@
         return m_context;
     }
     
+    LogService getLog() {
+        return m_log;
+    }
+    
     static void destroySession(String sessionID) {
         m_instance.m_sessionFactory.destroySession(sessionID);
     }
@@ -151,6 +156,7 @@
         manager.add(createService()
             .setImplementation(this)
             .add(createServiceDependency().setRequired(true).setService(SessionFactory.class))
+            .add(createServiceDependency().setService(LogService.class).setRequired(false))
             );
     }
     @Override

Modified: incubator/ace/trunk/webui/src/org/apache/ace/server/AssociationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/AssociationServiceImpl.java?rev=820744&r1=820743&r2=820744&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/AssociationServiceImpl.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/AssociationServiceImpl.java Thu Oct
 1 18:36:32 2009
@@ -39,6 +39,7 @@
 import org.apache.ace.client.services.GroupDescriptor;
 import org.apache.ace.client.services.LicenseDescriptor;
 import org.apache.ace.client.services.TargetDescriptor;
+import org.osgi.service.log.LogService;
 
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 
@@ -138,13 +139,19 @@
     }
 
     public Descriptor[] getRelated(Descriptor o) throws Exception {
-        HttpServletRequest request = getThreadLocalRequest();
-        RepositoryObject a = ObjectMapping.unwrap(request, o);
-        List<RepositoryObject> relatedObjects = getRelated(request, a);
-        List<Descriptor> descriptors = ObjectMapping.wrap(relatedObjects);
-        return descriptors.toArray(new Descriptor[descriptors.size()]);
+        try {
+            HttpServletRequest request = getThreadLocalRequest();
+            RepositoryObject a = ObjectMapping.unwrap(request, o);
+            List<RepositoryObject> relatedObjects = getRelated(request, a);
+            List<Descriptor> descriptors = ObjectMapping.wrap(relatedObjects);
+            return descriptors.toArray(new Descriptor[descriptors.size()]);
+        }
+        catch (Exception e) {
+            Activator.instance().getLog().log(LogService.LOG_ERROR, "Error getting related
objects", e);
+            throw e;
+        }
     }
-    
+
     /**
      * Helper method that finds all related {@link RepositoryObject}s for a given one.
      */
@@ -174,7 +181,8 @@
             result.addAll(groups);
             result.addAll(TargetServiceImpl.instance().findSGOs(request, targets));
         }
-        else if (object instanceof StatefulGatewayObject) {
+        else if (object instanceof StatefulGatewayObject && ((StatefulGatewayObject)
object).isRegistered()) {
+            // We can ignore any non-registered SGO's, since these will never have any associations.
             List<LicenseObject> licenses = getRelated(object, LicenseObject.class);
             List<GroupObject> groups = getRelated(licenses, GroupObject.class);
             List<ArtifactObject> artifacts = getRelated(groups, ArtifactObject.class);

Modified: incubator/ace/trunk/webui/src/org/apache/ace/server/CheckoutServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/server/CheckoutServiceImpl.java?rev=820744&r1=820743&r2=820744&view=diff
==============================================================================
--- incubator/ace/trunk/webui/src/org/apache/ace/server/CheckoutServiceImpl.java (original)
+++ incubator/ace/trunk/webui/src/org/apache/ace/server/CheckoutServiceImpl.java Thu Oct 
1 18:36:32 2009
@@ -24,7 +24,6 @@
 
 import org.apache.ace.client.repository.RepositoryAdmin;
 import org.apache.ace.client.repository.RepositoryAdminLoginContext;
-import org.apache.ace.client.repository.stateful.StatefulGatewayRepository;
 import org.apache.ace.client.services.CheckoutService;
 import org.osgi.service.useradmin.User;
 import org.osgi.service.useradmin.UserAdmin;



Mime
View raw message