use of com.cosylab.cdb.client.DAOProxyConnectionListener in project ACS by ACS-Community.
the class ManagerImpl method getComponentsDAOProxy.
/**
* Returns, if necessary also creates, components DAO (CDB access).
*
* @return DAOProxy components DAO (CDB access), otherwise <code>null</code>
*/
private synchronized DAOProxy getComponentsDAOProxy() {
if (System.getProperties().containsKey(NAME_CDB_DISABLE))
return null;
if (componentsDAO == null) {
componentsDAO = createDAO("MACI/Components");
if (componentsDAO != null) {
// initial refresh
componentListCache = refreshComponentsList(componentsDAO);
// ... and install link listener (to refresh after reconnect)
componentsDAO.addConnectionListener(new DAOProxyConnectionListener() {
public void connected(DAOProxy proxy) {
componentListCache = refreshComponentsList(proxy);
}
public void disconnected(DAOProxy proxy) {
/* noop */
}
});
}
}
return componentsDAO;
}
Aggregations