Yes, you need to register the listener when bundle activate. Please refer
[1] how to register Listener (which Kasun pointed above)

[1]
https://github.com/wso2/carbon-kernel/blob/4.4.x/core/org.wso2.carbon.ndatasource.core/src/main/java/org/wso2/carbon/ndatasource/core/internal/DataSourceServiceComponent.java#L129

Thanks
Godwin

On Mon, Dec 5, 2016 at 2:08 PM, wenxing zheng <[email protected]>
wrote:

> Thanks to Kasun.
>
> Do I need to explicitly register the Observer and Listener? or I just need
> to implement my own subclass.
>
> On Mon, Dec 5, 2016 at 4:30 PM, KasunG Gajasinghe <[email protected]> wrote:
>
>>
>> org.wso2.carbon.stratos.common.listeners.TenantMgtListener is for tenant
>> creation/activation/deactivation events.
>>
>> org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver is for
>> tenant loading/unloading events. I think you are looking for this. See a
>> sample impl here -
>>
>> https://github.com/wso2/carbon-kernel/blob/4.4.x/core/org.
>> wso2.carbon.ndatasource.core/src/main/java/org/wso2/carbon/
>> ndatasource/core/DataSourceAxis2ConfigurationContextObserver.java
>>
>>
>> On Mon, Dec 5, 2016 at 1:41 PM, wenxing zheng <[email protected]>
>> wrote:
>>
>>> Thanks to Dilan.
>>>
>>> One example is to load/unload some special data of a specific tenant
>>> after the loading and unloading. I know Carbon supports the caching of
>>> tenant data, but the housekeeping is run in 15 mins interval by default.
>>> It's a little late for us.
>>>
>>> Regards, Wenxing
>>>
>>>
>>>
>>> On Mon, Dec 5, 2016 at 3:38 PM, Dilan Udara Ariyaratne <[email protected]>
>>> wrote:
>>>
>>>> Hi Zheng,
>>>>
>>>> Tenancy concept [1] is common to any WSO2 product including AS and a
>>>> core feature facilitated by WSO2 Carbon Kernel [2], the core framework of
>>>> all WSO2 based Products.
>>>>
>>>> Can you elaborate a bit on what kind of customization you are hoping to
>>>> do on top of the existing life-cycle states for a tenant ?
>>>>
>>>> References :
>>>> [1] https://docs.wso2.com/display/ESB510/Multi+Tenant+Architecture
>>>> [2] https://docs.wso2.com/display/Carbon4410/Features
>>>>
>>>> Thanks,
>>>> Dilan.
>>>>
>>>>
>>>> *Dilan U. Ariyaratne*
>>>> Senior Software Engineer
>>>> WSO2 Inc. <http://wso2.com/>
>>>> Mobile: +94766405580 <%2B94766405580>
>>>> lean . enterprise . middleware
>>>>
>>>>
>>>> On Mon, Dec 5, 2016 at 11:48 AM, wenxing zheng <[email protected]
>>>> > wrote:
>>>>
>>>>> Dear all,
>>>>>
>>>>> I need to do some customization on following AS tenant states:
>>>>> 1. loaded
>>>>> 2. unloaded
>>>>>
>>>>> Beside the one mentioned in [1], any other way?
>>>>>
>>>>> [1]: http://wso2.markmail.org/search/?q=list%3Aorg.wso2.dev+
>>>>> tenant+loaded+event#query:list%3Aorg.wso2.dev%20tenant%20loaded%2
>>>>> 0event+page:9+mid:mla6cls7gsoxnstu+state:results
>>>>>
>>>>> Thanks, Wenxing
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>> email: kasung AT spamfree wso2.com
>> linked-in: http://lk.linkedin.com/in/gajasinghe
>> blog: http://kasunbg.org
>> phone: +1 650-745-4499 <+1%20650-745-4499>, 77 678 0813
>>
>>
>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
twitter: https://twitter.com/godwinamila
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to