etch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "scott comer (JIRA)" <>
Subject [jira] Commented: (ETCH-59) Listener stack is build 1/2 upside down and strange inhibiting name service and other transport filters
Date Mon, 09 Feb 2009 16:24:59 GMT


scott comer commented on ETCH-59:

constructing a listener:

(using TcpTransportFactory as an example)

MainBlahListener implements BlahHelper.BlahServerFactory

	newBlahServer( RemoteBlahClient client ) method returns new
		ImplBlahServer( client );


	Transport<ServerFactory> listener = BlahHelper.newListener( uri, null,
		new MainBlahListener() );
	listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );

BlahHelper.newListener (uri, resources, implFactory):

	return TransportFactory.getListener( uri, resources, new subclass of
		DefaultServerFactory( implFactory ) )
	(the DefaultServerFactory is all about responding to newServer method to
	build the transport stack for a new connection)

TransportFactory.getListener( uri, resources, factory ):

	TransportFactory f = getTransportFactory( u.getScheme() );
	return f.newListener( uri, resources, factory );

TcpTransportFactory.newListener( uri, resources, factory ):

	Transport<SessionListener<Socket>> l = new TcpListener( u, resources );
	MySessionListener b = new MySessionListener( l, uri, resources );
	b.setSession( factory );
	return b;

Here is the resulting stack of objects:

(subclass of DefaultServerFactory)

and remember, listener as returned by BlahHelper.newListener is MySessionListener.

to recap:

first we create implFactory
then we create our subclass of DefaultServerFactory
then we ask for a listener stack, passing in our subclass of DefaultServerFactory
return listener stack, leaving default server factory out of the loop.

this means the code which constructs the listener stack has to do the final

here is the better order, which is more like how the transport stack is constructed:

first we create implFactory
then we ask for a listener stack
then we create our subclass of DefaultServerFactory, passing in both the listener
and the implFactory.
return our subclass of DefaultServerFactory

> Listener stack is build 1/2 upside down and strange inhibiting name service and other
transport filters
> -------------------------------------------------------------------------------------------------------
>                 Key: ETCH-59
>                 URL:
>             Project: Etch
>          Issue Type: Improvement
>          Components: csharp-binding, java-binding
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2
>            Reporter: scott comer
>            Assignee: scott comer
>            Priority: Minor
>             Fix For: 1.1
>         Attachments: java_listener_structure_patch.txt
> when a service creates a listener, using BlahHelper.newListener(), the listener stack
is built top down for a bit and then bottom up and glued
> together. this is done in such a way that creating a listener filter is inhibited. this
is needed for the name server's etch:  listener scheme.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message