mx4j/src/tools/mx4j/tools/remote/soap SOAPConnectorServer.java,1.10,1.11

[email protected]
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/tools/mx4j/tools/remote/soap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8270/tools/mx4j/tools/remote/soap

Modified Files:
	SOAPConnectorServer.java 
Log Message:
Using the mechanism of the provider classloader to load the webcontainer implementation

Index: SOAPConnectorServer.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/tools/mx4j/tools/remote/soap/SOAPConnectorServer.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** SOAPConnectorServer.java	1 Mar 2004 18:05:39 -0000	1.10
--- SOAPConnectorServer.java	2 Mar 2004 09:10:21 -0000	1.11
***************
*** 16,19 ****
--- 16,20 ----
  import javax.management.MBeanServer;
  import javax.management.remote.JMXServiceURL;
+ import javax.management.remote.JMXConnectorServerFactory;
  
  import mx4j.remote.ConnectionResolver;
***************
*** 96,102 ****
           // Not present, by default use Jetty
           if (webContainerClassName == null || webContainerClassName.length() == 0) webContainerClassName = JettyWebContainer.class.getName();
!          webContainer = createWebContainer(webContainerClassName);
           // Jetty not present, use AXIS
!          if (webContainer == null) webContainer = createWebContainer(SimpleAxisWebContainer.class.getName());
           // Nothing present, give up
           if (webContainer == null) throw new IOException("Could not start embedded web container");
--- 97,103 ----
           // Not present, by default use Jetty
           if (webContainerClassName == null || webContainerClassName.length() == 0) webContainerClassName = JettyWebContainer.class.getName();
!          webContainer = createWebContainer(webContainerClassName, environment);
           // Jetty not present, use AXIS
!          if (webContainer == null) webContainer = createWebContainer(SimpleAxisWebContainer.class.getName(), environment);
           // Nothing present, give up
           if (webContainer == null) throw new IOException("Could not start embedded web container");
***************
*** 123,131 ****
     }
  
!    private WebContainer createWebContainer(String webContainerClassName)
     {
        try
        {
!          return (WebContainer)Thread.currentThread().getContextClassLoader().loadClass(webContainerClassName).newInstance();
        }
        catch (Exception x)
--- 124,139 ----
     }
  
!    private WebContainer createWebContainer(String webContainerClassName, Map environment)
     {
+       ClassLoader loader = Thread.currentThread().getContextClassLoader();
+       if (environment != null)
+       {
+          Object cl = environment.get(JMXConnectorServerFactory.PROTOCOL_PROVIDER_CLASS_LOADER);
+          if (cl instanceof ClassLoader) loader = (ClassLoader)cl;
+       }
+ 
        try
        {
!          return (WebContainer)loader.loadClass(webContainerClassName).newInstance();
        }
        catch (Exception x)



-------------------------------------------------------
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.