state = STARTING;
// Notifying the MBEan server that we're starting
notification = new AttributeChangeNotification
(this, sequenceNumber++, System.currentTimeMillis(),
"Starting " + NAME, "State", "java.lang.Integer",
new Integer(STOPPED), new Integer(STARTING));
sendNotification(notification);
try {
if (configFile == null) {
Domain.selfInit();
} else {
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setNamespaceAware(false);
factory.setValidating(false);
SAXParser parser = factory.newSAXParser();
FileInputStream is = new FileInputStream(configFile);
//init(reader);
Populate pop = new Populate();
Configuration slideConfiguration =
new ConfigurationElement(pop.load(new InputSource(is),
parser.getXMLReader()));
Domain.init(slideConfiguration);
Domain.start();
}
} catch (Throwable t) {
state = STOPPED;
notification = new AttributeChangeNotification
(this, sequenceNumber++, System.currentTimeMillis(),
"Stopped " + NAME, "State", "java.lang.Integer",
new Integer(STARTING), new Integer(STOPPED));
sendNotification(notification);
}
state = STARTED;
notification = new AttributeChangeNotification
(this, sequenceNumber++, System.currentTimeMillis(),
"Started " + NAME, "State", "java.lang.Integer",
new Integer(STARTING), new Integer(STARTED));
sendNotification(notification);