[jboss-jira] [JBoss JIRA] (AS7-2650) ConnectionFactory.newInstance() does not provide default impl
Thomas Diesler (Commented) (JIRA)
jira-events at lists.jboss.org
Tue Nov 15 19:28:40 EST 2011
[ https://issues.jboss.org/browse/AS7-2650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12643141#comment-12643141 ]
Thomas Diesler commented on AS7-2650:
-------------------------------------
Use ServiceLoader on the TCCL, then perhaps on getClass().getClassLoader(), then fall back to the above
> ConnectionFactory.newInstance() does not provide default impl
> -------------------------------------------------------------
>
> Key: AS7-2650
> URL: https://issues.jboss.org/browse/AS7-2650
> Project: Application Server 7
> Issue Type: Bug
> Components: JAXR
> Reporter: Thomas Diesler
> Assignee: Kurt Stam
>
> The current impl
> {code}
> public static ConnectionFactory newInstance() throws JAXRException
> {
> String factoryName = null;
> ConnectionFactory factory = null;
> try
> {
> String defaultName = null;
> factoryName = System.getProperty(SYS_PROP_NAME, defaultName);
> ClassLoader loader = Thread.currentThread().getContextClassLoader();
> Class factoryClass = loader.loadClass(factoryName);
> factory = (ConnectionFactory) factoryClass.newInstance();
> }
> catch(Throwable e)
> {
> throw new JAXRException("Failed to create instance of: "+factoryName, e);
> }
> return factory;
> }
> {code}
> does not provide a default impl as documented.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list