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 {
String value = "org.apache.naming";
String oldValue = System.getProperty(Context.URL_PKG_PREFIXES);
if (oldValue != null) {
oldUrlValue = oldValue;
value = oldValue + ":" + value;
}
System.setProperty(Context.URL_PKG_PREFIXES, value);
oldValue = System.getProperty(Context.INITIAL_CONTEXT_FACTORY);
if (oldValue != null) {
oldIcValue = oldValue;
} else {
System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
Constants.Package
+ ".java.javaURLContextFactory");
}
} 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);