public ObjectName createDistributionLocator(String host,int port,String workingDirectory,String productDirectory,String remoteCommand) throws MalformedObjectNameException {
  try {
    DistributionLocatorJmxImpl locator=(DistributionLocatorJmxImpl)addDistributionLocator();
    DistributionLocatorConfig config=locator.getConfig();
    config.setHost(host);
    config.setPort(port);
    config.setWorkingDirectory(workingDirectory);
    config.setProductDirectory(productDirectory);
    config.setRemoteCommand(remoteCommand);
    return new ObjectName(locator.getMBeanName());
  }
 catch (  RuntimeException e) {
    logger.warn(e.getMessage(),e);
    throw e;
  }
catch (  VirtualMachineError err) {
    SystemFailure.initiateFailure(err);
    throw err;
  }
catch (  Error e) {
    SystemFailure.checkFailure();
    logger.error(e.getMessage(),e);
    throw e;
  }
}

public ObjectName createDistributionLocator ( String host , int port , String workingDirectory , String productDirectory , String remoteCommand ) throws MalformedObjectNameException { try { DistributionLocatorJmxImpl locator = ( DistributionLocatorJmxImpl ) addDistributionLocator ( ) ; DistributionLocatorConfig config = locator . getConfig ( ) ; config . setHost ( host ) ; config . setPort ( port ) ; config . setWorkingDirectory ( workingDirectory ) ; config . setProductDirectory ( productDirectory ) ; config . setRemoteCommand ( remoteCommand ) ; return new ObjectName ( locator . getMBeanName ( ) ) ; } catch ( RuntimeException e ) { logger . warn ( e . getMessage ( ) , e ) ; throw e ; } catch ( VirtualMachineError err ) { SystemFailure . initiateFailure ( err ) ; throw err ; } catch ( Error e ) { SystemFailure . checkFailure ( ) ; logger . error ( e . getMessage ( ) , e ) ; throw e ; } }
creates a new distributionlocator for this system and registers an mbean for managing it . < p > if the locator already exists , then this will simply register an mbean for it .
