java - Understanding the @ConnectionDefinitions annotation in jca 1.6 -


i cannot find example shows use case using plural @connectiondefinitions on managedconnectionfactory implementation. confuses me singular @connectiondefinition annotation not let provide @configproperty each definition. can use @configproperty set default properties instances of managedconnectionfactory, , every connection definition must use different connectionfactory interface. assuming did this:

@connectiondefinitions(value = {      @connectiondefinition(             connection = com.company.product.connector.myconnection.class,              connectionfactory = com.company.product.connector.connectionfactory1.class,              connectionfactoryimpl = com.company.product.connector.connectionfactory1impl.class,              connectionimpl = com.company.product.connector.myconnectionimpl.class     )      @connectiondefinition(             connection = com.company.product.connector.myconnection.class,              connectionfactory = com.company.product.connector.connectionfactory2.class,              connectionfactoryimpl = com.company.product.connector.connectionfactory2impl.class,              connectionimpl = com.company.product.connector.myconnectionimpl.class     ) }) public class mymanagedconnectionfactory implements     managedconnectionfactory, resourceadapterassociation {  @override public object createconnectionfactory(connectionmanager connectionmanager)         throws resourceexception {         //return connection factory.     } } 

how createconnectionfactory() know whether or not return connectionfactory1 or connectionfactory2? unless overrides annotation anyways through ra.xml, see no way use config-property conditional.

it seems difficult determine connection definition managedconnectionfactory part of, why when can have seperate managedconnectionfactory every connectionfactory?

an example helpful.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -