felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <XavierMillie...@Eaton.com>
Subject Ipojo property
Date Mon, 15 Jul 2013 07:38:47 GMT
Hi All,

I would like to know, if it's possible with IPOJO to retrieve any property from a property
file, because after reading any documentation about this, normally, yes, but this code does
not work !! some help  please ?

package mypackage

@Component(name = "MyComponent ", immediate = true, propagation = true)
@Instantiate
@Provides
public class MyComponent {

    private static Logger logger = LoggerFactory.getLogger(MessageBusTransport.class);
    @Property(name = "myProperty")
    public void myProperty (String myProperty) {
        this. myProperty = myProperty;
    }

    /**
     * Try to connect with a AMQP MOM.
     *
     * @throws MessageBusException
     */
    @Validate
    public void starting(){
        logger.debug(MessageBusTransport.class.getSimpleName() + " : starting...");

        System.out.println(myProperty);
}

.....

With Karaf I put my property file under /etc, and the name, is: mypackage.MyComponent.cfg

In the file
myProperty=myValue


So ???????

Thanks you for help



________________________________

________________________________



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