felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Pauls <karlpa...@gmail.com>
Subject Re: Proxy as iPOJO fallback service
Date Thu, 17 Oct 2013 19:12:40 GMT
whats wrong with setting:


this should give you what you want no?



On Thu, Oct 17, 2013 at 7:32 PM, Hendrik Nunner <
hendrik.nunner@next-audience.com> wrote:

> Dear Felix Team,
> we came across an unsupported feature we would like to use, while using
> iPOJO service injection. When defining a service via the @Requires
> annotation it is possible to define a fallback service at the same time
> ("defaultclass" being a Class object). When this property is left out,
> iPOJO provides a default service using a Java Proxy (org.apache.felix.ipojo.
> **handlers.dependency.**NullableObject). This proxy delivers hard-coded
> default values (0 or false) according to the requested return type.
> Our goal is to use a custom Proxy as fallback service. This proxy can
> generically handle methods for different use cases. This would be great,
> for example, for services that are not able to provide certain aspects of
> their functionality by throwing an exception, whereas other aspects can be
> implemented by returning a default value different to 0 or false.
> One idea to achieve this, could be by implementing a new iPOJO interface
> extending InvocationHandler (with org.apache.felix.ipojo.**
> handlers.dependency.**NullableObject being a subclass of). Another idea
> would be by defining another property for the @Requires annotation, which
> will be checked and handled inside org.apache.felix.ipojo.**
> handlers.dependency.**Dependency.start().
> Maybe you guys came across this request before and came up with a solution
> already. Or mabye you have different ideas to achieve this feature. We
> would be more than happy to discuss this idea with you or implement this
> feature ourselves.
> Best regards,
> Hendrik Nunner

Karl Pauls

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message