Hi Roland

I was starting to write a wrapper but I thought I went a wrong way :-) So I'll 
try it again. Thanks for kicking me back to the right way ;-)

On Tuesday 19 September 2006 18:34, Roland Weber wrote:
> Hi,
>
> > In my application I am extending Socket to override getInputStream and
> > getOutputStream to add custom low-level "filtering". I use this socket in
> > my custom ProtocolSocketFactory that is registered to httpclient with
> > Protocol.registerProtocol. This is for HTTP protocol. Now I need the same
> > with HTTPS protocol. I use EasySSLProtocolSocketFactory from contrib. The
> > problem is that I can't implement MyCustomSSLSocket that extend
> > SSLSocket, because this SSLSocket is created by SSLContext ->
> > SSLSocketFactory. javax.net.SSLContext is abstract. Any hints to solve
> > this problem? Should I use some other JSSE like Jessie?
>
> Have you considered using a wrapper instead of extending the class
> that gets instantiated? In other words:
> - MyCustomSSLSocket extends SSLSocket
> - keep the wrapped socket from SSLSocketFactory as an attribute
> - delegate *all* calls of the SSLSocket class to the wrapped socket
> - add your custom modifications to the get{In|Out}putStream methods
>
> Some IDEs have tools that can generate basic wrappers automatically.
> One of the few occasions where I admit that IDEs have advantages :-)
>
> hope that helps,
>   Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Martin Zdila
Analyst/Developer

EpiSoftware Slovakia Ltd.
Letna 27, 043 14 Kosice

cellular: +421 908 363 848
   phone: +421 55 6770 420
     fax: +421 55 6770 420
  e-mail: [EMAIL PROTECTED]
     www: www.episoftware.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to