+ class DbRoot implements DbSourceProxyRoot
+ {
+
+ private String sourceName;
+
+ private String className;
+
+ DbRoot(String sourceName, String className)
+ {
+ this.sourceName = sourceName;
+ this.className = className;
+ }
+
+ @Override
+ public String getDbSource()
+ {
+ return sourceName;
+ }
+
+ /**
+ * lazy class creation
+ *
+ * @return the actual proxy object
+ */
+ public DbSourceProxy getProxy()
+ {
+ try
+ {
+ return (DbSourceProxy) Class.forName(className).newInstance();
+ } catch (Exception e)
+ {
+ // Serious problems if this happens.
+ throw new Error(MessageManager.getString(
+ "error.dbrefsource_implementation_exception"), e);
+ }
+ }
+
+ }
+