Hi,
On 25 July 2013 14:03, Lakmali Baminiwatta <[email protected]> wrote: > Hi Sinthuja, > > > On 25 July 2013 13:14, Sinthuja Ragendran <[email protected]> wrote: > >> Hi Lakmali, >> >> There is ServerStartupHandler in the carbon core, i think it'll be useful >> for your use-case. >> >> You just need to to implement the ServerStartupHandler in your component, >> and then register that class during the bundle activation time. The stuff >> you need to do after the server startup, should go to the invoke() method >> in your implemented class, so that it'll be called once server has started. >> Please check the mail thread on @dev '[Dev] Listener Implementation Added >> to Carbon Core for Receiving Notification of Server Initialization' for >> more information. >> > > Thanks a lot for pointing this. Will check with this approach. > I registered a ServerStartupHandler imlementation in my component. For my scenario, I need to invoke the login API of the Publisher API (Login is required before publishing the apis). But at the point which invoke() method is called, the login calls fails with following error. [2013-07-25 15:15:43,209] INFO {org.apache.axis2.transport.http.HTTPSender} - Unable to sendViaPost to url[https://10.200.0.202:9444/services/UserAdmin] org.apache.axis2.AxisFault: Transport error: 404 Error: Not Found at org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:308) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:194) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) ...... The other thing I noticed was, still there a 2 components which are getting invoked even after invoke() method is called. APIKeyMgtServiceComponent[1] & ThriftAuthenticationServiceComponent[2] are those components and still I am unable to find how those are getting activated only after the server has started. [1] https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/java/org/wso2/carbon/apimgt/keymgt/internal/APIKeyMgtServiceComponent.java [2] https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/identity/org.wso2.carbon.identity.thrift.authentication/src/main/java/org/wso2/carbon/identity/thrift/authentication/internal/ThriftAuthenticationServiceComponent.java Thanks, Lakmali > > Thanks, > Lakmali > >> >> Thanks, >> Sinthuja. >> >> >> On Thu, Jul 25, 2013 at 12:19 PM, Lakmali Baminiwatta >> <[email protected]>wrote: >> >>> Hi all, >>> >>> I have a requirement to publish some internal APIs at the server >>> startup. We are planing to use the Publisher API for this. So in order to >>> call Publisher API, the publisher web app should be available and in that >>> case, the server should have been started. >>> >>> We thought of writing a new OSGI component, which will activate after >>> the server has started. I noticed that there are some components already >>> there which always get activated after the server is started. >>> >>> ex: In API Manager, ThriftAuthenticationServiceComponent[1] activate >>> method get invoked after the server has started (ie : server is accessible >>> at that point). >>> >>> I added all the @src references available in the >>> ThriftAuthenticationServiceComponent to a new component which I wrote. But >>> the new component starts before the server start completion. So I am unable >>> to find the reason which makes the ThriftAuthenticationServiceComponent >>> startup to happen last. >>> >>> Is there a way to make a component to start after the server startup is >>> completed? >>> >>> >>> [1] >>> https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/identity/org.wso2.carbon.identity.thrift.authentication/src/main/java/org/wso2/carbon/identity/thrift/authentication/internal/ThriftAuthenticationServiceComponent.java >>> [2] >>> https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/identity/org.wso2.carbon.identity.thrift.authentication/src/main/java/org/wso2/carbon/identity/thrift/authentication/internal/ThriftAuthenticationServiceComponent.java >>> Thanks, >>> Lakmali >>> >>> >>> >>> >>> >>> >>> -- >>> Lakmali Baminiwatta* >>> * >>> Software Engineer >>> WSO2, Inc.: http://wso2.com >>> lean.enterprise.middleware >>> mobile: +94 71 2335936 >>> blog : lakmali.com >>> * >>> * >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> *Sinthuja Rajendran* >> >> Software Engineer <http://wso2.com/> >> WSO2, Inc.:http://wso2.com >> >> Blog: http://sinthu-rajan.blogspot.com/ >> Mobile: +94774273955 >> >> >> > > > -- > Lakmali Baminiwatta* > * > Software Engineer > WSO2, Inc.: http://wso2.com > lean.enterprise.middleware > mobile: +94 71 2335936 > blog : lakmali.com > * > * > -- Lakmali Baminiwatta* * Software Engineer WSO2, Inc.: http://wso2.com lean.enterprise.middleware mobile: +94 71 2335936 blog : lakmali.com * *
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
