Re: [Dev] OSGI bundle stopping mechanisms

2018-02-07 Thread Darshana Gunawardana
Hi Denuwanthi,

It's depend on the bundle type..

For an example, Oauth is a core bundle for a product like IS. So the
product should not start, if there are missing resources like required
database schemas.

Thanks,

On Tue, Feb 6, 2018 at 11:47 AM, Danesh Kuruppu  wrote:

> Hi Denuwanthi,
>
> We have a requirement where we need to interfere/stop the server start up,
>> if a certain condition is not fulfilled during the bundle startup.
>>
>> For that. is it ok to use following approach inside the bundle service
>> component if the particular condition is not met?
>> bundleContext.getBundle(0).stop();
>>
>
> Instead of shutting down osgi container completely, can we control this by
> not registering the service if certain condition is not satisfied. So
> inside bundle service component, we check the condition before registering
> the service. If the condition not satisfied, we return without registering
> the services.
>
> Thanks
> Danesh
>
>
>> Or is there any other proper  approach we can use?
>>
>> Thanks,
>>
>> --
>> Denuwanthi De Silva
>>
>>
>
>
> --
>
> *Danesh Kuruppu*
> Senior Software Engineer | WSO2
>
> Email: dan...@wso2.com
> Mobile: +94 (77) 1690552 <+94%2077%20169%200552>
> Web: WSO2 Inc 
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Regards,


*Darshana Gunawardana*Technical Lead
WSO2 Inc.; http://wso2.com

*E-mail: darsh...@wso2.com *
*Mobile: +94718566859*Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] OSGI bundle stopping mechanisms

2018-02-05 Thread Danesh Kuruppu
Hi Denuwanthi,

We have a requirement where we need to interfere/stop the server start up,
> if a certain condition is not fulfilled during the bundle startup.
>
> For that. is it ok to use following approach inside the bundle service
> component if the particular condition is not met?
> bundleContext.getBundle(0).stop();
>

Instead of shutting down osgi container completely, can we control this by
not registering the service if certain condition is not satisfied. So
inside bundle service component, we check the condition before registering
the service. If the condition not satisfied, we return without registering
the services.

Thanks
Danesh


> Or is there any other proper  approach we can use?
>
> Thanks,
>
> --
> Denuwanthi De Silva
>
>


-- 

*Danesh Kuruppu*
Senior Software Engineer | WSO2

Email: dan...@wso2.com
Mobile: +94 (77) 1690552 <+94%2077%20169%200552>
Web: WSO2 Inc 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] OSGI bundle stopping mechanisms

2018-02-05 Thread Denuwanthi De Silva
Hi,

We have a requirement where we need to interfere/stop the server start up,
if a certain condition is not fulfilled during the bundle startup.

For that. is it ok to use following approach inside the bundle service
component if the particular condition is not met?
bundleContext.getBundle(0).stop();

Or is there any other proper  approach we can use?

Thanks,

-- 
Denuwanthi De Silva
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev