title: Change Java app listening from 0.0.0.0 to 127.0.0.1 - JMX
body: <p>Why JMX listening on 0.0.0.0? It is possible to change this listening  to 127.0.0.1 only?</p>
  
  <p>I searched JMX documentation for any information about listening on 0.0.0.0 and found nothing. </p>
  
  <p>When I run my app and check in cmd <code>netstat</code> it prints 
   <code>TCP 0.0.0.0:1099 0.0.0.0:0 LISTENING [java.exe]</code></p>
  
  <p>I register beans like: </p>
  
  <pre><code>    @Bean
      public ConnectorServerFactoryBean serverConnector() throws MalformedObjectNameException {
          ConnectorServerFactoryBean factoryBean=new ConnectorServerFactoryBean();
          factoryBean.setServiceUrl("service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1099/appname");
          factoryBean.setThreaded(true);
          return factoryBean;
      }
  
      @Bean
      public RmiRegistryFactoryBean registry() {
          RmiRegistryFactoryBean factoryBean=new RmiRegistryFactoryBean();
          factoryBean.setPort(1099);
          factoryBean.setAlwaysCreate(true);
          return factoryBean;
      }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    @Bean
      public MBeanServerConnection clientConnection() throws IOException {
          MBeanServerConnectionFactoryBean factoryBean = new MBeanServerConnectionFactoryBean();
          factoryBean.setServiceUrl("service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1099/appname");
          factoryBean.afterPropertiesSet();
          return factoryBean.getObject();
      }
  </code></pre>
  
  <p>Any ideas how can I change this listening to 127.0.0.1 only?
  I use Spring Boot 1.4.1.RELEASE</p>