/** * Can throw tango exceptions. Once called this connection is dead. * * @throws Exeption */ public synchronized void dispose() throws Exception { super.dispose(); if (tangoEvents != null && listener != null) { tangoEvents.removeTangoChangeListener(listener, attributeName); } tangoProxy = null; tangoEvents = null; listener = null; }
/** * If dispose has been called, throws an exception * * @param listener */ public void addTangoConnectionListener(final TangoConnectionListener l) { if (tangoEvents == null) throw new RuntimeException( "This tango connection, '" + getUri() + "', is not listening to events!"); super.addTangoConnectionListener(l); }