Author: pete.muir(a)jboss.org
Date: 2009-07-31 10:45:51 -0400 (Fri, 31 Jul 2009)
New Revision: 3386
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
Log:
add proposed spi for accessing producer field values on EJBs
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java
===================================================================
---
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java 2009-07-31
14:09:49 UTC (rev 3385)
+++
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/api/SessionObjectReference.java 2009-07-31
14:45:51 UTC (rev 3386)
@@ -18,6 +18,8 @@
import java.io.Serializable;
+import javax.ejb.NoSuchEJBException;
+
/**
* A serializable reference to a session object in the EJB container
*
@@ -25,33 +27,46 @@
*/
public interface SessionObjectReference extends Serializable
{
-
+
/**
- * Get the reference from the EJB container to the session object for the
+ * Get the reference from the EJB container to the session object for the
* given business interface
*
- * @param <S>
- * the type of the business interface
- * @param businessInterfaceType
- * the type of the business interface
+ * @param <S> the type of the business interface
+ * @param businessInterfaceType the type of the business interface
* @return a reference
*
- * @throws IllegalStateException
- * if the business interface is not a local business interface of
- * the session bean
- * @throws NoSuchEJBException
- * if the session object has already been removed
+ * @throws IllegalStateException if the business interface is not a local
+ * business interface of the session bean
+ * @throws NoSuchEJBException if the session object has already been removed
*/
public <S> S getBusinessObject(Class<S> businessInterfaceType);
-
+
/**
* Request the EJB container remove the stateful session object
*
- * @throws UnsupportedOperationException
- * if the reference is not backed by a stateful session object
- * @throws NoSuchEJBException
- * if the session object has already been removed
+ * @throws UnsupportedOperationException if the reference is not backed by a
+ * stateful session object
+ * @throws NoSuchEJBException if the session object has already been removed
*/
public void remove();
-
+
+ /**
+ * Retrieve the value of a field. The field may have any visibility modifier.
+ *
+ * Used for retrieving producer field value.
+ *
+ * @param declaringClass the class declaring the field
+ * @param fieldName the name of the field
+ * @return the current field value
+ * @throws IllegalArgumentException if the declaringClass is null
+ * @throws IllegalArgumentException if the fieldName is null
+ * @throws IllegalArgumentException if the declaring class is not part of the
+ * inheritance hierarchy of this session object reference's bean
+ * class
+ * @throws IllegalArgumentException if the declaringClass represents an
+ * interface
+ */
+ public Object getFieldValue(Class<?> declaringClass, String fieldName);
+
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-07-31
14:09:49 UTC (rev 3385)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-07-31
14:45:51 UTC (rev 3386)
@@ -3,7 +3,6 @@
*/
package org.jboss.webbeans.mock;
-import java.lang.reflect.Field;
import java.util.Collection;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -47,7 +46,7 @@
}
- public Object getFieldValue(Field field)
+ public Object getFieldValue(Class<?> declaringClass, String fieldName)
{
// TODO Auto-generated method stub
return null;
Show replies by date