tag:blogger.com,1999:blog-18490491.post1077313748656287107..comments2023-09-15T15:20:41.933+02:00Comments on Martin Lippert: Dependency Injection for Extensions, Third EditionUnknownnoreply@blogger.comBlogger39125tag:blogger.com,1999:blog-18490491.post-32260952903239943382022-07-09T06:59:02.779+02:002022-07-09T06:59:02.779+02:00Your site blog was very nice its too good.
Imyfo...Your site blog was very nice its too good.<br /><br /><br /><a href="https://crackservice.com/imyfone-d-back-crack-registration-code/" rel="nofollow">Imyfone D Back Crack</a><br /><br /><br /><a href="https://crackservice.com/4k-stogram-crack/" rel="nofollow">4K Stogram Crack</a>crackservicehttps://www.blogger.com/profile/12129252353418250964noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-41569399114499887092022-05-26T05:08:16.482+02:002022-05-26T05:08:16.482+02:00Its a cozy delight reading your claim.Its full of ...Its a cozy delight reading your claim.Its full of aspire i am looking for and i lionize to claim a comment that "The content material of your proclaim is incredible" extremely good accomplish..... <a href="https://wishesquotz.com/happy-memorial-day-quotes/" rel="nofollow">https://wishesquotz.com/happy-memorial-day-quotes/</a>Valentines Day Wishes 2021https://www.blogger.com/profile/02171088066670307337noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-14623491341785542732022-05-24T07:45:50.464+02:002022-05-24T07:45:50.464+02:00pleasant to right of proper of admission your arti...pleasant to right of proper of admission your article! i'm looking speak to to sharing your adventures and studies. thank you! keep rocking. <a href="https://cyberspc.com/wirecast-crack/" rel="nofollow">Wirecast 7 crack</a>cyber pchttps://www.blogger.com/profile/09374218583192900200noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-22110405732970163432022-05-24T06:16:49.640+02:002022-05-24T06:16:49.640+02:00fantastic article. Very tempting to droop. I in fa...fantastic article. Very tempting to droop. I in fact adulation to entre this kind of plausible article. thank you! keep rocking. <a href="https://crackdj.com/clash-of-clans-hack-apk/" rel="nofollow">Clash Of Clans Hacks 2022</a>cyber pchttps://www.blogger.com/profile/09374218583192900200noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-8449569862675281162020-07-24T07:17:45.022+02:002020-07-24T07:17:45.022+02:00I am really happy with your blog because your arti...I am really happy with your blog because your article is very unique and powerful for new reader.<a href="https://www.acte.in/php-training-in-chennai" rel="nofollow"> PHP Training in Chennai | Certification | Online Training Course</a> | <a href="https://www.acte.in/machine-learning-training-in-chennai" rel="nofollow"> Machine Learning Training in Chennai | Certification | Online Training Course</a> | <a href="https://www.acte.in/iot-training-in-chennai" rel="nofollow"> iOT Training in Chennai | Certification | Online Training Course</a> | <a href="https://www.acte.in/blockchain-training-in-chennai" rel="nofollow"> Blockchain Training in Chennai | Certification | Online Training Course</a> | <a href="https://www.acte.in/openstack-training-in-chennai" rel="nofollow">Open Stack Training in Chennai | <br />Certification | Online Training Course</a> keerthanahttps://www.blogger.com/profile/10889152527958455096noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-70669227055737641022019-08-01T13:49:38.836+02:002019-08-01T13:49:38.836+02:00Informative post, thanks for sharing.
TIBCO Busine...Informative post, thanks for sharing.<br /><a href="https://www.visualpath.in/TIBCO-businessworks6x-online-training-course.html" title="We are Providing best Online Training" rel="nofollow">TIBCO Businessworks6x Online Training</a><br />Azure DevOpshttps://www.blogger.com/profile/05175115997002461151noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-51238578453434155272012-01-30T20:05:23.512+01:002012-01-30T20:05:23.512+01:00Hi Martin, thanks for your reply. That is very muc...Hi Martin, thanks for your reply. That is very much appreciated. My intention i to use Spring for Di and I do want to use AOP in my plugin design. Have learned to appreciate the spring way of app design from web app development. <br /><br />Will follow your recommendation and try Spring Extension Factory first. WIll come back with an update hopefully with a success story.Jochenhttps://www.blogger.com/profile/00067375515520075427noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-61575090191551851862012-01-18T15:03:22.118+01:002012-01-18T15:03:22.118+01:00Hey Jochen!
Blueprint is out there and I think it...Hey Jochen!<br /><br />Blueprint is out there and I think it is a great successor of Spring DM. I think your decision depends a bit on what you would like to use/combine. Do you wanna use Spring libs/frameworks and have spring configurations working within your OSGi bundles? Then Blueprint is the way to go. If you, in that case, would like to inject dependencies into Eclipse extensions (like views, editors, etc,), I would recommend the Spring Extension Factory over Equinox Aspects (the aspects version is a bit too heavyweight for most use cases). I haven't tried the Spring Extension Factory with the latest Blueprint implementations, so there might be some adjustments necessary, but the basic idea and the basic mechanism should work.<br /><br />The source code for the Spring Extension Factory is also easy to understand and contains just a few classes. So if there is anything not working, go to the GitHub repo for the Spring Extension Factory, clone the repo, fix the problem and send me a pull request. Would be very happy to put that into the repo.<br /><br />If you don't really want to use the Spring framework and instead are looking for dependency injection for OSGi in general, I would take a look at Declarative Services and/or maybe iPojo. If you are looking towards something Eclipse-specific (and integrated with the extension mechanism maybe), I would take a look at the Eclipse e4 DI mechanisms.<br /><br />HTH,<br />MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-45738419643361332322011-12-18T21:25:47.507+01:002011-12-18T21:25:47.507+01:00Today meaning December 2011Today meaning December 2011Jochenhttps://www.blogger.com/profile/00067375515520075427noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-39212834428102261992011-12-18T20:39:51.988+01:002011-12-18T20:39:51.988+01:00Great article.
I would like to use DI for Extensi...Great article. <br />I would like to use DI for Extensions, but where are we today? WHat has changed since this blog post?<br /><br />I see Blueprint is out with a 1.0 relase. Would I still want to use Spring Extension Factory or Equinox Aspects?<br /><br />I'm a bit lost in all the old docs out there. <br />Thanks for a pointer to a current sample or a quick update. Much appreciated.<br /><br />J.Jochenhttps://www.blogger.com/profile/00067375515520075427noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-15056973796807569082009-12-05T20:50:40.171+01:002009-12-05T20:50:40.171+01:00Hi John!
Haven't tried WebFlow myself with LT...Hi John!<br /><br />Haven't tried WebFlow myself with LTW, but I would take a look at the specialized Spring LTW for Equinox Aspects:<br /><br />http://martinlippert.blogspot.com/2009/04/load-time-weaving-for-spring-dm.html<br /><br />HTH,<br />MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-35907452026940825352009-12-03T20:59:52.577+01:002009-12-03T20:59:52.577+01:00Hi Martin,
any idea as to how to config for Aspec...Hi Martin,<br /><br />any idea as to how to config for Aspectj and Spring Webflow?<br /><br />the "org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" will inevitably throw not serialized errors.<br /><br />I can't figure out how to use LTW and Webflow,<br /><br />Regards John.John Okrasahttps://www.blogger.com/profile/04655965807430936213noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-86668006825900274262009-03-30T22:49:00.000+02:002009-03-30T22:49:00.000+02:00I think you have two options to achieve this:1. de...I think you have two options to achieve this:<BR/><BR/>1. define all your viewparts within the same bundle, use @Configurable for dependency injection, define the beans you would like to inject whereever you want, export them as osgi services, import them in the viewpart bundle and inject them into the viewparts.<BR/><BR/>2. use spring dependency injection for extensions using the spring extension factory (look for posting in my blog), define your viewparts in different bundles (as you like), define the other beans whereever you like, export them if necessary as osgi services, import them in the viewpart bundles and inject them.<BR/><BR/>Both ways should solve your problems. Choose whatever you like most... :-)<BR/><BR/>HTH,<BR/>MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-81353273974278461592009-03-30T21:06:00.000+02:002009-03-30T21:06:00.000+02:00Martin,But if I would like to use service injectio...Martin,<BR/><BR/>But if I would like to use service injection on ViewPart, I must use @Configurable annotation, right? Because ViewParts are instantiated automatically by Eclipse when needed.<BR/><BR/>Hmmmm, so... Does it means that I cannot use service injection if I'm developing RCP applications with many inter-module dependencies? At least for now?Emiliohttps://www.blogger.com/profile/06743139474294163439noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-20428193217068153372009-03-30T13:20:00.000+02:002009-03-30T13:20:00.000+02:00Each bundle can have its own spring configuration....Each bundle can have its own spring configuration. Those configurations are isolated from each other. If you would like to inject a bean from bundle A's context into a bean from bundle B's context, you need to export this bean as OSGi service and import it within the consuming bundle to inject it. The Spring-DM documentation tells you more about this.<BR/><BR/>The annotation based @Configurable way of doing injection works at the moment only for one bundle. There is a bug/feature request against spring-aop to solve this issue, but there is nothing available right now, I think.<BR/><BR/>HTH,<BR/>-MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-12842653882880680262009-03-30T07:04:00.000+02:002009-03-30T07:04:00.000+02:00Can I have more than one spring-context.xml in my ...Can I have more than one spring-context.xml in my RCP application? I mean, one for each bundle or do I need to consolidate all configuration into just one file?Emiliohttps://www.blogger.com/profile/06743139474294163439noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-52400973446001919612009-03-30T07:00:00.000+02:002009-03-30T07:00:00.000+02:00Hi Martin,As I said, I'm testing some usage sc...Hi Martin,<BR/><BR/>As I said, I'm testing some usage scenarios for dependency injection on RCP applications.<BR/><BR/>Your sample is working well, my custom sample is working also and I think I know how to setup everything to make it work.<BR/><BR/>Well, now I'm testing a new scenario where a service A injects into another service called B and B is injected into a ViewPart. It is very common pattern, for example, I have a service called CustomerService, which uses a DAOService. In this scenario, DAOService must be injected into CustomerService and CustomerService will be injected into ViewPart.<BR/><BR/>DAOService -> CustomerService -> ViewPart.<BR/><BR/>This configuration is not working yet. I tried everything to make it work but no success. I basically replicated every configuration to second and third bundle (DAOService and CustomerService respectively). The strange thing is that CustomerService is being injected to ViewPart but DAOService is not being injected in CustomerService.<BR/><BR/>Is there any configuration I'm missing?<BR/><BR/>Thank you,Emiliohttps://www.blogger.com/profile/06743139474294163439noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-2188810985639322002009-03-29T20:56:00.000+02:002009-03-29T20:56:00.000+02:00Hi Emilio! Glad to hear that you solved the proble...Hi Emilio! Glad to hear that you solved the problem and got your case to work! :-)<BR/><BR/>Cheers,<BR/>-MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-58861104955121108802009-03-29T09:56:00.000+02:002009-03-29T09:56:00.000+02:00Ops! Problem solved! I have informed a wrong class...Ops! Problem solved! I have informed a wrong class name on view bean configuration in file spring-context.xml.Emiliohttps://www.blogger.com/profile/06743139474294163439noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-80521743799759499962009-03-29T09:52:00.000+02:002009-03-29T09:52:00.000+02:00Hi Martin,First of all, congratulations, this is a...Hi Martin,<BR/><BR/>First of all, congratulations, this is a great library and also a great blog.<BR/><BR/>I was trying to use the library but no success. First I've tried your sample, just to make sure the environment is ok. After some adjusts, it is working well.<BR/><BR/>When I added a new bundle and injected a class into, it looks that everything worked well. I mean, I used your view, your bundle project, your launch config. and replaced your service class for my sample (in a separeted bundle).<BR/><BR/>So I did the next step: Created a brand new bundle with a view and used that bundle which was created and tested with your sample ViewPart. It does not work. Looks like the service is not being injected. I don't see any errors on log. Probably, there is some configuration you did in your *springdm.rcpview that I didn't. Do you have any ideas about it?<BR/><BR/>Thank you!Emiliohttps://www.blogger.com/profile/06743139474294163439noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-5943873432287714552009-01-07T23:50:00.000+01:002009-01-07T23:50:00.000+01:00Hi Thomas!Sorry for being late on this. Did you so...Hi Thomas!<BR/><BR/>Sorry for being late on this. Did you solve this issue in the meantime? If so, I would be happy to hear the solution. If I can still help, I would prefer to look at a running example. So it would be great if you could send me a small example to reproduce the problem?<BR/><BR/>Cheers,<BR/>-MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-42096324799222631402009-01-05T17:53:00.000+01:002009-01-05T17:53:00.000+01:00aaah forgot to say:there are three marks in the lo...aaah forgot to say:<BR/><BR/>there are three marks in the log to search for:<BR/><BR/>1. setPresenter - instance<BR/>2. init - instance<BR/>3. createPartControl - NULL<BR/><BR/>thanks a lot,<BR/><BR/>Thomas E.-E.teehttps://www.blogger.com/profile/11457998516456065171noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-50386774883192269962009-01-05T17:51:00.000+01:002009-01-05T17:51:00.000+01:00Hi Martin,thanks for this great work. After playin...Hi Martin,<BR/><BR/>thanks for this great work. After playing around a while getting the target-platform topic done DI is working now (almost).<BR/><BR/>I use it to inject a presenter class into my view. The problem ist the instance of the presenter is destroyed in the creation process.<BR/><BR/>What i've observed is this:<BR/><BR/>1. setPresenter(presenter) - perfect my instance is now in the view)<BR/>2. use spring-confiured init method and proove instance is still available - works<BR/>3. use presenter in the createPartControl() method - presenter is NULL now<BR/><BR/>quite weired, isn't it?<BR/><BR/>some lines of logging:<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'abstimmfensterModel'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Eagerly caching bean 'abstimmfensterPresenter' to allow for resolving potential circular references<BR/>DEBUG [org.springframework.beans.CachedIntrospectionResults] - Not strongly caching class [de.breuninger.sop.abstimmfenster.ui.internal.AbstimmfensterPresenter] because it is not cache-safe<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'abstimmfensterPresenter'<BR/>setPresenter: de.breuninger.sop.abstimmfenster.ui.internal.AbstimmfensterPresenter@1933cc<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Invoking init method 'init' on bean with name 'abstimmfensterView'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Finished creating instance of bean 'abstimmfensterView'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'abstimmfensterPresenter'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'abstimmfensterModel'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'kennzahlenManagerService'<BR/>DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - Returning cached instance of singleton bean 'kennzahlenManagerService'<BR/>DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Publishing event in context [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@bd4bac]: org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@bd4bac: display name [OsgiBundleXmlApplicationContext(bundle=de.breuninger.sop.abstimmfenster.ui, config=osgibundle:/META-INF/spring/*.xml)]; startup date [Mon Jan 05 17:42:50 CET 2009]; root of context hierarchy]<BR/>INFO [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Publishing application context as OSGi service with properties {org.springframework.context.service.name=de.breuninger.sop.abstimmfenster.ui, Bundle-SymbolicName=de.breuninger.sop.abstimmfenster.ui, Bundle-Version=1.0.0}<BR/>init: de.breuninger.sop.abstimmfenster.ui.internal.AbstimmfensterPresenter@1933cc<BR/>DEBUG [org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext] - Publishing service under classes {org.springframework.osgi.context.DelegatedExecutionOsgiBundleApplicationContext, org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext, org.springframework.context.ConfigurableApplicationContext, org.springframework.context.ApplicationContext, org.springframework.context.Lifecycle, org.springframework.beans.factory.ListableBeanFactory, org.springframework.beans.factory.HierarchicalBeanFactory, org.springframework.context.MessageSource, org.springframework.context.ApplicationEventPublisher, org.springframework.core.io.support.ResourcePatternResolver, org.springframework.beans.factory.BeanFactory, org.springframework.core.io.ResourceLoader, org.springframework.beans.factory.DisposableBean}<BR/>createPartControl: null<BR/>Application Started: 6944<BR/><BR/>Could you give me a pointer to narrow down this problem?<BR/><BR/>Cheers from Krefeld,<BR/><BR/>Thomas E.-E.teehttps://www.blogger.com/profile/11457998516456065171noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-35318753491990260652008-11-01T15:34:00.000+01:002008-11-01T15:34:00.000+01:00This comment has been removed by the author.Frederic Conrottehttps://www.blogger.com/profile/09690816043693205755noreply@blogger.comtag:blogger.com,1999:blog-18490491.post-62516817521741702122008-10-26T13:45:00.000+01:002008-10-26T13:45:00.000+01:00Thanks, Frederic, for the nice feedback and the hi...Thanks, Frederic, for the nice feedback and the hint to the weaver class property name.<BR/><BR/>Seeing you at ESE!<BR/><BR/>Cheers,<BR/>-MartinMartin Lipperthttps://www.blogger.com/profile/12324741319942962555noreply@blogger.com