Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-11-07 23:23:14 +0000
committerafinkbein2008-11-07 23:23:14 +0000
commit5dcead05bd0ed5b88acb837791779193ab8b2ea8 (patch)
treecf6a8df7bfe046e81d20d79454fe8d8d7d868232
parent3d1ee930b925de10493598661c35bd38ed6ecbf6 (diff)
downloadorg.eclipse.osee-5dcead05bd0ed5b88acb837791779193ab8b2ea8.tar.gz
org.eclipse.osee-5dcead05bd0ed5b88acb837791779193ab8b2ea8.tar.xz
org.eclipse.osee-5dcead05bd0ed5b88acb837791779193ab8b2ea8.zip
-rw-r--r--org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/DatabaseInfoManager.java17
-rw-r--r--org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/internal/InternalActivator.java26
2 files changed, 21 insertions, 22 deletions
diff --git a/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/DatabaseInfoManager.java b/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/DatabaseInfoManager.java
index 02f389ff97a..e48a671a1b0 100644
--- a/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/DatabaseInfoManager.java
+++ b/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/DatabaseInfoManager.java
@@ -3,6 +3,7 @@ package org.eclipse.osee.framework.db.connection;
import java.io.IOException;
import java.io.InputStream;
import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeDataStoreException;
import org.eclipse.osee.framework.db.connection.exception.OseeWrappedException;
import org.eclipse.osee.framework.db.connection.internal.InternalActivator;
import org.eclipse.osee.framework.db.connection.internal.parser.DbConfigParser;
@@ -15,12 +16,20 @@ public class DatabaseInfoManager {
private DatabaseInfoManager() {
}
- public static IDatabaseInfo getDefault() {
- return InternalActivator.getConnectionInfos().getSelectedDatabaseInfo();
+ public static IDatabaseInfo getDefault() throws OseeDataStoreException {
+ try {
+ return InternalActivator.getConnectionInfos().getSelectedDatabaseInfo();
+ } catch (InterruptedException ex) {
+ throw new OseeDataStoreException(ex);
+ }
}
- public static IDatabaseInfo getDataStoreById(String id) {
- return InternalActivator.getConnectionInfos().getDatabaseInfo(id);
+ public static IDatabaseInfo getDataStoreById(String id) throws OseeDataStoreException {
+ try {
+ return InternalActivator.getConnectionInfos().getDatabaseInfo(id);
+ } catch (InterruptedException ex) {
+ throw new OseeDataStoreException(ex);
+ }
}
public static IDatabaseInfo[] readFromXml(InputStream inputStream) throws OseeCoreException {
diff --git a/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/internal/InternalActivator.java b/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/internal/InternalActivator.java
index b9c21c3f905..e85441fd2d3 100644
--- a/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/internal/InternalActivator.java
+++ b/org.eclipse.osee.framework.db.connection/src/org/eclipse/osee/framework/db/connection/internal/InternalActivator.java
@@ -21,34 +21,24 @@ import org.osgi.util.tracker.ServiceTracker;
*/
public class InternalActivator implements BundleActivator {
+ private static final long TIMEOUT = 20000;
+
private static InternalActivator instance = null;
private ServiceTracker applicationDbManagerTracker;
private ServiceTracker dbConnectionProviderTracker;
private ServiceTracker dbConnectionInfoTracker;
- public static IDbConnectionFactory getConnectionFactory() {
- try {
- return (IDbConnectionFactory) instance.dbConnectionProviderTracker.waitForService(20000);
- } catch (InterruptedException ex) {
- return null;
- }
+ public static IDbConnectionFactory getConnectionFactory() throws InterruptedException {
+ return (IDbConnectionFactory) instance.dbConnectionProviderTracker.waitForService(TIMEOUT);
}
- public static IDbConnectionInformation getConnectionInfos() {
- try {
- return (IDbConnectionInformation) instance.dbConnectionInfoTracker.waitForService(20000);
- } catch (InterruptedException ex) {
- return null;
- }
+ public static IDbConnectionInformation getConnectionInfos() throws InterruptedException {
+ return (IDbConnectionInformation) instance.dbConnectionInfoTracker.waitForService(TIMEOUT);
}
- public static IApplicationDatabaseManager getApplicationDatabaseManager() {
- try {
- return (IApplicationDatabaseManager) instance.applicationDbManagerTracker.waitForService(20000);
- } catch (InterruptedException ex) {
- return null;
- }
+ public static IApplicationDatabaseManager getApplicationDatabaseManager() throws InterruptedException {
+ return (IApplicationDatabaseManager) instance.applicationDbManagerTracker.waitForService(TIMEOUT);
}
public static IApplicationDatabaseInfoProvider getApplicationDatabaseProvider() throws OseeCoreException, InterruptedException {

Back to the top