cvs commit: spice/sandbox/repository/componenthaus/src/java/org/componenthaus/spring AbstractPicoApplicationContext.java PicoApplicationContext.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/spring
                        AbstractPicoApplicationContext.java
                        PicoApplicationContext.java
  Log:
  If components are classes, show as little of the class as necessary to show service offering
  
  Revision  Changes    Path
  1.5       +0 -3      spice/sandbox/repository/componenthaus/src/java/org/componenthaus/spring/AbstractPicoApplicationContext.java
  
  Index: AbstractPicoApplicationContext.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/repository/componenthaus/src/java/org/componenthaus/spring/AbstractPicoApplicationContext.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractPicoApplicationContext.java	26 Oct 2003 13:46:41 -0000	1.4
  +++ AbstractPicoApplicationContext.java	9 Nov 2003 14:00:48 -0000	1.5
  @@ -126,7 +126,6 @@
       }
   
       public String[] getBeanDefinitionNames(Class type) {
  -        System.out.println("getBeanDefinitionNames");
           final Collection names = new ArrayList();
           for(Iterator i=pico.getComponentKeys().iterator();i.hasNext();) {
               final Object key = i.next();
  @@ -143,7 +142,6 @@
       }
   
       public Object getBean(String name) throws BeansException {
  -        System.out.println("getBean(" + name + ")");
           final Object instance = pico.getComponentInstance(name);
           if ( instance == null ) {
               throw new NoSuchBeanDefinitionException(name,"not registered");
  @@ -152,7 +150,6 @@
       }
   
       public Object getBean(String name, Class requiredType) throws BeansException {
  -        System.out.println("getBean2");
           final Object componentInstance = pico.getComponentInstance(name);
           if ( componentInstance == null ) {
               throw new NoSuchBeanDefinitionException(name,"not available");
  
  
  
  1.7       +14 -7     spice/sandbox/repository/componenthaus/src/java/org/componenthaus/spring/PicoApplicationContext.java
  
  Index: PicoApplicationContext.java
  ===================================================================
  RCS file: /cvsroot/spice/spice/sandbox/repository/componenthaus/src/java/org/componenthaus/spring/PicoApplicationContext.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PicoApplicationContext.java	3 Nov 2003 21:15:30 -0000	1.6
  +++ PicoApplicationContext.java	9 Nov 2003 14:00:48 -0000	1.7
  @@ -4,7 +4,6 @@
   import org.componenthaus.repository.api.ComponentRepository;
   import org.componenthaus.repository.api.RepositoryImpl;
   import org.componenthaus.repository.impl.ComponentFactory;
  -import org.componenthaus.repository.impl.ServiceImplementationFactory;
   import org.componenthaus.repository.services.CommandRegistryImpl;
   import org.componenthaus.search.AddComponentMonitor;
   import org.componenthaus.search.LuceneSearchService;
  @@ -13,14 +12,18 @@
   import org.componenthaus.usecases.listcomponents.ListComponentsController;
   import org.componenthaus.usecases.searchcomponents.SearchComponentsController;
   import org.componenthaus.usecases.showcomponent.ShowComponentController;
  -import org.componenthaus.usecases.showimplementation.ShowImplementationController;
  +import org.componenthaus.usecases.submitcomponent.DefaultCarSubmissionManager;
   import org.componenthaus.usecases.submitcomponent.SubmitComponentController;
  -import org.componenthaus.usecases.submitcomponent.DefaultSubmissionManager;
  +import org.componenthaus.usecases.submitcomponent.MetadataConverterImpl;
   import org.componenthaus.usecases.welcomeuser.WelcomeUserController;
   import org.componenthaus.util.file.FileManager;
   import org.componenthaus.util.file.FileManagerImpl;
   import org.componenthaus.util.source.CodeFormatter;
   import org.componenthaus.util.source.JalopyCodeFormatter;
  +import org.componenthaus.ant.ClassAbbreviatorImpl;
  +import org.componenthaus.ant.LineIndenterImpl;
  +import org.componenthaus.ant.JavadocFormatterImpl;
  +import org.componenthaus.ant.JavadocFormatter;
   import org.prevayler.Prevayler;
   import org.springframework.beans.BeansException;
   import org.springframework.context.ApplicationContext;
  @@ -30,6 +33,8 @@
   import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
   import org.springframework.web.servlet.view.ResourceBundleViewResolver;
   import org.springframework.web.servlet.view.tiles.TilesConfigurer;
  +import org.picocontainer.Parameter;
  +import org.picocontainer.defaults.ConstantParameter;
   
   import javax.servlet.ServletContext;
   import java.util.HashMap;
  @@ -57,7 +62,6 @@
   
           addController(WelcomeUserController.class, "/welcome.htm");
           addController(ListComponentsController.class, "/listComponents.action");
  -        addController(ShowImplementationController.class, "/showImplementation.action");
           addController(ShowComponentController.class, "/componentDetails.action");
           addController(DownloadComponentController.class, "/downloadComponent.action");
   
  @@ -87,12 +91,15 @@
           //pico.registerComponentImplementation(PrevalentSystem.class, RepositoryImpl.class); //This causes a second instance of repository to exist.  Yuck.
           pico.registerComponentImplementation(FileManager.class, FileManagerImpl.class);
           pico.registerComponentImplementation(ComponentFactory.class);
  -        pico.registerComponentImplementation(ServiceImplementationFactory.class);
           pico.registerComponentImplementation(Prevayler.class, PrevaylerBean.class);
  -        pico.registerComponentImplementation(DefaultSubmissionManager.class);
  -        pico.registerComponentImplementation(DefaultSubmissionManager.NullSubmissionMonitor.class);
  +        pico.registerComponentImplementation(DefaultCarSubmissionManager.class);
  +        pico.registerComponentImplementation(DefaultCarSubmissionManager.NullSubmissionMonitor.class);
           pico.registerComponentImplementation(CommandRegistryImpl.class);
           pico.registerComponentImplementation(LuceneSearchService.DefaultLuceneObjectFactory.class);
  +        pico.registerComponentImplementation(MetadataConverterImpl.class);
  +        pico.registerComponentImplementation(ClassAbbreviatorImpl.class);
  +        pico.registerComponentImplementation(LineIndenterImpl.class);
  +        pico.registerComponentImplementation(JavadocFormatter.class, JavadocFormatterImpl.class, new Parameter[]{new ConstantParameter(new Integer(80))});
   
           addSpringStuff();
           //This must be done last, because it reads things from Pico
  
  
  


-------------------------------------------------------
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/