org.red5.server.cache

## Class CacheableImpl

- java.lang.Object
- - org.red5.server.cache.CacheableImpl

All Implemented Interfaces:
  ICacheable

    public class CacheableImpl
    extends Object
    implements ICacheable

Provides an implementation of a cacheable object.

Author:
  The Red5 Project (red5@osflash.org), Paul Gregoire (mondain@gmail.com)

### Field Summary

Fields
`protected org.springframework.context.ApplicationContext` `applicationContext`
`protected static org.slf4j.Logger` `log`

### Constructor Summary

Constructors
Constructor and Description
`CacheableImpl(IoBuffer buffer)`
`CacheableImpl(Object obj)`

### Method Summary

Methods
`void` `addRequest()`
`IoBuffer` `getByteBuffer()` Returns a readonly byte buffer.
`byte[]` `getBytes()` Returns the object contained within the cacheable reference.
`String` `getName()` Returns the name of the cached object.
`boolean` `isCached()` Returns `true` if the object is cached, `false` otherwise.
`void` `setCached(boolean cached)` Sets a flag to represent the cached status of a cacheable object.
`void` `setName(String name)` Set the name of the cached object.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### log

    protected static org.slf4j.Logger log

#### applicationContext

    protected org.springframework.context.ApplicationContext applicationContext

### Constructor Detail

#### CacheableImpl

    public CacheableImpl(Object obj)

#### CacheableImpl

    public CacheableImpl(IoBuffer buffer)

### Method Detail

#### addRequest

    public void addRequest()

#### getBytes

    public byte[] getBytes()

Returns the object contained within the cacheable reference.

Specified by:
  `getBytes` in interface `ICacheable`
Returns:
  Cached representation of object

#### getByteBuffer

    public IoBuffer getByteBuffer()

Returns a readonly byte buffer.

Specified by:
  `getByteBuffer` in interface `ICacheable`
Returns:
  Read-only IoBuffer with cached data

#### getName

    public String getName()

Returns the name of the cached object.

Specified by:
  `getName` in interface `ICacheable`
Returns:
  Object name

#### isCached

    public boolean isCached()

Returns `true` if the object is cached, `false` otherwise.

Specified by:
  `isCached` in interface `ICacheable`
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 interface `ICacheable`
Parameters:
  `cached` - `true` if object is cached, `false` otherwise

#### setName

    public void setName(String name)

Set the name of the cached object.

Specified by:
  `setName` in interface `ICacheable`
Parameters:
  `name` - New object name