On Wed, 2003-09-24 at 16:21, Robert Cauble wrote:
> Thanks for your quick response. That helps a lot.
> 
> I have a couple more questions though... 
> 
> In the parent-delegation model, as long as the class of the shared
> object is present in a parent class loader of the two classes which are
> sharing the object, there should be no need to marshall the object,
> right? Is it just that it's too unwieldy to factor out the shared
> classes and place them in a parent class loader?
> 

Hot deployment works by throwing about the classloader and creating
a new one.

In the parent/child model, throwing away the parent makes
all the children invalid. 
Also siblings cannot see each other (this requires marshalling).

> Also, what is the difference in functionality between a)having several
> UnifiedClassLoaders which are part of the same UnifiedLoaderRepository
> and b)having a single instance of a classloader which is a subclass of
> URLClassLoader which allows url's to be added dynamically, hence
> supporting hot-deploy? In my previous email I was thinking that the
> advantage was you could redeploy a class without having to redeploy the
> classes which depend on it, but as you said any classes hard-referencing
> it would need to be redeployed anyway.

Multiple classloaders is more restrictive when it comes to
the security model. Classes in the same package cannot access
package private methods if the classes are in different classloaders.
You can also get errors when instances of the same class name
but different class objects are passed between classloaders.

Regards,
Adrian

> 
> Thanks,
> Rob
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:jboss-user-
> > [EMAIL PROTECTED] On Behalf Of Adrian Brock
> > Sent: Wednesday, September 24, 2003 9:35 AM
> > To: [EMAIL PROTECTED]
> > Subject: [JBoss-user] Re: [JBoss-user] ClassCircularityError-
> > QueuedPessimisticEJBLock$TxLock
> > 
> > On Wed, 2003-09-24 at 14:49, Robert Cauble wrote:
> > > Can someone please point me towards some documentation which
> describes
> > > the advantage of the UnifiedClassLoader model over the tree-based
> > > class loading model? We purchased the JBoss documentation and all it
> > > says in the administrators guide is that "JBoss 3.x employs a new
> > > class loading architechture that facilitates sharing of classes
> across
> > > deployment units". It also mentions that prior to this architecture,
> > > MBeans were not hot-deployable.
> > >
> > 
> > The main benefit of the UnifiedClassLoader is it removes the
> > need to do any marshalling when crossing application boundaries.
> > A little care in packaging means there is no marshalling between
> > the front plane (WEB/Remote Interface/etc.) and the back plane
> > (JCA, db, jms, etc)
> > 
> > Hotdeployment of mbeans is possible because it uses the same
> > classloader scheme, not because it uses the UnifiedClassLoader per se.
> > 
> > As a side note:
> > Eclipse uses a similar scheme and have made no attempt to workaround
> > this Sun JVM bug (unlike us), but then they don't support redeployment
> > and you must explicity share classes.
> > The JMX spec also uses a similar scheme. As of JMX1.2 they have
> > hacked the spec to avoid the bug rather than fix the JVM.
> > 
> > Try the following test to see the overhead of marshalling,
> > every parameter and return value must be marshalled (a String is
> > very simple object to marshall):
> > 
> > import java.rmi.MarshalledObject;
> > 
> > public class Marshalling
> > {
> >     static final int iterations = 100000;
> > 
> >     public static void main(String[] args)
> >        throws Exception
> >     {
> >        System.out.println("Non-marshalled");
> >        Payload payload = new NonMarshalledPayload();
> >        test(payload);
> >        System.out.println("Marshalled");
> >        payload = new MarshalledPayload();
> >        test(payload);
> >     }
> > 
> >     public static void test(Payload payload)
> >        throws Exception
> >     {
> >        String value = new String("Value");
> > 
> >        long begin = System.currentTimeMillis();
> >        for (int i = 0; i < iterations; ++i)
> >        {
> >           payload.setValue(value);
> >           payload.getValue();
> >        }
> >        System.out.println("Time per iteration (nano secs): " +
> ((1000000
> > * (System.currentTimeMillis() - begin)) / iterations));
> >     }
> > 
> >     public interface Payload
> >     {
> >        Object getValue() throws Exception;
> >        void setValue(Object value) throws Exception;
> >     }
> > 
> >     public static class NonMarshalledPayload
> >        implements Payload
> >     {
> >        Object value;
> > 
> >        public Object getValue()
> >        {
> >           return value;
> >        }
> > 
> >        public void setValue(Object value)
> >        {
> >           this.value = value;
> >        }
> >     }
> > 
> >     public static class MarshalledPayload
> >        implements Payload
> >     {
> >        MarshalledObject value;
> > 
> >        public Object getValue()
> >           throws Exception
> >        {
> >           return value.get();
> >        }
> > 
> >        public void setValue(Object value)
> >           throws Exception
> >        {
> >           this.value = new MarshalledObject(value);
> >        }
> >     }
> > }
> > 
> > >
> > >
> > > Is this basically saying that it allows you to hot-deploy a
> component
> > > without having to re-deploy those components which depend on it and
> > > its classes?
> > >
> > 
> > It depends how tightly linked they are. The UnifiedClassLoader
> > actually makes component redeployment harder. Every component
> > hard-referencing the shared class must also be redeployed.
> > 
> > Regards,
> > Adrian
> > 
> > >
> > >
> > > Any help here would be appreciated.
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Rob
> > --
> > xxxxxxxxxxxxxxxxxxxxxxxx
> > Adrian Brock
> > Director of Support
> > Back Office
> > JBoss Group, LLC
> > xxxxxxxxxxxxxxxxxxxxxxxx
> > 
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to