User: simone
Date: 00/10/16 16:37:26
Modified: src/main/org/jboss/ejb InstanceCache.java
Log:
Re-added release method for passivation purposes. Improved javadocs
Revision Changes Path
1.4 +32 -16 jboss/src/main/org/jboss/ejb/InstanceCache.java
Index: InstanceCache.java
===================================================================
RCS file: /products/cvs/ejboss/jboss/src/main/org/jboss/ejb/InstanceCache.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- InstanceCache.java 2000/10/09 20:15:34 1.3
+++ InstanceCache.java 2000/10/16 23:37:26 1.4
@@ -7,14 +7,14 @@
package org.jboss.ejb;
import java.rmi.RemoteException;
-import javax.ejb.NoSuchEntityException;
+import java.rmi.NoSuchObjectException;
/**
- * <description>
+ * The plugin that gives a container a cache for bean instances.
*
- * @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
- * @version $Revision: 1.3 $
+ * @author Simone Bordet ([EMAIL PROTECTED])
+ * @version $Revision: 1.4 $
*/
public interface InstanceCache
extends ContainerPlugin
@@ -30,30 +30,46 @@
// Public --------------------------------------------------------
/**
- * Get an instance of a particular identity.
- * This may involve activation if necessary.
- *
+ * Gets a bean instance from this cache given the identity.
+ * This method may involve activation if the instance is not in the cache.
+ * Implementation should have O(1) complexity.
* This method is never called for stateless session beans.
*
- * @param id
- * @return Context /w instance
- * @exception RemoteException
+ * @param id the primary key of the bean
+ * @return the EnterpriseContext related to the given id
+ * @exception RemoteException in case of illegal calls (concurrent / reentrant),
+ * NoSuchObjectException if the bean cannot be found.
+ * @see #release
*/
public EnterpriseContext get(Object id)
- throws Exception;
+ throws RemoteException, NoSuchObjectException;
/**
- * Insert an active instance after creation or activation. Write-lock is
required.
+ * Inserts an active bean instance after creation or activation.
+ * Implementation should guarantee proper locking and O(1) complexity.
*
- * @param ctx
+ * @param ctx the EnterpriseContext to insert in the cache
+ * @see #remove
*/
public void insert(EnterpriseContext ctx);
-
+ /**
+ * Releases the given bean instance from this cache.
+ * This method may passivate the bean to get it out of the cache.
+ * Implementation should return almost immediately leaving the
+ * passivation to be executed by another thread.
+ *
+ * @param ctx the EnterpriseContext to release
+ * @see #get
+ */
+ public void release(EnterpriseContext ctx);
+
/**
- * Remove an instance corresponding to the given id after removal
+ * Removes a bean instance from this cache given the identity.
+ * Implementation should have O(1) complexity and guarantee proper
locking.
*
- * @param ctx
+ * @param id the pimary key of the bean
+ * @see #insert
*/
public void remove(Object id);