public class TransactionLocalEntityCache extends Object implements ReadyEntityCache
Constructor and Description |
---|
TransactionLocalEntityCache(EntityBeanComponent component) |
Modifier and Type | Method and Description |
---|---|
void |
create(EntityBeanComponentInstance instance)
Called after an entity bean has been created and associated with a new identity.
|
void |
discard(EntityBeanComponentInstance instance)
Discard the object, called when an exception occurs
|
EntityBeanComponentInstance |
get(Object key)
Gets an entity bean instance for the given primary key.
|
void |
reference(EntityBeanComponentInstance instance) |
void |
release(EntityBeanComponentInstance instance,
boolean success)
Release the object from use.
|
void |
start()
Start the cache.
|
void |
stop()
Stop the cache.
|
public TransactionLocalEntityCache(EntityBeanComponent component)
public EntityBeanComponentInstance get(Object key) throws javax.ejb.NoSuchEJBException
ReadyEntityCache
ReadyEntityCache.release(org.jboss.as.ejb3.component.entity.EntityBeanComponentInstance, boolean)
Implementors of this method must ensure that repeated calls to get within the same transaction
return the same instance for a given primary key. This must also take into account entity beans
created in the same transaction using the ReadyEntityCache.create(org.jboss.as.ejb3.component.entity.EntityBeanComponentInstance)
method.
Implementations are free to use a 1 to 1 instance -> pk mapping, or create multiple instances per
primary key.get
in interface ReadyEntityCache
key
- the identifier of the objectjavax.ejb.NoSuchEJBException
public void discard(EntityBeanComponentInstance instance)
ReadyEntityCache
discard
in interface ReadyEntityCache
instance
- The instance to discardpublic void create(EntityBeanComponentInstance instance) throws javax.ejb.NoSuchEJBException
ReadyEntityCache
create
in interface ReadyEntityCache
instance
- The new instancejavax.ejb.NoSuchEJBException
public void release(EntityBeanComponentInstance instance, boolean success)
ReadyEntityCache
release
in interface ReadyEntityCache
instance
- The entitysuccess
- True if the transaction succeededpublic void reference(EntityBeanComponentInstance instance)
public void start()
ReadyEntityCache
start
in interface ReadyEntityCache
public void stop()
ReadyEntityCache
stop
in interface ReadyEntityCache
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.