Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » Gemini Blueprint and optional services
Gemini Blueprint and optional services [message #872236] Tue, 15 May 2012 18:23 Go to next message
Mastah Naleh is currently offline Mastah NalehFriend
Messages: 32
Registered: April 2012
Member
Hi. Is it possible using the attribute availability to make so a service become optional ?

I did try using availability="optional" but when the service is not present, I still have to catch an exception (org.eclipse.gemini.blueprint.service.ServiceUnavailableException)


Here is my bean config:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="wwwspringframework.org/schema/beans"
xmlns:aop="wwwspringframework.org/schema/aop"
xmlns:xsi="wwww3.org/2001/XMLSchema-instance"
xmlns:osgi="wwweclipse.org/gemini/blueprint/schema/blueprint"
xmlns:osgix="wwweclipse.org/gemini/blueprint/schema/blueprint-compendium"
xsi:schemaLocation="wwwspringframework.org/schema/aop wwwspringframework.org/schema/aop/spring-aop.xsd
wwwspringframework.org/schema/beans wwwspringframework.org/schema/beans/spring-beans.xsd
wwweclipse.org/gemini/blueprint/schema/blueprint wwweclipse.org/gemini/blueprint/schema/blueprint/gemini-blueprint.xsd
wwweclipse.org/gemini/blueprint/schema/blueprint-compendium wwweclipse.org/gemini/blueprint/schema/blueprint-compendium/gemini-blueprint-compendium.xsd">

<osgi:service ref="logFacade" interface="org.mastah.sdm.logger.facade.ILogFacade" />

<osgi:reference id="logEngine" interface="org.mastah.sdm.logger.engine.ILogEngine" availability="optional" timeout="10" />

</beans>


The proxy are created under JdkDynamicAopProxy, not idea if that could be a problem.
Is there a way to create them using CGLIB instead ?

Thanks.

[Updated on: Tue, 15 May 2012 18:25]

Report message to a moderator

Re: Gemini Blueprint and optional services [message #881012 is a reply to message #872236] Sun, 03 June 2012 16:48 Go to previous message
Mastah Naleh is currently offline Mastah NalehFriend
Messages: 32
Registered: April 2012
Member
Anyone that could have a clue of what I could do ?

So far I though that availability="optional" mean the service to be really optional (ie: possibility of no service). But when the service reference is flagged as optional and if no service is found when calling the service, an exception is still throw.

Wouldn't it be better to return null on returning method and do nothing on void method for true optional service ?

Or could it be possible to add an option to ask for an exception to be thrown or not if the service can't be found ?

Thanks
Previous Topic:Gemini DBAccess 1.1.0 M1
Next Topic:Value of Blueprint when using Spring?
Goto Forum:
  


Current Time: Sat Apr 20 09:29:15 GMT 2024

Powered by FUDForum. Page generated in 0.03024 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top