Well, for 1.1, we're only going to support exact matches for getServiceId(). Hierarchies will not be considered.
-----Original Message----- From: Jean-Yves Sironneau [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 23, 2005 3:35 PM To: [email protected] Subject: Re: Several services implementations Maybe restricting the search to one hivemind module would make it simpler. James Carman wrote: >There's a bug filed for exactly that. I'll look into it. I don't know how >we're going to get the kind of support we want (support interface/class >hierarchies) without actually realizing the class (which causes the >NoClassDefFound). > >-----Original Message----- >From: Jean-Yves Sironneau [mailto:[EMAIL PROTECTED] >Sent: Wednesday, August 17, 2005 4:43 PM >To: [email protected] >Subject: Re: Several services implementations > >That's the method i use and that throws the Exception > > > >James Carman wrote: > > > >>You can call getServiceIds( Class serviceInterface ) on the registry to get >>all service ids which implement that interface. >> >> >>-----Original Message----- >>From: Jean-Yves Sironneau [mailto:[EMAIL PROTECTED] >>Sent: Tuesday, August 16, 2005 7:11 PM >>To: [email protected] >>Subject: Re: Several services implementations >> >>Hello, >> >>I added again hivemind-lib to my classpath and i know get the following >>error, i guess it's normal as i don't have spring jars in my classpath. >>Do you know a way to get a list of services implementing a given >>interface or an interface extending it (i think a factory like the >>tapestry validators one is quite complicated for what i need) ? >> >>Thank you. >> >>Jean-Yves >> >> >>org.apache.hivemind.ApplicationRuntimeException: Unable to find >>interface org.springframework.beans.factory.BeanFactory (for service >>hivemind.lib.DefaultSpringBeanFactory). >>[jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/hivemind-lib-1.1- b >> >> >e > > >>ta-2.jar!/META-INF/hivemodule.xml, >>line 121, column 106] >> at >>org.apache.hivemind.impl.ServicePointImpl.lookupDeclaredInterface(ServiceP o >> >> >i > > >>ntImpl.java:132) >> at >>org.apache.hivemind.impl.ServicePointImpl.getDeclaredInterface(ServicePoin t >> >> >I > > >>mpl.java:110) >> at >>org.apache.hivemind.impl.ServicePointImpl.lookupServiceInterface(ServicePo i >> >> >n > > >>tImpl.java:142) >> at >>org.apache.hivemind.impl.ServicePointImpl.getServiceInterface(ServicePoint I >> >> >m > > >>pl.java:102) >> at >>org.apache.hivemind.impl.RegistryInfrastructureImpl.getServiceIds(Registry I >> >> >n > > >>frastructureImpl.java:591) >> at >>org.apache.hivemind.impl.RegistryImpl.getServiceIds(RegistryImpl.java:107) >> at >>org.jys.jphotowiki.content.ProcessorFactory.getMetaDataExtractor(Processor F >> >> >a > > >>ctory.java:20) >> at >>org.jys.jphotowiki.testing.tests.TestContentProcessing.testExifPreserved(T e >> >> >s > > >>tContentProcessing.java:55) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 3 >> >> >9 > > >>) >> at >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm p >> >> >l > > >>.java:25) >> at java.lang.reflect.Method.invoke(Method.java:585) >> at junit.framework.TestCase.runTest(TestCase.java:154) >> at junit.framework.TestCase.runBare(TestCase.java:127) >> at junit.framework.TestResult$1.protect(TestResult.java:106) >> at junit.framework.TestResult.runProtected(TestResult.java:124) >> at junit.framework.TestResult.run(TestResult.java:109) >> at junit.framework.TestCase.run(TestCase.java:118) >> at junit.framework.TestSuite.runTest(TestSuite.java:208) >> at junit.framework.TestSuite.run(TestSuite.java:203) >> at junit.framework.TestSuite.runTest(TestSuite.java:208) >> at junit.framework.TestSuite.run(TestSuite.java:203) >> at >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTest R >> >> >u > > >>nner.java:478) >> at >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunne r >> >> >. > > >>java:344) >> at >>org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunn e >> >> >r > > >>.java:196) >>Caused by: org.apache.hivemind.ApplicationRuntimeException: Unable to >>convert type 'org.springframework.beans.factory.BeanFactory' to a Java >>class, either as is, or in package org.apache.hivemind.lib. >> at org.apache.hivemind.impl.ModuleImpl.resolveType(ModuleImpl.java:197) >> at >>org.apache.hivemind.impl.ServicePointImpl.lookupDeclaredInterface(ServiceP o >> >> >i > > >>ntImpl.java:128) >> ... 24 more >> >> >> >> >>[EMAIL PROTECTED] wrote: >> >> >> >> >> >>>Yes you're right i was getting an error related to module definitions in >>>hivemind-lib that's why i tried without it but then i forgot, i have to >>> >>> >>> >>> >>post >> >> >> >> >>>the actual error. >>> >>>Selon Achim Huegen <[EMAIL PROTECTED]>: >>> >>> >>> >>> >>> >>> >>> >>>>Sounds like the hivemind-lib.jar is not in your classpath. >>>>Can you check that? >>>> >>>>Achim >>>> >>>>Jean-Yves Sironneau wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>>>Hello, >>>>> >>>>>I'am getting into an issue and i guess it's a design problem, but i >>>>>can't see why : >>>>> >>>>>I have an interface that services should implement : >>>>> >>>>>public interface IContentProcessor { >>>>> public boolean isDocumentClassSupported(Class<? extends IDocument> >>>>>documentClass); >>>>> >>>>> public boolean isContentClassSupported(Class<? extends IDocument> >>>>>contentClass); >>>>> public void process(IDocument document); >>>>>} >>>>> >>>>>And i have several implementations of this interface, so basically my >>>>>module definition looks like : >>>>> >>>>><service-point id="ThumbnailCreator" >>>>>interface="org.jys.jphotowiki.content.IContentProcessor"> >>>>> <invoke-factory> >>>>> <construct class="org.jys.jphotowiki.content.ThumbnailProcessor"> >>>>> <set property="thumbnailSize" value="50"/> >>>>> </construct> >>>>> </invoke-factory> >>>>></service-point> >>>>> >>>>><service-point id="MetaDataExtractor" >>>>>interface="org.jys.jphotowiki.content.IContentProcessor"> >>>>> <invoke-factory> >>>>> <construct class="org.jys.jphotowiki.content.MetaDataExtractor"/> >>>>> </invoke-factory> >>>>></service-point> >>>>> >>>>><service-point id="RotateLeftProcessor" >>>>>interface="org.jys.jphotowiki.content.IContentProcessor"> >>>>> <invoke-factory> >>>>> <construct class="org.jys.jphotowiki.content.RotateProcessor"> >>>>> <set property="clockwise" value="false"/> >>>>> </construct> >>>>> </invoke-factory> >>>>></service-point> >>>>> >>>>><service-point id="RotateRightProcessor" >>>>>interface="org.jys.jphotowiki.content.IContentProcessor"> >>>>> <create-instance >>>>>class="org.jys.jphotowiki.content.RotateProcessor,clockwise"/> >>>>></service-point> >>>>> >>>>> >>>>>So i would like to dynamically get all of the services that implements >>>>>the interface, so i tried to call >>>>>getRegistry().getServiceIds(IContentProcessor.class) and i'am getting a >>>>>lots of errors : >>>>> >>>>>#2005-08-11 02:03:20,138 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/hivemodule.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 23, column 57: Required module hivemind.lib does not exist. >>>>>#2005-08-11 02:03:20,353 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.props.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 24, column 94: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>#2005-08-11 02:03:20,356 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.props.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 105, column 99: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>#2005-08-11 02:03:20,357 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.enhance.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 58, column 91: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>#2005-08-11 02:03:20,359 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.listener.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 36, column 79: Unable to resolve reference to schema >>>>>'hivemind.lib.Pipeline'. >>>>>#2005-08-11 02:03:20,361 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.asset.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 83, column 95: Unable to resolve reference to schema >>>>>'hivemind.lib.StrategyRegistry'. >>>>>#2005-08-11 02:03:20,363 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.form.translator.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 23, column 90: Unable to resolve reference to schema >>>>>'hivemind.lib.BeanFactoryContribution'. >>>>>#2005-08-11 02:03:20,376 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.init.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 32, column 96: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>#2005-08-11 02:03:20,378 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.request.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 91, column 94: Unable to resolve reference to schema >>>>>'hivemind.lib.Pipeline'. >>>>>#2005-08-11 02:03:20,379 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.request.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 122, column 90: Unable to resolve reference to schema >>>>>'hivemind.lib.Pipeline'. >>>>>#2005-08-11 02:03:20,381 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.valid.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 23, column 90: Unable to resolve reference to schema >>>>>'hivemind.lib.BeanFactoryContribution'. >>>>>#2005-08-11 02:03:20,382 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.describe.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 22, column 92: Unable to resolve reference to schema >>>>>'hivemind.lib.StrategyRegistry'. >>>>>#2005-08-11 02:03:20,384 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.describe.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 73, column 87: Unable to resolve reference to schema >>>>>'hivemind.lib.StrategyRegistry'. >>>>>#2005-08-11 02:03:20,388 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.page.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 139, column 95: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>#2005-08-11 02:03:20,394 ERROR >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>org.apache.hivemind.impl.DefaultErrorHandler.error(DefaultErrorHandler.ja v >>> >>> >a > > >>> >>> >>> >>> >>:37) >> >> >> >> >>> >>> >>> >>> >>>>>- Error at >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-beta - >>> >>> >3 > > >>> >>> >>> >>> >>.jar!/META-INF/tapestry.page.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 188, column 100: Unable to resolve reference to schema >>>>>'hivemind.lib.ChainContribution'. >>>>>org.apache.hivemind.ApplicationRuntimeException: Unable to find >>>>>interface org.apache.hivemind.lib.BeanFactory (for service >>>>>tapestry.valid.ValidatorBeanFactory). >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>[jar:file:/home/jys/work/JPhotoWiki/src/java/lib/compile/tapestry-4.0-bet a >>> >>> >- > > >>> >>> >>> >>> >>3.jar!/META-INF/tapestry.valid.xml, >> >> >> >> >>> >>> >>> >>> >>>>>line 33, column 92] >>>>> >>>>>So i think there are some issues regarding the tapestry hivemind >>>>>modules, and as every module is processed i think i'am trying to do >>>>>something that do not make sense at all. >>>>> >>>>>What do you think ? Doesn't an interface can be implemented by several >>>>>services ? >>>>> >>>>>Thanks >>>>> >>>>>Jean-Yves >>>>> >>>>>--------------------------------------------------------------------- >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] >>>>>For additional commands, e-mail: [EMAIL PROTECTED] >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>--------------------------------------------------------------------- >>>>To unsubscribe, e-mail: [EMAIL PROTECTED] >>>>For additional commands, e-mail: [EMAIL PROTECTED] >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>-- >>>Jean-Yves Sironneau >>>[EMAIL PROTECTED] >>>06.16.18.71.63 >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: [EMAIL PROTECTED] >>>For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >>> >>> >>> >>> >>> >>> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> >> >> > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
