Hi Martin,
On Mon, Mar 17, 2014 at 7:30 PM, Martin Eppel (meppel) <mep...@cisco.com>wrote: > Hi, > > I am experimenting with some stratos code to add a property to a cartridge > (or service) which I can later retrieve from a service instance. > > Service.java (in org.apache.stratos.messaging.domain.topology) has > getter/setter for properties but I have a hard time to figure out the flow > / code where properties are actually retrieved from the cartridge > definition (json) and set at the service instance (e.g. when subscribing to > a cartridge). > > The idea is to add a new property to a cartridge json definition (see > example below), assign it to a service instance and retrieve it in the > context of autoscaler rules. Is there a better way to define properties at > the service level ? > Cartridge's properties should be available under org.apache.stratos.messaging.domain.topology.Service's properties. If not it's a bug :-) > > Also, another question is: I can see in the code that there is > ServiceCreatedEvent which I would assume would be generated and handled > when subscribing a cartridge (= service ?) but it seems that no such event > is being processed ? (- however I do see the ClusterCreatedEvent being > created and processed). When is ServiceCreatedEvent generated ? > ServiceCreatedEvent generated when you deploy a new Cartridge. org.apache.stratos.messaging.event.topology.ServiceCreatedEvent.ServiceCreatedEvent(String, ServiceType) |_org.apache.stratos.cloud.controller.topology.TopologyEventPublisher.sendServiceCreateEvent(List<Cartridge>) |_org.apache.stratos.cloud.controller.topology.TopologyBuilder.handleServiceCreated(List<Cartridge>) |_org.apache.stratos.cloud.controller.impl.CloudControllerServiceImpl.deployCartridgeDefinition(CartridgeConfig) > > Any pointers are highly appreciated > > Thanks > > Martin > > > .... > "property": [ > { > "name": "dependencies", > "value": "service_name" > } > ... > ] > -- Best Regards, Nirmal Nirmal Fernando. PPMC Member & Committer of Apache Stratos, Senior Software Engineer, WSO2 Inc. Blog: http://nirmalfdo.blogspot.com/