Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Application Implementation

asked 2016-05-20 08:04:33 -0800

monicarajasekaran gravatar image


When I start karaf, why is it that the implementation I have written for my application only gets called sometimes and not always?

I even tried starting karaf clean.

Note: “myapp/impl/src/main/java/org/opendaylight/myapp/impl/” has the implementation written under “onSessionInitiated()”

Or is session initiated only once and I have to write my implementation under “” which implements “MyAppService” ??


edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-05-23 21:36:39 -0800

karthik330 gravatar image

May i know what implementation are you trying? I believe session initiated gets executed only once . If you want to call your function whenever you need ,you have to implement it as RPC implementation unless it is listener function.

edit flag offensive delete publish link more


Hi Karthik, do you mean I should create a new service? I do have a separate service for my application that has been added to Rpc implementation. But If I want to invoke some function every time the application is started, how do i do that?

monicarajasekaran ( 2016-05-24 07:17:59 -0800 )edit

U could see impl/src/main/java/(org.*.*)/(yourProjectname)>createInstance() function. This function executes first whenever you launch your application.So No matter which class is having ur function-implemetation.Create object of that class inside createInstance() and call your function

karthik330 ( 2016-05-24 21:26:15 -0800 )edit

Hi Karthik, Thanks for that useful info! Do you know how I should get the ProviderContext's session object that was created in onSessionInitiated in my createInstance ? Is there a function to get the current session?

monicarajasekaran ( 2016-05-26 08:29:07 -0800 )edit
Login/Signup to Answer


Asked: 2016-05-20 08:04:33 -0800

Seen: 55 times

Last updated: May 23 '16