SystemPropertyInitializingBean implements InitializingBean,PriorityOrdered { public void afterPropertiesSet() throws Exception { System.setProperty("hostname", getHostName()); if (systemProperties != null) { System.getProperties().putAll(systemProperties); } }  void setOrder(int order); int getOrder(); void setSystemProperties(Properties systemProperties); void afterPropertiesSet(); String getHostName(); static void log4jConfigureAndWatch(File file,long refreshInterval);  }
@Test public void test() throws Exception{ SystemPropertyInitializingBean b = new SystemPropertyInitializingBean(); b.afterPropertiesSet(); System.out.println(System.getProperty("hostname")); }