hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/test/org/apache/hivemind/impl TestVisibility.java TestRegistryInfrastructure.java
Date Wed, 22 Dec 2004 14:25:21 GMT
hlship      2004/12/22 06:25:21

  Modified:    framework/src/java/org/apache/hivemind/internal
                        ServicePoint.java
               framework/src/java/org/apache/hivemind/impl
                        RegistryInfrastructureImpl.java
                        ServicePointImpl.java
               framework/src/test/org/apache/hivemind/impl
                        TestVisibility.java TestRegistryInfrastructure.java
  Log:
  Defer converting service interface class names to Class instances.
  
  Revision  Changes    Path
  1.7       +10 -0     jakarta-hivemind/framework/src/java/org/apache/hivemind/internal/ServicePoint.java
  
  Index: ServicePoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/internal/ServicePoint.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ServicePoint.java	2 Nov 2004 17:46:12 -0000	1.6
  +++ ServicePoint.java	22 Dec 2004 14:25:21 -0000	1.7
  @@ -33,6 +33,16 @@
        * implements.
        */
       public Class getServiceInterface();
  +    
  +    /**
  +     * Returns the fully qualified class name of the service interface. This
  +     * is useful so that loading the actual service interface class can
  +     * be deferred as late as possible.
  +     * 
  +     * @since 1.1
  +     */
  +    
  +    public String getServiceInterfaceClassName();
   
       /**
        * Obtains the full service implementation for this service extension point, an
  
  
  
  1.4       +14 -10    jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java
  
  Index: RegistryInfrastructureImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryInfrastructureImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegistryInfrastructureImpl.java	11 Nov 2004 10:16:06 -0000	1.3
  +++ RegistryInfrastructureImpl.java	22 Dec 2004 14:25:21 -0000	1.4
  @@ -60,9 +60,9 @@
       private Map _servicePoints = new HashMap();
   
       /**
  -     * Map of List (of {@link ServicePoint}, keyed on service interface.
  +     * Map of List (of {@link ServicePoint}, keyed on class name service interface.
        */
  -    private Map _servicePointsByInterface = new HashMap();
  +    private Map _servicePointsByInterfaceClassName = new HashMap();
   
       /**
        * Map of {@link ConfigurationPoint}keyed on fully qualified configuration id.
  @@ -119,14 +119,14 @@
   
       private void addServicePointByInterface(ServicePoint point)
       {
  -        Class key = point.getServiceInterface();
  +        String key = point.getServiceInterfaceClassName();
   
  -        List l = (List) _servicePointsByInterface.get(key);
  +        List l = (List) _servicePointsByInterfaceClassName.get(key);
   
           if (l == null)
           {
               l = new LinkedList();
  -            _servicePointsByInterface.put(key, l);
  +            _servicePointsByInterfaceClassName.put(key, l);
           }
   
           l.add(point);
  @@ -163,7 +163,9 @@
   
       public Object getService(Class serviceInterface, Module module)
       {
  -        List servicePoints = (List) _servicePointsByInterface.get(serviceInterface);
  +        String key = serviceInterface.getName();
  +
  +        List servicePoints = (List) _servicePointsByInterfaceClassName.get(key);
   
           if (servicePoints == null)
               servicePoints = Collections.EMPTY_LIST;
  @@ -312,16 +314,16 @@
           _shutdownCoordinator.shutdown();
   
           _servicePoints = null;
  -        _servicePointsByInterface = null;
  +        _servicePointsByInterfaceClassName = null;
           _configurationPoints = null;
           _shutdownCoordinator = null;
           _variableSources = null;
           _serviceModelFactories = null;
           _threadEventNotifier = null;
  -        
  +
           // It is believed that the cache held by PropertyUtils can affect application shutdown
           // and reload in some servlet containers (such as Tomcat); this should clear that
up.
  -        
  +
           PropertyUtils.clearCache();
       }
   
  @@ -412,7 +414,9 @@
       {
           checkShutdown();
   
  -        List servicePoints = (List) _servicePointsByInterface.get(serviceInterface);
  +        String key = serviceInterface.getName();
  +
  +        List servicePoints = (List) _servicePointsByInterfaceClassName.get(key);
   
           if (servicePoints == null)
               return false;
  
  
  
  1.9       +7 -0      jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java
  
  Index: ServicePointImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/ServicePointImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServicePointImpl.java	19 Dec 2004 15:43:07 -0000	1.8
  +++ ServicePointImpl.java	22 Dec 2004 14:25:21 -0000	1.9
  @@ -102,6 +102,13 @@
           return _serviceInterface;
       }
   
  +    /** @since 1.1 */
  +
  +    public String getServiceInterfaceClassName()
  +    {
  +        return _serviceInterfaceName;
  +    }
  +
       private Class lookupServiceInterface()
       {
           ClassResolver resolver = getModule().getClassResolver();
  
  
  
  1.6       +8 -8      jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestVisibility.java
  
  Index: TestVisibility.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestVisibility.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestVisibility.java	16 Nov 2004 10:27:11 -0000	1.5
  +++ TestVisibility.java	22 Dec 2004 14:25:21 -0000	1.6
  @@ -118,8 +118,8 @@
           sp.getExtensionPointId();
           spc.setReturnValue("foo.bar.Baz");
   
  -        sp.getServiceInterface();
  -        spc.setReturnValue(Runnable.class);
  +        sp.getServiceInterfaceClassName();
  +        spc.setReturnValue(Runnable.class.getName());
   
           sp.visibleToModule(null);
           spc.setReturnValue(false);
  @@ -157,8 +157,8 @@
           sp.getExtensionPointId();
           spc.setReturnValue("foo.bar.Baz");
   
  -        sp.getServiceInterface();
  -        spc.setReturnValue(Runnable.class);
  +        sp.getServiceInterfaceClassName();
  +        spc.setReturnValue(Runnable.class.getName());
   
           sp.visibleToModule(m);
           spc.setReturnValue(false);
  @@ -238,14 +238,14 @@
           sp1.getExtensionPointId();
           spc1.setReturnValue("foo.Private");
   
  -        sp1.getServiceInterface();
  -        spc1.setReturnValue(ObjectProvider.class);
  +        sp1.getServiceInterfaceClassName();
  +        spc1.setReturnValue(ObjectProvider.class.getName());
   
           sp2.getExtensionPointId();
           spc2.setReturnValue("foo.Public");
   
  -        sp2.getServiceInterface();
  -        spc2.setReturnValue(ObjectProvider.class);
  +        sp2.getServiceInterfaceClassName();
  +        spc2.setReturnValue(ObjectProvider.class.getName());
   
           sp1.visibleToModule(null);
           spc1.setReturnValue(false);
  
  
  
  1.2       +2 -2      jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java
  
  Index: TestRegistryInfrastructure.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/impl/TestRegistryInfrastructure.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestRegistryInfrastructure.java	25 Sep 2004 17:08:34 -0000	1.1
  +++ TestRegistryInfrastructure.java	22 Dec 2004 14:25:21 -0000	1.2
  @@ -65,8 +65,8 @@
           sp.getExtensionPointId();
           spc.setReturnValue("hivemind.Startup");
   
  -        sp.getServiceInterface();
  -        spc.setReturnValue(Runnable.class);
  +        sp.getServiceInterfaceClassName();
  +        spc.setReturnValue(Runnable.class.getName());
   
           sp.visibleToModule(null);
           spc.setReturnValue(true);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message