From: Vance K. <va...@us...> - 2006-02-09 07:18:49
|
User: vancek Date: 06/02/08 23:18:43 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionFacadeLogicImpl.java Log: getJndiNameRemote and getJndiNameLocal add the jndiNamePrefix if corresponding jndi name explicitly defined using tagged values. added getJndiNamePrefix implementation Revision Changes Path 1.11 +28 -4 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionFacadeLogicImpl.java Index: EJB3SessionFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionFacadeLogicImpl.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -w -r1.10 -r1.11 --- EJB3SessionFacadeLogicImpl.java 6 Feb 2006 04:06:30 -0000 1.10 +++ EJB3SessionFacadeLogicImpl.java 9 Feb 2006 07:18:43 -0000 1.11 @@ -79,13 +79,18 @@ /** * The default view type accessability for the session bean. */ - public static final String SESSION_DEFAULT_VIEW_TYPE = "serviceViewType"; + public static final String SERVICE_DEFAULT_VIEW_TYPE = "serviceViewType"; /** * The property that stores whether default service exceptions are permitted. */ public static final String ALLOW_DEFAULT_SERVICE_EXCEPTION = "allowDefaultServiceException"; + /** + * The property that stores the JNDI name prefix. + */ + public static final String SERVICE_JNDI_NAME_PREFIX = "jndiNamePrefix"; + // ---------------- constructor ------------------------------- public EJB3SessionFacadeLogicImpl (Object metaObject, String context) @@ -145,7 +150,12 @@ */ protected String handleGetJndiNameRemote() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_REMOTE); + String jndiName = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_REMOTE); + if (StringUtils.isNotBlank(jndiName)) + { + jndiName = this.getJndiNamePrefix() + "/" + jndiName; + } + return jndiName; } /** @@ -153,7 +163,21 @@ */ protected String handleGetJndiNameLocal() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local); + String jndiName = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local); + if (StringUtils.isNotBlank(jndiName)) + { + jndiName = this.getJndiNamePrefix() + "/" + jndiName; + } + return jndiName; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetJndiNamePrefix() + */ + protected String handleGetJndiNamePrefix() + { + return this.isConfiguredProperty(SERVICE_JNDI_NAME_PREFIX) ? + ObjectUtils.toString(this.getConfiguredProperty(SERVICE_JNDI_NAME_PREFIX)) : null; } /** @@ -215,7 +239,7 @@ protected java.lang.String handleGetViewType() { return EJB3MetafacadeUtils.getViewType(this, - String.valueOf(this.getConfiguredProperty(SESSION_DEFAULT_VIEW_TYPE))); + String.valueOf(this.getConfiguredProperty(SERVICE_DEFAULT_VIEW_TYPE))); } /** |