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.
- Version:
- $Revision: 1.1 $
- Author:
- Joe Walnes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Factory to lazily instantiate the destination. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate javax.servlet.ServletOutputStream
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
private javax.servlet.ServletOutputStream
boolean
isReady()
void
print
(boolean b) void
print
(char c) void
print
(double v) void
print
(float v) void
print
(int i) void
print
(long l) void
void
println()
void
println
(boolean b) void
println
(char c) void
println
(double v) void
println
(float v) void
println
(int i) void
println
(long l) void
void
setWriteListener
(javax.servlet.WriteListener listener) void
void
write
(byte[] b) void
write
(byte[] b, int off, int len) void
write
(int b) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
destination
private javax.servlet.ServletOutputStream destination -
factory
-
-
Constructor Details
-
RoutableServletOutputStream
-
-
Method Details
-
getDestination
- Throws:
IOException
-
updateDestination
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
print
- Overrides:
print
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
println
- Overrides:
println
in classjavax.servlet.ServletOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
setWriteListener
public void setWriteListener(javax.servlet.WriteListener listener) - Specified by:
setWriteListener
in classjavax.servlet.ServletOutputStream
-
isReady
public boolean isReady()- Specified by:
isReady
in classjavax.servlet.ServletOutputStream
-