Package org.red5.cache.impl
Class CacheableImpl
- java.lang.Object
-
- org.red5.cache.impl.CacheableImpl
-
- All Implemented Interfaces:
Serializable,ICacheable
public class CacheableImpl extends Object implements ICacheable
Provides an implementation of a cacheable object.- Author:
- The Red5 Project, Paul Gregoire (mondain@gmail.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description CacheableImpl(Object obj)CacheableImpl(org.apache.mina.core.buffer.IoBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequest()org.apache.mina.core.buffer.IoBuffergetByteBuffer()Returns a readonly byte buffer.byte[]getBytes()Returns the object contained within the cacheable reference.StringgetName()Returns the name of the cached object.booleanisCached()Returnstrueif the object is cached,falseotherwise.voidsetCached(boolean cached)Sets a flag to represent the cached status of a cacheable object.voidsetName(String name)Set the name of the cached object.
-
-
-
Constructor Detail
-
CacheableImpl
public CacheableImpl(Object obj)
-
CacheableImpl
public CacheableImpl(org.apache.mina.core.buffer.IoBuffer buffer)
-
-
Method Detail
-
addRequest
public void addRequest()
-
getBytes
public byte[] getBytes()
Returns the object contained within the cacheable reference.- Specified by:
getBytesin interfaceICacheable- Returns:
- Cached representation of object
-
getByteBuffer
public org.apache.mina.core.buffer.IoBuffer getByteBuffer()
Returns a readonly byte buffer.- Specified by:
getByteBufferin interfaceICacheable- Returns:
- Read-only IoBuffer with cached data
-
getName
public String getName()
Returns the name of the cached object.- Specified by:
getNamein interfaceICacheable- Returns:
- Object name
-
isCached
public boolean isCached()
Returnstrueif the object is cached,falseotherwise.- Specified by:
isCachedin interfaceICacheable- Returns:
trueif object is cached,falseotherwise
-
setCached
public void setCached(boolean cached)
Sets a flag to represent the cached status of a cacheable object.- Specified by:
setCachedin interfaceICacheable- Parameters:
cached-trueif object is cached,falseotherwise
-
setName
public void setName(String name)
Set the name of the cached object.- Specified by:
setNamein interfaceICacheable- Parameters:
name- New object name
-
-