You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jhammer03 <jh...@gmail.com> on 2014/07/14 22:29:07 UTC
Custom karaf.main.lock.Lock implementation - is it possible?
Hi all,
Still settling in with Karaf, so please bear with me.
I'd like to create and use a custom org.apache.karaf.main.lock.Lock
implementation without directly modifying karaf.jar. Is this even possible
to accomplish while still working within the constraints of OSGi class
loading and how they're used/implemented by Karaf?
Thanks,
- j
--
View this message in context: http://karaf.922171.n3.nabble.com/Custom-karaf-main-lock-Lock-implementation-is-it-possible-tp4034214.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Custom karaf.main.lock.Lock implementation - is it possible?
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
no problem ;)
Regards
JB
On 07/15/2014 08:56 PM, jhammer03 wrote:
> Thanks for the confirmation, JB.
>
> I had newbishly/foolishly assumed that any jar dropped in the
> $KARAF_HOME/lib directory would be auto-magically added to the classpath.
> One of the things that tripped me up was the less-than-informative message:
> "Exception instantiating lock class...", which I was receiving from Karaf
> when I started debugging.
>
> I was able to get my class loaded by prefacing the name of my jar with
> "karaf-", and also by appending the name of the jar to the $CLASSPATH
> variable in the $KARAF_HOME/bin/karaf script.
>
> Thanks again,
>
> - j
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Custom-karaf-main-lock-Lock-implementation-is-it-possible-tp4034214p4034228.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Custom karaf.main.lock.Lock implementation - is it possible?
Posted by jhammer03 <jh...@gmail.com>.
Thanks for the confirmation, JB.
I had newbishly/foolishly assumed that any jar dropped in the
$KARAF_HOME/lib directory would be auto-magically added to the classpath.
One of the things that tripped me up was the less-than-informative message:
"Exception instantiating lock class...", which I was receiving from Karaf
when I started debugging.
I was able to get my class loaded by prefacing the name of my jar with
"karaf-", and also by appending the name of the jar to the $CLASSPATH
variable in the $KARAF_HOME/bin/karaf script.
Thanks again,
- j
--
View this message in context: http://karaf.922171.n3.nabble.com/Custom-karaf-main-lock-Lock-implementation-is-it-possible-tp4034214p4034228.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Custom karaf.main.lock.Lock implementation - is it possible?
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
the lock is defined in the etc/system.properties file.
So, it should be possible to define:
karaf.lock.class=my.own.lock.Clazz
and put the jar file in the lib folder (prefixed with karaf-).
Regards
JB
On 07/14/2014 10:29 PM, jhammer03 wrote:
> Hi all,
>
> Still settling in with Karaf, so please bear with me.
>
> I'd like to create and use a custom org.apache.karaf.main.lock.Lock
> implementation without directly modifying karaf.jar. Is this even possible
> to accomplish while still working within the constraints of OSGi class
> loading and how they're used/implemented by Karaf?
>
> Thanks,
>
> - j
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Custom-karaf-main-lock-Lock-implementation-is-it-possible-tp4034214.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com