Coverage Report - org.mule.module.management.agent.JmxAgent
 
Classes in this File Line Coverage Branch Coverage Complexity
JmxAgent
77%
143/185
69%
43/62
2.273
JmxAgent$1
86%
12/14
100%
2/2
2.273
 
 1  
 /*
 2  
  * $Id: JmxAgent.java 11530 2008-04-08 12:49:14Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 package org.mule.module.management.agent;
 11  
 
 12  
 import org.mule.AbstractAgent;
 13  
 import org.mule.RegistryContext;
 14  
 import org.mule.api.MuleException;
 15  
 import org.mule.api.MuleRuntimeException;
 16  
 import org.mule.api.context.notification.MuleContextNotificationListener;
 17  
 import org.mule.api.context.notification.ServerNotification;
 18  
 import org.mule.api.lifecycle.InitialisationException;
 19  
 import org.mule.api.model.Model;
 20  
 import org.mule.api.service.Service;
 21  
 import org.mule.api.transport.Connector;
 22  
 import org.mule.api.transport.MessageReceiver;
 23  
 import org.mule.config.i18n.CoreMessages;
 24  
 import org.mule.context.notification.MuleContextNotification;
 25  
 import org.mule.context.notification.NotificationException;
 26  
 import org.mule.module.management.i18n.ManagementMessages;
 27  
 import org.mule.module.management.mbean.ConnectorService;
 28  
 import org.mule.module.management.mbean.ConnectorServiceMBean;
 29  
 import org.mule.module.management.mbean.EndpointService;
 30  
 import org.mule.module.management.mbean.EndpointServiceMBean;
 31  
 import org.mule.module.management.mbean.ModelService;
 32  
 import org.mule.module.management.mbean.ModelServiceMBean;
 33  
 import org.mule.module.management.mbean.MuleConfigurationService;
 34  
 import org.mule.module.management.mbean.MuleConfigurationServiceMBean;
 35  
 import org.mule.module.management.mbean.MuleService;
 36  
 import org.mule.module.management.mbean.MuleServiceMBean;
 37  
 import org.mule.module.management.mbean.ServiceService;
 38  
 import org.mule.module.management.mbean.ServiceServiceMBean;
 39  
 import org.mule.module.management.mbean.StatisticsService;
 40  
 import org.mule.module.management.support.AutoDiscoveryJmxSupportFactory;
 41  
 import org.mule.module.management.support.JmxSupport;
 42  
 import org.mule.module.management.support.JmxSupportFactory;
 43  
 import org.mule.module.management.support.SimplePasswordJmxAuthenticator;
 44  
 import org.mule.transport.AbstractConnector;
 45  
 import org.mule.util.ClassUtils;
 46  
 import org.mule.util.StringUtils;
 47  
 
 48  
 import java.rmi.server.ExportException;
 49  
 import java.util.ArrayList;
 50  
 import java.util.Arrays;
 51  
 import java.util.Collections;
 52  
 import java.util.HashMap;
 53  
 import java.util.Iterator;
 54  
 import java.util.List;
 55  
 import java.util.Map;
 56  
 
 57  
 import javax.management.InstanceAlreadyExistsException;
 58  
 import javax.management.MBeanRegistrationException;
 59  
 import javax.management.MBeanServer;
 60  
 import javax.management.MBeanServerFactory;
 61  
 import javax.management.MalformedObjectNameException;
 62  
 import javax.management.NotCompliantMBeanException;
 63  
 import javax.management.ObjectName;
 64  
 import javax.management.remote.JMXAuthenticator;
 65  
 import javax.management.remote.JMXConnectorServer;
 66  
 import javax.management.remote.JMXConnectorServerFactory;
 67  
 import javax.management.remote.JMXServiceURL;
 68  
 import javax.management.remote.rmi.RMIConnectorServer;
 69  
 
 70  
 import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
 71  
 
 72  
 import org.apache.commons.logging.Log;
 73  
 import org.apache.commons.logging.LogFactory;
 74  
 
 75  
 /**
 76  
  * <code>JmxAgent</code> registers Mule Jmx management beans with an MBean server.
 77  
  */
 78  
 public class JmxAgent extends AbstractAgent
 79  
 {
 80  
 
 81  
     public static final String DEFAULT_REMOTING_URI = "service:jmx:rmi:///jndi/rmi://localhost:1099/server";
 82  
     // populated with values below in a static initializer
 83  
     public static final Map DEFAULT_CONNECTOR_SERVER_PROPERTIES;
 84  
 
 85  
     /**
 86  
      * Default JMX Authenticator to use for securing remote access.
 87  
      */
 88  16
     public static final String DEFAULT_JMX_AUTHENTICATOR = SimplePasswordJmxAuthenticator.class.getName();
 89  
 
 90  
     /**
 91  
      * Logger used by this class
 92  
      */
 93  16
     protected static final Log logger = LogFactory.getLog(JmxAgent.class);
 94  
 
 95  
     /**
 96  
      * Should MBeanServer be discovered.
 97  
      */
 98  28
     protected boolean locateServer = true;
 99  
 
 100  28
     private boolean createServer = true;
 101  
     private String connectorServerUrl;
 102  
     private MBeanServer mBeanServer;
 103  
     private JMXConnectorServer connectorServer;
 104  28
     private Map connectorServerProperties = null;
 105  28
     private boolean enableStatistics = true;
 106  28
     private List registeredMBeans = new ArrayList();
 107  28
     private final AtomicBoolean serverCreated = new AtomicBoolean(false);
 108  28
     private final AtomicBoolean initialized = new AtomicBoolean(false);
 109  
 
 110  28
     private JmxSupportFactory jmxSupportFactory = AutoDiscoveryJmxSupportFactory.getInstance();
 111  28
     private JmxSupport jmxSupport = jmxSupportFactory.getJmxSupport();
 112  
 
 113  
 
 114  
     /**
 115  
      * Username/password combinations for JMX Remoting authentication.
 116  
      */
 117  28
     private Map credentials = new HashMap();
 118  
 
 119  
     static
 120  
     {
 121  16
         Map props = new HashMap(1);
 122  16
         props.put(RMIConnectorServer.JNDI_REBIND_ATTRIBUTE, "true");
 123  16
         DEFAULT_CONNECTOR_SERVER_PROPERTIES = Collections.unmodifiableMap(props);
 124  16
     }
 125  
 
 126  
     public JmxAgent()
 127  
     {
 128  28
         super("jmx-agent");
 129  28
         connectorServerProperties = new HashMap(DEFAULT_CONNECTOR_SERVER_PROPERTIES);
 130  28
     }
 131  
 
 132  
     /**
 133  
      * {@inheritDoc}
 134  
      *
 135  
      * @see org.mule.api.agent.Agent#getDescription()
 136  
      */
 137  
     public String getDescription()
 138  
     {
 139  0
         if (connectorServerUrl != null)
 140  
         {
 141  0
             return name + ": " + connectorServerUrl;
 142  
         }
 143  
         else
 144  
         {
 145  0
             return "JMX Agent";
 146  
         }
 147  
     }
 148  
 
 149  
     /**
 150  
      * The JmxAgent needs a RmiRegistryAgent to be started before it can properly work.
 151  
      */    
 152  
     public List getDependentAgents()
 153  
     {
 154  44
         return Arrays.asList(new Class[] { RmiRegistryAgent.class });
 155  
     }
 156  
 
 157  
     /**
 158  
      * {@inheritDoc}
 159  
      *
 160  
      */
 161  
     public void initialise() throws InitialisationException
 162  
     {
 163  30
         if (initialized.get())
 164  
         {
 165  4
             return;
 166  
         }
 167  26
         if (mBeanServer == null && !locateServer && !createServer)
 168  
         {
 169  0
             throw new InitialisationException(ManagementMessages.createOrLocateShouldBeSet(), this);
 170  
         }
 171  26
         if (mBeanServer == null && locateServer)
 172  
         {
 173  24
             List l = MBeanServerFactory.findMBeanServer(null);
 174  24
             if (l != null && l.size() > 0)
 175  
             {
 176  6
                 mBeanServer = (MBeanServer) l.get(0);
 177  
             }
 178  
         }
 179  26
         if (mBeanServer == null && createServer)
 180  
         {
 181  18
             mBeanServer = MBeanServerFactory.createMBeanServer();
 182  18
             serverCreated.set(true);
 183  
         }
 184  26
         if (mBeanServer == null)
 185  
         {
 186  0
             throw new InitialisationException(ManagementMessages.cannotLocateOrCreateServer(), this);
 187  
         }
 188  
 
 189  
         // We need to register all the services once the server has initialised
 190  26
         MuleContextNotificationListener l = new MuleContextNotificationListener()
 191  
         {
 192  26
             public void onNotification(ServerNotification notification)
 193  
             {
 194  244
                 if (notification.getAction() == MuleContextNotification.CONTEXT_STARTED_MODELS)
 195  
                 {
 196  
                     try
 197  
                     {
 198  22
                         registerWrapperService();
 199  22
                         registerStatisticsService();
 200  22
                         registerMuleService();
 201  22
                         registerConfigurationService();
 202  22
                         registerModelServices();
 203  22
                         registerServiceServices();
 204  22
                         registerEndpointServices();
 205  22
                         registerConnectorServices();
 206  
                     }
 207  0
                     catch (Exception e)
 208  
                     {
 209  0
                         throw new MuleRuntimeException(CoreMessages.objectFailedToInitialise("MBeans"), e);
 210  22
                     }
 211  
                 }
 212  244
             }
 213  
         };
 214  
 
 215  26
         if (StringUtils.isBlank(muleContext.getConfiguration().getId()))
 216  
         {
 217  
             // TODO i18n the message properly
 218  0
             throw new IllegalArgumentException(
 219  
                     "Manager ID is mandatory when running with JmxAgent. Give your Mule configuration a valid ID.");
 220  
         }
 221  
 
 222  
         try
 223  
         {
 224  26
             muleContext.registerListener(l);
 225  0
         } catch (NotificationException e) {
 226  0
             throw new InitialisationException(e, this);
 227  26
         }
 228  26
         initialized.compareAndSet(false, true);
 229  26
     }
 230  
 
 231  
     /**
 232  
      * {@inheritDoc} (non-Javadoc)
 233  
      *
 234  
      * @see org.mule.api.lifecycle.Startable#start()
 235  
      */
 236  
     public void start() throws MuleException
 237  
     {
 238  
         try
 239  
         {
 240  26
             logger.info("Creating and starting JMX agent connector Server");
 241  26
             if (connectorServerUrl != null)
 242  
             {
 243  10
                 JMXServiceURL url = new JMXServiceURL(connectorServerUrl);
 244  10
                 if (connectorServerProperties == null)
 245  
                 {
 246  0
                     connectorServerProperties = new HashMap(DEFAULT_CONNECTOR_SERVER_PROPERTIES);
 247  
                 }
 248  
                 // TODO custom authenticator may have its own security config,
 249  
                 // refactor
 250  10
                 if (!credentials.isEmpty())
 251  
                 {
 252  6
                     JMXAuthenticator jmxAuthenticator = (JMXAuthenticator)ClassUtils.instanciateClass(
 253  
                         DEFAULT_JMX_AUTHENTICATOR, ClassUtils.NO_ARGS);
 254  
                     // TODO support for custom authenticators
 255  6
                     ((SimplePasswordJmxAuthenticator)jmxAuthenticator).setCredentials(credentials);
 256  6
                     connectorServerProperties.put(JMXConnectorServer.AUTHENTICATOR, jmxAuthenticator);
 257  
                 }
 258  10
                 connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(url,
 259  
                     connectorServerProperties, mBeanServer);
 260  10
                 connectorServer.start();
 261  
             }
 262  
         }
 263  0
         catch (ExportException e)
 264  
         {
 265  0
             throw new JmxManagementException(CoreMessages.failedToStart("Jmx Agent"), e);
 266  
         }
 267  0
         catch (Exception e)
 268  
         {
 269  0
             throw new JmxManagementException(CoreMessages.failedToStart("Jmx Agent"), e);
 270  26
         }
 271  26
     }
 272  
 
 273  
     public void stop() throws MuleException
 274  
     {
 275  24
         if (connectorServer != null)
 276  
         {
 277  
             try
 278  
             {
 279  10
                 connectorServer.stop();
 280  
             }
 281  0
             catch (Exception e)
 282  
             {
 283  0
                 throw new JmxManagementException(CoreMessages.failedToStop("Jmx Connector"), e);
 284  10
             }
 285  
         }
 286  24
     }
 287  
 
 288  
     /**
 289  
      * {@inheritDoc}
 290  
      */
 291  
     public void dispose()
 292  
     {
 293  32
         if (mBeanServer != null)
 294  
         {
 295  24
             for (Iterator iterator = registeredMBeans.iterator(); iterator.hasNext();)
 296  
             {
 297  86
                 ObjectName objectName = (ObjectName) iterator.next();
 298  
                 try
 299  
                 {
 300  86
                     mBeanServer.unregisterMBean(objectName);
 301  
                 }
 302  0
                 catch (Exception e)
 303  
                 {
 304  0
                     logger.warn("Failed to unregister MBean: " + objectName + ". Error is: " + e.getMessage());
 305  86
                 }
 306  86
             }
 307  24
             if (serverCreated.get())
 308  
             {
 309  16
                 MBeanServerFactory.releaseMBeanServer(mBeanServer);
 310  
             }
 311  24
             mBeanServer = null;
 312  
         }
 313  
 
 314  32
         initialized.set(false);
 315  32
     }
 316  
 
 317  
     /** 
 318  
      * {@inheritDoc}
 319  
      */
 320  
     public void registered()
 321  
     {
 322  
         // nothing to do
 323  0
     }
 324  
 
 325  
     /** 
 326  
      * {@inheritDoc}
 327  
      */
 328  
     public void unregistered()
 329  
     {
 330  
         // nothing to do
 331  0
     }
 332  
 
 333  
     /**
 334  
      * Register a Java Service Wrapper agent.
 335  
      * @throws MuleException if registration failed
 336  
      */
 337  
     protected void registerWrapperService() throws MuleException
 338  
     {
 339  
         // WrapperManager to support restarts
 340  22
         final WrapperManagerAgent wmAgent = new WrapperManagerAgent();
 341  22
         if (muleContext.getRegistry().lookupAgent(wmAgent.getName()) == null)
 342  
         {
 343  22
            muleContext.getRegistry().registerAgent(wmAgent);
 344  
         }
 345  22
     }
 346  
 
 347  
 
 348  
     protected void registerStatisticsService() throws NotCompliantMBeanException, MBeanRegistrationException,
 349  
                                                       InstanceAlreadyExistsException, MalformedObjectNameException
 350  
     {
 351  22
         ObjectName on = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":type=org.mule.Statistics,name=AllStatistics");
 352  22
         StatisticsService mBean = new StatisticsService();
 353  22
         mBean.setMuleContext(muleContext);
 354  22
         mBean.setEnabled(isEnableStatistics());
 355  22
         logger.debug("Registering statistics with name: " + on);
 356  22
         mBeanServer.registerMBean(mBean, on);
 357  22
         registeredMBeans.add(on);
 358  22
     }
 359  
 
 360  
     protected void registerModelServices() throws NotCompliantMBeanException, MBeanRegistrationException,
 361  
                                                   InstanceAlreadyExistsException, MalformedObjectNameException
 362  
     {
 363  22
         for (Iterator iterator = muleContext.getRegistry().lookupObjects(Model.class).iterator(); iterator.hasNext();)
 364  
         {
 365  22
             Model model = (Model) iterator.next();
 366  22
             ModelServiceMBean serviceMBean = new ModelService(model);
 367  22
             String rawName = serviceMBean.getName() + "(" + serviceMBean.getType() + ")";
 368  22
             String name = jmxSupport.escape(rawName);
 369  22
             ObjectName on = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":type=org.mule.Model,name=" + name);
 370  22
             logger.debug("Registering model with name: " + on);
 371  22
             mBeanServer.registerMBean(serviceMBean, on);
 372  22
             registeredMBeans.add(on);
 373  22
         }
 374  22
     }
 375  
 
 376  
     protected void registerMuleService() throws NotCompliantMBeanException, MBeanRegistrationException,
 377  
                                                 InstanceAlreadyExistsException, MalformedObjectNameException
 378  
     {
 379  22
         ObjectName on = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":type=org.mule.MuleContext,name=MuleServerInfo");
 380  22
         MuleServiceMBean serviceMBean = new MuleService(muleContext);
 381  22
         logger.debug("Registering mule with name: " + on);
 382  22
         mBeanServer.registerMBean(serviceMBean, on);
 383  22
         registeredMBeans.add(on);
 384  22
     }
 385  
 
 386  
     protected void registerConfigurationService() throws NotCompliantMBeanException, MBeanRegistrationException,
 387  
                                                          InstanceAlreadyExistsException, MalformedObjectNameException
 388  
     {
 389  22
         ObjectName on = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":type=org.mule.Configuration,name=GlobalConfiguration");
 390  22
         MuleConfigurationServiceMBean serviceMBean = new MuleConfigurationService(RegistryContext.getConfiguration());
 391  22
         logger.debug("Registering configuration with name: " + on);
 392  22
         mBeanServer.registerMBean(serviceMBean, on);
 393  22
         registeredMBeans.add(on);
 394  22
     }
 395  
 
 396  
     protected void registerServiceServices() throws NotCompliantMBeanException, MBeanRegistrationException,
 397  
             InstanceAlreadyExistsException, MalformedObjectNameException
 398  
     {
 399  
         String rawName;
 400  22
         for (Iterator iterator = muleContext.getRegistry().lookupObjects(Service.class).iterator(); iterator.hasNext();)
 401  
         {
 402  0
             rawName = ((Service) iterator.next()).getName();
 403  0
             final String name = jmxSupport.escape(rawName);
 404  0
             ObjectName on = jmxSupport.getObjectName(jmxSupport.getDomainName(muleContext) + ":type=org.mule.Service,name=" + name);
 405  0
             ServiceServiceMBean serviceMBean = new ServiceService(rawName);
 406  0
             logger.debug("Registering service with name: " + on);
 407  0
             mBeanServer.registerMBean(serviceMBean, on);
 408  0
             registeredMBeans.add(on);
 409  0
         }
 410  
 
 411  22
     }
 412  
 
 413  
     protected void registerEndpointServices() throws NotCompliantMBeanException, MBeanRegistrationException,
 414  
             InstanceAlreadyExistsException, MalformedObjectNameException
 415  
     {
 416  22
         Iterator iter = muleContext.getRegistry().lookupObjects(Connector.class).iterator();
 417  
         Connector connector;
 418  28
         while (iter.hasNext())
 419  
         {
 420  6
             connector = (Connector) iter.next();
 421  6
             if (connector instanceof AbstractConnector)
 422  
             {
 423  6
                 for (Iterator iterator = ((AbstractConnector) connector).getReceivers().values().iterator(); iterator.hasNext();)
 424  
                 {
 425  0
                     EndpointServiceMBean mBean = new EndpointService((MessageReceiver) iterator.next());
 426  0
                     final String rawName = mBean.getName();
 427  0
                     final String name = jmxSupport.escape(rawName);
 428  0
                     if (logger.isInfoEnabled()) {
 429  0
                         logger.info("Attempting to register service with name: " + jmxSupport.getDomainName(muleContext) +
 430  
                                                     ":type=org.mule.Endpoint,service=" +
 431  
                                                     jmxSupport.escape(mBean.getComponentName()) +
 432  
                                                     ",name=" + name);
 433  
                     }
 434  0
                     ObjectName on = jmxSupport.getObjectName(
 435  
                                                     jmxSupport.getDomainName(muleContext) +
 436  
                                                     ":type=org.mule.Endpoint,service=" +
 437  
                                                     jmxSupport.escape(mBean.getComponentName()) +
 438  
                                                     ",name=" + name);
 439  0
                     mBeanServer.registerMBean(mBean, on);
 440  0
                     registeredMBeans.add(on);
 441  0
                     logger.info("Registered Endpoint Service with name: " + on);
 442  0
                 }
 443  
             }
 444  
             else
 445  
             {
 446  0
                 logger.warn("Connector: " + connector
 447  
                             + " is not an istance of AbstractConnector, cannot obtain Endpoint MBeans from it");
 448  
             }
 449  
 
 450  
         }
 451  22
     }
 452  
 
 453  
     protected void registerConnectorServices() throws
 454  
                                                 MalformedObjectNameException,
 455  
                                                 NotCompliantMBeanException,
 456  
                                                 MBeanRegistrationException,
 457  
                                                 InstanceAlreadyExistsException
 458  
     {
 459  22
         Iterator iter = muleContext.getRegistry().lookupObjects(Connector.class).iterator();
 460  28
         while (iter.hasNext())
 461  
         {
 462  6
             Connector connector = (Connector) iter.next();
 463  6
             ConnectorServiceMBean mBean = new ConnectorService(connector);
 464  6
             final String rawName = mBean.getName();
 465  6
             final String name = jmxSupport.escape(rawName);
 466  6
             final String stringName = jmxSupport.getDomainName(muleContext) + ":type=org.mule.Connector,name=" + name;
 467  6
             if (logger.isDebugEnabled())
 468  
             {
 469  0
                 logger.debug("Attempting to register service with name: " + stringName);
 470  
             }
 471  6
             ObjectName oName = jmxSupport.getObjectName(stringName);
 472  6
             mBeanServer.registerMBean(mBean, oName);
 473  6
             registeredMBeans.add(oName);
 474  6
             logger.info("Registered Connector Service with name " + oName);
 475  6
         }
 476  22
     }
 477  
 
 478  
     /**
 479  
      * @return Returns the createServer.
 480  
      */
 481  
     public boolean isCreateServer()
 482  
     {
 483  4
         return createServer;
 484  
     }
 485  
 
 486  
     /**
 487  
      * @param createServer The createServer to set.
 488  
      */
 489  
     public void setCreateServer(boolean createServer)
 490  
     {
 491  6
         this.createServer = createServer;
 492  6
     }
 493  
 
 494  
     /**
 495  
      * @return Returns the locateServer.
 496  
      */
 497  
     public boolean isLocateServer()
 498  
     {
 499  4
         return locateServer;
 500  
     }
 501  
 
 502  
     /**
 503  
      * @param locateServer The locateServer to set.
 504  
      */
 505  
     public void setLocateServer(boolean locateServer)
 506  
     {
 507  6
         this.locateServer = locateServer;
 508  6
     }
 509  
 
 510  
     /**
 511  
      * @return Returns the connectorServerUrl.
 512  
      */
 513  
     public String getConnectorServerUrl()
 514  
     {
 515  0
         return connectorServerUrl;
 516  
     }
 517  
 
 518  
     /**
 519  
      * @param connectorServerUrl The connectorServerUrl to set.
 520  
      */
 521  
     public void setConnectorServerUrl(String connectorServerUrl)
 522  
     {
 523  12
         this.connectorServerUrl = connectorServerUrl;
 524  12
     }
 525  
 
 526  
     /**
 527  
      * @return Returns the enableStatistics.
 528  
      */
 529  
     public boolean isEnableStatistics()
 530  
     {
 531  26
         return enableStatistics;
 532  
     }
 533  
 
 534  
     /**
 535  
      * @param enableStatistics The enableStatistics to set.
 536  
      */
 537  
     public void setEnableStatistics(boolean enableStatistics)
 538  
     {
 539  4
         this.enableStatistics = enableStatistics;
 540  4
     }
 541  
 
 542  
     /**
 543  
      * @return Returns the mBeanServer.
 544  
      */
 545  
     public MBeanServer getMBeanServer()
 546  
     {
 547  2
         return mBeanServer;
 548  
     }
 549  
 
 550  
     /**
 551  
      * @param mBeanServer The mBeanServer to set.
 552  
      */
 553  
     public void setMBeanServer(MBeanServer mBeanServer)
 554  
     {
 555  2
         this.mBeanServer = mBeanServer;
 556  2
     }
 557  
 
 558  
     /**
 559  
      * Getter for property 'connectorServerProperties'.
 560  
      *
 561  
      * @return Value for property 'connectorServerProperties'.
 562  
      */
 563  
     public Map getConnectorServerProperties()
 564  
     {
 565  6
         return connectorServerProperties;
 566  
     }
 567  
 
 568  
     /**
 569  
      * Setter for property 'connectorServerProperties'. Set to {@code null} to use defaults ({@link
 570  
      * #DEFAULT_CONNECTOR_SERVER_PROPERTIES}). Pass in an empty map to use no parameters. Passing a non-empty map will
 571  
      * replace defaults.
 572  
      *
 573  
      * @param connectorServerProperties Value to set for property 'connectorServerProperties'.
 574  
      */
 575  
     public void setConnectorServerProperties(Map connectorServerProperties)
 576  
     {
 577  10
         this.connectorServerProperties = connectorServerProperties;
 578  10
     }
 579  
 
 580  
 
 581  
     /**
 582  
      * Getter for property 'jmxSupportFactory'.
 583  
      *
 584  
      * @return Value for property 'jmxSupportFactory'.
 585  
      */
 586  
     public JmxSupportFactory getJmxSupportFactory()
 587  
     {
 588  2
         return jmxSupportFactory;
 589  
     }
 590  
 
 591  
     /**
 592  
      * Setter for property 'jmxSupportFactory'.
 593  
      *
 594  
      * @param jmxSupportFactory Value to set for property 'jmxSupportFactory'.
 595  
      */
 596  
     public void setJmxSupportFactory(JmxSupportFactory jmxSupportFactory)
 597  
     {
 598  0
         this.jmxSupportFactory = jmxSupportFactory;
 599  0
     }
 600  
 
 601  
 
 602  
     /**
 603  
      * Setter for property 'credentials'.
 604  
      *
 605  
      * @param newCredentials Value to set for property 'credentials'.
 606  
      */
 607  
     public void setCredentials(final Map newCredentials)
 608  
     {
 609  12
         this.credentials.clear();
 610  12
         if (newCredentials != null && !newCredentials.isEmpty())
 611  
         {
 612  10
             this.credentials.putAll(newCredentials);
 613  
         }
 614  12
     }
 615  
     
 616  
 }