|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.ejb.AbstractServer
com.caucho.ejb.entity.EntityServer
public class EntityServer
EntityServer is a container for the instances of an entity bean.
| Field Summary |
|---|
| Fields inherited from class com.caucho.ejb.AbstractServer |
|---|
_component, _contextImplClass, _ejbClass, _ejbContainer, _ejbName, _handleEncoder, _handleServerId, _homeStubClass, _id, _initInject, _initProgram, _jvmClient, _loader, _local21, _localApiList, _localHome, _localHomeClass, _mappedName, _metaData, _moduleName, _primaryKeyClass, _protocolEncoderMap, _remote21, _remoteApiList, _remoteHome, _remoteHomeClass, _remoteHomeView, _remoteObjectClass, _remoteStubClass, _serviceEndpointClass, _transactionTimeout, log |
| Constructor Summary | |
|---|---|
EntityServer(EjbContainer ejbContainer)
Creates a new EntityServer. |
|
| Method Summary | |
|---|---|
void |
addRemoveListener(QEntityContext context)
Adds a remove listener. |
void |
addUpdateListener(EntityServer listener)
Adds an update listener. |
static java.lang.IllegalStateException |
createGetStateException(int state)
|
protected AbstractHandle |
createHandle(java.lang.Object primaryKey)
Creates a handle for the primary key. |
static java.lang.IllegalStateException |
createSetStateException(int state)
|
void |
destroy()
Cleans up the entity server nicely. |
boolean |
doLoad(long loadTime)
Returns true if the bean should be loaded. |
java.lang.String |
encodeId(java.lang.Object primaryKey)
Returns the encoded id. |
AbstractContext |
findByPrimaryKey(int key)
Returns the underlying object by searching the primary key. |
AbstractContext |
findByPrimaryKey(java.lang.Object key)
Returns the underlying object by searching the primary key. |
java.lang.Object |
findKnownObjectByPrimaryKey(int key)
Returns the underlying object by searching the primary key. |
AbstractContext |
findKnownObjectByPrimaryKey(java.lang.Object key)
Returns the underlying object by searching the primary key. |
EntityItem |
getAmberCacheItem(java.lang.Object key)
|
AmberEntityHome |
getAmberEntityHome()
Sets the amber entity home. |
boolean |
getBeanManagedPersistence()
Gets the persistence scheme for the entity bean |
EJBHome |
getClientHome()
Returns the EJBHome stub for the container |
EJBLocalHome |
getClientLocalHome()
Returns the EJBLocalHome stub for the container |
java.sql.Connection |
getConnection()
|
java.sql.Connection |
getConnection(boolean isReadOnly)
Returns a new connection. |
AbstractContext |
getContext(java.lang.Object key)
|
AbstractContext |
getContext(java.lang.Object key,
boolean forceLoad)
Finds the remote bean by its key. |
AbstractContext |
getContext(java.lang.Object key,
boolean forceLoad,
boolean isFindEntityItem)
Finds the remote bean by its key. |
javax.sql.DataSource |
getDataSource()
Returns the server's DataSource |
EJBHome |
getEJBHome()
Returns the EJBHome stub for the container |
java.lang.Object |
getHomeObject()
Returns the EJBHome stub for the container |
java.lang.Class |
getPrimaryKeyClass()
Gets the primary key class |
void |
init()
Initializes the EntityServer, generating and compiling the skeletons if necessary. |
void |
invalidateCache()
Invalidates all cache entries, forcing them to reload. |
boolean |
isCMP()
Sets CMP. |
boolean |
isLoadLazyOnTransaction()
Sets true if entities should be loaded lazily on transaction. |
void |
postCreate(java.lang.Object key,
QEntityContext cxt)
Associate the skeleton with a key. |
int |
randomInt(int max,
int i)
Returns a random integer for a new id |
java.lang.String |
randomString(int max,
int i)
Returns a random string for a new id |
void |
remove(java.lang.Object key)
Remove an object. |
void |
removeCache(java.lang.Object key)
|
void |
setAmberEntityHome(AmberEntityHome home)
Sets the amber entity home. |
void |
setCMP(boolean isCMP)
Sets CMP. |
void |
setDataSource(javax.sql.DataSource dataSource)
Sets the server's DataSource |
void |
setJdbcIsolation(int isolation)
|
void |
setLoadLazyOnTransaction(boolean isLoadLazy)
Sets true if entities should be loaded lazily on transaction. |
void |
setPrimaryKeyClass(java.lang.Class cl)
Sets the primary key class. |
void |
update(java.lang.Object key)
Updates the named entity bean |
void |
updateView(java.lang.Object key)
Updates the named entity bean |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EntityServer(EjbContainer ejbContainer)
serverId - the entity server's unique identifierallowJVMCall - allows fast calls to the same JVM (with serialization)config - the EJB configuration.| Method Detail |
|---|
public java.lang.Class getPrimaryKeyClass()
getPrimaryKeyClass in class AbstractServerpublic void setCMP(boolean isCMP)
public boolean isCMP()
public boolean getBeanManagedPersistence()
public boolean isLoadLazyOnTransaction()
public void setLoadLazyOnTransaction(boolean isLoadLazy)
public void setJdbcIsolation(int isolation)
public boolean doLoad(long loadTime)
loadTime - the time the bean was last loaded.public void setAmberEntityHome(AmberEntityHome home)
public AmberEntityHome getAmberEntityHome()
public void invalidateCache()
invalidateCache in class AbstractServerpublic void setPrimaryKeyClass(java.lang.Class cl)
public void init()
throws java.lang.Exception
init in class AbstractServerjava.lang.Exceptionprotected AbstractHandle createHandle(java.lang.Object primaryKey)
public java.lang.String encodeId(java.lang.Object primaryKey)
encodeId in class AbstractServer
public void postCreate(java.lang.Object key,
QEntityContext cxt)
public void addRemoveListener(QEntityContext context)
listener - the home context that's listening for events.listenClass - the class for this server.public void addUpdateListener(EntityServer listener)
public void remove(java.lang.Object key)
remove in class AbstractServerpublic void removeCache(java.lang.Object key)
public AbstractContext findByPrimaryKey(java.lang.Object key)
throws FinderException
FinderException
public AbstractContext findByPrimaryKey(int key)
throws FinderException
FinderExceptionpublic AbstractContext findKnownObjectByPrimaryKey(java.lang.Object key)
public java.lang.Object findKnownObjectByPrimaryKey(int key)
public EJBHome getClientHome()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic EJBHome getEJBHome()
getEJBHome in class AbstractServerpublic EJBLocalHome getClientLocalHome()
getClientLocalHome in class AbstractServerpublic java.lang.Object getHomeObject()
AbstractServer
getHomeObject in class AbstractServer
public AbstractContext getContext(java.lang.Object key)
throws FinderException
getContext in class AbstractServerFinderException
public AbstractContext getContext(java.lang.Object key,
boolean forceLoad)
throws FinderException
getContext in class AbstractServerkey - the remote key
FinderException
public AbstractContext getContext(java.lang.Object key,
boolean forceLoad,
boolean isFindEntityItem)
throws FinderException
key - the remote key
FinderExceptionpublic EntityItem getAmberCacheItem(java.lang.Object key)
public java.sql.Connection getConnection(boolean isReadOnly)
throws java.sql.SQLException
java.sql.SQLExceptionpublic void update(java.lang.Object key)
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.DataSource dataSource)
public java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void updateView(java.lang.Object key)
public java.lang.String randomString(int max,
int i)
max - the previous maximum valuei - the repetition index
public int randomInt(int max,
int i)
max - the previous maximum valuei - the repetition indexpublic static java.lang.IllegalStateException createGetStateException(int state)
public static java.lang.IllegalStateException createSetStateException(int state)
public void destroy()
destroy in class AbstractServer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||