HI,
yes I understand the current solution. It is really nice. My request was
for a much simpler much more basic feature.

karaf.lock.exclusive

would probably be what I need. But I would not know how to implement that

Fabian

On Wed, Dec 2, 2015 at 10:15 AM, Jean-Baptiste Onofré <j...@nanthrax.net>
wrote:

> Hi Fabian,
>
> the purpose is also to be able to "prepare" the slave instance, so the
> instance has to be started somehow.
>
> However, what you propose could make sense in some use case. Maybe we can
> add a karaf.lock.exclusive property to define this behavior.
>
> WDYT ?
>
> Regards
> JB
>
>
> On 12/02/2015 09:32 AM, Fabian Lange wrote:
>
>> Hi,
>> to my surprise I saw that while Karaf has a sweet failover mechanism, it
>> does not provide means to actually prevent startup of a second instance,
>> should the use case require it.
>> i can turn Lock off, but then I can start as many instances as I like
>> (which subsequently have bundle issues due to activators not able to bind
>> ports).
>> And I can wait for previous instances to terminate by using File or JDBC
>> lock.
>> In my case I want the second start to fail.
>>
>> Would it be sufficient to subclass SimpleFileLock, and to overwrite
>>
>> boolean lock() throws Exception {
>>   boolean locked = super.lock();
>>   if (!locked) throw new RuntimeException("startup aborted");
>>   return true;
>> }
>>
>> or would that be not a great idea?
>>
>> if you think its useful I can make this nice and package as PR
>>
>> Fabian
>>
>>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Reply via email to