mx4j/src/core/mx4j/server/interceptor SecurityMBeanServerInterceptor.java,1.11,1.12 NotificationListenerMBeanServerInterceptor.java,1.8,1.9 InvokerMBeanServerInterceptor.java,1.18,1.19 ContextClassLoaderMBeanServerInterceptor.java,1.8,1.9

[email protected]
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/mx4j/server/interceptor
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3376/core/mx4j/server/interceptor

Modified Files:
	SecurityMBeanServerInterceptor.java 
	NotificationListenerMBeanServerInterceptor.java 
	InvokerMBeanServerInterceptor.java 
	ContextClassLoaderMBeanServerInterceptor.java 
Log Message:
Changed MBeanMetaData to be an interface instead of a class, allowing its pluggability

Index: SecurityMBeanServerInterceptor.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/interceptor/SecurityMBeanServerInterceptor.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** SecurityMBeanServerInterceptor.java	3 Aug 2003 11:17:33 -0000	1.11
--- SecurityMBeanServerInterceptor.java	24 Feb 2004 15:13:24 -0000	1.12
***************
*** 53,57 ****
     public void addNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
     {
!       checkPermission(metadata.info.getClassName(), null, metadata.name, "addNotificationListener");
        super.addNotificationListener(metadata, listener, filter, handback);
     }
--- 53,57 ----
     public void addNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "addNotificationListener");
        super.addNotificationListener(metadata, listener, filter, handback);
     }
***************
*** 59,63 ****
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener) throws ListenerNotFoundException
     {
!       checkPermission(metadata.info.getClassName(), null, metadata.name, "removeNotificationListener");
        super.removeNotificationListener(metadata, listener);
     }
--- 59,63 ----
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener) throws ListenerNotFoundException
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "removeNotificationListener");
        super.removeNotificationListener(metadata, listener);
     }
***************
*** 65,69 ****
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
     {
!       checkPermission(metadata.info.getClassName(), null, metadata.name, "removeNotificationListener");
        super.removeNotificationListener(metadata, listener, filter, handback);
     }
--- 65,69 ----
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "removeNotificationListener");
        super.removeNotificationListener(metadata, listener, filter, handback);
     }
***************
*** 71,75 ****
     public void instantiate(MBeanMetaData metadata, String className, String[] params, Object[] args) throws ReflectionException, MBeanException
     {
!       checkPermission(className, null, metadata.name, "instantiate");
        super.instantiate(metadata, className, params, args);
     }
--- 71,75 ----
     public void instantiate(MBeanMetaData metadata, String className, String[] params, Object[] args) throws ReflectionException, MBeanException
     {
!       checkPermission(className, null, metadata.getObjectName(), "instantiate");
        super.instantiate(metadata, className, params, args);
     }
***************
*** 77,81 ****
     public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
     {
!       checkPermission(metadata.info.getClassName(), null, metadata.name, "getMBeanInfo");
        return super.getMBeanInfo(metadata);
     }
--- 77,81 ----
     public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "getMBeanInfo");
        return super.getMBeanInfo(metadata);
     }
***************
*** 83,87 ****
     public Object invoke(MBeanMetaData metadata, String method, String[] params, Object[] args) throws MBeanException, ReflectionException
     {
!       checkPermission(metadata.info.getClassName(), method, metadata.name, "invoke");
        return super.invoke(metadata, method, params, args);
     }
--- 83,87 ----
     public Object invoke(MBeanMetaData metadata, String method, String[] params, Object[] args) throws MBeanException, ReflectionException
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), method, metadata.getObjectName(), "invoke");
        return super.invoke(metadata, method, params, args);
     }
***************
*** 89,93 ****
     public AttributeList getAttributes(MBeanMetaData metadata, String[] attributes)
     {
!       Object[] secured = filterAttributes(metadata.info.getClassName(), metadata.name, attributes, true);
        String[] array = new String[secured.length];
        for (int i = 0; i < array.length; ++i) array[i] = (String)secured[i];
--- 89,93 ----
     public AttributeList getAttributes(MBeanMetaData metadata, String[] attributes)
     {
!       Object[] secured = filterAttributes(metadata.getMBeanInfo().getClassName(), metadata.getObjectName(), attributes, true);
        String[] array = new String[secured.length];
        for (int i = 0; i < array.length; ++i) array[i] = (String)secured[i];
***************
*** 97,101 ****
     public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
     {
!       Object[] secured = filterAttributes(metadata.info.getClassName(), metadata.name, attributes.toArray(), false);
        AttributeList list = new AttributeList();
        for (int i = 0; i < secured.length; ++i) list.add(secured[i]);
--- 97,101 ----
     public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
     {
!       Object[] secured = filterAttributes(metadata.getMBeanInfo().getClassName(), metadata.getObjectName(), attributes.toArray(), false);
        AttributeList list = new AttributeList();
        for (int i = 0; i < secured.length; ++i) list.add(secured[i]);
***************
*** 105,109 ****
     public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException
     {
!       checkPermission(metadata.info.getClassName(), attribute, metadata.name, "getAttribute");
        return super.getAttribute(metadata, attribute);
     }
--- 105,109 ----
     public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), attribute, metadata.getObjectName(), "getAttribute");
        return super.getAttribute(metadata, attribute);
     }
***************
*** 111,115 ****
     public void setAttribute(MBeanMetaData metadata, Attribute attribute) throws MBeanException, AttributeNotFoundException, InvalidAttributeValueException, ReflectionException
     {
!       checkPermission(metadata.info.getClassName(), attribute.getName(), metadata.name, "setAttribute");
        super.setAttribute(metadata, attribute);
     }
--- 111,115 ----
     public void setAttribute(MBeanMetaData metadata, Attribute attribute) throws MBeanException, AttributeNotFoundException, InvalidAttributeValueException, ReflectionException
     {
!       checkPermission(metadata.getMBeanInfo().getClassName(), attribute.getName(), metadata.getObjectName(), "setAttribute");
        super.setAttribute(metadata, attribute);
     }
***************
*** 120,132 ****
        {
           case PRE_REGISTER:
!             checkPermission(metadata.info.getClassName(), null, metadata.name, "registerMBean");
!             checkTrustRegistration(metadata.mbean.getClass());
              break;
           case POST_REGISTER_TRUE:
              // The MBean can implement MBeanRegistration and change the ObjectName
!             checkPermission(metadata.info.getClassName(), null, metadata.name, "registerMBean");
              break;
           case PRE_DEREGISTER:
!             checkPermission(metadata.info.getClassName(), null, metadata.name, "unregisterMBean");
              break;
           default:
--- 120,132 ----
        {
           case PRE_REGISTER:
!             checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "registerMBean");
!             checkTrustRegistration(metadata.getMBean().getClass());
              break;
           case POST_REGISTER_TRUE:
              // The MBean can implement MBeanRegistration and change the ObjectName
!             checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "registerMBean");
              break;
           case PRE_DEREGISTER:
!             checkPermission(metadata.getMBeanInfo().getClassName(), null, metadata.getObjectName(), "unregisterMBean");
              break;
           default:

Index: NotificationListenerMBeanServerInterceptor.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/interceptor/NotificationListenerMBeanServerInterceptor.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** NotificationListenerMBeanServerInterceptor.java	16 Nov 2003 14:18:20 -0000	1.8
--- NotificationListenerMBeanServerInterceptor.java	24 Feb 2004 15:13:40 -0000	1.9
***************
*** 99,103 ****
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.name);
           super.addNotificationListener(metadata, wrapper, filter, handback);
        }
--- 99,103 ----
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.getObjectName());
           super.addNotificationListener(metadata, wrapper, filter, handback);
        }
***************
*** 112,116 ****
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.name);
           super.removeNotificationListener(metadata, wrapper);
        }
--- 112,116 ----
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.getObjectName());
           super.removeNotificationListener(metadata, wrapper);
        }
***************
*** 125,129 ****
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.name);
           super.removeNotificationListener(metadata, wrapper, filter, handback);
        }
--- 125,129 ----
        if (isEnabled())
        {
!          ListenerWrapper wrapper = new ListenerWrapper(listener, metadata.getObjectName());
           super.removeNotificationListener(metadata, wrapper, filter, handback);
        }

Index: InvokerMBeanServerInterceptor.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/interceptor/InvokerMBeanServerInterceptor.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** InvokerMBeanServerInterceptor.java	2 Dec 2003 19:31:41 -0000	1.18
--- InvokerMBeanServerInterceptor.java	24 Feb 2004 15:13:40 -0000	1.19
***************
*** 79,88 ****
     public void addNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
     {
!       ((NotificationBroadcaster)metadata.mbean).addNotificationListener(listener, filter, handback);
     }
  
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener) throws ListenerNotFoundException
     {
!       ((NotificationBroadcaster)metadata.mbean).removeNotificationListener(listener);
     }
  
--- 79,88 ----
     public void addNotificationListener(MBeanMetaData metadata, NotificationListener listener, NotificationFilter filter, Object handback)
     {
!       ((NotificationBroadcaster)metadata.getMBean()).addNotificationListener(listener, filter, handback);
     }
  
     public void removeNotificationListener(MBeanMetaData metadata, NotificationListener listener) throws ListenerNotFoundException
     {
!       ((NotificationBroadcaster)metadata.getMBean()).removeNotificationListener(listener);
     }
  
***************
*** 90,94 ****
             throws ListenerNotFoundException
     {
!       ((NotificationEmitter)metadata.mbean).removeNotificationListener(listener, filter, handback);
     }
  
--- 90,94 ----
             throws ListenerNotFoundException
     {
!       ((NotificationEmitter)metadata.getMBean()).removeNotificationListener(listener, filter, handback);
     }
  
***************
*** 97,101 ****
        try
        {
!          ClassLoader loader = metadata.classloader;
           if (loader == null) loader = Thread.currentThread().getContextClassLoader();
           Class cls = loader.loadClass(className);
--- 97,101 ----
        try
        {
!          ClassLoader loader = metadata.getClassLoader();
           if (loader == null) loader = Thread.currentThread().getContextClassLoader();
           Class cls = loader.loadClass(className);
***************
*** 105,109 ****
           Constructor ctor = cls.getConstructor(signature);
  
!          metadata.mbean = ctor.newInstance(args);
        }
        catch (ClassNotFoundException x)
--- 105,109 ----
           Constructor ctor = cls.getConstructor(signature);
  
!          metadata.setMBean(ctor.newInstance(args));
        }
        catch (ClassNotFoundException x)
***************
*** 147,153 ****
     public void registration(MBeanMetaData metadata, int operation) throws MBeanRegistrationException
     {
!       if (!(metadata.mbean instanceof MBeanRegistration)) return;
  
!       MBeanRegistration registrable = (MBeanRegistration)metadata.mbean;
  
        try
--- 147,154 ----
     public void registration(MBeanMetaData metadata, int operation) throws MBeanRegistrationException
     {
!       Object mbean = metadata.getMBean();
!       if (!(mbean instanceof MBeanRegistration)) return;
  
!       MBeanRegistration registrable = (MBeanRegistration)mbean;
  
        try
***************
*** 156,161 ****
           {
              case PRE_REGISTER:
!                ObjectName objName = registrable.preRegister(outerServer, metadata.name);
!                metadata.name = objName;
                 break;
              case POST_REGISTER_TRUE:
--- 157,162 ----
           {
              case PRE_REGISTER:
!                ObjectName objName = registrable.preRegister(outerServer, metadata.getObjectName());
!                metadata.setObjectName(objName);
                 break;
              case POST_REGISTER_TRUE:
***************
*** 190,223 ****
     public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
     {
!       if (metadata.dynamic)
        {
           // From JMX 1.1 the MBeanInfo may be dynamically changed at every time, let's refresh it
! 		 MBeanInfo info = null;
! 		 try {
! 			 info = ((DynamicMBean)metadata.mbean).getMBeanInfo();
! 		 } catch (RuntimeException x) {
! 			 throw new RuntimeMBeanException(x);
! 		 }
!          if (info == null) return null;
!          metadata.info = info;
! 
!          // Refresh also ObjectInstance.getClassName(), if it's the case
!          String className = info.getClassName();
!          if (!metadata.instance.getClassName().equals(className))
           {
!             metadata.instance = new ObjectInstance(metadata.name, className);
           }
        }
  
!       return (MBeanInfo)metadata.info.clone();
     }
  
     public Object invoke(MBeanMetaData metadata, String method, String[] params, Object[] args) throws MBeanException, ReflectionException
     {
!       if (metadata.dynamic)
        {
           try
           {
!             return ((DynamicMBean)metadata.mbean).invoke(method, args, params);
           }
           catch (JMRuntimeException x)
--- 191,220 ----
     public MBeanInfo getMBeanInfo(MBeanMetaData metadata)
     {
!       if (metadata.isMBeanDynamic())
        {
           // From JMX 1.1 the MBeanInfo may be dynamically changed at every time, let's refresh it
!          MBeanInfo info = null;
!          try
           {
!             info = ((DynamicMBean)metadata.getMBean()).getMBeanInfo();
!          }
!          catch (RuntimeException x)
!          {
!             throw new RuntimeMBeanException(x);
           }
+          if (info == null) return null;
+          metadata.setMBeanInfo(info);
        }
  
!       return (MBeanInfo)metadata.getMBeanInfo().clone();
     }
  
     public Object invoke(MBeanMetaData metadata, String method, String[] params, Object[] args) throws MBeanException, ReflectionException
     {
!       if (metadata.isMBeanDynamic())
        {
           try
           {
!             return ((DynamicMBean)metadata.getMBean()).invoke(method, args, params);
           }
           catch (JMRuntimeException x)
***************
*** 236,240 ****
        else
        {
!          return metadata.invoker.invoke(metadata, method, params, args);
        }
     }
--- 233,237 ----
        else
        {
!          return metadata.getMBeanInvoker().invoke(metadata, method, params, args);
        }
     }
***************
*** 242,250 ****
     public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException
     {
!       if (metadata.dynamic)
        {
           try
           {
!             return ((DynamicMBean)metadata.mbean).getAttribute(attribute);
           }
           catch (JMRuntimeException x)
--- 239,247 ----
     public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException
     {
!       if (metadata.isMBeanDynamic())
        {
           try
           {
!             return ((DynamicMBean)metadata.getMBean()).getAttribute(attribute);
           }
           catch (JMRuntimeException x)
***************
*** 263,267 ****
        else
        {
!          return metadata.invoker.getAttribute(metadata, attribute);
        }
     }
--- 260,264 ----
        else
        {
!          return metadata.getMBeanInvoker().getAttribute(metadata, attribute);
        }
     }
***************
*** 269,277 ****
     public void setAttribute(MBeanMetaData metadata, Attribute attribute) throws MBeanException, AttributeNotFoundException, InvalidAttributeValueException, ReflectionException
     {
!       if (metadata.dynamic)
        {
           try
           {
!             ((DynamicMBean)metadata.mbean).setAttribute(attribute);
           }
           catch (JMRuntimeException x)
--- 266,274 ----
     public void setAttribute(MBeanMetaData metadata, Attribute attribute) throws MBeanException, AttributeNotFoundException, InvalidAttributeValueException, ReflectionException
     {
!       if (metadata.isMBeanDynamic())
        {
           try
           {
!             ((DynamicMBean)metadata.getMBean()).setAttribute(attribute);
           }
           catch (JMRuntimeException x)
***************
*** 290,294 ****
        else
        {
!          metadata.invoker.setAttribute(metadata, attribute);
        }
     }
--- 287,291 ----
        else
        {
!          metadata.getMBeanInvoker().setAttribute(metadata, attribute);
        }
     }
***************
*** 296,304 ****
     public AttributeList getAttributes(MBeanMetaData metadata, String[] attributes)
     {
!       if (metadata.dynamic)
        {
           try
           {
!             return ((DynamicMBean)metadata.mbean).getAttributes(attributes);
           }
           catch (JMRuntimeException x)
--- 293,301 ----
     public AttributeList getAttributes(MBeanMetaData metadata, String[] attributes)
     {
!       if (metadata.isMBeanDynamic())
        {
           try
           {
!             return ((DynamicMBean)metadata.getMBean()).getAttributes(attributes);
           }
           catch (JMRuntimeException x)
***************
*** 339,347 ****
     public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
     {
!       if (metadata.dynamic)
        {
           try
           {
!             return ((DynamicMBean)metadata.mbean).setAttributes(attributes);
           }
           catch (JMRuntimeException x)
--- 336,344 ----
     public AttributeList setAttributes(MBeanMetaData metadata, AttributeList attributes)
     {
!       if (metadata.isMBeanDynamic())
        {
           try
           {
!             return ((DynamicMBean)metadata.getMBean()).setAttributes(attributes);
           }
           catch (JMRuntimeException x)

Index: ContextClassLoaderMBeanServerInterceptor.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/mx4j/server/interceptor/ContextClassLoaderMBeanServerInterceptor.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ContextClassLoaderMBeanServerInterceptor.java	16 Sep 2003 14:43:55 -0000	1.8
--- ContextClassLoaderMBeanServerInterceptor.java	24 Feb 2004 15:13:40 -0000	1.9
***************
*** 52,60 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.addNotificationListener(metadata, listener, filter, handback);
                 return;
--- 52,60 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.addNotificationListener(metadata, listener, filter, handback);
                 return;
***************
*** 75,83 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.removeNotificationListener(metadata, listener);
                 return;
--- 75,83 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.removeNotificationListener(metadata, listener);
                 return;
***************
*** 98,106 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.removeNotificationListener(metadata, listener, filter, handback);
                 return;
--- 98,106 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.removeNotificationListener(metadata, listener, filter, handback);
                 return;
***************
*** 121,129 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.instantiate(metadata, className, params, args);
                 return;
--- 121,129 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.instantiate(metadata, className, params, args);
                 return;
***************
*** 144,152 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.registration(metadata, operation);
                 return;
--- 144,152 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.registration(metadata, operation);
                 return;
***************
*** 167,175 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 return super.getMBeanInfo(metadata);
              }
--- 167,175 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 return super.getMBeanInfo(metadata);
              }
***************
*** 189,197 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 return super.invoke(metadata, method, params, args);
              }
--- 189,197 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 return super.invoke(metadata, method, params, args);
              }
***************
*** 211,219 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 return super.getAttributes(metadata, attributes);
              }
--- 211,219 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 return super.getAttributes(metadata, attributes);
              }
***************
*** 233,241 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 return super.setAttributes(metadata, attributes);
              }
--- 233,241 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 return super.setAttributes(metadata, attributes);
              }
***************
*** 255,263 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 return super.getAttribute(metadata, attribute);
              }
--- 255,263 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 return super.getAttribute(metadata, attribute);
              }
***************
*** 277,285 ****
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.classloader != context)
           {
              try
              {
!                setContextClassLoader(metadata.classloader);
                 super.setAttribute(metadata, attribute);
                 return;
--- 277,285 ----
        {
           ClassLoader context = getContextClassLoader();
!          if (metadata.getClassLoader() != context)
           {
              try
              {
!                setContextClassLoader(metadata.getClassLoader());
                 super.setAttribute(metadata, attribute);
                 return;



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.