Thanks Clement. I forgot to write that I use iPOJO 1.6.6.
/Bengt 2010/11/10 Clement Escoffier <[email protected]> > Hi, > > > On 10.11.10 17:04, "Bengt Rodehav" <[email protected]> wrote: > > >I create iPOJO instances from factory configurations using Configuration > >Admin and File Install. When the iPOJO instance becomes valid I do my > >initialisation (which normally starts a Camel route) and when the iPOJO > >instance becomes invalid I terminate my processing (which means that I > >normally stop a Camel route). > > > > @Validate > > public void start() { > > // Start the route > > } > > > > @Invalidate > > public void stop() { > > // Stop the route > > } > > > >To make it possible to control my iPOJO instances I use a controller > >property as follows: > > > > @Controller > > @Property(name = "enable", mandatory = true) > > private boolean mValid; > > > >This allows me to enable/disable my service via configuration. However, I > >have noticed that if an exception is thrown in the start() method above, > >then the iPOJO becomes invalid and there is no way for me to make it valid > >by changing any configuration property. It seems like I have to delete the > >configuration and create a new one. Have I understood this correctly? > > Modifying the configuration should trigger a reconfiguration of the > instance. It should then recompute the state (in theory it should work). > Deleting the configuration disposes the instance and recreates a new one. > > > > >I would like a convenient way to either make my iPOJO instance valid again > >or a way to dispose of the old instance and create a new one. How can I > >accomplish this? It would be convenient if I could flag my iPOJO class > >with > >an annotation like "deleteOnException" or something like that. > > Modifying the configuration should do the work. I will check that. > > Regards, > > Clement > > > > >/Bengt > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

