Package org.red5.cache.impl
Class CacheableImpl
java.lang.Object
org.red5.cache.impl.CacheableImpl
- All Implemented Interfaces:
Serializable
,ICacheable
Provides an implementation of a cacheable object.
- Author:
- The Red5 Project, Paul Gregoire (mondain@gmail.com)
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCacheableImpl
(Object obj) CacheableImpl
(org.apache.mina.core.buffer.IoBuffer buffer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
org.apache.mina.core.buffer.IoBuffer
Returns a readonly byte buffer.byte[]
getBytes()
Returns the object contained within the cacheable reference.getName()
Returns the name of the cached object.boolean
isCached()
Returnstrue
if the object is cached,false
otherwise.void
setCached
(boolean cached) Sets a flag to represent the cached status of a cacheable object.void
Set the name of the cached object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
log
protected static org.slf4j.Logger log -
bytes
private byte[] bytes -
name
-
cached
private boolean cached
-
-
Constructor Details
-
CacheableImpl
-
CacheableImpl
public CacheableImpl(org.apache.mina.core.buffer.IoBuffer buffer)
-
-
Method Details
-
addRequest
public void addRequest() -
getBytes
public byte[] getBytes()Returns the object contained within the cacheable reference.- Specified by:
getBytes
in interfaceICacheable
- Returns:
- Cached representation of object
-
getByteBuffer
public org.apache.mina.core.buffer.IoBuffer getByteBuffer()Returns a readonly byte buffer.- Specified by:
getByteBuffer
in interfaceICacheable
- Returns:
- Read-only IoBuffer with cached data
-
getName
Returns the name of the cached object.- Specified by:
getName
in interfaceICacheable
- Returns:
- Object name
-
isCached
public boolean isCached()Returnstrue
if the object is cached,false
otherwise.- Specified by:
isCached
in interfaceICacheable
- Returns:
true
if object is cached,false
otherwise
-
setCached
public void setCached(boolean cached) Sets a flag to represent the cached status of a cacheable object.- Specified by:
setCached
in interfaceICacheable
- Parameters:
cached
-true
if object is cached,false
otherwise
-
setName
Set the name of the cached object.- Specified by:
setName
in interfaceICacheable
- Parameters:
name
- New object name
-