1 45 package org.exolab.jms.net.connector; 46 47 48 54 public abstract class AbstractManagedConnection implements ManagedConnection { 55 56 59 private ManagedConnectionListener _listener; 60 61 62 65 public AbstractManagedConnection() { 66 } 67 68 74 public synchronized void setConnectionEventListener( 75 ManagedConnectionListener listener) 76 throws ResourceException { 77 _listener = listener; 78 } 79 80 83 protected void notifyClosed() { 84 ManagedConnectionListener listener = getConnectionEventListener(); 85 if (listener != null) { 86 listener.closed(this); 87 } 88 } 89 90 95 protected void notifyError(Throwable error) { 96 ManagedConnectionListener listener = getConnectionEventListener(); 97 if (listener != null) { 98 listener.error(this, error); 99 } 100 } 101 102 108 protected synchronized ManagedConnectionListener 109 getConnectionEventListener() { 110 return _listener; 111 } 112 } 113 | Popular Tags |