[
https://issues.apache.org/jira/browse/ETCH-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12671910#action_12671910
]
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 );
MainBlahListener.main:
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:
(implFactory)
(subclass of DefaultServerFactory)
(MySessionListener)
(TcpListener)
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
plumbing.
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: https://issues.apache.org/jira/browse/ETCH-59
> 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.