org.jboss.ejb3.cache.impl
Class SimpleCache<T extends Identifiable>

java.lang.Object
  extended by org.jboss.ejb3.cache.impl.SimpleCache<T>
All Implemented Interfaces:
Cache<T>

public class SimpleCache<T extends Identifiable>
extends Object
implements Cache<T>

Comment

Version:
$Revision: $
Author:
Carlo de Wolf

Constructor Summary
SimpleCache(StatefulObjectFactory<T> factory)
           
 
Method Summary
 T create(Class<?>[] initTypes, Object[] initValues)
          Create a new object.
 T get(Object key)
          Get the specified object from cache.
 T peek(Object key)
          Peek at an object which might be in use.
 void release(T obj)
          Release the object from use.
 void remove(Object key)
          Remove the specified object from cache.
 void start()
          Start the cache.
 void stop()
          Stop the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCache

public SimpleCache(StatefulObjectFactory<T> factory)
Method Detail

create

public T create(Class<?>[] initTypes,
                Object[] initValues)
Description copied from interface: Cache
Create a new object.

Specified by:
create in interface Cache<T extends Identifiable>
Returns:

get

public T get(Object key)
                           throws javax.ejb.NoSuchEJBException
Description copied from interface: Cache
Get the specified object from cache. This will mark the object as being in use.

Specified by:
get in interface Cache<T extends Identifiable>
Parameters:
key - the identifier of the object
Returns:
the object
Throws:
javax.ejb.NoSuchEJBException - if the object does not exist

peek

public T peek(Object key)
                            throws javax.ejb.NoSuchEJBException
Description copied from interface: Cache
Peek at an object which might be in use.

Specified by:
peek in interface Cache<T extends Identifiable>
Parameters:
key - the identifier of the object
Returns:
the object
Throws:
javax.ejb.NoSuchEJBException - if the object does not exist

release

public void release(T obj)
Description copied from interface: Cache
Release the object from use.

Specified by:
release in interface Cache<T extends Identifiable>
Parameters:
obj - the object

remove

public void remove(Object key)
Description copied from interface: Cache
Remove the specified object from cache.

Specified by:
remove in interface Cache<T extends Identifiable>
Parameters:
key - the identifier of the object

start

public void start()
Description copied from interface: Cache
Start the cache.

Specified by:
start in interface Cache<T extends Identifiable>

stop

public void stop()
Description copied from interface: Cache
Stop the cache.

Specified by:
stop in interface Cache<T extends Identifiable>


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.