ch.elca.el4j.util.socketstatistics
Class SocketImplLogger

java.lang.Object
  extended by java.net.SocketImpl
      extended by ch.elca.el4j.util.socketstatistics.SocketImplLogger
All Implemented Interfaces:
SocketOptions

public class SocketImplLogger
extends SocketImpl

SocketImpl for use with SocketStatistics. Generates and returns modified InputStreams / OutputStreams with support logging. In other cases, it behaves just like the original java.net class

Author:
Jonas Hauenstein (JHN)
File-location:
SocketImplLogger
Last check-in date:
2009-09-25 16:38:41 +0200 (Fr, 25. Sep 2009) by jonasha for revision 3929

Field Summary
 
Fields inherited from class java.net.SocketImpl
address, fd, localport, port
 
Fields inherited from interface java.net.SocketOptions
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
 
Constructor Summary
SocketImplLogger()
          Constructor. creates a ReflectiveDelegator for delegation of method calls to java.net.SocksSocketImpl and a new ConnectionStatistics inside SocketStatistics
 
Method Summary
protected  void accept(SocketImpl s)
          
protected  int available()
          
protected  void bind(InetAddress host, int port)
          
protected  void close()
          Modified version of close().
protected  void connect(InetAddress address, int port)
          
protected  void connect(SocketAddress address, int timeout)
          
protected  void connect(String host, int port)
          
protected  void create(boolean stream)
          
protected  InputStream getInputStream()
          Modified version of getInputStream().
 Object getOption(int optID)
          
protected  OutputStream getOutputStream()
          Modified version of getOutputStream().
protected  void listen(int backlog)
          
protected  void sendUrgentData(int data)
          
 void setOption(int optID, Object value)
          
 
Methods inherited from class java.net.SocketImpl
getFileDescriptor, getInetAddress, getLocalPort, getPort, setPerformancePreferences, shutdownInput, shutdownOutput, supportsUrgentData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketImplLogger

public SocketImplLogger()
Constructor. creates a ReflectiveDelegator for delegation of method calls to java.net.SocksSocketImpl and a new ConnectionStatistics inside SocketStatistics

Method Detail

accept

protected void accept(SocketImpl s)
               throws IOException

Specified by:
accept in class SocketImpl
Throws:
IOException

available

protected int available()
                 throws IOException

Specified by:
available in class SocketImpl
Throws:
IOException

bind

protected void bind(InetAddress host,
                    int port)
             throws IOException

Specified by:
bind in class SocketImpl
Throws:
IOException

close

protected void close()
              throws IOException
Modified version of close(). Sets the the destroyed date in ConnectionStatistics

Specified by:
close in class SocketImpl
Throws:
IOException

connect

protected void connect(String host,
                       int port)
                throws IOException

Specified by:
connect in class SocketImpl
Throws:
IOException

connect

protected void connect(InetAddress address,
                       int port)
                throws IOException

Specified by:
connect in class SocketImpl
Throws:
IOException

connect

protected void connect(SocketAddress address,
                       int timeout)
                throws IOException

Specified by:
connect in class SocketImpl
Throws:
IOException

create

protected void create(boolean stream)
               throws IOException

Specified by:
create in class SocketImpl
Throws:
IOException

getInputStream

protected InputStream getInputStream()
                              throws IOException
Modified version of getInputStream(). Returns an InputStreamLogger for logging of socket traffic

Specified by:
getInputStream in class SocketImpl
Throws:
IOException

getOutputStream

protected OutputStream getOutputStream()
                                throws IOException
Modified version of getOutputStream(). Returns an OutputStreamLogger for logging of socket traffic

Specified by:
getOutputStream in class SocketImpl
Throws:
IOException

listen

protected void listen(int backlog)
               throws IOException

Specified by:
listen in class SocketImpl
Throws:
IOException

sendUrgentData

protected void sendUrgentData(int data)
                       throws IOException

Specified by:
sendUrgentData in class SocketImpl
Throws:
IOException

getOption

public Object getOption(int optID)
                 throws SocketException

Throws:
SocketException

setOption

public void setOption(int optID,
                      Object value)
               throws SocketException

Throws:
SocketException


Copyright © 2005-2011 ELCA. All Rights Reserved.