svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / data / object / ObjectDriverDataSourceAdapter.java @ 1956
History | View | Annotate | Download (1.62 KB)
1 |
package com.hardcode.gdbms.engine.data.object; |
---|---|
2 |
|
3 |
import com.hardcode.gdbms.engine.data.driver.DriverCommons; |
4 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
5 |
import com.hardcode.gdbms.engine.data.driver.ObjectDriver; |
6 |
import com.hardcode.gdbms.engine.data.driver.ReadAccess; |
7 |
import com.hardcode.gdbms.engine.data.file.AbstractFileDataSource; |
8 |
|
9 |
|
10 |
/**
|
11 |
*
|
12 |
*/
|
13 |
class ObjectDriverDataSourceAdapter extends AbstractFileDataSource implements ObjectDataSource { |
14 |
private ObjectDriver readDriver;
|
15 |
/**
|
16 |
* @see com.hardcode.gdbms.engine.data.DataSource#start()
|
17 |
*/
|
18 |
public void start() throws DriverException { |
19 |
if (readDriver instanceof DriverCommons) { |
20 |
((DriverCommons) readDriver).setDataSourceFactory(getDataSourceFactory()); |
21 |
} |
22 |
} |
23 |
|
24 |
/**
|
25 |
* @see com.hardcode.gdbms.engine.data.DataSource#stop()
|
26 |
*/
|
27 |
public void stop() throws DriverException { |
28 |
} |
29 |
|
30 |
/**
|
31 |
* @see com.hardcode.gdbms.engine.data.DataSource#getDriver()
|
32 |
*/
|
33 |
public ReadAccess getReadDriver() {
|
34 |
return readDriver;
|
35 |
} |
36 |
|
37 |
/**
|
38 |
* DOCUMENT ME!
|
39 |
*
|
40 |
* @param readDriver DOCUMENT ME!
|
41 |
*/
|
42 |
public void setDriver(ObjectDriver readDriver) { |
43 |
this.readDriver = readDriver;
|
44 |
} |
45 |
|
46 |
/**
|
47 |
* @see com.hardcode.gdbms.engine.data.file.AbstractFileDataSource#getDriverInfo()
|
48 |
*/
|
49 |
public DriverCommons getDriverInfo() {
|
50 |
if (readDriver instanceof DriverCommons) { |
51 |
return (DriverCommons) readDriver;
|
52 |
} else {
|
53 |
return null; |
54 |
} |
55 |
} |
56 |
|
57 |
/**
|
58 |
* @see com.hardcode.gdbms.engine.data.DataSource#getDBMS()
|
59 |
*/
|
60 |
public String getDBMS() { |
61 |
return sourceInfo.dbms;
|
62 |
} |
63 |
|
64 |
/**
|
65 |
* @see com.hardcode.gdbms.engine.data.DataSource#getName()
|
66 |
*/
|
67 |
public String getName() { |
68 |
return sourceInfo.name;
|
69 |
} |
70 |
} |