Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup
In directory sc8-pr-cvs1:/tmp/cvs-serv678/modules/ejb/src/xdoclet/modules/ejb/lookup
Modified Files:
LookupObjectSubTask.java LookupUtilTagsHandler.java
Log Message:
Experimental changes for allowing stateless session beans to be proxied as local calls
without RMI. A result of the realization that SLSB is just a nuciance during
development when Hibernate is already substituting for entity beans.
Index: LookupObjectSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/LookupObjectSubTask.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** LookupObjectSubTask.java 3 Apr 2003 23:52:29 -0000 1.10
--- LookupObjectSubTask.java 5 Aug 2003 05:50:05 -0000 1.11
***************
*** 60,63 ****
--- 60,68 ----
/**
+ * should local proxies to session beans be generated
+ */
+ private boolean localProxies = false;
+
+ /**
* Describe what the UtilObjectSubTask constructor does
*/
***************
*** 71,74 ****
--- 76,89 ----
/**
+ * should local proxies be returned instead of home interfaces be returned for
SLSBs?
+ *
+ * @return
+ */
+ public boolean getLocalProxies()
+ {
+ return localProxies;
+ }
+
+ /**
* Gets the Kind attribute of the UtilObjectSubTask object
*
***************
*** 115,118 ****
--- 130,138 ----
return DEFAULT_UTIL_CLASS_PATTERN;
}
+ }
+
+ public void setLocalProxies(boolean localProxies)
+ {
+ this.localProxies = localProxies;
}
Index: LookupUtilTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/lookup/LookupUtilTagsHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** LookupUtilTagsHandler.java 29 Apr 2003 19:14:50 -0000 1.8
--- LookupUtilTagsHandler.java 5 Aug 2003 05:50:05 -0000 1.9
***************
*** 16,19 ****
--- 16,20 ----
import xdoclet.modules.ejb.lookup.LookupObjectSubTask;
+ import xdoclet.modules.ejb.session.SessionTagsHandler;
import xdoclet.util.LogUtil;
***************
*** 137,139 ****
--- 138,186 ----
return getUtilClassFor(getCurrentClass());
}
+
+ /**
+ * Returns true if clazz is a stateless session bean and localProxy config param
is true, false otherwise.
+ *
+ * @param clazz Description of Parameter
+ * @return The StatelessSession value
+ * @exception XDocletException
+ */
+ public boolean generateLocalProxy(XClass clazz) throws XDocletException
+ {
+ LookupObjectSubTask lookupSubtask = ((LookupObjectSubTask)
DocletContext.getInstance().getSubTaskBy(DocletTask.getSubTaskName(LookupObjectSubTask.class)));
+
+ return (SessionTagsHandler.isSession(clazz) &&
lookupSubtask.getLocalProxies());
+ }
+
+ /**
+ * Evaluate the body block if current class is a stateless session bean and
localProxy config param is true.
+ *
+ * @param template The body of the block tag
+ * @exception XDocletException
+ * @see #generateLocalProxy(xjavadoc.XClass)
+ * @doc.tag type="block"
+ */
+ public void ifGenerateLocalProxy(String template) throws XDocletException
+ {
+ if (generateLocalProxy(getCurrentClass())) {
+ generate(template);
+ }
+ }
+
+ /**
+ * Evaluate the body block if current class is not stateless session bean and
localProxy config param is true.
+ *
+ * @param template The body of the block tag
+ * @exception XDocletException
+ * @see #generateLocalProxy(xjavadoc.XClass)
+ * @doc.tag type="block"
+ */
+ public void ifNotGenerateLocalProxy(String template) throws XDocletException
+ {
+ if (!generateLocalProxy(getCurrentClass())) {
+ generate(template);
+ }
+ }
+
}
+
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel