From: Vance K. <va...@us...> - 2006-06-03 15:36:50
|
User: vancek Date: 06/06/03 08:36:48 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenBean.vsl andromda-ejb3/src/main/resources/templates/ejb3/config ejb-jar.xml.vsl andromda-ejb3/src/main/resources/META-INF/andromda profile.xml andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3MessageDrivenFacadeLogicImpl.java andromda-ejb3/src/main/uml EJB3MetafacadeModel.xml.zip andromda-ejb3/src/main/resources/templates/ejb3/config/jboss jboss.xml.vsl Log: Removed container configuration option for MDB. Added minimumPoolSize and maximumPoolSize (EJB3MessageDrivenFacade) using tagged values on MDB. MDB implements MessageListener. Revision Changes Path 1.24 +7 -3 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java Index: EJB3Profile.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Profile.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -r1.23 -r1.24 --- EJB3Profile.java 17 Apr 2006 02:00:31 -0000 1.23 +++ EJB3Profile.java 3 Jun 2006 15:36:47 -0000 1.24 @@ -460,10 +460,14 @@ public static final String TAGGEDVALUE_EJB_SESSION_JNDI_NAME_Local = profile.get("SERVICE_JNDI_NAME_LOCAL"); /** - * The tagged value indicating the MDB or session bean - * container configuration name specific to JBoss. + * The tagged value indicating the bean minimum pool size */ - public static final String TAGGEDVALUE_EJB_CONTAINER_CONFIGURATION = profile.get("CONTAINER_CONFIGURATION"); + public static final String TAGGEDVALUE_EJB_MDB_MINIMUM_POOL_SIZE = profile.get("MDB_MINIMUM_POOL_SIZE"); + + /** + * The tagged value indicating the bean maximum pool size + */ + public static final String TAGGEDVALUE_EJB_MDB_MAXIMUM_POOL_SIZE = profile.get("MDB_MAXIMUM_POOL_SIZE"); /** * Defines the association collection type 1.14 +4 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl Index: MessageDrivenBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -r1.13 -r1.14 --- MessageDrivenBean.vsl 29 May 2006 01:42:33 -0000 1.13 +++ MessageDrivenBean.vsl 3 Jun 2006 15:36:47 -0000 1.14 @@ -42,10 +42,10 @@ #* *##set ($lifecycleCallback = "") #**##end // Lifecycle callback listeners and interceptors are defined in ejb-jar.xml -// javax.ejb.Interceptors({$transform.getInterceptorsAsList(${interceptors}, ${lifecycleCallback})}) +// javax.interceptor.Interceptors({$transform.getInterceptorsAsList(${interceptors}, ${lifecycleCallback})}) #end #if ($service.excludeDefaultInterceptors) -// @javax.ejb.ExcludeDefaultInterceptors +// @javax.interceptor.ExcludeDefaultInterceptors #end #if ($mdb.transactionManagement) @@ -60,6 +60,7 @@ @javax.annotation.security.RunAs("${mdb.runAs}") #end public abstract class ${mdb.messageDrivenName} + implements javax.jms.MessageListener { // ------ Message Driven Context Injection ------ @@ -91,7 +92,7 @@ /** * Inject session EJB ${reference.name}; */ - @javax.annotation.EJB + @javax.ejb.EJB protected ${reference.fullyQualifiedServiceRemoteInterfaceName} $stringUtils.uncapitalize(${reference.name}); #**##end 1.5 +14 -1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/ejb-jar.xml.vsl Index: ejb-jar.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/ejb-jar.xml.vsl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -r1.4 -r1.5 --- ejb-jar.xml.vsl 24 Apr 2006 02:33:20 -0000 1.4 +++ ejb-jar.xml.vsl 3 Jun 2006 15:36:47 -0000 1.5 @@ -79,7 +79,7 @@ <ejb-class>${mdb.fullyQualifiedMessageDrivenImplementationName}</ejb-class> <transaction-type>Container</transaction-type> <message-destination-type>${mdb.destinationType}</message-destination-type> -#**##if ($mdb.transactionManagementBean || $stringUtils.isNotBlank($mdb.messageSelector) || $mdb.destinationTypeTopic) +#**##if ($mdb.transactionManagementBean || $stringUtils.isNotBlank($mdb.messageSelector) || $mdb.destinationTypeTopic || $mdb.minimumPoolSize > 0 || $mdb.maximumPoolSize > 0) <activation-config> #* *##if ($mdb.transactionManagementBean) <activation-config-property> @@ -99,6 +99,18 @@ <activation-config-property-value>${mdb.subscriptionDurability}</activation-config-property-value> </activation-config-property> #* *##end +#* *##if ($mdb.minimumPoolSize > 0) + <activation-config-property> + <activation-config-property-name>minPoolSize</activation-config-property-name> + <activation-config-property-value>${mdb.minimumPoolSize}</activation-config-property-value> + </activation-config-property> +#* *##end +#* *##if ($mdb.maximumPoolSize > 0) + <activation-config-property> + <activation-config-property-name>maxPoolSize</activation-config-property-name> + <activation-config-property-value>${mdb.maximumPoolSize}</activation-config-property-value> + </activation-config-property> +#* *##end </activation-config> #**##end #**##if ($stringUtils.isNotBlank($mdb.runAs)) @@ -116,6 +128,7 @@ </env-entry> #**##end </message-driven> + #end </enterprise-beans> 1.29 +17 -6 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml Index: profile.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/profile.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -r1.28 -r1.29 --- profile.xml 13 May 2006 02:57:17 -0000 1.28 +++ profile.xml 3 Jun 2006 15:36:47 -0000 1.29 @@ -1251,14 +1251,25 @@ <value>@andromda.ejb.mdb.subscription.durability</value> <appliedOnElement>Message Driven Bean</appliedOnElement> </element> - <element name="CONTAINER_CONFIGURATION"> + <element name="MDB_MINIMUM_POOL_SIZE"> <documentation> - Defines the container configuration name set in - jboss.xml to configure the container for a - session bean or MDB. + Defines the bean's minimum pool size. + Must be an integer and greater than 0, otherwise + will not be set. </documentation> - <value>@andromda.ejb.container.configuration</value> - <appliedOnElement>Message Driven or Session Bean</appliedOnElement> + <value>@andromda.ejb.mdb.pool.size.min</value> + <appliedOnElement>Message Driven</appliedOnElement> + </element> + <element name="MDB_MAXIMUM_POOL_SIZE"> + <documentation> + Defines the bean's maximum pool size. + Can be used to define singleton message driven + beans. + Must be an integer and greater than 0, otherwise + will not be set. + </documentation> + <value>@andromda.ejb.mdb.pool.size.max</value> + <appliedOnElement>Message Driven</appliedOnElement> </element> <element name="ENTITY_CACHE"> <documentation> 1.7 +24 -3 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MessageDrivenFacadeLogicImpl.java Index: EJB3MessageDrivenFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MessageDrivenFacadeLogicImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -r1.6 -r1.7 --- EJB3MessageDrivenFacadeLogicImpl.java 9 Mar 2006 04:43:38 -0000 1.6 +++ EJB3MessageDrivenFacadeLogicImpl.java 3 Jun 2006 15:36:48 -0000 1.7 @@ -18,6 +18,7 @@ import org.apache.commons.collections.Transformer; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; /** @@ -334,11 +335,31 @@ } /** - * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacadeLogic#handleGetContainerConfiguration() + * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacadeLogic#handleGetMinimumPoolSize() */ - protected String handleGetContainerConfiguration() + protected int handleGetMinimumPoolSize() { - return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_CONTAINER_CONFIGURATION); + int minPoolSize = 0; + String minPoolSizeStr = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_MDB_MINIMUM_POOL_SIZE); + if (StringUtils.isNotBlank(minPoolSizeStr) && NumberUtils.isDigits(minPoolSizeStr)) + { + minPoolSize = Integer.parseInt(minPoolSizeStr); + } + return minPoolSize; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacadeLogic#handleGetMaximumPoolSize() + */ + protected int handleGetMaximumPoolSize() + { + int maxPoolSize = 0; + String maxPoolSizeStr = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_MDB_MAXIMUM_POOL_SIZE); + if (StringUtils.isNotBlank(maxPoolSizeStr) && NumberUtils.isDigits(maxPoolSizeStr)) + { + maxPoolSize = Integer.parseInt(maxPoolSizeStr); + } + return maxPoolSize; } /** 1.39 +208 -210 cartridges/andromda-ejb3/src/main/uml/EJB3MetafacadeModel.xml.zip <<Binary file>> 1.4 +0 -3 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/jboss/jboss.xml.vsl Index: jboss.xml.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/config/jboss/jboss.xml.vsl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- jboss.xml.vsl 24 Apr 2006 02:34:41 -0000 1.3 +++ jboss.xml.vsl 3 Jun 2006 15:36:48 -0000 1.4 @@ -47,9 +47,6 @@ #foreach ($mdb in $mdbs) <message-driven> <ejb-name>${mdb.messageDrivenName}</ejb-name> -#**##if ($stringUtils.isNotBlank($mdb.containerConfiguration)) - <configuration-name>${mdb.containerConfiguration}</configuration-name> -#**##end <destination-jndi-name>${mdb.destination}</destination-jndi-name> </message-driven> |