summaryrefslogtreecommitdiff
path: root/src/drivers/DriverManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/DriverManager.java')
-rw-r--r--src/drivers/DriverManager.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/drivers/DriverManager.java b/src/drivers/DriverManager.java
new file mode 100644
index 0000000..9a3c37c
--- /dev/null
+++ b/src/drivers/DriverManager.java
@@ -0,0 +1,48 @@
+package org.manzerbredes.open_klm.drivers;
+
+
+/**
+ * Driver Manager
+ *
+ * @author Manzerbredes
+ *
+ */
+public class DriverManager{
+
+ /**
+ * List of avalaible drivers
+ */
+ private Class<?>[] drivers={
+ Driver_1770_ff00.class
+ };
+
+
+
+ /**
+ * Get a successfully loaded driver
+ *
+ * @return Driver the loaded driver.
+ */
+ public Driver getDevice(){
+ // Walk on driver list
+ for(int i=0;i<this.drivers.length;i++){
+ // Try to load each drivers
+ try {
+ Driver drv=(Driver) this.drivers[i].newInstance();
+ // If success return it
+ if(drv.initDriver())
+ return drv;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ // If no driver avalaible
+ return null;
+ }
+
+
+
+
+
+
+} \ No newline at end of file