Re: [Dev] [C5] How to programmatically shut down C5 based products?

2017-10-31 Thread Niranjan Karunanandham
Hi Grainier,

On Fri, Oct 27, 2017 at 7:04 PM, Grainier Perera  wrote:

> Hi Nira,
>
> My requirement is, I have a distributed deployment where resource nodes
> can get added to a resource pool via a coordinator node (leader). Here,
> resource node will request the coordinator to join the resource pool at its
> server startup (where OSGi refs get resolved) and the coordinator has the
> ability to allow or reject resource node from joining the resource pool
> depending on some conditions. If the resource node gets rejected, it should
> get terminated. That's where I need to shut down the resource node
> programmatically.
>
As I understand this is during the server start up. In such a scenario, if
the condition does not satisfy then IMO we should not start the server. The
reason for this is that once the server has started and its transport ports
are open, then the load balancer will start serving the request. But this
can cause an issue since the requirement for the server has not been
satisfied. In C5, there is something called Startup order resolver [1],
where you can indirectly tell the startup order to not start the transport
services until your component is satisfied.


>
> Thanks,
>
> On Thu, Oct 26, 2017 at 6:58 PM, Cyril Rognon 
> wrote:
>
>> I have a use case : we are using c5 on raspberry pi and we need a clean
>> shutdown when user want to halt to prevent micro sd card corruption issues.
>>
>> Thanks
>> Cyril
>>
>> Le jeu. 26 oct. 2017 à 13:56, Niranjan Karunanandham 
>> a écrit :
>>
>>> Hi Grainier,
>>>
>>> Can you explain the use case for this where you would want to shut down
>>> server programmatically?
>>>
>>> Regards,
>>> Nira
>>>
>>> On Wed, Oct 25, 2017 at 5:35 PM, Grainier Perera 
>>> wrote:
>>>
 Hi Devs,

 I have a requirement where I need to programmatically shut down a C5
 based product. Is there a carbon utility to do that?

 Thanks,
 Grainier.
 --
 Grainier Perera
 Senior Software Engineer
 Mobile : +94716122384 <+94%2071%20612%202384>
 WSO2 Inc. | http://wso2.com
 lean.enterprise.middleware

>>>
>>>
>>>
>>> --
>>>
>>>
>>> *Niranjan Karunanandham*
>>> Associate Technical Lead - WSO2 Inc.
>>> WSO2 Inc.: http://www.wso2.com
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>> --
>> Bien cordialement,
>>
>> Cyril Rognon
>> 06 08 89 16 86
>> Directeur associé
>> EMOXA
>> 73, rue du Château
>> 
>> 92100 Boulogne-Billancourt
>> 
>> France
>> 
>>
>
>
>
> --
> Grainier Perera
> Senior Software Engineer
> Mobile : +94716122384 <+94%2071%20612%202384>
> WSO2 Inc. | http://wso2.com
> lean.enterprise.middleware
>

[1] -
https://github.com/wso2/carbon-kernel/blob/master/docs/KernelFeatures/ResolvingtheComponentStartupOrder.md

Regards,
Nira

-- 


*Niranjan Karunanandham*
Associate Technical Lead - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [C5] How to programmatically shut down C5 based products?

2017-10-31 Thread Niranjan Karunanandham
Hi Cyril,

On Thu, Oct 26, 2017 at 6:58 PM, Cyril Rognon  wrote:

> I have a use case : we are using c5 on raspberry pi and we need a clean
> shutdown when user want to halt to prevent micro sd card corruption issues.
>
Currently, in C5 there is no graceful shutdown but it has a method[1] to
put the server on maintenance mode. Can you also give more information on
your requirement? That is, does this check happen at the server startup or
after the server is started up and is running?


>
> Thanks
> Cyril
>
> Le jeu. 26 oct. 2017 à 13:56, Niranjan Karunanandham 
> a écrit :
>
>> Hi Grainier,
>>
>> Can you explain the use case for this where you would want to shut down
>> server programmatically?
>>
>> Regards,
>> Nira
>>
>> On Wed, Oct 25, 2017 at 5:35 PM, Grainier Perera 
>> wrote:
>>
>>> Hi Devs,
>>>
>>> I have a requirement where I need to programmatically shut down a C5
>>> based product. Is there a carbon utility to do that?
>>>
>>> Thanks,
>>> Grainier.
>>> --
>>> Grainier Perera
>>> Senior Software Engineer
>>> Mobile : +94716122384 <+94%2071%20612%202384>
>>> WSO2 Inc. | http://wso2.com
>>> lean.enterprise.middleware
>>>
>>
>>
>>
>> --
>>
>>
>> *Niranjan Karunanandham*
>> Associate Technical Lead - WSO2 Inc.
>> WSO2 Inc.: http://www.wso2.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
> --
> Bien cordialement,
>
> Cyril Rognon
> 06 08 89 16 86
> Directeur associé
> EMOXA
> 73, rue du Château
> 
> 92100 Boulogne-Billancourt
> 
> France
> 
>

[1] -
https://github.com/wso2/carbon-kernel/blob/master/core/src/main/java/org/wso2/carbon/kernel/internal/runtime/CarbonRuntimeService.java#L89

Regards,
Nira

-- 


*Niranjan Karunanandham*
Associate Technical Lead - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [C5] How to programmatically shut down C5 based products?

2017-10-26 Thread Niranjan Karunanandham
Hi Grainier,

Can you explain the use case for this where you would want to shut down
server programmatically?

Regards,
Nira

On Wed, Oct 25, 2017 at 5:35 PM, Grainier Perera  wrote:

> Hi Devs,
>
> I have a requirement where I need to programmatically shut down a C5 based
> product. Is there a carbon utility to do that?
>
> Thanks,
> Grainier.
> --
> Grainier Perera
> Senior Software Engineer
> Mobile : +94716122384 <+94%2071%20612%202384>
> WSO2 Inc. | http://wso2.com
> lean.enterprise.middleware
>



-- 


*Niranjan Karunanandham*
Associate Technical Lead - WSO2 Inc.
WSO2 Inc.: http://www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [C5] How to programmatically shut down C5 based products?

2017-10-25 Thread Grainier Perera
Hi Devs,

I have a requirement where I need to programmatically shut down a C5 based
product. Is there a carbon utility to do that?

Thanks,
Grainier.
-- 
Grainier Perera
Senior Software Engineer
Mobile : +94716122384
WSO2 Inc. | http://wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev