[Openbus-cvs-commits] Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl ServerStarter
Status: Alpha
Brought to you by:
esancho
|
From: Diego E. <er...@us...> - 2005-07-19 03:07:35
|
Update of /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21221/src/java/org/openbus/jbi/server/commands/impl Modified Files: ServerStarter.java Log Message: fixed problems with the reference implementation interfaces Index: ServerStarter.java =================================================================== RCS file: /cvsroot/openbus/Openbus/OpenbusJBI/src/java/org/openbus/jbi/server/commands/impl/ServerStarter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ServerStarter.java 26 Jun 2005 22:48:24 -0000 1.2 --- ServerStarter.java 19 Jul 2005 03:06:55 -0000 1.3 *************** *** 35,39 **** import org.openbus.commons.OpenbusConfigurationException; import org.openbus.commons.exceptions.OpenbusException; - import org.openbus.commons.i18n.ResourceBundleFinder; import org.openbus.jbi.server.ServerController; import org.openbus.jbi.server.commands.ServerCommand; --- 35,38 ---- *************** *** 56,112 **** */ public void doCommand(CommandLine cmd) throws OpenbusException { ! // String confFile = null; ! // ConfigurationFacade conf = ConfigurationFacade.getInstance(); ! // ! // // if a file name is provided in the command line, then override ! // // the configured one. ! // if (cmd.hasOption(ServerController.FILE)) ! // confFile = cmd.getOptionValue(ServerController.FILE); ! // else ! // confFile = conf.getRootDir().concat( ! // conf.getConfig().getString( ! // CommandsKeys.JMX_STARTUP_CONF_FILE)); ! // ! // if (confFile == null) ! // throw new OpenbusConfigurationException( ! // CommandsKeys.ERR_NO_JMX_FILE); ! // ! // File file = new File(confFile); ! // if (!file.exists()) ! // throw new OpenbusConfigurationException( ! // CommandsKeys.ERR_NO_JMX_FILE); ! // ! // // start server instance ! // MBeanServer server = MBeanServerFactory.newMBeanServer(); ! // ConfigurationLoader loader = new ConfigurationLoader(); ! // ! // ResourceBundle bundle = ResourceBundleFinder.getInstance().find(getClass()); ! // ! // // register configuration loader ! // log.info(bundle.getString(CommandsKeys.START_REGISTERING_CONF_LOADER)); ! // try { ! // server.registerMBean(loader, ObjectName ! // .getInstance("config:service=loader")); ! // } catch (Exception ex) { ! // throw new OpenbusException( ! // bundle.getString(CommandsKeys.ERR_REGISTERING_CONF_LOADER), ex); ! // } ! // ! // // load configuration from file ! // log.info(bundle.getString(CommandsKeys.START_LOADING_CONF)); ! // try { ! // Reader reader = new BufferedReader(new FileReader(confFile)); ! // ! // // start jmx server with supplied configuration ! // loader.startup(reader); ! // ! // // free reader ! // reader.close(); ! // } catch (Exception ex) { ! // throw new OpenbusException( ! // bundle.getString(CommandsKeys.ERR_LOADING_CONF), ex); ! // } ! // ! // log.info(bundle.getString(CommandsKeys.START_FINISH)); } --- 55,112 ---- */ public void doCommand(CommandLine cmd) throws OpenbusException { ! String confFile = null; ! ConfigurationFacade conf = ConfigurationFacade.getInstance(); ! ! // if a file name is provided in the command line, then override ! // the configured one. ! if (cmd.hasOption(ServerController.FILE)) ! confFile = cmd.getOptionValue(ServerController.FILE); ! else ! confFile = conf.getRootDir().concat( ! conf.getConfig().getString( ! CommandsKeys.JMX_STARTUP_CONF_FILE)); ! ! if (confFile == null) ! throw new OpenbusConfigurationException( ! CommandsKeys.ERR_NO_JMX_FILE); ! ! File file = new File(confFile); ! if (!file.exists()) ! throw new OpenbusConfigurationException( ! CommandsKeys.ERR_NO_JMX_FILE); ! ! // start server instance ! MBeanServer server = MBeanServerFactory.newMBeanServer(); ! ConfigurationLoader loader = new ConfigurationLoader(); ! ! // @todo implement ! ResourceBundle bundle = null; //ResourceBundleFinder.getInstance().find(getClass()); ! ! // register configuration loader ! log.info(bundle.getString(CommandsKeys.START_REGISTERING_CONF_LOADER)); ! try { ! server.registerMBean(loader, ObjectName ! .getInstance("config:service=loader")); ! } catch (Exception ex) { ! throw new OpenbusException( ! bundle.getString(CommandsKeys.ERR_REGISTERING_CONF_LOADER), ex); ! } ! ! // load configuration from file ! log.info(bundle.getString(CommandsKeys.START_LOADING_CONF)); ! try { ! Reader reader = new BufferedReader(new FileReader(confFile)); ! ! // start jmx server with supplied configuration ! loader.startup(reader); ! ! // free reader ! reader.close(); ! } catch (Exception ex) { ! throw new OpenbusException( ! bundle.getString(CommandsKeys.ERR_LOADING_CONF), ex); ! } ! ! log.info(bundle.getString(CommandsKeys.START_FINISH)); } |