Skip to content

Commit

Permalink
added remove() method to schema pool
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 278]
  • Loading branch information
Andreas Voss committed Feb 3, 2003
1 parent df789ce commit 0760674
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/main/mondrian/rolap/RolapSchema.java
Expand Up @@ -116,16 +116,22 @@ public Dimension createDimension(Cube cube, String xml) {
return ((RolapCube) cube).createDimension(xmlDimension);
}

private static Pool pool = new Pool();
/**
* A pool is a collection of schemas. Call <code>Pool.instance.{@link #get
* get(catalogName,jdbcConnectString)</code>.
*/
static class Pool {
HashMap mapUrlToSchema = new HashMap();
static Pool instance() {
public static class Pool {
private static Pool pool = new Pool();

private HashMap mapUrlToSchema = new HashMap();

private Pool() {
}

public static Pool instance() {
return pool;
}

synchronized RolapSchema get(
String catalogName, String jdbcConnectString,
Util.PropertyList connectInfo) {
Expand All @@ -136,10 +142,14 @@ synchronized RolapSchema get(
mapUrlToSchema.put(key, schema);
// Must create RolapConnection after we add to map, otherwise
// we will loop.
schema.internalConnection = new RolapConnection(connectInfo, schema);
// no, this is redundant - its set in the ctor of RolapSchema
// schema.internalConnection = new RolapConnection(connectInfo, schema);
}
return schema;
}
public synchronized void remove(String catalogName, String jdbcConnectString) {
mapUrlToSchema.remove(catalogName + ":" + jdbcConnectString);
}
}

public Cube lookupCube(String cube,boolean failIfNotFound)
Expand Down

0 comments on commit 0760674

Please sign in to comment.