C# Class Brunet.Security.Transport.WrapperEdgeListener

Wraps the underlying EdgeListener by listening for new edges and wrapping those edges. This class is thread-safe.
Inheritance: EdgeListener
Show file Open project: johnynek/brunet Class Usage Examples

Protected Properties

Property Type Description
_edge_to_ecw EdgeCreationWrapper>.Dictionary
_edge_to_wrapper_edge WrapperEdge>.Dictionary
_el EdgeListener
_sync object

Public Methods

Method Description
AddEdge ( EdgeCreationWrapper ecw ) : void

A new underlying edge has been created, this is used to add the edge to the EdgeListener for handling and to wrap the edge.

CreateEdgeTo ( TransportAddress ta, EdgeCreationCallback ecb ) : void

This wraps the underlying CreateEdgeTo using EdgeCreationWrappers

Start ( ) : void

This is passed to the underlying EdgeListener. By default we do nothing to this.

Stop ( ) : void

This is passed to the underlying EdgeListener. By default we do nothing to this.

UpdateLocalTAs ( Edge e, TransportAddress ta ) : void

This is passed tothe underlying EdgeListener. By default we do nothing to this.

UpdateRemoteTAs ( IList list, Edge e, TransportAddress ta ) : void

This is passed tothe underlying EdgeListener. By default we do nothing to this.

WrapperEdgeListener ( EdgeListener el ) : Brunet

Protected Methods

Method Description
EdgeClose ( object o, EventArgs ea ) : void

This is called when one of our edges closes. This handles removing the state from the EdgeListener as necessary.

Finalize ( WrapperEdge wedge ) : void

When the edge is finally wrapped, this is called to finalize the adding of the edge to the edgelistner.

HandleEdgeCloseRequestEvent ( object el, EventArgs ea ) : void

This handles the RequestClose of the underlying edge.

The convoluted model for handling edge closes is this... I) UEL calls RequestClose 1) Triggers HandleEdgeCloseRequestEvent 2) If there is a wrapper edge, call RequestClose on it 3) If there isn't a wrapper edge, we are forced to simply close the edge and send a failed ecw II) A wrapper edge is responsible for calling edge close on the wrapped edge on edge close III) if an wrapped edge calls close, we are notified via an event, that will send a failed ecw or close the wrapper edge

HandleEdgeEvent ( object edge, EventArgs ea ) : void

A new edge has been created! This comes from the underlying EL's SendEdgeEvent.

SendEdgeEventHelper ( bool success, Edge e, Exception x ) : void

This is a EdgeCallback used when to handle the cases for inbound edes. This executes SendEdgeEvent for this WEL.

WrapEdge ( Edge edge ) : void

This method is usd to wrap the edge.

Method Details

AddEdge() public method

A new underlying edge has been created, this is used to add the edge to the EdgeListener for handling and to wrap the edge.
public AddEdge ( EdgeCreationWrapper ecw ) : void
ecw EdgeCreationWrapper
return void

CreateEdgeTo() public method

This wraps the underlying CreateEdgeTo using EdgeCreationWrappers
public CreateEdgeTo ( TransportAddress ta, EdgeCreationCallback ecb ) : void
ta TransportAddress
ecb EdgeCreationCallback
return void

EdgeClose() protected method

This is called when one of our edges closes. This handles removing the state from the EdgeListener as necessary.
protected EdgeClose ( object o, EventArgs ea ) : void
o object
ea System.EventArgs
return void

Finalize() protected method

When the edge is finally wrapped, this is called to finalize the adding of the edge to the edgelistner.
protected Finalize ( WrapperEdge wedge ) : void
wedge WrapperEdge
return void

HandleEdgeCloseRequestEvent() protected method

This handles the RequestClose of the underlying edge.
The convoluted model for handling edge closes is this... I) UEL calls RequestClose 1) Triggers HandleEdgeCloseRequestEvent 2) If there is a wrapper edge, call RequestClose on it 3) If there isn't a wrapper edge, we are forced to simply close the edge and send a failed ecw II) A wrapper edge is responsible for calling edge close on the wrapped edge on edge close III) if an wrapped edge calls close, we are notified via an event, that will send a failed ecw or close the wrapper edge
protected HandleEdgeCloseRequestEvent ( object el, EventArgs ea ) : void
el object
ea System.EventArgs
return void

HandleEdgeEvent() protected method

A new edge has been created! This comes from the underlying EL's SendEdgeEvent.
protected HandleEdgeEvent ( object edge, EventArgs ea ) : void
edge object
ea System.EventArgs
return void

SendEdgeEventHelper() protected method

This is a EdgeCallback used when to handle the cases for inbound edes. This executes SendEdgeEvent for this WEL.
protected SendEdgeEventHelper ( bool success, Edge e, Exception x ) : void
success bool
e Edge
x System.Exception
return void

Start() public method

This is passed to the underlying EdgeListener. By default we do nothing to this.
public Start ( ) : void
return void

Stop() public method

This is passed to the underlying EdgeListener. By default we do nothing to this.
public Stop ( ) : void
return void

UpdateLocalTAs() public method

This is passed tothe underlying EdgeListener. By default we do nothing to this.
public UpdateLocalTAs ( Edge e, TransportAddress ta ) : void
e Edge
ta TransportAddress
return void

UpdateRemoteTAs() public method

This is passed tothe underlying EdgeListener. By default we do nothing to this.
public UpdateRemoteTAs ( IList list, Edge e, TransportAddress ta ) : void
list IList
e Edge
ta TransportAddress
return void

WrapEdge() protected method

This method is usd to wrap the edge.
protected WrapEdge ( Edge edge ) : void
edge Edge
return void

WrapperEdgeListener() public method

public WrapperEdgeListener ( EdgeListener el ) : Brunet
el EdgeListener
return Brunet

Property Details

_edge_to_ecw protected property

protected Dictionary _edge_to_ecw
return EdgeCreationWrapper>.Dictionary

_edge_to_wrapper_edge protected property

protected Dictionary _edge_to_wrapper_edge
return WrapperEdge>.Dictionary

_el protected property

protected EdgeListener _el
return EdgeListener

_sync protected property

protected object _sync
return object