Hi,
Here in this post there are some standard MDB3.0 annotations are demonstrated which can be used to make our MDBs Code Container Independent. Now if we use the following Properties as part of @javax.ejb.ActivationConfigProperty then our MDB will become Vendor independent and then we can deploy the same MDB in most of the Popular containers like OC4J, WebLogic…etc.
Advantage of using @javax.ejb.ActivationConfigProperty annotation is …It eliminates the presence of “weblogic-ejb-jar.xml” (WebLogic Specific configuration file for EJBs).
NOTE: If we will provide @javax.ejb.ActivationConfigProperty and “weblogic-ejb-jar.xml” file configurations together then Always “weblogic-ejb-jar.xml” file configuration will take precedence over the Annotations.
Example:
@MessageDriven( activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") , @ActivationConfigProperty(propertyName="connectionFactoryJndiName",propertyValue="QCF"), @ActivationConfigProperty(propertyName="destinationJndiName", propertyValue="TestQ") },mappedName="TestQ" )
More Examples can be seen in the following Link: mdb3-0-sample-for-weblogic-application-server/
For Informations And Meaning about the Tags of “weblogic-ejb-jar.xml” Please refer to:
http://download.oracle.com/docs/cd/E15051_01/wls/docs103/ejb/DDreference-ejb-jar.html#wp1113444
Below are the Tags of “weblogic-ejb-jar.xml” and their Equivalent proeprties which can be used in the @ActivationConfigProperty
WebLogic 10.3.3 provides Support for many Properties Mentioned Below:
connection-factory-jndi-name (Equivalent Property: connectionFactoryJndiName)
destination-jndi-name (Equivalent Property: destinationJndiName)
distributed-destination-connection (Equivalent Property:distributedDestinationConnection)
connection-factory-resource-link (Equivalent Property: connectionFactoryResourceLink )
resource-adapter-jndi-name (Equivalent Property: resourceAdapterJndiName)
destination-resource-link (Equivalent Property: destinationResourceLink)
Jms-polling-interval-seconds(Equivalent Property: jmsPollingIntervalSeconds )
jms-client-id(Equivalent Property: jmsClientId)
durable-subscription-deletion (Equivalent Property: durableSubscriptionDeletion )
max-messages-in-transaction (Equivalent Property: maxMessagesInTransaction)
max-suspend-seconds (Equivalent Property: maxSuspendSeconds)
init-suspend-seconds (Equivalent Property: initSuspendSeconds)
use81-style-polling (Equivalent Property: use81StylePolling)
initial-context-factory (Equivalent Property: initialContextFactory)
provider-url (Equivalent Property: providerURL)
.
.
Thanks
Jay SenSharma
July 3rd, 2010 on 3:56 pm
is any annotations available for configuring initial-beans-in-free-pool with out using descriptor xml in weblogic 11g.
July 3rd, 2010 on 4:20 pm
Hi Ramesh,
No, So far there is no such Annotation available as part of WebLogic 11g to specify the “initial-beans-in-free-pool” using Annotations. If we want to change it then we need to generate the “weblogic-ejb-jar.xml” and then we need to provide the Value for this attribute. Many new annotations have been introduced in WLS11g EJB container but those are specially for MDBs but the one which u want to use is not yet implemented.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 5th, 2010 on 11:30 am
Admin,
but weblogic.ejbgen.MessageDriven annotations supports
initial-beans-in-free-pool like
@MessageDriven(ejbName=”xxxxbean”,
destinationJndiName=”xxxjndiname “,
destinationType=”javax.jms.Queue”,
maxBeansInFreePool=”10″,
initialBeansInFreePool=”1″,
transTimeoutSeconds=”90″,
defaultTransaction = MessageDriven.DefaultTransaction.NOT_SUPPORTED)
How can we use this annotations ?
July 5th, 2010 on 11:57 am
Hi Ramesh,
EJBGen annotations are WebLogic Container specific Annotations which is Suitable for EJB2.x kind of Beans only. EJBGen tool cannot be used for generation of EJB3 classes because it supports only EJB2.x.
EJB3.0 Uses standard Annotations which are not container specific. And so far there is no such annotation available as part of EJB3 Standars to specify the “initialBeansInFreePool”. So we have only one option left to change the “initialBeansInFreePool” that is Using Container Specific deployment descriptors “weblogic-ejb-jar.xml”…we need to edit this file.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 5th, 2010 on 1:10 pm
Is any patches available for solving or Is it configurable in admin console it self ?
July 5th, 2010 on 4:29 pm
Hi Ramesh,
There is no Annotation available to change the “initial-beans-in-free-pool” as part of Standered EJB3.0 Specification ….. How ever you can use the “Plan.xml” feature of WebLogic to Change the Values of this Tuning Parameter. I have developed a Simple post which describes has Step By Step insctruction to achieve this Please refer to: http://middlewaremagic.com/weblogic/?p=2121/
.
.
Keep Posting 🙂
Thanks
Jay SenSharma