Update of /cvsroot/jrobin/src/org/jrobin/inspector
In directory sc8-pr-cvs1:/tmp/cvs-serv6751/org/jrobin/inspector
Modified Files:
ArchiveTableModel.java DataTableModel.java
DatasourceTableModel.java HeaderTableModel.java
MainTreeModel.java
Log Message:
Removed RrdDbPool for inspector - not appropriate...
Index: ArchiveTableModel.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/ArchiveTableModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ArchiveTableModel.java 12 Nov 2003 13:24:24 -0000 1.3
--- ArchiveTableModel.java 13 Nov 2003 15:33:28 -0000 1.4
***************
*** 38,42 ****
};
private static final String[] COLUMN_NAMES = {"description", "value"};
- private static final RrdDbPool pool = RrdDbPool.getInstance();
private File file;
--- 38,41 ----
***************
*** 85,89 ****
if(dsIndex >= 0 && arcIndex >= 0) {
try {
! RrdDb rrd = pool.requestRrdDb(file.getAbsolutePath());
Archive arc = rrd.getArchive(arcIndex);
ArcState state = arc.getArcState(dsIndex);
--- 84,88 ----
if(dsIndex >= 0 && arcIndex >= 0) {
try {
! RrdDb rrd = new RrdDb(file.getAbsolutePath());
Archive arc = rrd.getArchive(arcIndex);
ArcState state = arc.getArcState(dsIndex);
***************
*** 98,106 ****
"" + arc.getEndTime() + " [" + new Date(arc.getEndTime() * 1000L) + "]"
};
! pool.release(rrd);
}
catch (IOException e) {
}
catch (RrdException e) {
}
}
--- 97,107 ----
"" + arc.getEndTime() + " [" + new Date(arc.getEndTime() * 1000L) + "]"
};
! rrd.close();
}
catch (IOException e) {
+ e.printStackTrace();
}
catch (RrdException e) {
+ e.printStackTrace();
}
}
Index: DataTableModel.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/DataTableModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DataTableModel.java 12 Nov 2003 13:24:25 -0000 1.3
--- DataTableModel.java 13 Nov 2003 15:33:28 -0000 1.4
***************
*** 35,39 ****
class DataTableModel extends AbstractTableModel {
private static final String[] COLUMN_NAMES = {"timestamp", "date", "value"};
- private static final RrdDbPool pool = RrdDbPool.getInstance();
private File file;
--- 35,38 ----
***************
*** 79,83 ****
if(dsIndex >= 0 && arcIndex >= 0) {
try {
! RrdDb rrd = pool.requestRrdDb(file.getAbsolutePath());
Archive arc = rrd.getArchive(arcIndex);
Robin robin = arc.getRobin(dsIndex);
--- 78,82 ----
if(dsIndex >= 0 && arcIndex >= 0) {
try {
! RrdDb rrd = new RrdDb(file.getAbsolutePath());
Archive arc = rrd.getArchive(arcIndex);
Robin robin = arc.getRobin(dsIndex);
***************
*** 94,102 ****
};
}
! pool.release(rrd);
}
catch (IOException e) {
}
catch (RrdException e) {
}
}
--- 93,103 ----
};
}
! rrd.close();
}
catch (IOException e) {
+ e.printStackTrace();
}
catch (RrdException e) {
+ e.printStackTrace();
}
}
Index: DatasourceTableModel.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/DatasourceTableModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** DatasourceTableModel.java 12 Nov 2003 13:24:25 -0000 1.3
--- DatasourceTableModel.java 13 Nov 2003 15:33:28 -0000 1.4
***************
*** 28,32 ****
import org.jrobin.core.Datasource;
import org.jrobin.core.RrdException;
- import org.jrobin.core.RrdDbPool;
import javax.swing.table.AbstractTableModel;
--- 28,31 ----
***************
*** 38,42 ****
"max value", "last value", "accum. value", "NaN seconds"};
private static final String[] COLUMN_NAMES = {"description", "value"};
- private static final RrdDbPool pool = RrdDbPool.getInstance();
private File file;
--- 37,40 ----
***************
*** 84,88 ****
if(dsIndex >= 0) {
try {
! RrdDb rrd = pool.requestRrdDb(file.getAbsolutePath());
Datasource ds = rrd.getDatasource(dsIndex);
values = new Object[]{
--- 82,86 ----
if(dsIndex >= 0) {
try {
! RrdDb rrd = new RrdDb(file.getAbsolutePath());
Datasource ds = rrd.getDatasource(dsIndex);
values = new Object[]{
***************
*** 96,104 ****
"" + ds.getNanSeconds()
};
! pool.release(rrd);
}
catch (IOException e) {
}
catch (RrdException e) {
}
}
--- 94,104 ----
"" + ds.getNanSeconds()
};
! rrd.close();
}
catch (IOException e) {
+ e.printStackTrace();
}
catch (RrdException e) {
+ e.printStackTrace();
}
}
Index: HeaderTableModel.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/HeaderTableModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HeaderTableModel.java 12 Nov 2003 13:24:25 -0000 1.3
--- HeaderTableModel.java 13 Nov 2003 15:33:28 -0000 1.4
***************
*** 29,33 ****
import org.jrobin.core.Header;
import org.jrobin.core.RrdException;
- import org.jrobin.core.RrdDbPool;
import javax.swing.table.AbstractTableModel;
--- 29,32 ----
***************
*** 40,44 ****
"datasources", "archives", "size"};
private static final String[] COLUMN_NAMES = {"description", "value"};
- private static final RrdDbPool pool = RrdDbPool.getInstance();
private File file;
--- 39,42 ----
***************
*** 78,82 ****
values = null;
String path = file.getAbsolutePath();
! RrdDb rrd = pool.requestRrdDb(path);
Header header = rrd.getHeader();
String signature = header.getSignature();
--- 76,80 ----
values = null;
String path = file.getAbsolutePath();
! RrdDb rrd = new RrdDb(path);
Header header = rrd.getHeader();
String signature = header.getSignature();
***************
*** 87,91 ****
String archives = "" + header.getArcCount();
String size = rrd.getRrdFile().getFileSize() + " bytes";
! pool.release(rrd);
values = new Object[] {
path, signature, step, lastTimestamp, datasources, archives, size
--- 85,89 ----
String archives = "" + header.getArcCount();
String size = rrd.getRrdFile().getFileSize() + " bytes";
! rrd.close();
values = new Object[] {
path, signature, step, lastTimestamp, datasources, archives, size
Index: MainTreeModel.java
===================================================================
RCS file: /cvsroot/jrobin/src/org/jrobin/inspector/MainTreeModel.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MainTreeModel.java 12 Nov 2003 13:24:25 -0000 1.3
--- MainTreeModel.java 13 Nov 2003 15:33:28 -0000 1.4
***************
*** 28,32 ****
import org.jrobin.core.RrdDb;
import org.jrobin.core.RrdException;
- import org.jrobin.core.RrdDbPool;
import javax.swing.tree.DefaultTreeModel;
--- 28,31 ----
***************
*** 38,42 ****
private static final DefaultMutableTreeNode INVALID_NODE =
new DefaultMutableTreeNode("No valid RRD file specified");
- private static final RrdDbPool pool = RrdDbPool.getInstance();
private File file;
--- 37,40 ----
***************
*** 50,54 ****
try {
file = newFile;
! RrdDb rrd = pool.requestRrdDb(file.getAbsolutePath());
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new RrdNode(rrd));
int dsCount = rrd.getRrdDef().getDsCount();
--- 48,52 ----
try {
file = newFile;
! RrdDb rrd = new RrdDb(file.getAbsolutePath());
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new RrdNode(rrd));
int dsCount = rrd.getRrdDef().getDsCount();
***************
*** 64,68 ****
root.add(dsNode);
}
! pool.release(rrd);
setRoot(root);
}
--- 62,66 ----
root.add(dsNode);
}
! rrd.close();
setRoot(root);
}
|