Changeset 0a8abad7


Ignore:
Timestamp:
Jul 17, 2011 6:57:22 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8034dc3c
Parents:
8a9882c
Message:

remove code by extending instead of implementing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java

    r8a9882c r0a8abad7  
    7373 *  Todo: Most events are not listened to elsewhere, so error propagation is poor
    7474 */
    75 public class I2PTunnel implements Logging, EventDispatcher {
     75public class I2PTunnel extends EventDispatcherImpl implements Logging {
    7676    private final Log _log;
    77     private final EventDispatcherImpl _event;
    7877    private final I2PAppContext _context;
    7978    private static long __tunnelId = 0;
     
    115114
    116115    public I2PTunnel(String[] args, ConnectionEventListener lsnr) {
     116        super();
    117117        _context = I2PAppContext.getGlobalContext(); // new I2PAppContext();
    118118        _tunnelId = ++__tunnelId;
    119119        _log = _context.logManager().getLog(I2PTunnel.class);
    120         _event = new EventDispatcherImpl();
    121120        // as of 0.8.4, include context properties
    122121        Properties p = _context.getProperties();
     
    16581657        public void routerDisconnected();
    16591658    }
    1660 
    1661     /* Required by the EventDispatcher interface */
    1662     public EventDispatcher getEventDispatcher() {
    1663         return _event;
    1664     }
    1665 
    1666     public void attachEventDispatcher(EventDispatcher e) {
    1667         _event.attachEventDispatcher(e.getEventDispatcher());
    1668     }
    1669 
    1670     public void detachEventDispatcher(EventDispatcher e) {
    1671         _event.detachEventDispatcher(e.getEventDispatcher());
    1672     }
    1673 
    1674     public void notifyEvent(String e, Object a) {
    1675         _event.notifyEvent(e, a);
    1676     }
    1677 
    1678     public Object getEventValue(String n) {
    1679         return _event.getEventValue(n);
    1680     }
    1681 
    1682     public Set getEvents() {
    1683         return _event.getEvents();
    1684     }
    1685 
    1686     public void ignoreEvents() {
    1687         _event.ignoreEvents();
    1688     }
    1689 
    1690     public void unIgnoreEvents() {
    1691         _event.unIgnoreEvents();
    1692     }
    1693 
    1694     public Object waitEventValue(String n) {
    1695         return _event.waitEventValue(n);
    1696     }
    16971659}
Note: See TracChangeset for help on using the changeset viewer.