protected SocketWrapper(Socket delegate) throws SocketException {
super(new WrappingSocketImpl(delegate));
this.delegate = delegate;
+ System.out.println("Creating SocketWrapper $Rev$");
}
public SocketChannel getChannel() {
}
protected void close() throws IOException {
+ System.out.println("Calling delegate.close");
delegate.close();
}
}
}
+ public void close() throws IOException {
+ System.out.println("Calling SocketWrapper.delegate.close");
+ delegate.close();
+ }
+
public boolean equals(Object obj) {
if (!(obj instanceof SocketWrapper)) return false;
SocketWrapper that = (SocketWrapper)obj;
public int hashCode() {
return delegate.hashCode() ^ 0x01010101;
}
+ public String toString() {
+ return "<SocketWrapper " + super.toString() + "(delegating to " + delegate.toString() + ")" + ">";
+ }
}
\ No newline at end of file