You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(178) |
Feb
(169) |
Mar
(286) |
Apr
(117) |
May
(98) |
Jun
(68) |
Jul
(63) |
Aug
(121) |
Sep
(88) |
Oct
(124) |
Nov
(2) |
Dec
(111) |
2007 |
Jan
(224) |
Feb
(69) |
Mar
(10) |
Apr
(72) |
May
(7) |
Jun
(21) |
Jul
(33) |
Aug
(35) |
Sep
(12) |
Oct
(22) |
Nov
(5) |
Dec
(6) |
2008 |
Jan
(2) |
Feb
(10) |
Mar
(39) |
Apr
(58) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(10) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Vance K. <va...@us...> - 2006-01-06 13:52:09
|
User: vancek Date: 06/01/06 05:51:54 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added MDB template elements Revision Changes Path 1.4 +41 -7 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- cartridge.xml 4 Jan 2006 06:10:36 -0000 1.3 +++ cartridge.xml 6 Jan 2006 13:51:54 -0000 1.4 @@ -17,6 +17,8 @@ <property reference="hibernateCacheProvider"/> <property reference="hibernateTreecacheMbeanObject"/> + <!-- Entity Bean Templates --> + <template path="templates/ejb3/Entity.vsl" outputPattern="{0}/{1}.java" @@ -68,13 +70,7 @@ </modelElements> </template> - <!-- - The following definitions map services to session beans. - The templates map a service to a session bean - and the template itself decides to generate a stateless or stateful - session bean, based on the fact that the UML class contains attributes or not. - (Matthias Bohlen) - --> + <!-- Session Bean Templates --> <template path="templates/ejb3/SessionBean.vsl" @@ -138,6 +134,44 @@ </modelElements> </template> + <!-- Message Driven Bean Templates --> + + <template + path="templates/ejb3/MessageDrivenBean.vsl" + outputPattern="{0}/{1}MDBBean.java" + outlet="message-driven-beans" + overwrite="true"> + <modelElements variable="mdb"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacade"/> + </modelElement> + </modelElements> + </template> + + <template + path="templates/ejb3/MessageDrivenBeanImpl.vsl" + outputPattern="{0}/{1}MDBBeanImpl.java" + outlet="message-driven-impls" + overwrite="false"> + <modelElements variable="mdb"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacade"/> + </modelElement> + </modelElements> + </template> + + <template + path="templates/ejb3/MessageDrivenListener.vsl" + outputPattern="{0}/{1}Listener.java" + outlet="message-driven-impls" + overwrite="false"> + <modelElements variable="mdb"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3MessageDrivenFacade"/> + </modelElement> + </modelElements> + </template> + <!-- cartridge-template merge-point --> </cartridge> \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-06 13:51:33
|
User: vancek Date: 06/01/06 05:51:12 Added: andromda-ejb3/src/main/resources/templates/ejb3 MessageDrivenListener.vsl MessageDrivenBeanImpl.vsl MessageDrivenBean.vsl Log: initial revision for MDB Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenListener.vsl Index: MessageDrivenListener.vsl =================================================================== // license-header java merge-point #if ($stringUtils.isNotBlank($mdb.packageName)) package $mdb.packageName; #end /** * Callback Listener for Message Driven bean ${mdb.fullyQualifiedMessageDrivenName} * * @see ${mdb.fullyQualifiedMessageDrivenName} */ public class ${mdb.messageDrivenListenerName} { /** * Default public no-args constructor */ public ${mdb.messageDrivenListenerName}() { } @javax.ejb.PostConstruct public void postConstruct(${mdb.fullyQualifiedMessageDrivenName} ${stringUtils.uncapitalize(${mdb.name})}) { // post construct implementation } @javax.ejb.PreDestroy public void preDestroy(${mdb.fullyQualifiedMessageDrivenName} ${stringUtils.uncapitalize(${mdb.name})}) { // pre destroy implementation } } 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBeanImpl.vsl Index: MessageDrivenBeanImpl.vsl =================================================================== // license-header java merge-point #if ($stringUtils.isNotBlank($mdb.packageName)) package $mdb.packageName; #end /** * @see ${mdb.fullyQualifiedMessageDrivenName} */ public class ${mdb.messageDrivenImplementationName} extends ${mdb.fullyQualifiedMessageDrivenName} implements javax.jms.MessageListener { // --------- Default Constructor ---------- public ${mdb.messageDrivenImplementationName}() { super(); } /** * MessageListener callback on arrival of a JMS message * * @param message The inbound JMS message to process */ public void onMessage(javax.jms.Message message) { // Implementation } #set ($operations = $mdb.operations) #if (!$operations.empty) // -------- User Defined Methods -------------- #**##foreach ($operation in $operations) #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##set ($signature = $operation.signature) #* *##set ($visibility = $operation.visibility) /** * @see ${mdb.fullyQualifiedMessageDrivenName}#${operation.getSignature(false)} */ $visibility $returnType $signature #* *##if ($operation.exceptionsPresent) throws $operation.exceptionList #* *##end { //TODO: put your implementation here. #* *##if ($operation.returnTypePresent) // Dummy return value, just that the file compiles return $operation.returnType.javaNullString; #* *##end } #**##end #end } 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/MessageDrivenBean.vsl Index: MessageDrivenBean.vsl =================================================================== // license-header java merge-point /* Autogenerated by AndroMDA (MessageDrivenBean.vsl) - do not edit */ #if ($stringUtils.isNotBlank($mdb.packageName)) package $mdb.packageName; #end /** * Autogenerated JMS message driven EJB class for the ${mdb.messageDrivenName} bean. * $mdb.getDocumentation(" * ") */ @javax.ejb.MessageDriven(activateConfig = { @javax.ejb.ActivationConfigProperty(propertyName="destinationType", propertyValue="${mdb.destinationType}"), @javax.ejb.ActivationConfigProperty(propertyName="destination", propertyValue="${mdb.destination}")#if ($mdb.acknowledgeMode || $mdb.messageSelector || $mdb.subscriptionDurability),#end #if ($mdb.acknowledgeMode) @javax.ejb.ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="${mdb.acknowledgeMode}")#if ($mdb.messageSelector || $mdb.subscriptionDurability),#end #end #if ($mdb.messageSelector) @javax.ejb.ActivationConfigProperty(propertyName="messageSelector", propertyValue="${mdb.messageSelector}")#if ($mdb.subscriptionDurability),#end #end #if ($mdb.subscriptionDurability) @javax.ejb.ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="${mdb.subscriptionDurability}") #end } ) #if ($mdb.transactionManagement) @javax.ejb.TransactionManagement(javax.ejb.TransactionManagementType.${mdb.transactionManagement}) #end #if (!$mdb.transactionManagementBean) #**##if ($mdb.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${mdb.transactionType}) #**##end #end #if ($mdb.runAs) @javax.annotation.security.RunAs("${mdb.runAs}") #end public abstract class ${mdb.messageDrivenName} implements javax.jms.MessageListener { // ------ Message Driven Context Injection ------ @javax.annotation.Resource protected javax.ejb.MessageDrivenContext context; #if ($service.transactionManagementBean) // ---------- User Transaction Injection --------- @javax.annotation.Resource protected javax.transaction.UserTransaction userTrans; #end #set ($constants = $mdb.getConstants(true)) #if (!$constants.empty) // ----------- Constant Definitions ----------- #**##foreach($constant in $constants) public static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; #**##end #end #set ($references = $mdb.serviceReferences) #if (!$references.empty) // ------ EJB Injection Definitions -------- #**##foreach ($dependency in $references) #* *##set ($reference = $dependency.targetElement) /** * Inject session EJB ${reference.name}; */ @javax.annotation.EJB protected ${reference.fullyQualifiedServiceName} $stringUtils.uncapitalize(${reference.name}); #**##end #end // --------- Default Constructor ---------- public ${mdb.messageDrivenName}() { // Empty implementation } #set ($operations = $mdb.operations) #if (!$operations.empty) // -------- User Defined Methods -------------- #**##foreach ($operation in $operations) #* *##set ($visibility = $operation.visibility) #* *##if ($visibility == "public") /** $operation.getDocumentation(" * ") */ #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) $visibility abstract $returnType $operation.signature throws $operation.exceptionList; #* *##else $visibility abstract $returnType $operation.signature; #* *##end #* *##end #**##end #end } |
From: Vance K. <va...@us...> - 2006-01-06 13:51:12
|
User: vancek Date: 06/01/06 05:50:35 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBeanImpl.vsl Log: extends fully qualified service name Revision Changes Path 1.3 +2 -4 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBeanImpl.vsl Index: SessionBeanImpl.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBeanImpl.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- SessionBeanImpl.vsl 3 Jan 2006 01:05:35 -0000 1.2 +++ SessionBeanImpl.vsl 6 Jan 2006 13:50:35 -0000 1.3 @@ -3,13 +3,11 @@ package $service.packageName; #end -import javax.ejb.SessionContext; - /** * @see ${service.fullyQualifiedServiceName} */ public class ${service.serviceImplementationName} - extends ${service.serviceName} + extends ${service.fullyQualifiedServiceName} { // --------------- Constructors --------------- @@ -46,7 +44,7 @@ #**##end } #end -#set ($operations = $service.operations) +#set ($operations = $service.businessOperations) #if (!$operations.empty) // -------- Business Methods -------------- |
From: Vance K. <va...@us...> - 2006-01-06 13:50:24
|
User: vancek Date: 06/01/06 05:49:35 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionBean.vsl Log: added transaction management annotation, denyAll & runAs annotations, UserTransaction resource injection, queue and queue connection factory resource injections. Revision Changes Path 1.3 +67 -12 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl Index: SessionBean.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionBean.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- SessionBean.vsl 3 Jan 2006 01:04:39 -0000 1.2 +++ SessionBean.vsl 6 Jan 2006 13:49:34 -0000 1.3 @@ -8,12 +8,15 @@ * Autogenerated EJB entity POJO class for the ${service.serviceName} session bean. * $service.getDocumentation(" * ") - * - * */ @javax.ejb.${service.type} -#if ($service.transactionType) +#if ($service.transactionManagement) +...@ja...ansactionManagement(javax.ejb.TransactionManagementType.${service.transactionManagement}) +#end +#if (!$service.transactionManagementBean) +#**##if ($service.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${service.transactionType}) +#**##end #end @javax.ejb.CallbackListener(${service.fullyQualifiedServiceListenerName}.class) #if ($service.securityDomain) @@ -23,9 +26,14 @@ #end #if ($service.permitAll) @javax.annotation.security.PermitAll +#elseif ($service.denyAll) +...@ja...nyAll #elseif ($service.rolesAllowed) @javax.annotation.security.RolesAllowed({${service.rolesAllowed}}) #end +#if ($service.runAs) +...@ja...nAs("${service.runAs}") +#end public abstract class ${service.serviceName} #if($service.generalization) extends ${service.generalization.fullyQualifiedName}BeanImpl @@ -35,7 +43,14 @@ // ------ Session Context Injection ------ @javax.annotation.Resource - javax.ejb.SessionContext context; + protected javax.ejb.SessionContext context; +#if ($service.transactionManagementBean) + + // ---------- User Transaction Injection --------- + + @javax.annotation.Resource + protected javax.transaction.UserTransaction userTrans; +#end // ------ Persistence Context Definitions -------- @@ -60,18 +75,47 @@ #end #set ($references = $service.serviceReferences) #if (!$references.empty) -#**##foreach ($dependency in $references) -#* *##set ($reference = $dependency.targetElement) // ------ EJB Injection Definitions -------- +#**##foreach ($dependency in $references) +#* *##set ($reference = $dependency.targetElement) /** - * Inject session EJB ${reference.name}; + * Inject session EJB ${reference.name} */ @javax.annotation.EJB protected ${reference.fullyQualifiedServiceName} $stringUtils.uncapitalize(${reference.name}); #**##end #end +#set ($mdbReferences = $service.messageDrivenReferences) +#if (!$mdbReferences.empty) + + // ------ Message Driven EJB Injection Definitions -------- + +#**##foreach ($dependency in $mdbReferences) +#* *##set ($reference = $dependency.targetElement) +#* *##if ($reference.destinationTypeQueue) +#* *##if (!$queueConnectionFactoryDefined) + @javax.annotation.Resource(name = "ConnectionFactory") + protected javax.jms.QueueConnectionFactory queueFactory; +#* *##set ($queueConnectionFactoryDefined = true) + +#* *##end +#* *##elseif ($reference.destinationTypeTopic) +#* *##if (!$topicConnectionFactoryDefined) + @javax.annotation.Resource(name = "ConnectionFactory") + protected javax.jms.TopicConnectionFactory topicFactory; +#* *##set ($topicConnectionFactoryDefined = true) + +#* *##end +#* *##end + /** + * Inject ${reference.destinationType} + */ + @javax.annotation.Resource(name = "${reference.destination}") + protected #if ($reference.destinationTypeQueue)javax.jms.Queue#elseif ($reference.destinationTypeTopic)javax.jms.Topic#end $stringUtils.uncapitalize(${reference.name}); +#**##end +#end #set ($constants = $service.getConstants(true)) #if (!$constants.empty) @@ -150,9 +194,11 @@ * Get the ${attribute.name} property $attribute.getDocumentation(" * ") */ +#* *##if (!$service.transactionManagementBean) #* *##if ($attribute.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${attribute.transactionType}) #* *##end +#* *##end $visibility $attribute.type.fullyQualifiedName ${attribute.getterName}() { return $attribute.name; @@ -164,9 +210,11 @@ * Set the $attribute.name property * @param value the new value */ +#* *##if (!$service.transactionManagementBean) #* *##if ($attribute.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${attribute.transactionType}) #* *##end +#* *##end $visibility void ${attribute.setterName}($attribute.type.fullyQualifiedName value) { this.$attribute.name = value; @@ -183,19 +231,26 @@ #**##foreach ($operation in $operations) #* *##set ($visibility = $operation.visibility) +## Only public methods have transactions and are exported to the interfaces #* *##if ($visibility == "public") /** $operation.getDocumentation(" * ") -## Only public methods have transactions and are exported to the interfaces */ +#* *##if (!$service.transactionManagementBean) #* *##if ($operation.transactionType) @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${operation.transactionType}) #* *##end +#* *##end #* *##if ($operation.permitAll) @javax.annotation.security.PermitAll +#* *##elseif ($operation.denyAll) + @javax.annotation.security.DenyAll #* *##elseif ($operation.rolesAllowed) @javax.annotation.security.RolesAllowed({${operation.rolesAllowed}}) #* *##end +#* *##if ($operation.flushMode) + @javax.persistence.FlushMode(javax.persistence.FlushModeType.${operation.flushMode}) +#* *##end #* *##set ($returnType = $operation.returnType.fullyQualifiedName) #* *##if ($operation.exceptionsPresent) $visibility abstract $returnType $operation.signature throws $operation.exceptionList; |
From: Vance K. <va...@us...> - 2006-01-06 13:46:16
|
User: vancek Date: 06/01/06 05:46:07 Modified: andromda-ejb3/src/main/resources/templates/ejb3 Entity.vsl Log: fixed comments and removed transaction annotation from entity bean Revision Changes Path 1.3 +55 -54 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl Index: Entity.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/Entity.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- Entity.vsl 3 Jan 2006 01:03:14 -0000 1.2 +++ Entity.vsl 6 Jan 2006 13:46:06 -0000 1.3 @@ -44,28 +44,40 @@ { private static final long serialVersionUID = ${entity.serialVersionUID}L; +#set ($constants = $entity.getConstants(true)) +#if (!$constants.empty) - // ----------- constant definitions ------------- -#foreach($constant in $entity.getConstants(true)) + // ----------- Constant Definitions ------------- + +#**##foreach($constant in $constants) @javax.persistence.Transient private static final $constant.type.fullyQualifiedName $constant.name = $constant.defaultValue; +#**##end #end +#set ($attributes = $entity.attributes) +#if (!$attributes.empty) - // ----------- attribute definitions ------------ -#foreach ( $attribute in $entity.attributes) + // ----------- Attribute Definitions ------------ + +#**##foreach ($attribute in $attributes) private $attribute.type.fullyQualifiedName $attribute.name; +#**##end #end +#set ($entityRelations = $entity.allEntityRelations) +#if (!$entityRelations.empty) - // --------- relationship definitions ----------- -#foreach ($associationEnd in $entity.allEntityRelations) -#**##if ($associationEnd.one2Many || $associationEnd.many2Many) + // --------- Relationship Definitions ----------- + +#**##foreach ($associationEnd in $entityRelations) +#**##**##if ($associationEnd.one2Many || $associationEnd.many2Many) private $associationEnd.relationType<${associationEnd.otherEnd.type.name}> ${associationEnd.otherEnd.name}; -#**##else +#**##**##else private $associationEnd.relationType ${associationEnd.otherEnd.name}; +#**##**##end #**##end #end - // --------------- constructors ----------------- + // --------------- Constructors ----------------- public ${entity.entityName}() { @@ -138,7 +150,7 @@ } #end - // --------- accessors for constants ---------- + // --------- Constant Accessors ---------- #foreach($constant in $entity.getConstants(true)) /** * Get the <code>$constant.name</code> constant @@ -149,9 +161,11 @@ return $constant.name; } #end +#if (!$attributes.empty) + + // -------- Attribute Accessors ---------- - // -------- attribute getters/setters ---------- -#foreach ($attribute in $entity.attributes) +#**##foreach ($attribute in $entity.attributes) #**##set ($visibility = $attribute.visibility) /** * Get the $attribute.name property. @@ -174,9 +188,6 @@ ## LOB type is specified - also sepcify FetchType if set to EAGER since default fetch type for LOB annotation is LAZY @javax.persistence.Lob(type = javax.persistence.LobType.${attribute.lobType}#if ($attribute.eager), fetch = javax.persistence.FetchType.EAGER#end) #**##end -#**##if ($attribute.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${attribute.transactionType}) -#**##end @javax.persistence.Column(name = "${attribute.columnName}"#if ($attribute.unique), unique = ${attribute.unique}#end#if (!$attribute.columnNullable), nullable = ${attribute.columnNullable}#end#if ($attribute.columnLength), length = ${attribute.columnLength}#end#if ($attribute.columnDefinition), columnDefinition = "${attribute.columnDefinition}"#end#if ($attribute.columnPrecision), precision = ${attribute.columnPrecision}#end#if ($attribute.columnScale), scale = ${attribute.columnScale}#end) ## Only add the fetch type property for LAZY hints - default is EAGER #**##if ($attribute.lazy) @@ -199,9 +210,10 @@ } #**##end +#**##end #end - // ------------- relations ------------------ + // ------------- Relations ------------------ #foreach ($associationEnd in $entity.allEntityRelations) #**##set ($target = $associationEnd.otherEnd) @@ -219,9 +231,6 @@ #* *##set ($argExists = false) @javax.persistence.ManyToOne(#if (!$target.optional)optional = false#set ($argExists = true)#end#if ($target.cascadeType)#if ($argExists), #end#**#cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($target.lazy)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.LAZY#end) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; @@ -251,9 +260,6 @@ */ #* *##set ($argExists = false) @javax.persistence.OneToMany(#if ($target.cascadeType)cascade = {${target.cascadeType}}#set ($argExists = true)#end#if ($associationEnd.navigable)#if ($argExists) ,#end#**#mappedBy="${associationEnd.name}"#set ($argExists = true)#end#if ($target.eager)#if ($argExists), #end#**#fetch = javax.persistence.FetchType.EAGER#end) -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") @@ -289,9 +295,6 @@ #* *##if($associationEnd.owning) @javax.persistence.JoinColumn(name = "$stringUtils.upperCase(${target.name})"#if ($associationEnd.columnDefinition), columnDefinition = "${associationEnd.columnDefinition}"#end) #* *##end -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end public $associationEnd.relationType ${target.getterName}() { return this.${target.name}; @@ -323,9 +326,6 @@ #* *##if(($associationEnd.owning) && ${associationEnd.association.tableName}) @javax.persistence.JoinTable(table = @javax.persistence.Table(name = "${associationEnd.association.tableName}")) #* *##end -#* *##if ($associationEnd.association.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${$associationEnd.association.transactionType}) -#* *##end #* *##if ($target.hasTaggedValue("@andromda.persistence.orderBy")) #* *##if ($stringUtils.isNotEmpty(${target.orderByClause})) @javax.persistence.OrderBy("${target.orderByClause}") @@ -350,7 +350,7 @@ #**##end #end - // ----------------- finder method ------------------ + // ----------------- Finder Method ------------------ #foreach ($finder in $entity.getQueryOperations(true)) #**##set ($returnType = $finder.returnType.fullyQualifiedName) @@ -397,17 +397,17 @@ } #end## finder operations - // --------------- business methods ----------------- +#set ($businessOperations = $entity.businessOperations) +#if (!$businessOperations.empty) + + // --------------- Business Methods ----------------- -#foreach ($operation in $entity.businessOperations) +#**##foreach ($operation in ) #**##set ($signature = $operation.signature) #**##set ($visibility = $operation.visibility.toString()) /** $operation.getDocumentation(" * ") */ -#**##if ($operation.transactionType) - @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.${operation.transactionType}) -#**##end #**##set ($returnType = $operation.returnType.fullyQualifiedName) #**##if ($operation.exceptionsPresent) $visibility abstract $returnType $signature @@ -415,5 +415,6 @@ #**##else $visibility abstract $returnType $signature; #**##end +#**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-04 06:12:26
|
User: vancek Date: 06/01/03 22:12:19 Modified: andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml Log: added new entity-config outlet property, JDBC property group and Cache property group Revision Changes Path 1.3 +75 -4 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- namespace.xml 3 Jan 2006 01:13:03 -0000 1.2 +++ namespace.xml 4 Jan 2006 06:12:19 -0000 1.3 @@ -20,15 +20,21 @@ </documentation> <property name="entity-beans"> <documentation> - The directory to which Entity EJBs are generated. + The directory to which Entity POJOs are generated. </documentation> </property> <property name="entity-impls"> <documentation> - The location to which Entity EJB implementation + The location to which Entity POJO implementation files are generated. </documentation> </property> + <property name="entity-config"> + <documentation> + The location where the persistence XML descriptor + is generated. + </documentation> + </property> <property name="session-beans"> <documentation> The directory to which Session Bean files are @@ -42,6 +48,71 @@ </documentation> </property> </propertyGroup> + <propertyGroup name="JDBC"> + <property name="entityManagerName" required="false"> + <documentation> + The name assigned to the entity manager. If no name + is specified, the name of the containing persistence + archive without the .par extension is used. + </documentation> + </property> + <property name="entityManagerJTADataSource"> + <default>java:/DefaultDS</default> + <documentation> + Specifies the global JNDI name of the JTA data source. + </documentation> + </property> + <property name="hibernateHbm2DDLAuto" required="false"> + <default>create</default> + <documentation> + Automatically export schema DDL to the database when deployed. + With create-drop, the database schema will be dropped when + the entity is undeployed. Permitted values are: + <ul> + <li>update</li> + <li>create</li> + <li>create-drop</li> + <li>none</li> + </ul> + </documentation> + </property> + <property name="hibernateDialect" required="false"> + <default>org.hibernate.dialect.MySQLDialect</default> + <documentation> + The SQL dialect of the database. + <ul> + <li>org.hibernate.dialect.MySQLDialect</li> + <li>org.hibernate.dialect.HSQLDialect</li> + </ul> + </documentation> + </property> + <property name="hibernateShowSql" required="false"> + <documentation> + Whether or not to log SQL statements. + </documentation> + </property> + </propertyGroup> + <propertyGroup name="Cache"> + <property name="hibernateCacheProvider" required="false"> + <documentation> + Defines Hibernate Cache Provider implementation class. + Possible values for JBoss4/Hibernate are: + <ul> + <li>org.hibernate.cache.HashtableCacheProvider</li> + <li>org.jboss.ejb3.entity.TreeCacheProviderHook</li> + </ul> + </documentation> + </property> + <property name="hibernateTreecacheMbeanObject" required="false"> + <documentation> + Defines the Hibernate cache MBean object name + used in JBoss4. + <ul> + <li>jboss.cache:service=EJB3EntityTreeCache</li> + </ul> + </documentation> + </property> + </propertyGroup> <propertyGroup name="Name Patterns"> <property name="entityNamePattern"> <default>{0}</default> @@ -301,8 +372,8 @@ <default>Default</default> <documentation> Specifies the default security domain to use - for role based authorization. JBoss uses the - security model to match allowed roles. + for role based authorization. Use the + security realm to match allowed roles. </documentation> </property> <property name="queryUseNamedParameters"> |
From: Vance K. <va...@us...> - 2006-01-04 06:10:45
|
User: vancek Date: 06/01/03 22:10:36 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added new persistence.xml.vsl template element Revision Changes Path 1.3 +138 -107 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- cartridge.xml 3 Jan 2006 01:09:23 -0000 1.2 +++ cartridge.xml 4 Jan 2006 06:10:36 -0000 1.3 @@ -9,7 +9,16 @@ <!-- cartridge-resource merge-point --> - <template path="templates/ejb3/Entity.vsl" + <property reference="entityManagerName"/> + <property reference="entityManagerJTADataSource"/> + <property reference="hibernateHbm2DDLAuto"/> + <property reference="hibernateDialect"/> + <property reference="hibernateShowSql"/> + <property reference="hibernateCacheProvider"/> + <property reference="hibernateTreecacheMbeanObject"/> + + <template + path="templates/ejb3/Entity.vsl" outputPattern="{0}/{1}.java" outlet="entity-beans" overwrite="true"> @@ -20,7 +29,8 @@ </modelElements> </template> - <template path="templates/ejb3/EntityImpl.vsl" + <template + path="templates/ejb3/EntityImpl.vsl" outputPattern="{0}/{1}Impl.java" outlet="entity-impls" overwrite="false"> @@ -31,7 +41,8 @@ </modelElements> </template> - <template path="templates/ejb3/EntityListener.vsl" + <template + path="templates/ejb3/EntityListener.vsl" outputPattern="{0}/{1}Listener.java" outlet="entity-impls" overwrite="false"> @@ -42,6 +53,21 @@ </modelElements> </template> + <template + path="templates/ejb3/persistence.xml.vsl" + outputPattern="META-INF/persistence.xml" + outlet="entity-config" + overwrite="true" + outputToSingleFile="true" + outputOnEmptyElements="false"> + <modelElements variable="entities"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade"> + </type> + </modelElement> + </modelElements> + </template> + <!-- The following definitions map services to session beans. The templates map a service to a session bean @@ -50,7 +76,8 @@ (Matthias Bohlen) --> - <template path="templates/ejb3/SessionBean.vsl" + <template + path="templates/ejb3/SessionBean.vsl" outputPattern="{0}/{1}Bean.java" outlet="session-beans" overwrite="true"> @@ -61,7 +88,8 @@ </modelElements> </template> - <template path="templates/ejb3/SessionLocal.vsl" + <template + path="templates/ejb3/SessionLocal.vsl" outputPattern="{0}/{1}Local.java" outlet="session-beans" overwrite="true" @@ -73,7 +101,8 @@ </modelElements> </template> - <template path="templates/ejb3/SessionRemote.vsl" + <template + path="templates/ejb3/SessionRemote.vsl" outputPattern="{0}/{1}Remote.java" outlet="session-beans" overwrite="true" @@ -85,7 +114,8 @@ </modelElements> </template> - <template path="templates/ejb3/SessionBeanImpl.vsl" + <template + path="templates/ejb3/SessionBeanImpl.vsl" outputPattern="{0}/{1}BeanImpl.java" outlet="session-impls" overwrite="false"> @@ -96,7 +126,8 @@ </modelElements> </template> - <template path="templates/ejb3/SessionListener.vsl" + <template + path="templates/ejb3/SessionListener.vsl" outputPattern="{0}/{1}Listener.java" outlet="session-impls" overwrite="false"> |
From: Vance K. <va...@us...> - 2006-01-04 06:09:39
|
User: vancek Date: 06/01/03 22:09:33 Added: andromda-ejb3/src/main/resources/templates/ejb3 persistence.xml.vsl Log: initial revision of template for persistence.xml generation Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/persistence.xml.vsl Index: persistence.xml.vsl =================================================================== <?xml version="1.0" encoding="UTF-8"?> <!-- Attention: Generated code! Do not modify by hand! Generated by: persistence.xml.vsl in andromda-ejb3-cartridge. --> <entity-manager> #if ($stringUtils.isNotBlank($entityManagerName)) <name>${entityManagerName}</name> #end #if ($stringUtils.isNotBlank($entityManagerJTADataSource)) <jta-data-source>${entityManagerJTADataSource}</jta-data-source> #end <properties> #if ($stringUtils.isNotBlank($hibernateHbm2DDLAuto)) <property name="hibernate.hbm2ddl.auto" value="${hibernateHbm2DDLAuto}"/> #end #if ($stringUtils.isNotBlank($hibernateShowSql)) <property name="show_sql" value="${hibernateShowSql}"/> #end #if ($stringUtils.isNotBlank($hibernateDialect)) <property name="hibernate.dialect" value="${hibernateDialect}"/> #end #if ($stringUtils.isNotBlank($hibernateCacheProvider)) <property name="hibernate.cache.provider_class" value="${hibernateCacheProvider}"/> #end #if ($stringUtils.isNotBlank($hibernateTreecacheMbeanObject)) <property name="hibernate.treecache.mbean.object_name" value="${hibernateTreecacheMbeanObject}"/> #end </properties> </entity-manager> |
From: Vance K. <va...@us...> - 2006-01-03 01:44:15
|
User: vancek Date: 06/01/02 17:44:08 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionOperationFacadeLogicImpl.java Log: Added session bean operation methods Revision Changes Path 1.2 +125 -2 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionOperationFacadeLogicImpl.java Index: EJB3SessionOperationFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3SessionOperationFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3SessionOperationFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3SessionOperationFacadeLogicImpl.java 3 Jan 2006 01:44:07 -0000 1.2 @@ -1,5 +1,11 @@ package org.andromda.cartridges.ejb3.metafacades; +import org.andromda.cartridges.ejb3.EJB3Globals; +import org.andromda.cartridges.ejb3.EJB3Profile; +import org.apache.commons.lang.BooleanUtils; +import org.apache.commons.lang.ObjectUtils; +import org.apache.commons.lang.StringUtils; + /** * MetafacadeLogic implementation for org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacade. @@ -20,8 +26,125 @@ */ protected java.lang.String handleGetViewType() { - // TODO: put your implementation here. - return null; + String viewType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_VIEWTYPE); + if (StringUtils.isEmpty(viewType)) + { + EJB3SessionFacade sessionFacade = (EJB3SessionFacade)this.getOwner(); + if (StringUtils.isNotEmpty(sessionFacade.getViewType())) + { + viewType = sessionFacade.getViewType(); + } + else + { + viewType = EJB3Globals.VIEW_TYPE_BOTH; + } + } + return viewType; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsViewTypeRemote() + */ + protected boolean handleIsViewTypeRemote() + { + boolean isRemote = false; + if (this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_REMOTE)) + { + isRemote = true; + } + return isRemote; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsViewTypeLocal() + */ + protected boolean handleIsViewTypeLocal() + { + boolean isLocal = false; + if (this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_LOCAL)) + { + isLocal = true; + } + return isLocal; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsViewTypeBoth() + */ + protected boolean handleIsViewTypeBoth() + { + boolean isBoth = false; + if (this.getViewType().equalsIgnoreCase(EJB3Globals.VIEW_TYPE_BOTH)) + { + isBoth = true; + } + return isBoth; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleGetTransactionType() + */ + protected String handleGetTransactionType() + { + String transType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_TRANSACTION_TYPE); + if (StringUtils.isNotBlank(transType)) + { + transType = EJB3MetafacadeUtils.convertTransactionType(transType); + } + else + { + transType = StringUtils.trimToEmpty( + ObjectUtils.toString(this.getConfiguredProperty(EJB3Globals.TRANSACTION_TYPE))); + } + return transType; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsBusinessOperation() + */ + protected boolean handleIsBusinessOperation() + { + return !this.hasStereotype(EJB3Profile.STEREOTYPE_CREATE_METHOD); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleGetRolesAllowed() + */ + protected String handleGetRolesAllowed() + { + String rolesAllowedStr = null; + final String tmpRoles = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED); + if (StringUtils.isNotBlank(tmpRoles)) + { + StringBuffer rolesAllowed = new StringBuffer(); + final String[] roles = StringUtils.split(tmpRoles, ','); + for (int i = 0; i < roles.length; i++) + { + if (i > 0) + { + rolesAllowed.append(", "); + } + rolesAllowed.append('"'); + rolesAllowed.append(roles[i]); + rolesAllowed.append('"'); + } + rolesAllowedStr = rolesAllowed.toString(); + } + return rolesAllowedStr; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogic#handleIsPermitAll() + */ + protected boolean handleIsPermitAll() + { + boolean permitAll = false; + String permitAllStr = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_PERMIT_ALL); + if (StringUtils.isNotBlank(permitAllStr)) + { + permitAll = BooleanUtils.toBoolean(permitAllStr); + } + return permitAll; } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:43:51
|
User: vancek Date: 06/01/02 17:43:43 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3SessionFacadeLogicImpl.java Log: added and fixed session bean methods Revision Changes Path 1.2 +231 -21 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.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3SessionFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3SessionFacadeLogicImpl.java 3 Jan 2006 01:43:43 -0000 1.2 @@ -2,12 +2,17 @@ import java.text.MessageFormat; import java.util.Collection; +import java.util.Iterator; import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacade; +import org.andromda.metafacades.uml.DependencyFacade; +import org.andromda.metafacades.uml.ModelElementFacade; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.Predicate; +import org.apache.commons.lang.BooleanUtils; +import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.StringUtils; @@ -74,9 +79,9 @@ public boolean evaluate(Object object) { boolean businessOperation = false; - if (EJB3OperationFacade.class.isAssignableFrom(object.getClass())) + if (EJB3SessionOperationFacade.class.isAssignableFrom(object.getClass())) { - businessOperation = ((EJB3OperationFacade)object).isBusinessOperation(); + businessOperation = ((EJB3SessionOperationFacade)object).isBusinessOperation(); } return businessOperation; } @@ -137,7 +142,17 @@ */ protected boolean handleIsStateful() { - return !isStateless(); + boolean isStateful = false; + String sessionType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_TYPE); + if (StringUtils.isBlank(sessionType)) + { + isStateful = !isStateless(); + } + else + { + isStateful = sessionType.equalsIgnoreCase(EJB3Globals.SERVICE_TYPE_STATEFUL); + } + return isStateful; } /** @@ -145,7 +160,17 @@ */ protected boolean handleIsStateless() { - return this.getAllInstanceAttributes() == null || this.getAllInstanceAttributes().isEmpty(); + boolean isStateless = false; + String sessionType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_TYPE); + if (StringUtils.isBlank(sessionType)) + { + isStateless = this.getAllInstanceAttributes() == null || this.getAllInstanceAttributes().isEmpty(); + } + else + { + isStateless = sessionType.equalsIgnoreCase(EJB3Globals.SERVICE_TYPE_STATELESS); + } + return isStateless; } /** @@ -153,12 +178,16 @@ */ protected java.lang.String handleGetType() { - String type = "Stateful"; + String sessionType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SESSION_TYPE); + if (StringUtils.isBlank(sessionType)) + { + sessionType = "Stateful"; if (this.isStateless()) { - type = "Stateless"; + sessionType = "Stateless"; + } } - return type; + return sessionType; } /** @@ -166,7 +195,8 @@ */ protected java.lang.String handleGetViewType() { - return EJB3MetafacadeUtils.getViewType(this); + return EJB3MetafacadeUtils.getViewType(this, + String.valueOf(this.getConfiguredProperty(EJB3Globals.SESSION_DEFAULT_VIEW_TYPE))); } /** @@ -183,7 +213,11 @@ protected java.lang.String handleGetTransactionType() { String transactionType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_TRANSACTION_TYPE); - if (StringUtils.isBlank(transactionType)) + if (StringUtils.isNotBlank(transactionType)) + { + transactionType = EJB3MetafacadeUtils.convertTransactionType(transactionType); + } + else { transactionType = transactionType = String.valueOf(this.getConfiguredProperty(EJB3Globals.TRANSACTION_TYPE)); @@ -215,7 +249,7 @@ return EJB3MetafacadeUtils.getConstants(this, follow); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetServiceName() */ protected String handleGetServiceName() @@ -227,7 +261,7 @@ new Object[] {StringUtils.trimToEmpty(this.getName())}); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetServiceLocalInterfaceName() */ protected String handleGetServiceLocalInterfaceName() @@ -240,7 +274,7 @@ new Object[] {StringUtils.trimToEmpty(this.getName())}); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetServiceRemoteInterfaceName() */ protected String handleGetServiceRemoteInterfaceName() @@ -253,7 +287,7 @@ new Object[] {StringUtils.trimToEmpty(this.getName())}); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetServiceImplementationName() */ protected String handleGetServiceImplementationName() @@ -266,7 +300,7 @@ new Object[] {StringUtils.trimToEmpty(this.getName())}); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetServiceListenerName() */ protected String handleGetServiceListenerName() @@ -279,7 +313,18 @@ new Object[] {StringUtils.trimToEmpty(this.getName())}); } - /* (non-Javadoc) + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceName() + */ + protected String handleGetFullyQualifiedServiceName() + { + return EJB3MetafacadeUtils.getFullyQualifiedName( + this.getPackageName(), + this.getServiceName(), + null); + } + + /** * @see org.andromda.cartridges.ejb3.metafacades. * EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceImplementationName() */ @@ -291,10 +336,10 @@ null); } - /* (non-Javadoc) - * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceListener() + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceListenerName() */ - protected String handleGetFullyQualifiedServiceListener() + protected String handleGetFullyQualifiedServiceListenerName() { return EJB3MetafacadeUtils.getFullyQualifiedName( this.getPackageName(), @@ -302,7 +347,7 @@ null); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades. * EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceLocalInterfaceName() */ @@ -314,7 +359,7 @@ null); } - /* (non-Javadoc) + /** * @see org.andromda.cartridges.ejb3.metafacades. * EJB3SessionFacadeLogic#handleGetFullyQualifiedServiceRemoteInterfaceName() */ @@ -326,4 +371,169 @@ null); } + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetPersistenceContextUnitName() + */ + protected String handleGetPersistenceContextUnitName() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_UNIT_NAME); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetPersistenceContextType() + */ + protected String handleGetPersistenceContextType() + { + return (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_TYPE); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetPersistenceContextReferences() + */ + protected Collection handleGetPersistenceContextReferences() + { + Collection references = this.getSourceDependencies(); + CollectionUtils.filter(references, new Predicate() + { + public boolean evaluate(Object object) + { + ModelElementFacade targetElement = ((DependencyFacade)object).getTargetElement(); + return (targetElement != null + && EJB3SessionFacade.class.isAssignableFrom(targetElement.getClass()) + && targetElement.hasStereotype(EJB3Profile.STEREOTYPE_PERSISTENCE_CONTEXT)); + } + }); + return references; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#getServiceReferences() + * + * Returns the Collection of DependencyFacades where the target is a Service ONLY. + */ + public Collection getServiceReferences() + { + Collection references = super.getServiceReferences(); + CollectionUtils.filter(references, new Predicate() + { + public boolean evaluate(Object object) + { + ModelElementFacade targetElement = ((DependencyFacade)object).getTargetElement(); + return targetElement.hasStereotype(EJB3Profile.STEREOTYPE_SERVICE); + } + }); + return references; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic# + * handleGetAttributesAsList(java.util.Collection, boolean, boolean) + */ + protected String handleGetAttributesAsList(Collection attributes, boolean includeTypes, boolean includeNames) + { + if (!includeNames && !includeTypes || attributes == null) + { + return ""; + } + + StringBuffer sb = new StringBuffer(); + String separator = ""; + + for (final Iterator it = attributes.iterator(); it.hasNext();) + { + EJB3SessionAttributeFacade attr = (EJB3SessionAttributeFacade)it.next(); + sb.append(separator); + separator = ", "; + if (includeTypes) + { + sb.append(attr.getType().getFullyQualifiedName()); + sb.append(" "); + } + if (includeNames) + { + sb.append(attr.getName()); + } + } + return sb.toString(); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetPersistenceContainer() + */ + protected String handleGetPersistenceContainer() + { + return StringUtils.trimToEmpty( + ObjectUtils.toString(this.getConfiguredProperty(EJB3Globals.PERSISTENCE_CONTAINER))); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleIsPersistenceContainerJboss() + */ + protected boolean handleIsPersistenceContainerJboss() + { + return getPersistenceContainer().equalsIgnoreCase(EJB3Globals.PERSISTENCE_CONTAINER_JBOSS); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleIsPersistenceContainerWeblogic() + */ + protected boolean handleIsPersistenceContainerWeblogic() + { + return getPersistenceContainer().equalsIgnoreCase(EJB3Globals.PERSISTENCE_CONTAINER_WEBLOGIC); + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetRolesAllowed() + */ + protected String handleGetRolesAllowed() + { + String rolesAllowedStr = null; + final String tmpRoles = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED); + if (StringUtils.isNotBlank(tmpRoles)) + { + StringBuffer rolesAllowed = new StringBuffer(); + final String[] roles = StringUtils.split(tmpRoles, ','); + for (int i = 0; i < roles.length; i++) + { + if (i > 0) + { + rolesAllowed.append(", "); + } + rolesAllowed.append('"'); + rolesAllowed.append(roles[i]); + rolesAllowed.append('"'); + } + rolesAllowedStr = rolesAllowed.toString(); + } + return rolesAllowedStr; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleIsPermitAll() + */ + protected boolean handleIsPermitAll() + { + boolean permitAll = false; + String permitAllStr = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_PERMIT_ALL); + if (StringUtils.isNotBlank(permitAllStr)) + { + permitAll = BooleanUtils.toBoolean(permitAllStr); + } + return permitAll; + } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogic#handleGetSecurityDomain() + */ + protected String handleGetSecurityDomain() + { + String securityDomain = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_SECURITY_DOMAIN); + if (StringUtils.isBlank(securityDomain)) + { + securityDomain = StringUtils.trimToEmpty( + ObjectUtils.toString(this.getConfiguredProperty(EJB3Globals.SECURITY_DOMAIN))); + } + return securityDomain; + } + } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:40:59
|
User: vancek Date: 06/01/02 17:40:54 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3OperationFacadeLogicImpl.java Log: fixed transaction type return value to support ejb3 style Revision Changes Path 1.2 +1 -24 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3OperationFacadeLogicImpl.java Index: EJB3OperationFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3OperationFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3OperationFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3OperationFacadeLogicImpl.java 3 Jan 2006 01:40:54 -0000 1.2 @@ -32,30 +32,7 @@ String transType = (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_TRANSACTION_TYPE, true); if (StringUtils.isNotBlank(transType)) { - if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_MANDATORY)) - { - transType = "MANDATORY"; - } - else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_NEVER)) - { - transType = "NEVER"; - } - else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_NOT_SUPPORTED)) - { - transType = "NOT_SUPPORTED"; - } - else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_REQUIRED)) - { - transType = "REQUIRED"; - } - else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_REQUIRES_NEW)) - { - transType = "REQUIRES_NEW"; - } - else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_SUPPORTS)) - { - transType = "SUPPORTS"; - } + transType = EJB3MetafacadeUtils.convertTransactionType(transType); } else { |
From: Vance K. <va...@us...> - 2006-01-03 01:39:58
|
User: vancek Date: 06/01/02 17:39:53 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3MetafacadeUtils.java Log: changed getViewType signature and added convertTransacionType method Revision Changes Path 1.2 +66 -15 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MetafacadeUtils.java Index: EJB3MetafacadeUtils.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3MetafacadeUtils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3MetafacadeUtils.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3MetafacadeUtils.java 3 Jan 2006 01:39:53 -0000 1.2 @@ -1,5 +1,6 @@ package org.andromda.cartridges.ejb3.metafacades; +import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.andromda.core.common.ExceptionUtils; import org.andromda.metafacades.uml.AttributeFacade; @@ -20,6 +21,7 @@ * Contains utilities for use with EJB metafacades. * * @author Chad Brandon + * @author Vance Karimi */ class EJB3MetafacadeUtils { @@ -82,38 +84,49 @@ } /** - * Gets the view type for the passed in <code>classifier</code>. Returns 'local' if the model element has the entity - * stereotype, others checks there ejb tagged value and if there is no value defined, returns 'remote'. + * Gets the view type for the passed in <code>classifier</code>. If no + * view type can be retrieved from the <code>classifier</code>, then the + * <code>defaultViewType</code> is returned. * + * If the model element has the entity stereotype, returns 'local'. + * Otherwise (session ejb) checks the ejb tagged value and if there is + * no value defined, returns 'remote'. + * + * @param classifier The classifier to lookup the view type tagged value + * @param defaultViewType The default view type if one is not found * @return String the view type name. */ - static String getViewType(ClassifierFacade classifier) + static String getViewType( + ClassifierFacade classifier, + String defaultViewType) { final String methodName = "EJBMetafacadeUtils.getViewType"; ExceptionUtils.checkNull(methodName, "classifer", classifier); - String viewType = "local"; - if (classifier.hasStereotype(EJB3Profile.STEREOTYPE_SERVICE)) + String viewType = (String)classifier.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_VIEWTYPE); + if (classifier.hasStereotype(EJB3Profile.STEREOTYPE_ENTITY)) + { + if (StringUtils.isEmpty(viewType)) + { + viewType = (StringUtils.isNotBlank(defaultViewType) ? defaultViewType : EJB3Globals.VIEW_TYPE_LOCAL); + } + } + else if (classifier.hasStereotype(EJB3Profile.STEREOTYPE_SERVICE)) { - String viewTypeValue = (String)classifier.findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_VIEWTYPE); // if the view type wasn't found, search all super classes - if (StringUtils.isEmpty(viewTypeValue)) + if (StringUtils.isEmpty(viewType)) { viewType = (String)CollectionUtils.find(classifier.getAllGeneralizations(), new Predicate() { public boolean evaluate(Object object) { - return ((ModelElementFacade)object).findTaggedValue(EJB3Profile.TAGGEDVALUE_EJB_VIEWTYPE) != - null; + return ((ModelElementFacade)object).findTaggedValue( + EJB3Profile.TAGGEDVALUE_EJB_VIEWTYPE) != null; } }); } - if (StringUtils.isNotEmpty(viewTypeValue)) - { - viewType = viewTypeValue; - } - else + if (StringUtils.isEmpty(viewType)) { - viewType = "remote"; + viewType = (StringUtils.isNotBlank(defaultViewType) ? defaultViewType : EJB3Globals.VIEW_TYPE_REMOTE); } } return viewType.toLowerCase(); @@ -274,4 +287,42 @@ fullyQualifiedName.append(StringUtils.trimToEmpty(suffix)); return fullyQualifiedName.toString(); } + + /** + * Convert the transaction type from lower casing to upper casing. + * This maintains reusable tagged value enumeration from EJB + * implementation. + * + * @param transType + * @return + */ + static String convertTransactionType(String transType) + { + String type = null; + if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_MANDATORY)) + { + type = "MANDATORY"; + } + else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_NEVER)) + { + type = "NEVER"; + } + else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_NOT_SUPPORTED)) + { + transType = "NOT_SUPPORTED"; + } + else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_REQUIRED)) + { + type = "REQUIRED"; + } + else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_REQUIRES_NEW)) + { + type = "REQUIRES_NEW"; + } + else if (StringUtils.equalsIgnoreCase(transType, EJB3Globals.TRANSACTION_TYPE_SUPPORTS)) + { + type = "SUPPORTS"; + } + return type; + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:38:59
|
User: vancek Date: 06/01/02 17:38:53 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3FinderMethodArgumentFacadeLogicImpl.java Log: renamed constants Revision Changes Path 1.2 +6 -5 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3FinderMethodArgumentFacadeLogicImpl.java Index: EJB3FinderMethodArgumentFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3FinderMethodArgumentFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3FinderMethodArgumentFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3FinderMethodArgumentFacadeLogicImpl.java 3 Jan 2006 01:38:53 -0000 1.2 @@ -1,5 +1,6 @@ package org.andromda.cartridges.ejb3.metafacades; +import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.andromda.metafacades.uml.ClassifierFacade; import org.apache.commons.lang.StringUtils; @@ -34,15 +35,15 @@ if (!classifier.isPrimitive()) { if (classifier.isDateType()) { - temporalType = EJB3Profile.TEMPORALTYPE_DATE; + temporalType = EJB3Globals.TEMPORAL_TYPE_DATE; } else if (classifier.isTimeType()) { - temporalType = EJB3Profile.TEMPORALTYPE_TIME; + temporalType = EJB3Globals.TEMPORAL_TYPE_TIME; } else if (classifier.getName().equals("Timestamp")) { - temporalType = EJB3Profile.TEMPORALTYPE_TIMESTAMP; + temporalType = EJB3Globals.TEMPORAL_TYPE_TIMESTAMP; } } } @@ -60,7 +61,7 @@ (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_RESULT_TYPE); if (StringUtils.isNotBlank(resultType)) { - if (resultType.equalsIgnoreCase(EJB3Profile.FINDER_RESULTTYPE_FIRST)) + if (resultType.equalsIgnoreCase(EJB3Globals.FINDER_RESULT_TYPE_FIRST)) { firstResult = true; } @@ -78,7 +79,7 @@ (String)this.findTaggedValue(EJB3Profile.TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_RESULT_TYPE); if (StringUtils.isNotBlank(resultType)) { - if (resultType.equalsIgnoreCase(EJB3Profile.FINDER_RESULTTYPE_MAX)) + if (resultType.equalsIgnoreCase(EJB3Globals.FINDER_RESULT_TYPE_MAX)) { maxResults = true; } |
From: Vance K. <va...@us...> - 2006-01-03 01:38:10
|
User: vancek Date: 06/01/02 17:38:02 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityFacadeLogicImpl.java Log: refactored getAttributesAsList method from utils to here Revision Changes Path 1.2 +39 -1 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java Index: EJB3EntityFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3EntityFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3EntityFacadeLogicImpl.java 3 Jan 2006 01:38:01 -0000 1.2 @@ -239,7 +239,8 @@ */ protected java.lang.String handleGetViewType() { - return EJB3MetafacadeUtils.getViewType(this); + return EJB3MetafacadeUtils.getViewType(this, + String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_VIEW_TYPE))); } /** @@ -835,4 +836,41 @@ // Must the root class - Cannot have embeddable superclass in the middle of the hierarchy return isEmbeddableSuperclass && isRoot(); } + + /** + * @see org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogic# + * handleGetAttributesAsList(java.util.Collection, boolean, boolean) + */ + protected String handleGetAttributesAsList(Collection attributes, boolean includeTypes, boolean includeNames) + { + if (!includeNames && !includeTypes || attributes == null) + { + return ""; + } + + StringBuffer sb = new StringBuffer(); + String separator = ""; + + for (final Iterator it = attributes.iterator(); it.hasNext();) + { + //AttributeFacade attr = (AttributeFacade)it.next(); + EJB3EntityAttributeFacade attr = (EJB3EntityAttributeFacade)it.next(); + if (!attr.isVersion()) + { + sb.append(separator); + separator = ", "; + if (includeTypes) + { + sb.append(attr.getType().getFullyQualifiedName()); + sb.append(" "); + } + if (includeNames) + { + sb.append(attr.getName()); + } + } + + } + return sb.toString(); + } } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:36:38
|
User: vancek Date: 06/01/02 17:36:31 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3EntityAttributeFacadeLogicImpl.java Log: renamed fetch type and generator type constants Revision Changes Path 1.2 +8 -6 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java Index: EJB3EntityAttributeFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3EntityAttributeFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3EntityAttributeFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3EntityAttributeFacadeLogicImpl.java 3 Jan 2006 01:36:31 -0000 1.2 @@ -1,5 +1,8 @@ package org.andromda.cartridges.ejb3.metafacades; +import java.util.Collection; +import java.util.Iterator; + import org.andromda.cartridges.ejb3.EJB3Globals; import org.andromda.cartridges.ejb3.EJB3Profile; import org.apache.commons.lang.StringUtils; @@ -57,7 +60,7 @@ boolean isEager = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_EAGER)) + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_EAGER)) { isEager = true; } @@ -73,7 +76,7 @@ boolean isLazy = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_LAZY)) { + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_LAZY)) { isLazy = true; } } @@ -113,7 +116,7 @@ genType = String.valueOf(this.getConfiguredProperty(EJB3Globals.ENTITY_DEFAULT_GENERATOR_TYPE)); if (StringUtils.isBlank(genType)) { - genType = EJB3Profile.GENERATORTYPE_AUTO; + genType = EJB3Globals.GENERATOR_TYPE_AUTO; } } return genType; @@ -158,7 +161,7 @@ boolean isSequence = false; if (StringUtils.isNotBlank(this.getGeneratorType())) { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Profile.GENERATORTYPE_SEQUENCE)) + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_SEQUENCE)) { isSequence = true; } @@ -174,7 +177,7 @@ boolean isTable = false; if (StringUtils.isNotBlank(this.getGeneratorType())) { - if (this.getGeneratorType().equalsIgnoreCase(EJB3Profile.GENERATORTYPE_TABLE)) + if (this.getGeneratorType().equalsIgnoreCase(EJB3Globals.GENERATOR_TYPE_TABLE)) { isTable = true; } @@ -320,5 +323,4 @@ } return isTransient; } - } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:35:04
|
User: vancek Date: 06/01/02 17:34:57 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades EJB3AssociationEndFacadeLogicImpl.java Log: renamed fetch type constants Revision Changes Path 1.2 +4 -4 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3AssociationEndFacadeLogicImpl.java Index: EJB3AssociationEndFacadeLogicImpl.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/metafacades/EJB3AssociationEndFacadeLogicImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3AssociationEndFacadeLogicImpl.java 28 Dec 2005 00:32:55 -0000 1.1 +++ EJB3AssociationEndFacadeLogicImpl.java 3 Jan 2006 01:34:57 -0000 1.2 @@ -117,11 +117,11 @@ { if (this.getOtherEnd().isOne2Many() || this.getOtherEnd().isMany2Many()) { - fetchType = EJB3Profile.FETCHTYPE_LAZY; + fetchType = EJB3Globals.FETCH_TYPE_LAZY; } else { - fetchType = EJB3Profile.FETCHTYPE_EAGER; + fetchType = EJB3Globals.FETCH_TYPE_EAGER; } } @@ -136,7 +136,7 @@ boolean isEager = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_EAGER)) + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_EAGER)) { isEager = true; } @@ -152,7 +152,7 @@ boolean isLazy = false; if (StringUtils.isNotBlank(this.getFetchType())) { - if (this.getFetchType().equalsIgnoreCase(EJB3Profile.FETCHTYPE_LAZY)) + if (this.getFetchType().equalsIgnoreCase(EJB3Globals.FETCH_TYPE_LAZY)) { isLazy = true; } |
From: Vance K. <va...@us...> - 2006-01-03 01:33:50
|
User: vancek Date: 06/01/02 17:33:44 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3ScriptHelper.java Log: refactored getAttributesAsList out to the session facade Revision Changes Path 1.2 +1 -44 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java Index: EJB3ScriptHelper.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3ScriptHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3ScriptHelper.java 28 Dec 2005 00:32:56 -0000 1.1 +++ EJB3ScriptHelper.java 3 Jan 2006 01:33:44 -0000 1.2 @@ -1,6 +1,7 @@ package org.andromda.cartridges.ejb3; import org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacade; +import org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.metafacades.uml.ModelElementFacade; @@ -18,50 +19,6 @@ */ public class EJB3ScriptHelper { - - /** - * Create a comma seperated list of attributes. - * <p/> - * This method can be used to generated e.g. argument lists for constructors, method calls etc. - * <p/> - * It will not return attributes tagged to be optimistic lock values. - * - * @param attributes a collection of {@link Attribute} objects - * @param includeTypes if <code>true</code>, the type names of the attributes are included. - * @param includeNames if <code>true</code>, the names of the attributes are included - */ - public String getAttributesAsList(Collection attributes, boolean includeTypes, boolean includeNames) - { - if (!includeNames && !includeTypes || attributes == null) - { - return ""; - } - - StringBuffer sb = new StringBuffer(); - String separator = ""; - - for (final Iterator it = attributes.iterator(); it.hasNext();) - { - // AttributeFacade attr = (AttributeFacade)it.next(); - EJB3EntityAttributeFacade attr = (EJB3EntityAttributeFacade)it.next(); - if (!attr.isVersion()) - { - sb.append(separator); - separator = ", "; - if (includeTypes) - { - sb.append(attr.getType().getFullyQualifiedName()); - sb.append(" "); - } - if (includeNames) - { - sb.append(attr.getName()); - } - } - } - return sb.toString(); - } - /** * Create a collection of String objects representing the argument names. * |
From: Vance K. <va...@us...> - 2006-01-03 01:32:20
|
User: vancek Date: 06/01/02 17:32:12 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Profile.java Log: added new persistence context, session bean and security tagged values Revision Changes Path 1.2 +165 -37 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.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3Profile.java 28 Dec 2005 00:32:56 -0000 1.1 +++ EJB3Profile.java 3 Jan 2006 01:32:12 -0000 1.2 @@ -18,8 +18,21 @@ private static final Profile profile = Profile.instance(); /* ----------------- Stereotypes -------------------- */ + + /** + * Specifies the create method stereotype - used in entity POJO + * and session bean. + */ public static final String STEREOTYPE_CREATE_METHOD = "CreateMethod"; + + /** + * Specifies the select method stereotype - used in EJB2.x + */ public static final String STEREOTYPE_SELECT_METHOD = "SelectMethod"; + + /** + * Specifies the environment entry stereotype - used in EJB2.x + */ public static final String STEREOTYPE_ENV_ENTRY = "EnvEntry"; /** @@ -37,29 +50,129 @@ */ public static final String STEREOTYPE_VALUE_REF = "ValueRef"; + /** + * Represents a persistence context instance referenced from a session bean. + */ + public static final String STEREOTYPE_PERSISTENCE_CONTEXT = profile.get("PERSISTENCE_CONTEXT"); + /* ----------------- Tagged Values -------------------- */ + + /** + * + */ public static final String TAGGEDVALUE_GENERATE_CMR = "@andromda.ejb.generateCMR"; + + /** + * The tagged value indicating the EJB query. + */ public static final String TAGGEDVALUE_EJB_QUERY = "@andromda.ejb.query"; + + /** + * The tagged value indicating the view type for the class or operation. + */ public static final String TAGGEDVALUE_EJB_VIEWTYPE = "@andromda.ejb.viewType"; + + /** + * The tagged value indicating the transaction property. + */ public static final String TAGGEDVALUE_EJB_TRANSACTION_TYPE = "@andromda.ejb.transaction.type"; + + /** + * + */ public static final String TAGGEDVALUE_EJB_NO_SYNTHETIC_CREATE_METHOD = "@andromda.ejb.noSyntheticCreateMethod"; - public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_TEMPORAL_TYPE = "@andromda.persistence.finder.temporal.type"; - public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_RESULT_TYPE = "@andromda.persistence.finder.result.type"; + /** + * The tagged value indicating the finder temporal type. + */ + public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_TEMPORAL_TYPE = + "@andromda.persistence.finder.temporal.type"; + + /** + * The tagged value indicating the finder result type (First or Max). + */ + public static final String TAGGEDVALUE_PERSISTENCE_FINDER_PARAMETER_RESULT_TYPE = + "@andromda.persistence.finder.result.type"; + + /** + * The tagged value indicating the entity table name. + */ public static final String TAGGEDVALUE_PERSISTENCE_ENTITY_TABLE_NAME = "@andromda.persistence.entity.table.name"; + + /** + * The tagged value indicating the fetch type. + */ public static final String TAGGEDVALUE_PERSISTENCE_FETCH_TYPE = "@andromda.persistence.fetch.type"; + + /** + * The tagged value indicating the LOB type. + */ public static final String TAGGEDVALUE_PERSISTENCE_LOB_TYPE = "@andromda.persistence.lob.type"; + + /** + * The tagged value indicating the cascade type. + */ public static final String TAGGEDVALUE_PERSISTENCE_CASCADE_TYPE = "@andromda.persistence.cascade.type"; + + /** + * The tagged value indicating the generator type. + */ public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_TYPE = "@andromda.persistence.generator.type"; + + /** + * The tagged value indicating the generator name. + */ public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_NAME = "@andromda.persistence.generator.name"; - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_SOURCE_NAME = "@andromda.persistence.generator.source.name"; - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_PKCOLUMN_VALUE = "@andromda.persistence.generator.pkcolumn.value"; - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_INITIAL_VALUE = "@andromda.persistence.generator.initial.value"; - public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_ALLOCATION_SIZE = "@andromda.persistence.generator.allocation.size"; - public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION = "@andromda.persistence.column.definition"; + + /** + * The tagged value indicating the generator source name + */ + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_SOURCE_NAME = + "@andromda.persistence.generator.source.name"; + + /** + * The tagged value indicating the primary key column value for the generator. + */ + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_PKCOLUMN_VALUE = + "@andromda.persistence.generator.pkcolumn.value"; + + /** + * The tagged value indicating the initial value for the generator. + */ + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_INITIAL_VALUE = + "@andromda.persistence.generator.initial.value"; + + /** + * The tagged value indicating the step size for the generator. + */ + public static final String TAGGEDVALUE_PERSISTENCE_GENERATOR_ALLOCATION_SIZE = + "@andromda.persistence.generator.allocation.size"; + + /** + * The tagged value indicating the SQL definition for a column. + */ + public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_DEFINITION = + "@andromda.persistence.column.definition"; + + /** + * The tagged value for the precision in a float/double column. + */ public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_PRECISION = "@andromda.persistence.column.precision"; + + /** + * The tagged value for the scale in a float/double column. + */ public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_SCALE = "@andromda.persistence.column.scale"; + + /** + * The tagged value to represent a column that is nullable. + */ public static final String TAGGEDVALUE_PERSISTENCE_COLUMN_NULLABLE = "@andromda.persistence.column.nullable"; + + /** + * The tagged value that indicates the order by logic on the Many side of the + * One-to-Many and Many-to-Many relationships. + */ public static final String TAGGEDVALUE_PERSISTENCE_ORDERBY = "@andromda.persistence.orderBy"; /** @@ -89,22 +202,26 @@ /** * The tagged value indicating that the row is an entity of the annotated entity type. */ - public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_VALUE = profile.get("ENTITY_DISCRIMINATOR_VALUE"); + public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_VALUE = + profile.get("ENTITY_DISCRIMINATOR_VALUE"); /** * The tagged value indicating the name of the column used for the discriminator */ - public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN = profile.get("ENTITY_DISCRIMINATOR_COLUMN"); + public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN = + profile.get("ENTITY_DISCRIMINATOR_COLUMN"); /** * The tagged value representing the SQL used in generation of DDL for the discriminator column */ - public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN_DEFINITION = profile.get("ENTITY_DISCRIMINATOR_COLUMN_DEFINITION"); + public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN_DEFINITION = + profile.get("ENTITY_DISCRIMINATOR_COLUMN_DEFINITION"); /** * The tagged value representing the column length for the String discriminator column type. */ - public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN_LENGTH = profile.get("ENTITY_DISCRIMINATOR_COLUMN_LENGTH"); + public static final String TAGGEDVALUE_PERSISTENCE_DISCRIMINATOR_COLUMN_LENGTH = + profile.get("ENTITY_DISCRIMINATOR_COLUMN_LENGTH"); /** * The tagged value representing the access type for the entity class @@ -114,30 +231,41 @@ /** * The tagged value representing whether this entity is an embeddable superclass */ - public static final String TAGGEDVALUE_PERSISTENCE_EMBEDDABLE_SUPERCLASS = profile.get("ENTITY_EMBEDDABLE_SUPERCLASS"); + public static final String TAGGEDVALUE_PERSISTENCE_EMBEDDABLE_SUPERCLASS = + profile.get("ENTITY_EMBEDDABLE_SUPERCLASS"); + + /** + * The tagged value representing the persistence context unit name (EntityManager) + */ + public static final String TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_UNIT_NAME = + profile.get("SERVICE_PERSISTENCE_CONTEXT_UNIT_NAME"); + + /** + * The tagged value representing the persistence context transaction/extended type + */ + public static final String TAGGEDVALUE_EJB_PERSISTENCE_CONTEXT_TYPE = + profile.get("SERVICE_PERSISTENCE_CONTEXT_TYPE"); - /* ------------------- Fetch Types ------------------------*/ - public static final String FETCHTYPE_EAGER = "EAGER"; - public static final String FETCHTYPE_LAZY = "LAZY"; - - /* --------------------- Lob Types ------------------------*/ - public static final String LOBTYPE_CLOB = "CLOB"; - public static final String LOBTYPE_BLOB = "BLOB"; - - /* ---------------- Generator Types -----------------------*/ - public static final String GENERATORTYPE_TABLE = "TABLE"; - public static final String GENERATORTYPE_SEQUENCE = "SEQUENCE"; - public static final String GENERATORTYPE_IDENTITY = "IDENTITY"; - public static final String GENERATORTYPE_AUTO = "AUTO"; - public static final String GENERATORTYPE_NONE = "NONE"; - - /* ---------------- Temporal Types ------------------------*/ - public static final String TEMPORALTYPE_DATE = "DATE"; - public static final String TEMPORALTYPE_TIME = "TIME"; - public static final String TEMPORALTYPE_TIMESTAMP = "TIMESTAMP"; - public static final String TEMPORALTYPE_NONE = "NONE"; - - /* ------------ Finder Method Result Types ----------------*/ - public static final String FINDER_RESULTTYPE_FIRST = "First"; - public static final String FINDER_RESULTTYPE_MAX = "Max"; + /** + * The tagged value representing the session EJB type (Stateless or Stateful) + */ + public static final String TAGGEDVALUE_EJB_SESSION_TYPE = profile.get("SERVICE_TYPE"); + + /** + * The tagged value representing the comma separated list of security roles + * permitted to execute operations in a session bean. + */ + public static final String TAGGEDVALUE_EJB_SECURITY_ROLES_ALLOWED = profile.get("SECURITY_ROLES_ALLOWED"); + + /** + * The tagged value representing whether to permit all roles to execute + * operations in a session bean. + */ + public static final String TAGGEDVALUE_EJB_SECURITY_PERMIT_ALL = profile.get("SECURITY_PERMIT_ALL"); + + /** + * The tagged value representing the security domain to sepecify at + * the session bean class level. + */ + public static final String TAGGEDVALUE_EJB_SECURITY_DOMAIN = profile.get("SECURITY_DOMAIN"); } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:16:00
|
User: vancek Date: 06/01/02 17:15:54 Modified: andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3 EJB3Globals.java Log: added session and security related constants Revision Changes Path 1.2 +158 -28 cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Globals.java Index: EJB3Globals.java =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/java/org/andromda/cartridges/ejb3/EJB3Globals.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- EJB3Globals.java 28 Dec 2005 00:32:56 -0000 1.1 +++ EJB3Globals.java 3 Jan 2006 01:15:54 -0000 1.2 @@ -3,16 +3,161 @@ /** * Stores Globals specific to the EJB3 cartridge. * - * @author Chad Brandon + * @author Vance Karimi */ public class EJB3Globals { /** - * Stores the default EJB transaction type. + * The property that stores the persistence container name. + */ + public static final String PERSISTENCE_CONTAINER = "persistenceContainerName"; + + /** + * The property that stores the default EJB transaction type. */ public static final String TRANSACTION_TYPE = "transactionType"; /** + * The pattern to use for determining the package name for EJBs. + */ + public static final String JNDI_NAME_PREFIX = "jndiNamePrefix"; + + /** + * The property that stores the default entity ID generator type + */ + public static final String ENTITY_DEFAULT_GENERATOR_TYPE = "entityDefaultGeneratorType"; + + /** + * The property that stores the default generator initial value + */ + public static final String ENTITY_DEFAULT_GENERATOR_INITIAL_VALUE = "entityDefaultGeneratorInitialValue"; + + /** + * The property that stores the default generator allocation size for incrementing ids + */ + public static final String ENTITY_DEFAULT_GENERATOR_ALLOCATION_SIZE = "entityDefaultGeneratorAllocationSize"; + + /** + * The property that stores the default entity association optional attribute for Many-to-One and One-to-One + */ + public static final String ENTITY_DEFAULT_ASSOCIATION_OPTIONAL = "entityDefaultAssociationOptional"; + + /** + * Stores whether or not named parameters should be used in EJB queries. + */ + public static final String QUERY_USE_NAMED_PARAMETERS = "queryUseNamedParameters"; + + /** + * The default composite association cascade property + */ + public static final String ENTITY_DEFAULT_COMPOSITE_CASCADE = "entityCompositeCascade"; + + /** + * The default aggregation association cascade property + */ + public static final String ENTITY_DEFAULT_AGGREGATION_CASCADE = "entityAggergationCascade"; + + /** + * The default view type accessability for an entity POJO bean + */ + public static final String ENTITY_DEFAULT_VIEW_TYPE = "entityViewType"; + + /** + * The default view type accessability for the session bean + */ + public static final String SESSION_DEFAULT_VIEW_TYPE = "serviceViewType"; + + /** + * Represents the eager fetch type + */ + public static final String FETCH_TYPE_EAGER = "EAGER"; + + /** + * Represents the lazy fetch type + */ + public static final String FETCH_TYPE_LAZY = "LAZY"; + + /** + * Represents the clob lob type + */ + public static final String LOB_TYPE_CLOB = "CLOB"; + + /** + * Represents the blob lob type + */ + public static final String LOB_TYPE_BLOB = "BLOB"; + + /** + * Represents the table generator type + */ + public static final String GENERATOR_TYPE_TABLE = "TABLE"; + + /** + * Represents the sequence generator type + */ + public static final String GENERATOR_TYPE_SEQUENCE = "SEQUENCE"; + + /** + * Represents the identity generator type + */ + public static final String GENERATOR_TYPE_IDENTITY = "IDENTITY"; + + /** + * Represents the auto generator type + */ + public static final String GENERATOR_TYPE_AUTO = "AUTO"; + + /** + * Represents the none generator type + */ + public static final String GENERATOR_TYPE_NONE = "NONE"; + + /** + * Represents the date temporal type + */ + public static final String TEMPORAL_TYPE_DATE = "DATE"; + + /** + * Represents the time temporal type + */ + public static final String TEMPORAL_TYPE_TIME = "TIME"; + + /** + * Represents the timestamp temporal type + */ + public static final String TEMPORAL_TYPE_TIMESTAMP = "TIMESTAMP"; + + /** + * Represents the none temporal type + */ + public static final String TEMPORAL_TYPE_NONE = "NONE"; + + /** + * Represents the finder method index type on the parameter + */ + public static final String FINDER_RESULT_TYPE_FIRST = "First"; + + /** + * Represents the finder method max count on the parameter + */ + public static final String FINDER_RESULT_TYPE_MAX = "Max"; + + /** + * Represents the view type for the entity POJO as both remote and local + */ + public static final String VIEW_TYPE_BOTH = "both"; + + /** + * Represents the local view type for the entity POJO + */ + public static final String VIEW_TYPE_LOCAL = "local"; + + /** + * Represents the remote view type for the entity POJO + */ + public static final String VIEW_TYPE_REMOTE = "remote"; + + /** * Represents the mandatory transaction type */ public static final String TRANSACTION_TYPE_MANDATORY = "Manadatory"; @@ -43,42 +188,27 @@ public static final String TRANSACTION_TYPE_SUPPORTS = "Supports"; /** - * The pattern to use for determining the package name for EJBs. - */ - public static final String JNDI_NAME_PREFIX = "jndiNamePrefix"; - - /** - * The property that stores the default entity ID generator type - */ - public static final String ENTITY_DEFAULT_GENERATOR_TYPE = "entityDefaultGeneratorType"; - - /** - * The property that stores the default generator initial value - */ - public static final String ENTITY_DEFAULT_GENERATOR_INITIAL_VALUE = "entityDefaultGeneratorInitialValue"; - - /** - * The property that stores the default generator allocation size for incrementing ids + * Represents the stateless session bean */ - public static final String ENTITY_DEFAULT_GENERATOR_ALLOCATION_SIZE = "entityDefaultGeneratorAllocationSize"; + public static final String SERVICE_TYPE_STATELESS = "Stateless"; /** - * The property that stores the default entity association optional attribute for Many-to-One and One-to-One + * Represents the stateful session bean */ - public static final String ENTITY_DEFAULT_ASSOCIATION_OPTIONAL = "entityDefaultAssociationOptional"; + public static final String SERVICE_TYPE_STATEFUL = "Stateful"; /** - * Stores whether or not named parameters should be used in EJB queries. + * Represents the JBoss persistence container constant */ - public static final String QUERY_USE_NAMED_PARAMETERS = "queryUseNamedParameters"; + public static final String PERSISTENCE_CONTAINER_JBOSS = "jboss"; /** - * The default composite association cascade property + * Represents the Weblogic persistence container contant */ - public static final String ENTITY_DEFAULT_COMPOSITE_CASCADE = "entityCompositeCascade"; + public static final String PERSISTENCE_CONTAINER_WEBLOGIC = "weblogic"; /** - * The default aggregation association cascade property + * Represents the default security domain */ - public static final String ENTITY_DEFAULT_AGGREGATION_CASCADE = "entityAggergationCascade"; + public static final String SECURITY_DOMAIN = "securityDomain"; } |
From: Vance K. <va...@us...> - 2006-01-03 01:14:07
|
User: vancek Date: 06/01/02 17:13:53 Modified: andromda-ejb3/src/main/resources/META-INF/andromda profile.xml Log: added persistence context, service and security related elements Revision Changes Path 1.2 +112 -0 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.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- profile.xml 28 Dec 2005 00:32:56 -0000 1.1 +++ profile.xml 3 Jan 2006 01:13:53 -0000 1.2 @@ -53,6 +53,14 @@ <value>Transient</value> <appliedOnElement>Entity attribute</appliedOnElement> </element> + <element name="PERSISTENCE_CONTEXT"> + <documentation> + Identifies a persistence context used to express a dependency + on an EntityManager persistence context. + </documentation> + <value>PersistenceContext</value> + <appliedOnElement>class</appliedOnElement> + </element> <element name="IDENTIFIER"> <documentation> Identifies an attribute as an identifier (primary @@ -308,6 +316,110 @@ <![CDATA[<<Entity>>]]> </appliedOnElement> </element> + <element name="SERVICE_TYPE"> + <documentation> + Used at the class level of a service bean to + override the default session bean type which + is determined by the existence of instance + variables. + </documentation> + <value> + @andromda.ejb.service.type + </value> + <appliedOnElement> + <![CDATA[<<Service>>]]> + </appliedOnElement> + <allowedValues> + <value>Stateless</value> + <value>Stateful</value> + </allowedValues> + </element> + <element name="SERVICE_PERSISTENCE_CONTEXT_UNIT_NAME"> + <documentation> + Used at the class level of a service bean or + a class with stereotype PersistenceContext to + determine the persistence context unit + name. + </documentation> + <value> + @andromda.ejb.persistence.context.unit.name + </value> + <appliedOnElement> + <![CDATA[<<Service>>]]> + </appliedOnElement> + </element> + <element name="SERVICE_PERSISTENCE_CONTEXT_TYPE"> + <documentation> + Used at the class level of a service bean or + a class with stereotype PersistenceContext to + determine the persistence context type. + This can be set to extend the transaction + on a Stateful session bean for it's + EntityManager. + </documentation> + <value> + @andromda.ejb.persistence.context.unit.type + </value> + <appliedOnElement> + <![CDATA[<<Service>>]]> + </appliedOnElement> + <allowedValues> + <value>EXTENDED</value> + <value>TRANSACTION</value> + </allowedValues> + </element> + <element name="SECURITY_ROLES_ALLOWED"> + <documentation> + Specifies the comma separated list of security + roles that are permitted to execute opertions. + This can be set on the session bean or on + individual operations. + If set on the session bean, all operations will + inherit this behaviour. + </documentation> + <value> + @andromda.ejb.security.rolesAllowed + </value> + <appliedOnElement> + Service and service operation + </appliedOnElement> + </element> + <element name="SECURITY_PERMIT_ALL"> + <documentation> + Specifies whether to permit all roles to + execute the opertions in a session bean. + This can be set on the session bean or on + individual operations. + If set on the session bean, all operations will + inherit this behaviour. + The permit all tagged value will override + the roles allowed. If both are set, only the + permit all tagged value is rendered. + </documentation> + <value> + @andromda.ejb.security.permitAll + </value> + <appliedOnElement> + Service and service operation + </appliedOnElement> + <allowedValues> + <value>true</value> + <value>false</value> + </allowedValues> + </element> + <element name="SECURITY_DOMAIN"> + <documentation> + Specifies the security domain for + role based authorization. JBoss uses + the security model to match allowed roles. + </documentation> + <value> + @andromda.ejb.security.domain + </value> + <appliedOnElement> + Session bean + </appliedOnElement> + </element> <element name="AUTOMATIC_KEY"> <documentation> Can be used in class level of an entity. If you set |
From: Vance K. <va...@us...> - 2006-01-03 01:13:11
|
User: vancek Date: 06/01/02 17:13:04 Modified: andromda-ejb3/src/main/resources/META-INF/andromda namespace.xml Log: added container and security properties, entity/service properties and fixed transaction type property values Revision Changes Path 1.2 +52 -7 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml Index: namespace.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/namespace.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- namespace.xml 28 Dec 2005 00:32:56 -0000 1.1 +++ namespace.xml 3 Jan 2006 01:13:03 -0000 1.2 @@ -125,6 +125,19 @@ </property> </propertyGroup> <propertyGroup name="Other Properties"> + <property name="persistenceContainerName"> + <default>jboss</default> + <documentation> + The default persistence container engine name. + Used when specifying specific annotations + for different persistence containers. + Possible values are: + <ul> + <li>jboss</li> + <li>weblogic</li> + </ul> + </documentation> + </property> <property name="entityAccessType"> <default>PROPERTY</default> <documentation> @@ -284,6 +297,14 @@ always exist. </documentation> </property> + <property name="securityDomain"> + <default>Default</default> + <documentation> + Specifies the default security domain to use + for role based authorization. JBoss uses the + security model to match allowed roles. + </documentation> + </property> <property name="queryUseNamedParameters"> <default>true</default> <documentation> @@ -301,18 +322,42 @@ <property name="valueObjectName"> <default>{0}</default> </property> + <property name="entityViewType"> + <default>local</default> + <documentation> + The default view type accessability for an entity POJO bean. + <ul> + Permitted values are: + <li>local</li> + <li>remote</li> + <li>both</li> + </ul> + </documentation> + </property> + <property name="serviceViewType"> + <default>remote</default> + <documentation> + The default view type accessability for a session bean. + <ul> + Permitted values are: + <li>local</li> + <li>remote</li> + <li>both</li> + </ul> + </documentation> + </property> <property name="transactionType"> - <default>Required</default> + <default>REQUIRED</default> <documentation> The default value to use for transaction types. <ul> Permitted values are: - <li>NotSupported</li> - <li>Supports</li> - <li>Required</li> - <li>RequiresNew</li> - <li>Mandatory</li> - <li>Never</li> + <li>NOT_SUPPORTED</li> + <li>SUPPORTS</li> + <li>REQUIRED</li> + <li>REQUIRES_NEW</li> + <li>MANDATORY</li> + <li>NEVER</li> </ul> <strong>NOTE:</strong> Can be overridden on a per entity basis with the |
From: Vance K. <va...@us...> - 2006-01-03 01:10:32
|
User: vancek Date: 06/01/02 17:10:24 Modified: andromda-ejb3/src/main/resources/META-INF/andromda metafacades.xml Log: added service related properties Revision Changes Path 1.2 +21 -27 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/metafacades.xml Index: metafacades.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/metafacades.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- metafacades.xml 28 Dec 2005 00:32:56 -0000 1.1 +++ metafacades.xml 3 Jan 2006 01:10:24 -0000 1.2 @@ -2,6 +2,7 @@ <metafacades> <property reference="transactionType" /> <property reference="entityAccessType" /> + <property reference="entityViewType" /> <property reference="entityListenerNamePattern" /> <property reference="entityEmbeddableNamePattern" /> <property reference="entityNamePattern" /> @@ -10,18 +11,18 @@ <property reference="entityInheritanceStrategy" /> <property reference="entityDiscriminatorType" /> <property reference="entityDiscriminatorColumnName" /> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacadeLogicImpl"> + <property reference="serviceViewType" /> + <property reference="persistenceContainerName" /> + <property reference="securityDomain" /> + <!-- Entity POJO EJB Metafacades --> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3OperationFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade </context> </mapping> </metafacade> - <!-- Entity POJO EJB Metafacades --> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodFacadeLogicImpl" - contextRoot="true"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodFacadeLogicImpl" contextRoot="true"> <mapping> <stereotype>FINDER_METHOD</stereotype> <context> @@ -30,9 +31,7 @@ </mapping> <property reference="queryUseNamedParameters" /> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodFacadeLogicImpl" - contextRoot="true"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodFacadeLogicImpl" contextRoot="true"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade @@ -40,25 +39,21 @@ <property name="query" /> </mapping> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodArgumentFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodArgumentFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3FinderMethodFacade </context> </mapping> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogicImpl" - contextRoot="true"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacadeLogicImpl" contextRoot="true"> <mapping> <stereotype>ENTITY</stereotype> </mapping> <property reference="sqlMappingsUri" /> <property reference="jndiNamePrefix" /> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3AssociationEndFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade @@ -68,16 +63,14 @@ <property reference="entityCompositeCascade" /> <property reference="entityAggergationCascade" /> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3AssociationFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3AssociationFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade </context> </mapping> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3EntityAttributeFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade @@ -88,24 +81,25 @@ <property reference="entityDefaultGeneratorAllocationSize" /> </metafacade> <!-- Session EJB Metafacades --> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionOperationFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade </context> </mapping> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogicImpl" - contextRoot="true"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacadeLogicImpl" contextRoot="true"> <mapping> <stereotype>SERVICE</stereotype> </mapping> <property reference="jndiNamePrefix" /> + <property reference="serviceNamePattern" /> + <property reference="serviceLocalInterfaceNamePattern" /> + <property reference="serviceRemoteInterfaceName" /> + <property reference="serviceImplementationNamePattern" /> + <property reference="serviceListenerNamePattern" /> </metafacade> - <metafacade - class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionAttributeFacadeLogicImpl"> + <metafacade class="org.andromda.cartridges.ejb3.metafacades.EJB3SessionAttributeFacadeLogicImpl"> <mapping> <context> org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade |
From: Vance K. <va...@us...> - 2006-01-03 01:09:29
|
User: vancek Date: 06/01/02 17:09:24 Modified: andromda-ejb3/src/main/resources/META-INF/andromda cartridge.xml Log: added session listener template Revision Changes Path 1.2 +40 -32 cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml Index: cartridge.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/META-INF/andromda/cartridge.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- cartridge.xml 28 Dec 2005 00:32:56 -0000 1.1 +++ cartridge.xml 3 Jan 2006 01:09:23 -0000 1.2 @@ -1,10 +1,8 @@ <cartridge> <!-- define the template objects that are made availble to the template --> - <templateObject name="stringUtils" - className="org.apache.commons.lang.StringUtils" /> - <templateObject name="transform" - className="org.andromda.cartridges.ejb3.EJB3ScriptHelper" /> + <templateObject name="stringUtils" className="org.apache.commons.lang.StringUtils" /> + <templateObject name="transform" className="org.andromda.cartridges.ejb3.EJB3ScriptHelper" /> <!-- cartridge-templateObject merge-point--> <!-- cartridge-property merge-point--> @@ -12,33 +10,34 @@ <!-- cartridge-resource merge-point --> <template path="templates/ejb3/Entity.vsl" - outputPattern="{0}/{1}.java" outlet="entity-beans" overwrite="true"> + outputPattern="{0}/{1}.java" + outlet="entity-beans" + overwrite="true"> <modelElements variable="entity"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> </modelElement> </modelElements> </template> <template path="templates/ejb3/EntityImpl.vsl" - outputPattern="{0}/{1}Impl.java" outlet="entity-impls" + outputPattern="{0}/{1}Impl.java" + outlet="entity-impls" overwrite="false"> <modelElements variable="entity"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> </modelElement> </modelElements> </template> <template path="templates/ejb3/EntityListener.vsl" - outputPattern="{0}/{1}Listener.java" outlet="entity-impls" + outputPattern="{0}/{1}Listener.java" + outlet="entity-impls" overwrite="false"> <modelElements variable="entity"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3EntityFacade" /> </modelElement> </modelElements> </template> @@ -52,49 +51,58 @@ --> <template path="templates/ejb3/SessionBean.vsl" - outputPattern="{0}/{1}Bean.java" outlet="session-beans" - overwrite="false"> + outputPattern="{0}/{1}Bean.java" + outlet="session-beans" + overwrite="true"> <modelElements variable="service"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> </modelElement> </modelElements> </template> <template path="templates/ejb3/SessionLocal.vsl" - outputPattern="{0}/{1}Local.java" outlet="session-beans" - overwrite="true" generateEmptyFiles="false"> + outputPattern="{0}/{1}Local.java" + outlet="session-beans" + overwrite="true" + generateEmptyFiles="true"> <modelElements variable="service"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"> - <property name="viewType">local</property> - </type> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> </modelElement> </modelElements> </template> <template path="templates/ejb3/SessionRemote.vsl" - outputPattern="{0}/{1}.java" outlet="session-beans" overwrite="true" - generateEmptyFiles="false"> + outputPattern="{0}/{1}Remote.java" + outlet="session-beans" + overwrite="true" + generateEmptyFiles="true"> <modelElements variable="service"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade"> - <property name="viewType">remote</property> - </type> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> </modelElement> </modelElements> </template> <template path="templates/ejb3/SessionBeanImpl.vsl" - outputPattern="{0}/{1}BeanImpl.java" outlet="session-impls" + outputPattern="{0}/{1}BeanImpl.java" + outlet="session-impls" + overwrite="false"> + <modelElements variable="service"> + <modelElement> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> + </modelElement> + </modelElements> + </template> + + <template path="templates/ejb3/SessionListener.vsl" + outputPattern="{0}/{1}Listener.java" + outlet="session-impls" overwrite="false"> <modelElements variable="service"> <modelElement> - <type - name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> + <type name="org.andromda.cartridges.ejb3.metafacades.EJB3SessionFacade" /> </modelElement> </modelElements> </template> |
From: Vance K. <va...@us...> - 2006-01-03 01:06:30
|
User: vancek Date: 06/01/02 17:06:24 Modified: andromda-ejb3/src/main/resources/templates/ejb3 SessionLocal.vsl SessionRemote.vsl Log: fixed interfaces to work with ejb3 session bean Revision Changes Path 1.2 +46 -50 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionLocal.vsl Index: SessionLocal.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionLocal.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- SessionLocal.vsl 28 Dec 2005 00:32:55 -0000 1.1 +++ SessionLocal.vsl 3 Jan 2006 01:06:24 -0000 1.2 @@ -5,81 +5,77 @@ #end /** - * Local component interface for the $service.name session bean. + * Local component interface for the ${service.serviceName} session bean. $service.getDocumentation(" * ") */ +@javax.ejb.Local public interface ${service.serviceLocalInterfaceName} #if($service.generalization) extends ${service.generalization.fullyQualifiedName}Local -#else - extends javax.ejb.EJBLocalObject #end { - // -- accessors for environment entries -- -#foreach($envEntry in $service.getEnvironmentEntries(true)) -#if($envEntry.visibility == "public") - /** - * Get the ${envEntry.name} environment entry -$envEntry.getDocumentation(" * ") - */ - public $envEntry.type.fullyQualifiedName get$AttName(); +#set ($constants = $service.constants) +#if (!$constants.empty) -#end -#end - // -- accessors for constants -- -#foreach($attribute in $service.staticAttributes) -#if(!$attribute.hasStereotype("EnvEntry")) -#set ($visibility = $attribute.visibility) -## Only expose the method to the home interface if it is public. -#if($visibility == "public") -#set($attType = $attribute.type.fullyQualifiedName) -#set($AttName = $stringUtils.capitalize($attribute.name)) + // ----------- accessors for constants ------------ + +#**##foreach($constant in $constants) +## Only expose the method if it is public. +#* *##if($constant.visibility == "public") /** * Get the $attribute.name constant -$attribute.getDocumentation(" * ") +$constant.getDocumentation(" * ") */ - public $attType get$AttName(); + public $constant.type.fullyQualifiedName ${constant.getterName}(); +#* *##end +#**##end #end -#end -#end +#set ($attributes = $service.instanceAttributes) +#if (!$attributes.empty) + // --------------- attributes --------------------- -#foreach ( $attribute in $service.instanceAttributes) -#set ($visibility = $attribute.visibility) + +#**##foreach ($attribute in $attributes) ## Only expose the method to the component interface if it is public. -#if($visibility == "public") +#* *##if ($attribute.visibility == "public") /** - * Get the ${attribute.name} property + * Get the $attribute.name property $attribute.getDocumentation(" * ") */ public $attribute.type.fullyQualifiedName ${attribute.getterName}(); -#if(!$attribute.readOnly) +#* *##if(!$attribute.readOnly) /** - * Set the ${attribute.name} property + * Set the $attribute.name property * @param value the new value */ public void ${attribute.setterName}($attribute.type.fullyQualifiedName value); + +#* *##end +#* *##end +#**##end #end -#end -#end +#set ($operations = $service.businessOperations) +#if (!$operations.empty) - // ---------------- business methods ---------------------- -#foreach ( $operation in $service.businessOperations) -#set ($visibility = $operation.visibility) -## Only expose public methods -#if ($visibility == "public") + // ------------ business methods ----------------- +#**##foreach ($operation in $operations) +## Only expose public methods with local view type accessability +#* *##if ($operation.visibility == "public" && ($operation.viewTypeLocal || $operation.viewTypeBoth)) /** $operation.getDocumentation(" * ") */ -#set ($returnType = $operation.returnType.fullyQualifiedName) -#if ($operation.exceptionsPresent) +#* *##set ($returnType = $operation.returnType.fullyQualifiedName) +#* *##if ($operation.exceptionsPresent) public $returnType $operation.signature throws $operation.exceptionList; -#else - $visibility $returnType $operation.signature; -#end -#end +#* *##else + public $returnType $operation.signature; +#* *##end + +#* *##end +#**##end #end } \ No newline at end of file 1.2 +46 -43 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl Index: SessionRemote.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionRemote.vsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- SessionRemote.vsl 28 Dec 2005 00:32:55 -0000 1.1 +++ SessionRemote.vsl 3 Jan 2006 01:06:24 -0000 1.2 @@ -8,71 +8,74 @@ * Remote component interface for the ${service.serviceName} session bean. $service.getDocumentation(" * ") */ +...@ja...mote public interface ${service.serviceRemoteInterfaceName} #if ($service.generalization) - extends $service.fullyQualifiedName -#else - extends javax.ejb.EJBObject + extends ${service.generalization.fullyQualifiedName}Remote #end { - // -- accessors for environment entries -- -#foreach($envEntry in $service.getEnvironmentEntries(true)) -#if($visibility == "public") - /** - * Get the ${envEntry.name} environment entry -$envEntry.getDocumentation(" * ") - */ - public $envEntry.type.fullyQualifiedName ${envEntry.getterName}(); +#set ($constants = $service.constants) +#if (!$constants.empty) -#end -#end - // -- accessors for constants -- -#foreach($constant in $service.constants) -## Only expose the method to the home interface if it is public. -#if($constant.visibility == "public") + // ---------- accessors for constants ----------- + +#**##foreach($constant in $constants) +## Only expose the method if it is public. +#* *##if($constant.visibility == "public") /** * Get the $attribute.name constant $constant.getDocumentation(" * ") */ public $constant.type.fullyQualifiedName ${constant.getterName}(); +#* *##end +#**##end #end -#end +#set ($attributes = $service.instanceAttributes) +#if (!$attributes.empty) + // --------------- attributes --------------------- -#foreach ( $attribute in $service.instanceAttributes) + +#**##foreach ($attribute in $attributes) +## Only expose the method to the component interface if it is public. +#* *##if ($attribute.visibility == "public") /** - * Get the ${attribute.name} property + * Get the $attribute.name property $attribute.getDocumentation(" * ") */ - public $attribute.type.fullyQualifiedName ${attribute.getterName}() - throws java.rmi.RemoteException; + public $attribute.type.fullyQualifiedName ${attribute.getterName}(); -#if(!$attribute.readOnly) +#* *##if(!$attribute.readOnly) /** * Set the $attribute.name property * @param value the new value */ - public void ${attribute.setterName}($attribute.type.fullyQualifiedName value) - throws java.rmi.RemoteException; -#end + public void ${attribute.setterName}($attribute.type.fullyQualifiedName value); + +#* *##end +#* *##end +#**##end #end +#set ($operations = $service.businessOperations) +#if (!$operations.empty) - // ---------------- business methods ---------------------- -#foreach ( $operation in $service.businessOperations) -## Only expose public methods -#if ($operation.visibility == "public") + // ------------ business methods ----------------- +#**##foreach ($operation in $operations) +## Only expose public methods with remote view type accessability +#* *##if ($operation.visibility == "public" && ($operation.viewTypeRemote || $operation.viewTypeBoth)) /** $operation.getDocumentation(" * ") */ -#set ($returnType = $operation.returnType.fullyQualifiedName) -#if ($operation.exceptionsPresent) - public $returnType $operation.signature - throws $operation.getExceptionList('java.rmi.RemoteException'); -#else +#* *##set ($returnType = $operation.returnType.fullyQualifiedName) +#* *##if ($operation.exceptionsPresent) public $returnType $operation.signature - throws java.rmi.RemoteException; -#end -#end + throws $operation.exceptionList; +#* *##else + public $returnType $operation.signature; +#* *##end + +#* *##end +#**##end #end } \ No newline at end of file |
From: Vance K. <va...@us...> - 2006-01-03 01:06:19
|
User: vancek Date: 06/01/02 17:06:00 Added: andromda-ejb3/src/main/resources/templates/ejb3 SessionListener.vsl Log: initial revision Revision Changes Path 1.1 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/SessionListener.vsl Index: SessionListener.vsl =================================================================== // license-header java merge-point #if ($stringUtils.isNotBlank($service.packageName)) package $service.packageName; #end /** * Callback Listener for Session bean ${service.fullyQualifiedName} * * @see ${service.fullyQualifiedName} */ public class ${service.serviceListenerName} { /** * Default public no-args constructor */ public ${service.serviceListenerName}() { } @javax.ejb.PostConstruct public void postConstruct(${service.fullyQualifiedServiceName} ${stringUtils.uncapitalize(${service.name})}) { // post construct implementation } @javax.ejb.PostActivate public void postActivate(${service.fullyQualifiedServiceName} ${stringUtils.uncapitalize(${service.name})}) { // post construct implementation } @javax.ejb.PrePassivate public void prePassivate(${service.fullyQualifiedServiceName} ${stringUtils.uncapitalize(${service.name})}) { // pre passivate implementation } @javax.ejb.PreDestroy public void preDestroy(${service.fullyQualifiedServiceName} ${stringUtils.uncapitalize(${service.name})}) { // pre destroy implementation } @javax.ejb.Remove public void remove(${service.fullyQualifiedServiceName} ${stringUtils.uncapitalize(${service.name})}) { // remove implementation } } |