Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home
In directory
sc8-pr-cvs1:/tmp/cvs-serv16202/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home
Modified Files:
HomeTagsHandler.java
Log Message:
fixes the websphere ejb-ref problem reported by Gavin
Index: HomeTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/home/HomeTagsHandler.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** HomeTagsHandler.java 10 Dec 2002 22:54:57 -0000 1.24
--- HomeTagsHandler.java 27 Dec 2002 16:44:37 -0000 1.25
***************
*** 237,240 ****
--- 237,262 ----
}
+ public static String getJndiNameOfTypeFor(String type, XClass clazz) throws
+XDocletException
+ {
+ XTag bean_tag = clazz.getDoc().getTag("ejb:bean");
+ String compName = getCompNameFor(clazz, type);
+
+ if (bean_tag != null) {
+ String jndiName = bean_tag.getAttributeValue("jndi-name");
+ String localJndiName = bean_tag.getAttributeValue("local-jndi-name");
+
+ //Return "local" jndi name
+ if ("local".equals(type)) {
+ return localJndiName != null ? localJndiName : compName;
+ }
+
+ //Didn't ask for local, assume remote
+ return jndiName != null ? jndiName : compName;
+ }
+
+ //nothing specified so madeup one
+ return compName;
+ }
+
/**
* Converts ejbHome<em>blabla</em> to home<em>blabla</em> , the one that should
appear in home interface.
***************
*** 602,624 ****
public String jndiName(Properties attributes) throws XDocletException
{
! String type = attributes.getProperty("type");
! XTag bean_tag = getCurrentClass().getDoc().getTag("ejb:bean");
! String compName = getCompNameFor(getCurrentClass(), type);
!
! if (bean_tag != null) {
! String jndiName = bean_tag.getAttributeValue("jndi-name");
! String localJndiName = bean_tag.getAttributeValue("local-jndi-name");
!
! //Return "local" jndi name
! if ("local".equals(type)) {
! return localJndiName != null ? localJndiName : compName;
! }
!
! //Didn't ask for local, assume remote
! return jndiName != null ? jndiName : compName;
! }
!
! //nothing specified so madeup one
! return compName;
}
--- 624,628 ----
public String jndiName(Properties attributes) throws XDocletException
{
! return getJndiNameOfTypeFor(attributes.getProperty("type"),
getCurrentClass());
}
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel