public void Dispose()
 {
     if (_disposed)
     {
         return;
     }
     try
     {
         if (_connection != null)
         {
             _connection.Dispose();
             _connection = null;
         }
     }
     finally
     {
         _disposed = true;
     }
 }
 public void Connect(object credentials)
 {
     _connectionId = Guid.NewGuid();
     _connection = new Jsr262MBeanServerConnection(_enumerationMaxElements, _serviceUrl);
 }
 public void Close()
 {
     _connection.Dispose();
     _connection = null;
 }