+1 Yes a good point! We will need to start the servers based on the artifact repository availability.
On Tue, Mar 3, 2015 at 2:50 PM, Chamila De Alwis <chami...@wso2.com> wrote: > Hi, > > I've implemented a Python extension executor which would execute the bash > extensions files. The extension files are renamed to match their relevent > event and a plugin called ExtensionExecutor will execute the extension > based on the event it was triggered on. > > Since service start logic is now moved to the CA itself, we will have to > introduce a plugin or an extension which starts the server. From the JCA > code [1], it seems that this was earlier done as an extension. The > startServer extension is run before the instance activated event is > published from the agent. > > IMO, this is not a proper way to start a service, since at this point (for > the repository based cartridges) the artifacts have not been cloned yet (or > if they are cloned, it is a timing chance and not consistent). Furthermore, > since each service would have to write the extension for its start logic, > it can be implemented as a plugin and not an extension. This plugin can be > mapped to the ArtifactUpdatedEvent for repository based cartridges and for > InstanceStartedEvent for non repository based cartridges. > > Similarly for the Java Cartridge Agent, the ArtifactUpdatedEvent > extension, and the InstanceStartedEvent extension should execute the server > start logic. > > WDYT? Please add if I've missed anything. > > [1] - > https://github.com/apache/stratos/blob/master/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/CartridgeAgent.java#L120-L127 > > > Regards, > Chamila de Alwis > Software Engineer | WSO2 | +94772207163 > Blog: code.chamiladealwis.com > > > -- Imesh Gunaratne Technical Lead, WSO2 Committer & PMC Member, Apache Stratos