|
|
Choosing A Webhost: |
cvs commit: spice/sandbox/repository/componenthaus/src/java/org/componentha: msg#00067java.spice.cvs
hogie 03/09/22 12:20:49 Modified: sandbox/repository/componenthaus/src/java/org/componenthaus/repository/api ComponentRepository.java RepositoryImpl.java Log: Initial integration of Lucene search service. Last component overwrites Lucene index at the minute Revision Changes Path 1.2 +4 -0 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ComponentRepository.java 21 Sep 2003 13:41:57 -0000 1.1 +++ ComponentRepository.java 22 Sep 2003 19:20:49 -0000 1.2 @@ -10,4 +10,8 @@ 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.2 +15 -1 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RepositoryImpl.java 21 Sep 2003 13:41:57 -0000 1.1 +++ RepositoryImpl.java 22 Sep 2003 19:20:49 -0000 1.2 @@ -1,6 +1,8 @@ package org.componenthaus.repository.api; import org.prevayler.implementation.AbstractPrevalentSystem; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.context.ApplicationContextException; import java.util.HashMap; import java.util.Map; @@ -9,21 +11,33 @@ import java.util.Iterator; import java.io.File; -public class RepositoryImpl extends AbstractPrevalentSystem implements ComponentRepository { +public class RepositoryImpl extends AbstractPrevalentSystem implements ComponentRepository,InitializingBean { private final Map components; private final Map downloadables; + private ComponentRepository.Monitor monitor = null; public RepositoryImpl() { components = new HashMap(); downloadables = new HashMap(); } + public void setMonitor(ComponentRepository.Monitor monitor) { + this.monitor = monitor; + } + + public void afterPropertiesSet() throws Exception { + if ( monitor == null ) { + throw new ApplicationContextException("Must set property 'monitor' on " + getClass()); + } + } + public String add(Component component) { assert component != null; assert component.getId() == null; //I'm in charge of ids component.setId(""+components.size()); components.put(component.getId(),component); giveIdsToImplementations(component); + monitor.componentAdded(component); return component.getId(); } ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | cvs commit: spice/sandbox/repository/componenthaus/src/java/org/componenthaus/usecases/submitcomponent SubmitComponentController.java, Mike Hogan |
|---|---|
| Next by Date: | cvs commit: spice/sandbox/repository/componenthaus project.xml, Mike Hogan |
| Previous by Thread: | cvs commit: spice/sandbox/repository/componenthaus/src/java/org/componenthaus/usecases/submitcomponent SubmitComponentController.java, Mike Hogan |
| Next by Thread: | cvs commit: spice/sandbox/repository/componenthaus project.xml, Mike Hogan |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |