<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,3 +5,4 @@ Aaron Batalion:: {aaron.batalion@gmail.com}[mailto:aaron.batalion@gmail.com] --
 Skaar::          {skaar@waste.org}[mailto:skaar@waste.org]
 Clay McClure::   {clay@daemons.net}[mailto:clay@daemons.net] --
                  http://daemons.net/~clay
+Michael Nadel::  {michael.nadel@gmail.com}[mailto:michael.nadel@gmail.com]</diff>
      <filename>AUTHORS.txt</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,7 @@ module JMX
 
   class MBean
     include_class 'java.util.HashMap'
+    include_class 'javax.naming.Context'
     include_class 'javax.management.Attribute'
     include_class 'javax.management.ObjectName'
     include_class 'javax.management.remote.JMXConnector'
@@ -149,6 +150,8 @@ module JMX
     # [:credentials] custom credentials (if the MBean server requires authentication).
     #                No default. It has precedence over :username and :password (i.e. if
     #                :credentials is specified, :username &amp; :password are ignored)   
+    # [:provider_package] use to fill the JMXConnectorFactory::PROTOCOL_PROVIDER_PACKAGES
+    #                No default
     #
     def self.create_connection(args={})
       host= args[:host] || &quot;localhost&quot;
@@ -156,6 +159,7 @@ module JMX
       username = args[:username]
       password = args[:password]
       credentials = args[:credentials]
+      provider_package = args[:provider_package]
       
       # host &amp; port are not taken into account if url is set (see issue #7)
       standard_url = &quot;service:jmx:rmi:///jndi/rmi://#{host}:#{port}/jmxrmi&quot;
@@ -170,6 +174,12 @@ module JMX
       
       env = HashMap.new
       env.put(JMXConnector::CREDENTIALS, credentials) if credentials
+      # only fill the Context and JMXConnectorFactory properties if provider_package is set
+      if provider_package
+        env.put(Context::SECURITY_PRINCIPAL, username) if username
+        env.put(Context::SECURITY_CREDENTIALS, password) if password
+        env.put(JMXConnectorFactory::PROTOCOL_PROVIDER_PACKAGES, provider_package)
+      end
 
       # the context class loader is set to JRuby's classloader when
       # creating the JMX Connection so that classes loaded using </diff>
      <filename>lib/jmx4r.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2b733f361764c26d424b25b745db9d8127924e3b</id>
    </parent>
  </parents>
  <author>
    <name>Michael A. Nadel</name>
    <email>michael.nadel@gmail.com</email>
  </author>
  <url>http://github.com/jmesnil/jmx4r/commit/d5b89227ffa541cd2133249f8e47382e567fb71a</url>
  <id>d5b89227ffa541cd2133249f8e47382e567fb71a</id>
  <committed-date>2009-02-12T05:00:29-08:00</committed-date>
  <authored-date>2009-02-12T05:00:29-08:00</authored-date>
  <message>weblogic support

* when creating the JMX connections, filled the properties required to support weblogic auth
  - Context::SECURITY_PRINCIPAL
  - Context::SECURITY_CREDENTIALS
  - JMXConnectorFactory::PROTOCOL_PROVIDER_PACKAGES

Usage:

JMX::MBean.establish_connection :url =&gt; &quot;service:jmx:t3://#{host}:#{port}/jndi/weblogic.mana
        :provider_package =&gt; 'weblogic.management.remote',
        :username =&gt; user,
        :password =&gt; passwd

* added Michael to AUTHORS.txt file</message>
  <tree>ac5af366b1d013e3cf4b0c8d2b1d777e5e8d91b7</tree>
  <committer>
    <name>Jeff Mesnil</name>
    <email>jmesnil@gmail.com</email>
  </committer>
</commit>
