|
From: <lh...@us...> - 2010-02-27 18:46:34
|
Revision: 155
http://tmapi.svn.sourceforge.net/tmapi/?rev=155&view=rev
Author: lheuer
Date: 2010-02-27 18:46:28 +0000 (Sat, 27 Feb 2010)
Log Message:
-----------
Forgot to commit the OSGi-aware TopicMapSystemFactory. Done
Modified Paths:
--------------
trunk/src/main/java/org/tmapi/core/TopicMapSystemFactory.java
Modified: trunk/src/main/java/org/tmapi/core/TopicMapSystemFactory.java
===================================================================
--- trunk/src/main/java/org/tmapi/core/TopicMapSystemFactory.java 2010-02-27 18:45:15 UTC (rev 154)
+++ trunk/src/main/java/org/tmapi/core/TopicMapSystemFactory.java 2010-02-27 18:46:28 UTC (rev 155)
@@ -195,6 +195,16 @@
@SuppressWarnings("unchecked")
private static Class<? extends TopicMapSystemFactory> getImplementationClass()
throws FactoryConfigurationException {
+ try {
+ // Try use OSGi. Will fail silently within non-OSGi environments
+ Class spiClass = org.tmapi.core.internal.OsgiLocator.locate(FACTORY_PROPERTY);
+ if (spiClass != null) {
+ return (Class<TopicMapSystemFactory>) spiClass;
+ }
+ }
+ catch (Throwable e) {
+ // noop.
+ }
String implClassName = getClassNameFromProperties();
if (implClassName == null) {
implClassName = getClassNameFromResource();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|