geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krishnakumar B <>
Subject Re: Static Variables and ClassLoaders
Date Tue, 13 Sep 2005 06:43:38 GMT

Thanks for the response. I am not sure if i understood ur answer
right. I tried the following

GBean Plan Config ID = test/Hello

<?xml version="1.0" encoding="UTF-8"?>
    parentId="org/apache/geronimo/Server" >
    <gbean name="HelloGBean" class="">

Web Application Plan

<?xml version="1.0" encoding="UTF-8"?>

I set the Parent ID of WAR plan  to GBean plan Config ID. I have
removed the dependency jar in Web Plan.

Still i get a null for static reference created in GBean.

Krishnakumar B

On 9/13/05, Krishnakumar B <> wrote:
> Hi,
> I have a doubt related to usage of Static Variables.
> "Static Variables are scoped in the class they r defined. So if a
> class is loaded by more than one classloader in same JVM then there
> will be multiple copies within same JVM"
> How do i used Config Id/Parent Id to ensure that 2 plans use the same
> ClassLoader so that i get a single instance of static variable.
> Regards
> Krishnakumar B

View raw message