org.eclipse.ecf.filetransfer.events.socket
Interface ISocketEvent

All Superinterfaces:
Event
All Known Subinterfaces:
ISocketClosedEvent, ISocketConnectedEvent, ISocketCreatedEvent
All Known Implementing Classes:
AbstractSocketEvent, SocketClosedEvent, SocketConnectedEvent, SocketCreatedEvent

public interface ISocketEvent
extends Event

Socket events are emitted by a ISocketEventSource and are delivered to a ISocketListener.

Beware that the associated source may not be instance currently using the socket. For example a socket may be put into a connection pool after it is used. It is then typically reused by another source. When a socket is closed this is attributed to the source which created it, not which currently or most recently used it.

This limits the usefulness of these events to cases where the caller can make broader assumptions for example because it wants to close or monitor all sockets in the entire application. The events are also useful for implementing unit tests.

The ISocketConnectedEvent allows an ISocketListener to wrap the socket.

EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the ECF team.

Since:
3.0

Method Summary
 java.net.Socket getFactorySocket()
           
 java.net.Socket getSocket()
           
 ISocketEventSource getSource()
           
 boolean isSameFactorySocket(ISocketEvent socketEvent)
           
 

Method Detail

getSource

ISocketEventSource getSource()

isSameFactorySocket

boolean isSameFactorySocket(ISocketEvent socketEvent)

getFactorySocket

java.net.Socket getFactorySocket()

getSocket

java.net.Socket getSocket()