You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Andrew Mettke <me...@gmail.com> on 2011/06/22 14:55:21 UTC

iPOJO: Constructor Injection using XML metadata

Hi,

I have a question concerning iPOJO and constructor injection.  In the
documentation I see that constructor injection was introduced with the
1.7.0-SNAPSHOT of iPOJO and that you are able to mark constructor
parameters using the @Requires annotation.  However absent from
documentation is how to perform constructor injection using XML
metadata.  I'm currently using version 1.8.0 of iPOJO and I can't seem
to find any attributes in the Requires element schema that would make
sense for constructor injection.  I was wondering if 1.8.0 support
constructor injection via XML metadata?  If so, could you provide a
simple example?  If not, is adding the ability to specify constructor
injection in XML metadata going to be in a future release?

Regards,
Andrew

Why the OSGI Configuration is bound to a config admin bundle, and not visible to other app bundles?

Posted by ext2 <xu...@tongtech.com>.
Hi:
	I have a bundle which will deploy a properties file as OSGI
Configuration, temporary I just call this bundle as a "config admin
bundle"; 

	Most time, after "config admin bundle" update configuration , the
application bundle can got it immediately. But rarely, the application
bundle must wait for 4~~5 second, otherwise the application bundle can only
get a OSGI Configuration which properties is null(
Configuration.getProperties() return NULL).
	And also a error in log shows: the configuration has been bound to
the "config admin  bundle";
	
	
	Why the application must wait for 4~5 seconds? I have confirmed that
I have reset the configuration's bundle location to NULL in the "config
admin  bundle"; 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: iPOJO: Constructor Injection using XML metadata

Posted by Clement Escoffier <cl...@gmail.com>.
Hi,

It's already supported, just not documented yet:
Add 'constructor-parameter="constructor parameter index (0 based)"' in your <requires> or <property> such as in:

<requires constructor-parameter="0"/>
<properties>
	<property constructor-parameter="1" value="Hello"/>
</properties>

for a class containing:
public Foo(LogService log, String message) {
...
}


Regards,

Clement

On 22.06.2011, at 14:55, Andrew Mettke wrote:

> Hi,
> 
> I have a question concerning iPOJO and constructor injection.  In the
> documentation I see that constructor injection was introduced with the
> 1.7.0-SNAPSHOT of iPOJO and that you are able to mark constructor
> parameters using the @Requires annotation.  However absent from
> documentation is how to perform constructor injection using XML
> metadata.  I'm currently using version 1.8.0 of iPOJO and I can't seem
> to find any attributes in the Requires element schema that would make
> sense for constructor injection.  I was wondering if 1.8.0 support
> constructor injection via XML metadata?  If so, could you provide a
> simple example?  If not, is adding the ability to specify constructor
> injection in XML metadata going to be in a future release?
> 
> Regards,
> Andrew


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org