User: user57
Date: 01/07/13 15:35:30
Modified: src/main/org/jboss/ejb/plugins
MessageDrivenInstanceInterceptor.java
Log:
o cleaned up
Revision Changes Path
1.5 +34 -30
jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java
Index: MessageDrivenInstanceInterceptor.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/MessageDrivenInstanceInterceptor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- MessageDrivenInstanceInterceptor.java 2001/06/18 20:01:23 1.4
+++ MessageDrivenInstanceInterceptor.java 2001/07/13 22:35:30 1.5
@@ -11,46 +11,50 @@
import org.jboss.ejb.Container;
import org.jboss.ejb.MessageDrivenContainer;
import org.jboss.ejb.MethodInvocation;
-import org.jboss.logging.Logger;
+
/**
- * This container acquires the given instance. This must be used after
- * the EnvironmentInterceptor, since acquiring instances requires a proper
- * JNDI environment to be set
- * For MessageDriven Beans, we inherit the StatelessSession for now,
- * since message driven beans is much like them
+ * This container acquires the given instance. This must be used after
+ * the EnvironmentInterceptor, since acquiring instances requires a proper
+ * JNDI environment to be set.
+ *
+ * <p>For MessageDriven Beans, we inherit the StatelessSession for now,
+ * since message driven beans is much like them.
*
- * @see <related>
- * @author <a href="mailto:[EMAIL PROTECTED]">Peter Antman</a>.
- * @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
- * @version $Revision: 1.4 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Peter Antman</a>.
+ * @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
+ * @version $Revision: 1.5 $
*/
public class MessageDrivenInstanceInterceptor
extends StatelessSessionInstanceInterceptor
{
- protected MessageDrivenContainer container;
+ protected MessageDrivenContainer container;
- public void setContainer(Container container)
+ public void setContainer(final Container container)
{
- this.container = (MessageDrivenContainer)container;
+ this.container = (MessageDrivenContainer)container;
}
- // Overriden here, since these bastards don't have homes
- public Object invokeHome(MethodInvocation mi)
+ /**
+ * Message driven beans do not have homes.
+ *
+ * @throws Error Not valid for MessageDriven beans
+ */
+ public Object invokeHome(final MethodInvocation mi)
throws Exception
{
- throw new Error("Not valid for MessageDriven beans");
+ throw new Error("Not valid for MessageDriven beans");
}
- // Interceptor implementation --------------------------------------
-
+
+ // Interceptor implementation --------------------------------------
- public Object invoke(MethodInvocation mi)
+ public Object invoke(final MethodInvocation mi)
throws Exception
{
// Get context
mi.setEnterpriseContext(container.getInstancePool().get());
- // There is no need for synchronization since the instance is always fresh
also there should
- // never be a tx associated with the instance.
+ // There is no need for synchronization since the instance is always
+ // fresh also there should never be a tx associated with the instance.
try
{
@@ -58,21 +62,21 @@
return getNext().invoke(mi);
} catch (RuntimeException e) // Instance will be GC'ed at MI return
{
- mi.setEnterpriseContext(null);
- throw e;
+ mi.setEnterpriseContext(null);
+ throw e;
} catch (RemoteException e) // Instance will be GC'ed at MI return
{
- mi.setEnterpriseContext(null);
- throw e;
+ mi.setEnterpriseContext(null);
+ throw e;
} catch (Error e) // Instance will be GC'ed at MI return
{
- mi.setEnterpriseContext(null);
- throw e;
+ mi.setEnterpriseContext(null);
+ throw e;
} finally
{
- // Return context
- if (mi.getEnterpriseContext() != null)
- container.getInstancePool().free(mi.getEnterpriseContext());
+ // Return context
+ if (mi.getEnterpriseContext() != null)
+ container.getInstancePool().free(mi.getEnterpriseContext());
}
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development