11-11-05 10:45 PM
[ http://issues.apache.org/jira/brows...23573
96 ]
Greg Bodi commented on DIRMINA-116:
-----------------------------------
Yes, putting it as a session attribute would accomplish the same thing. How
ever, would it then be possible to expose IoProtocolSession.getIoSession() u
p to the IoSession interface so that I could still access it from a Protocol
Handler? i.e.:
public void messageReceived(ProtocolSession session, Object message) throws
Exception
{
..
Service service = (Service)session.getIoSession().getAttribute(ServiceRegist
ry.SERVICE);
..
}
Or, would it safe enough to try to cast down (i.e., make an assumption that'
s it not a VmPipeSession)?
public void messageReceived(ProtocolSession session, Object message) throws
Exception
{
// not pretty, but fine if it works
Service service=(Service)((IoProtocolSession)ses
sion).getIoSession().getAttr
ibute(ServiceRegistry.SERVICE);
..
}
Or maybe is this somehow possible via another mechanism I overlooked? Thank
s!
> Get the Service from which a connection is accepted
> ---------------------------------------------------
>
> Key: DIRMINA-116
> URL: http://issues.apache.org/jira/browse/DIRMINA-116
> Project: Directory MINA
> Type: Improvement
> Versions: 0.8
> Reporter: Paolo Perrucci
> Assignee: Trustin Lee
> Priority: Minor
> Fix For: 0.9
[vbcol=seagreen]
>
> When a new connection is accepted may be usefull to know the related Service.[/vbc
ol]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[ Post a follow-up to this message ]
|