Class RoutableServletOutputStream
java.lang.Object
java.io.OutputStream
javax.servlet.ServletOutputStream
com.opensymphony.module.sitemesh.filter.RoutableServletOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class RoutableServletOutputStream
extends javax.servlet.ServletOutputStream
Provides a ServletOutputStream that routes through to another ServletOutputStream, however the destination can be
changed at any point. The destination can be passed in using a factory, so it will not be created until it's actually
needed.
- Author:
- Joe Walnes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFactory to lazily instantiate the destination. -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new routable servlet output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()booleanisReady()voidprint(boolean b) voidprint(char c) voidprint(double v) voidprint(float v) voidprint(int i) voidprint(long l) voidvoidprintln()voidprintln(boolean b) voidprintln(char c) voidprintln(double v) voidprintln(float v) voidprintln(int i) voidprintln(long l) voidvoidsetWriteListener(javax.servlet.WriteListener writeListener) voidUpdate destination.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b)
-
Constructor Details
-
RoutableServletOutputStream
Instantiates a new routable servlet output stream.- Parameters:
factory- the factory
-
-
Method Details
-
updateDestination
Update destination.- Parameters:
factory- the factory
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
print
- Overrides:
printin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
println
- Overrides:
printlnin classjavax.servlet.ServletOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
isReady
public boolean isReady()- Specified by:
isReadyin classjavax.servlet.ServletOutputStream
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener writeListener) - Specified by:
setWriteListenerin classjavax.servlet.ServletOutputStream
-