use of javax.oss.fm.monitor.JVTAlarmMonitorHome in project opennms by OpenNMS.
the class AlarmListJ2eeConnectionManagerThread method lookupBean.
/**
* Method to find and connect to the remote bean.
*/
private void lookupBean() throws NamingException, RemoteException {
/* Create a new InitialContext with the properties paramters -
* The starting point of naming resolution
*/
LOG.info("AlarmListJ2eeConnectionManagerThread.lookupBean() Looking up QoS bean");
InitialContext ic = new InitialContext(env);
LOG.info("AlarmListJ2eeConnectionManagerThread.lookupBean() InitialContext created");
try {
ref = ic.lookup(props.getProperty("org.openoss.opennms.spring.qosd.jvthome"));
LOG.info("AlarmListJ2eeConnectionManagerThread.lookupBean() QoS Bean found");
JVTAlarmMonitorHome home = (JVTAlarmMonitorHome) PortableRemoteObject.narrow(ref, JVTAlarmMonitorHome.class);
LOG.debug("AlarmListJ2eeConnectionManagerThread.lookupBean() home initialised");
session = home.create();
LOG.debug("AlarmListJ2eeConnectionManagerThread.lookupBean() Session created");
alarmInternals = (AlarmMonitor) PortableRemoteObject.narrow(session.getHandle().getEJBObject(), AlarmMonitor.class);
if (alarmInternals == null)
LOG.error("AlarmListJ2eeConnectionManagerThread.lookupBean() AlarmMonitor alarmInternals is null line 244");
} catch (IllegalArgumentException iae_ex) {
LOG.error("AlarmListJ2eeConnectionManagerThread.lookupBean() jvthome property does not exist", iae_ex);
}/*catch(RemoteException remote_ex)
{
log.error("Cannot connect to bean", remote_ex);
status = DISCONNECTED;
}*/
catch (CreateException create_ex) {
LOG.error("AlarmListJ2eeConnectionManagerThread.lookupBean() Cannot create new session", create_ex);
} catch (NullPointerException np_ex) {
LOG.error("AlarmListJ2eeConnectionManagerThread.lookupBean() NullPointerException caught", np_ex);
} finally {
ic.close();
}
LOG.info("AlarmListJ2eeConnectionManagerThread.lookupBean() New bean session started");
}
Aggregations