cvs commit: spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api Component.java ComponentRepository.java RepositoryImpl.java ServiceImplementation.java

Mike Hogan <[email protected]> Sun, 09 Nov 2003 06:00:48 -0800
Newsgroups gmane.comp.java.spice.cvs
Message-ID <[email protected]>
hogie       03/11/09 06:00:48

  Modified:    sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api
                        Component.java ComponentRepository.java
                        RepositoryImpl.java
  Removed:     sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api
                        ServiceImplementation.java
  Log:
  If components are classes, show as little of the class as necessary to show service offering
  
  Revision  Changes    Path
  1.2       +0 -2      spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/Component.java
  
  Index: Component.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/Component.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Component.java	21 Sep 2003 13:41:57 -0000	1.1
  +++ Component.java	9 Nov 2003 14:00:47 -0000	1.2
  @@ -12,7 +12,5 @@
       //Do not pull id up into service because a service in an abstract sense does not have an id.  The id is a system level thing.
       String getId();
       void setId(final String id);
  -    Collection getImplementations();
  -    void addImplementation(ServiceImplementation impl);
       String getServiceInterface();
   }
  
  
  
  1.3       +0 -1      spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/ComponentRepository.java
  
  Index: ComponentRepository.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/ComponentRepository.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComponentRepository.java	22 Sep 2003 19:20:49 -0000	1.2
  +++ ComponentRepository.java	9 Nov 2003 14:00:47 -0000	1.3
  @@ -9,7 +9,6 @@
       Component getComponent(String id);
       void registerDownloadable(String componentId, File downloadable);
       File getDownloadable(String componentId);
  -    ServiceImplementation getImplementation(String componentId, String implId);
   
       public static interface Monitor {
           public void componentAdded(final Component component);
  
  
  
  1.6       +0 -42     spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/RepositoryImpl.java
  
  Index: RepositoryImpl.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api/RepositoryImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RepositoryImpl.java	26 Oct 2003 14:56:19 -0000	1.5
  +++ RepositoryImpl.java	9 Nov 2003 14:00:47 -0000	1.6
  @@ -6,7 +6,6 @@
   import java.util.Collection;
   import java.util.Collections;
   import java.util.HashMap;
  -import java.util.Iterator;
   import java.util.Map;
   
   public class RepositoryImpl extends AbstractPrevalentSystem implements ComponentRepository {
  @@ -25,33 +24,10 @@
           assert component.getId() == null; //I'm in charge of ids
           component.setId(""+components.size());
           components.put(component.getId(),component);
  -        giveIdsToImplementations(component);
           monitor.componentAdded(component);
  -        System.out.println("Added component " + component);
           return component.getId();
       }
   
  -    private void giveIdsToImplementations(Component component) {
  -        int index = 0;
  -        for(Iterator i=component.getImplementations().iterator();i.hasNext();) {
  -            final ServiceImplementation impl = (ServiceImplementation) i.next();
  -            assert impl.getId() == null; //I'm in charge of ids
  -            impl.setId("" + component.getId() + ":" + index++);
  -            handlePlugs(impl);
  -        }
  -    }
  -
  -    /**
  -     * Plugs themselves are interfaces, so we get recursive.  This will require some more
  -     * thought, because some of the plugs might already exist.
  -     */
  -    private void handlePlugs(ServiceImplementation impl) {
  -        for(Iterator i=impl.getPlugs().iterator();i.hasNext();) {
  -            final Component plug = (Component) i.next();
  -            add(plug);
  -        }
  -    }
  -
       public Collection listComponents() {
           return Collections.unmodifiableCollection(components.values());
       }
  @@ -61,29 +37,11 @@
       }
   
       public void registerDownloadable(String componentId, File downloadable) {
  -        System.out.println("Registering downloadable " + downloadable.getAbsolutePath() + " against component id " + componentId);
           downloadables.put(componentId,downloadable);
       }
   
       public File getDownloadable(String componentId) {
           return (File) downloadables.get(componentId);
  -    }
  -
  -    public ServiceImplementation getImplementation(String componentId, String implId) {
  -        final Component component = getComponent(componentId);
  -        return getImpl(component,implId);
  -    }
  -
  -    private ServiceImplementation getImpl(Component component, String implId) {
  -        ServiceImplementation result = null;
  -        final Iterator i = component.getImplementations().iterator();
  -        while(result == null && i.hasNext()) {
  -            final ServiceImplementation current = (ServiceImplementation) i.next();
  -            if ( implId.equals(current.getId())) {
  -                result = current;
  -            }
  -        }
  -        return result;
       }
   }
   
  
  
  


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/