edu.wisc.my.webproxy.beans.cache
Class CacheWriter
java.lang.Object
java.io.Writer
edu.wisc.my.webproxy.beans.cache.CacheWriter
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Appendable
public class CacheWriter
- extends java.io.Writer
Caching output stream. Takes a PageCache and the cache parameters along with
an output stream to delegate the calls to.
When close() is called on this class the bufferend content is written
out to the PageCache.
- Version:
- $Revision: 47804 $
- Author:
- Eric Dalquist edalquist@unicon.net
| Fields inherited from class java.io.Writer |
lock |
|
Constructor Summary |
CacheWriter(java.io.Writer out,
CacheEntry entryBase,
PageCache cache,
java.lang.String cacheKey,
boolean persistData)
Creates a new CacheWriter with the specified delegate stream and
caching configuration. |
|
Method Summary |
java.io.Writer |
append(char c)
|
java.io.Writer |
append(java.lang.CharSequence csq)
|
java.io.Writer |
append(java.lang.CharSequence csq,
int start,
int end)
|
void |
close()
Creates and stores a CacheEntry in the PageCache. |
void |
flush()
|
void |
write(char[] cbuf)
|
void |
write(char[] cbuf,
int off,
int len)
|
void |
write(int c)
|
void |
write(java.lang.String str)
|
void |
write(java.lang.String str,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CacheWriter
public CacheWriter(java.io.Writer out,
CacheEntry entryBase,
PageCache cache,
java.lang.String cacheKey,
boolean persistData)
- Creates a new CacheWriter with the specified delegate stream and
caching configuration.
- Parameters:
out - The output stream to delegate cache calls to. If null no delegation is performed.entryBase - The base CacheEntry to store, the content field will be overwritten before caching.cache - The PageCache to use to store the data, may not be null.cacheKey - The key to store the data with, may not be null.persistData - If the data should be persisted by the store.
close
public void close()
throws java.io.IOException
- Creates and stores a
CacheEntry in the PageCache.
- Specified by:
close in interface java.io.Closeable- Specified by:
close in class java.io.Writer
- Throws:
java.io.IOException- See Also:
OutputStream.close()
flush
public void flush()
throws java.io.IOException
- Specified by:
flush in interface java.io.Flushable- Specified by:
flush in class java.io.Writer
- Throws:
java.io.IOException- See Also:
OutputStream.flush()
write
public void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Specified by:
write in class java.io.Writer
- Throws:
java.io.IOException
append
public java.io.Writer append(char c)
throws java.io.IOException
- Specified by:
append in interface java.lang.Appendable- Overrides:
append in class java.io.Writer
- Throws:
java.io.IOException
append
public java.io.Writer append(java.lang.CharSequence csq,
int start,
int end)
throws java.io.IOException
- Specified by:
append in interface java.lang.Appendable- Overrides:
append in class java.io.Writer
- Throws:
java.io.IOException
append
public java.io.Writer append(java.lang.CharSequence csq)
throws java.io.IOException
- Specified by:
append in interface java.lang.Appendable- Overrides:
append in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(char[] cbuf)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(int c)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
write
public void write(java.lang.String str)
throws java.io.IOException
- Overrides:
write in class java.io.Writer
- Throws:
java.io.IOException
Copyright © 2010 Jasig. All Rights Reserved.