You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
(46) |
Oct
(102) |
Nov
(10) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(3) |
Mar
(14) |
Apr
(9) |
May
(12) |
Jun
(4) |
Jul
(40) |
Aug
(60) |
Sep
(38) |
Oct
(2) |
Nov
(1) |
Dec
(42) |
2008 |
Jan
(23) |
Feb
(29) |
Mar
(107) |
Apr
(27) |
May
(3) |
Jun
(1) |
Jul
(15) |
Aug
(7) |
Sep
(19) |
Oct
|
Nov
(2) |
Dec
|
2009 |
Jan
(36) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(15) |
Jul
(30) |
Aug
(32) |
Sep
(11) |
Oct
(21) |
Nov
(12) |
Dec
(15) |
2010 |
Jan
(29) |
Feb
(9) |
Mar
(25) |
Apr
|
May
(7) |
Jun
(5) |
Jul
(21) |
Aug
(32) |
Sep
(10) |
Oct
(8) |
Nov
(29) |
Dec
(8) |
2011 |
Jan
(9) |
Feb
(35) |
Mar
(11) |
Apr
(4) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(30) |
2012 |
Jan
(5) |
Feb
(7) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mwl...@us...> - 2009-01-22 22:22:28
|
Revision: 853 http://cishell.svn.sourceforge.net/cishell/?rev=853&view=rev Author: mwlinnem Date: 2009-01-22 22:00:42 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Complete and total disgusting hack in order to get everything to "work right". Will be changing this later for sure. Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java Modified: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-22 19:47:33 UTC (rev 852) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-22 22:00:42 UTC (rev 853) @@ -1,8 +1,15 @@ package org.cishell.reference.service.database; +import java.sql.Connection; +import java.sql.DatabaseMetaData; +import java.sql.DriverManager; +import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Statement; import java.util.Hashtable; +import javax.sql.DataSource; + import org.apache.commons.dbcp.ConnectionFactory; import org.apache.commons.dbcp.DriverManagerConnectionFactory; import org.apache.commons.dbcp.PoolableConnectionFactory; @@ -15,9 +22,11 @@ import org.cishell.service.database.DatabaseService; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; -import org.osgi.service.log.LogService; + + public class DatabaseServiceImpl implements DatabaseService, BundleActivator { /* TODO: These variables should be abstracted out in a Preferences page at some point (I guess). @@ -28,12 +37,7 @@ private static final String DEFAULT_CREATE_CONNECTION_STRING = ";create=true"; private static final String DEFAULT_DB_NAME = "ultra_sasquatch"; - // Give each db a unique (but meaningless) name by counting up from 0 for each - // new database. - /* TODO: Using a rolling counter like this may have bad implications later on, - but it's decent for now. - */ - //Not used for now + //db name must be unique per running instance of the same NWB installation, otherwise they will overlap private static int dbNameCounter = 0; private ServiceRegistration databaseServiceRegistration; @@ -53,6 +57,17 @@ databaseServiceRegistration = context.registerService (DatabaseService.class.getName(), this, new Hashtable()); + ServiceReference ref = context.getServiceReference(DatabaseService.class.getName()); + if (ref == null) { + System.out.println("REEEEEEEEEEEEEEEEEEEEEEEFFFFFFF IS NUUUUUUUULLLLLLL!!@!(@!(!)!"); + } + DatabaseService dbService = (DatabaseService) context.getService(ref); + if (dbService == null) { + System.out.println("DEEEBEESEERVICE IS NUUUUL!L!@L!@!@!@@!@!@L..1"); + } else { + + } + // Get MY data source! It's mine, and you can't have it! try { myDataSource = createDatabase(); @@ -63,13 +78,43 @@ } System.err.println("meep?"); + cleanOutDatabaseTables(); } + + private void cleanOutDatabaseTables() throws Exception { + //TODO: We need to be cleaning up and starting the DB correctly + //TODO: Clean this up + DataSource ds = getDataSource(); + Connection c = ds.getConnection(); + DatabaseMetaData dmd = c.getMetaData(); + ResultSet tableNames = dmd.getTables(null, null, null, null); + while (tableNames.next()) { + for (int ii = 1; ii <= tableNames.getMetaData().getColumnCount(); ii++) { + String tableContents = tableNames.getString(ii); + System.out.print(tableContents + ", "); + } + if (tableNames.getString(2).indexOf("APP") != -1) { + System.out.println("MAGOOT!"); + Statement s = c.createStatement(); + System.out.println(tableNames.getString(3)); + System.out.println(s.executeUpdate("DROP TABLE APP." + tableNames.getString(3))); + + } + System.out.println(""); + } + } public void stop(BundleContext context) throws Exception { + cleanOutDatabaseTables(); + try { + DriverManager.getConnection("jdbc:derby:;shutdown=true"); + } catch (Exception e) { + + } } // If one hasn't been created yet, create a connection pool and return it. - private PoolingDataSource getConnectionPool() throws DatabaseCreationException + private PoolingDataSource getDataSource() throws DatabaseCreationException { if (poolingDataSource != null) return poolingDataSource; @@ -82,6 +127,7 @@ // We can use this later to check acceptsUrl for better error reporting. // Driver jdbcDriver = (Driver) Class.forName(driver).newInstance(); + //TODO: It may exist from before, actually. Fix this. String newDatabaseName = DEFAULT_DB_NAME; String newDatabaseConnectionURL = DEFAULT_PROTOCOL + @@ -132,6 +178,6 @@ } public DataSourceWithID createDatabase() throws DatabaseCreationException { - return new DataSourceWithIDImpl(getConnectionPool()); + return new DataSourceWithIDImpl(getDataSource()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-22 19:47:43
|
Revision: 852 http://cishell.svn.sourceforge.net/cishell/?rev=852&view=rev Author: mwlinnem Date: 2009-01-22 19:47:33 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Altered CIShellContext contract so that it attempts to find a requested service, even if it is not one of the standard services. Modified Paths: -------------- trunk/core/org.cishell.framework/src/org/cishell/framework/CIShellContext.java trunk/core/org.cishell.framework/src/org/cishell/framework/LocalCIShellContext.java Modified: trunk/core/org.cishell.framework/src/org/cishell/framework/CIShellContext.java =================================================================== --- trunk/core/org.cishell.framework/src/org/cishell/framework/CIShellContext.java 2009-01-22 18:10:47 UTC (rev 851) +++ trunk/core/org.cishell.framework/src/org/cishell/framework/CIShellContext.java 2009-01-22 19:47:33 UTC (rev 852) @@ -41,8 +41,10 @@ GUIBuilderService.class.getName()}; /** - * Locates and returns a standard service given the service name. The + * Locates and returns a service given the service name. The * service name is generally the full class name of the service interface. + * Standard CIShell services are guaranteed to be returned, but requests + * for non-standard services may return null. * For example, <code>LogService</code>'s string is * <code>org.osgi.service.log.LogService</code>. * Modified: trunk/core/org.cishell.framework/src/org/cishell/framework/LocalCIShellContext.java =================================================================== --- trunk/core/org.cishell.framework/src/org/cishell/framework/LocalCIShellContext.java 2009-01-22 18:10:47 UTC (rev 851) +++ trunk/core/org.cishell.framework/src/org/cishell/framework/LocalCIShellContext.java 2009-01-22 19:47:33 UTC (rev 852) @@ -61,6 +61,7 @@ * @see org.cishell.framework.CIShellContext#getService(java.lang.String) */ public Object getService(String service) { + //check if the requested service is a standard service for (int i=0; i < standardServices.length; i++) { if (standardServices[i].equals(service)) { ServiceReference ref = bContext.getServiceReference(service); @@ -73,6 +74,12 @@ } } - return null; + /* + * if it is not a standard service, we try to retrieve it anyway, + * but make no guarantees as to its availability + */ + + ServiceReference ref = bContext.getServiceReference(service); + return bContext.getService(ref); //may be null } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-22 18:10:51
|
Revision: 851 http://cishell.svn.sourceforge.net/cishell/?rev=851&view=rev Author: mwlinnem Date: 2009-01-22 18:10:47 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Fixed imports. Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF Modified: trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-22 16:58:37 UTC (rev 850) +++ trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-22 18:10:47 UTC (rev 851) @@ -10,6 +10,7 @@ org.apache.commons.pool, org.apache.commons.pool.impl, org.apache.derby, + org.apache.derby.jdbc, org.cishell.framework.algorithm;version="1.0.0", org.cishell.service.database, org.osgi.framework;version="1.4.0", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-22 16:58:41
|
Revision: 850 http://cishell.svn.sourceforge.net/cishell/?rev=850&view=rev Author: mwlinnem Date: 2009-01-22 16:58:37 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Corrected the interface to implement DataSource. Modified Paths: -------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java Modified: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java 2009-01-22 16:56:57 UTC (rev 849) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java 2009-01-22 16:58:37 UTC (rev 850) @@ -4,8 +4,10 @@ import java.sql.Connection; import java.sql.SQLException; -public interface DataSourceWithID { +import javax.sql.DataSource; +public interface DataSourceWithID extends DataSource { + public abstract int getID(); public abstract Connection getConnection() throws SQLException; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-22 16:57:02
|
Revision: 849 http://cishell.svn.sourceforge.net/cishell/?rev=849&view=rev Author: mwlinnem Date: 2009-01-22 16:56:57 +0000 (Thu, 22 Jan 2009) Log Message: ----------- Made DataSourceWithID into an interface, and moved the implementation to the reference plugin. Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java Added Paths: ----------- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DataSourceWithIDImpl.java Copied: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DataSourceWithIDImpl.java (from rev 848, trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java) =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DataSourceWithIDImpl.java (rev 0) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DataSourceWithIDImpl.java 2009-01-22 16:56:57 UTC (rev 849) @@ -0,0 +1,79 @@ +package org.cishell.reference.service.database; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +import javax.sql.DataSource; + +import org.cishell.service.database.DataSourceWithID; + +public class DataSourceWithIDImpl implements DataSource, DataSourceWithID { + private static int idCounter = 0; + + private DataSource wrappedDataSource; + private int id; + + private static int generateNewID() { + int newID = idCounter; + + idCounter++; + + return newID; + } + + public DataSourceWithIDImpl(DataSource wrappedDataSource) { + this.wrappedDataSource = wrappedDataSource; + this.id = generateNewID(); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#getID() + */ + public int getID() { + return id; + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#getConnection() + */ + public Connection getConnection() throws SQLException { + return this.wrappedDataSource.getConnection(); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#getConnection(java.lang.String, java.lang.String) + */ + public Connection getConnection(String username, String password) + throws SQLException { + return this.wrappedDataSource.getConnection(username, password); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#getLogWriter() + */ + public PrintWriter getLogWriter() throws SQLException { + return this.wrappedDataSource.getLogWriter(); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#setLogWriter(java.io.PrintWriter) + */ + public void setLogWriter(PrintWriter out) throws SQLException { + this.wrappedDataSource.setLogWriter(out); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#getLoginTimeout() + */ + public int getLoginTimeout() throws SQLException { + return this.wrappedDataSource.getLoginTimeout(); + } + + /* (non-Javadoc) + * @see org.cishell.service.database.DataSourceWithIDI#setLoginTimeout(int) + */ + public void setLoginTimeout(int seconds) throws SQLException { + this.wrappedDataSource.setLoginTimeout(seconds); + } +} \ No newline at end of file Property changes on: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DataSourceWithIDImpl.java ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-21 21:57:08 UTC (rev 848) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-22 16:56:57 UTC (rev 849) @@ -33,6 +33,7 @@ /* TODO: Using a rolling counter like this may have bad implications later on, but it's decent for now. */ + //Not used for now private static int dbNameCounter = 0; private ServiceRegistration databaseServiceRegistration; @@ -82,7 +83,7 @@ // Driver jdbcDriver = (Driver) Class.forName(driver).newInstance(); String newDatabaseName = - DEFAULT_DB_NAME + Integer.toString(dbNameCounter); + DEFAULT_DB_NAME; String newDatabaseConnectionURL = DEFAULT_PROTOCOL + newDatabaseName + DEFAULT_CREATE_CONNECTION_STRING; @@ -131,6 +132,6 @@ } public DataSourceWithID createDatabase() throws DatabaseCreationException { - return new DataSourceWithID(getConnectionPool()); + return new DataSourceWithIDImpl(getConnectionPool()); } } Modified: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java 2009-01-21 21:57:08 UTC (rev 848) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java 2009-01-22 16:56:57 UTC (rev 849) @@ -1,56 +1,23 @@ -package org.cishell.service.database; - -import java.io.PrintWriter; -import java.sql.Connection; -import java.sql.SQLException; - -import javax.sql.DataSource; - -public class DataSourceWithID implements DataSource { - private static int idCounter = 0; - - private DataSource wrappedDataSource; - private int id; - - private static int generateNewID() { - int newID = idCounter; - - idCounter++; - - return newID; - } - - public DataSourceWithID(DataSource wrappedDataSource) { - this.wrappedDataSource = wrappedDataSource; - this.id = generateNewID(); - } - - public int getID() { - return id; - } - - public Connection getConnection() throws SQLException { - return this.wrappedDataSource.getConnection(); - } - - public Connection getConnection(String username, String password) - throws SQLException { - return this.wrappedDataSource.getConnection(username, password); - } - - public PrintWriter getLogWriter() throws SQLException { - return this.wrappedDataSource.getLogWriter(); - } - - public void setLogWriter(PrintWriter out) throws SQLException { - this.wrappedDataSource.setLogWriter(out); - } - - public int getLoginTimeout() throws SQLException { - return this.wrappedDataSource.getLoginTimeout(); - } - - public void setLoginTimeout(int seconds) throws SQLException { - this.wrappedDataSource.setLoginTimeout(seconds); - } +package org.cishell.service.database; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +public interface DataSourceWithID { + + public abstract int getID(); + + public abstract Connection getConnection() throws SQLException; + + public abstract Connection getConnection(String username, String password) throws SQLException; + + public abstract PrintWriter getLogWriter() throws SQLException; + + public abstract void setLogWriter(PrintWriter out) throws SQLException; + + public abstract int getLoginTimeout() throws SQLException; + + public abstract void setLoginTimeout(int seconds) throws SQLException; + } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-21 22:22:12
|
Revision: 848 http://cishell.svn.sourceforge.net/cishell/?rev=848&view=rev Author: pataphil Date: 2009-01-21 21:57:08 +0000 (Wed, 21 Jan 2009) Log Message: ----------- Changed starting mechanism from immedate activatation to bundle starting. Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java Modified: trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-21 21:09:43 UTC (rev 847) +++ trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-21 21:57:08 UTC (rev 848) @@ -4,10 +4,12 @@ Bundle-SymbolicName: org.cishell.reference.service.database Bundle-Version: 1.0.0 Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Bundle-Activator: org.cishell.reference.service.database.DatabaseServiceImpl X-AutoStart: true Import-Package: org.apache.commons.dbcp, org.apache.commons.pool, org.apache.commons.pool.impl, + org.apache.derby, org.cishell.framework.algorithm;version="1.0.0", org.cishell.service.database, org.osgi.framework;version="1.4.0", Modified: trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml =================================================================== --- trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml 2009-01-21 21:09:43 UTC (rev 847) +++ trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml 2009-01-21 21:57:08 UTC (rev 848) @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> -<component name="org.cishell.reference.service.database.DatabaseService.component" immediate="true"> +<component name="org.cishell.reference.service.database.DatabaseService.component" immediate="false"> <implementation class="org.cishell.reference.service.database.DatabaseServiceImpl"/> <properties entry="OSGI-INF/service.properties"/> - <reference name="LOG" interface="org.osgi.service.log.LogService"/> <service> <provide interface= Modified: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-21 21:09:43 UTC (rev 847) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-21 21:57:08 UTC (rev 848) @@ -1,7 +1,7 @@ package org.cishell.reference.service.database; -import java.sql.ResultSet; import java.sql.SQLException; +import java.util.Hashtable; import org.apache.commons.dbcp.ConnectionFactory; import org.apache.commons.dbcp.DriverManagerConnectionFactory; @@ -10,15 +10,15 @@ import org.apache.commons.pool.KeyedObjectPoolFactory; import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory; import org.apache.commons.pool.impl.GenericObjectPool; -import org.cishell.framework.algorithm.AlgorithmExecutionException; import org.cishell.service.database.DataSourceWithID; -import org.cishell.service.database.DatabaseCopyException; import org.cishell.service.database.DatabaseCreationException; import org.cishell.service.database.DatabaseService; -import org.osgi.service.component.ComponentContext; +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; import org.osgi.service.log.LogService; -public class DatabaseServiceImpl implements DatabaseService { +public class DatabaseServiceImpl implements DatabaseService, BundleActivator { /* TODO: These variables should be abstracted out in a Preferences page at some point (I guess). */ @@ -35,26 +35,46 @@ */ private static int dbNameCounter = 0; - private static PoolingDataSource poolingDataSource = null; + private ServiceRegistration databaseServiceRegistration; + private PoolingDataSource poolingDataSource = null; + // TODO: Needed? I just want to make sure nothing goes wrong for now. + private DataSourceWithID myDataSource = null; + private String driver; - private LogService logger; - protected void activate(ComponentContext ctxt) { + public void start(BundleContext context) throws Exception { this.driver = DEFAULT_DRIVER_NAME; - this.logger = (LogService)ctxt.locateService("LOG"); + + System.err.println("starting!"); + + // Register me as a service! (This doesn't work?) + databaseServiceRegistration = context.registerService + (DatabaseService.class.getName(), this, new Hashtable()); + + // Get MY data source! It's mine, and you can't have it! + try { + myDataSource = createDatabase(); + } + catch (DatabaseCreationException e) { + System.err.println(":'( " + e.getMessage()); + throw e; + } + + System.err.println("meep?"); } - protected void deactivate(ComponentContext ctxt) { + public void stop(BundleContext context) throws Exception { } // If one hasn't been created yet, create a connection pool and return it. - private PoolingDataSource getConnectionPool() throws AlgorithmExecutionException + private PoolingDataSource getConnectionPool() throws DatabaseCreationException { if (poolingDataSource != null) return poolingDataSource; try { + System.err.println("Loading driver"); // This loads the database driver. Class.forName(DEFAULT_DRIVER_NAME); @@ -67,6 +87,8 @@ newDatabaseName + DEFAULT_CREATE_CONNECTION_STRING; + System.err.println("connection url: " + newDatabaseConnectionURL); + // This connection factory actually uses the loaded database driver to // generate connections. ConnectionFactory connectionFactory = new DriverManagerConnectionFactory @@ -96,16 +118,12 @@ poolingDataSource.getConnection().close(); } catch (SQLException e) { - this.logger.log(LogService.LOG_WARNING, - "Problem opening test connection.", - e); - - throw new AlgorithmExecutionException + throw new DatabaseCreationException ("Could not properly initiate database.", e); } } catch (ClassNotFoundException e) { - throw new AlgorithmExecutionException + throw new DatabaseCreationException ("Database driver (" + driver + ") could not be found", e); } @@ -113,20 +131,6 @@ } public DataSourceWithID createDatabase() throws DatabaseCreationException { - DataSourceWithID dataSource = null; - - return dataSource; + return new DataSourceWithID(getConnectionPool()); } - - public DataSourceWithID copyDatabase(DataSourceWithID database) - throws DatabaseCopyException { - // TODO Auto-generated method stub. - return null; - } - - public DataSourceWithID createDatabase(ResultSet resultSet) - throws DatabaseCreationException { - // TODO Auto-generated method stub - return null; - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-21 21:09:47
|
Revision: 847 http://cishell.svn.sourceforge.net/cishell/?rev=847&view=rev Author: pataphil Date: 2009-01-21 21:09:43 +0000 (Wed, 21 Jan 2009) Log Message: ----------- Updated database service interface to not include methods it doesn't need/use. Modified Paths: -------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java Modified: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-21 20:57:39 UTC (rev 846) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-21 21:09:43 UTC (rev 847) @@ -1,12 +1,5 @@ package org.cishell.service.database; -import java.sql.ResultSet; - -import javax.sql.DataSource; - public interface DatabaseService { - public DataSourceWithID createDatabase() throws DatabaseCreationException; - public DataSourceWithID createDatabase(ResultSet resultSet) throws DatabaseCreationException; - public DataSourceWithID copyDatabase(DataSourceWithID database) throws DatabaseCopyException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-21 20:57:42
|
Revision: 846 http://cishell.svn.sourceforge.net/cishell/?rev=846&view=rev Author: pataphil Date: 2009-01-21 20:57:39 +0000 (Wed, 21 Jan 2009) Log Message: ----------- Implemented part of the database service, but didn't finish. Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml trunk/core/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML trunk/core/org.cishell.reference.service.database/build.properties trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java Modified: trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-21 20:56:31 UTC (rev 845) +++ trunk/core/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-21 20:57:39 UTC (rev 846) @@ -3,13 +3,14 @@ Bundle-Name: Database Plug-in Bundle-SymbolicName: org.cishell.reference.service.database Bundle-Version: 1.0.0 -Bundle-Activator: org.cishell.reference.service.database.DatabaseServiceImpl -Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.4 +X-AutoStart: true Import-Package: org.apache.commons.dbcp, org.apache.commons.pool, org.apache.commons.pool.impl, + org.cishell.framework.algorithm;version="1.0.0", org.cishell.service.database, org.osgi.framework;version="1.4.0", org.osgi.service.component;version="1.0.0", org.osgi.service.log;version="1.3.0" +Service-Component: OSGI-INF/component.xml Modified: trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml =================================================================== --- trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml 2009-01-21 20:56:31 UTC (rev 845) +++ trunk/core/org.cishell.reference.service.database/OSGI-INF/component.xml 2009-01-21 20:57:39 UTC (rev 846) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <component name="org.cishell.reference.service.database.DatabaseService.component" immediate="true"> - <implementation class="org.cishell.reference.service.database.DatabaseServiceImpl.component"/> + <implementation class="org.cishell.reference.service.database.DatabaseServiceImpl"/> <properties entry="OSGI-INF/service.properties"/> <reference name="LOG" interface="org.osgi.service.log.LogService"/> @@ -8,7 +8,4 @@ <provide interface= "org.cishell.service.database.DatabaseService"/> </service> -</component> - - - \ No newline at end of file +</component> \ No newline at end of file Modified: trunk/core/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/core/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML 2009-01-21 20:56:31 UTC (rev 845) +++ trunk/core/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML 2009-01-21 20:57:39 UTC (rev 846) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> - <Designate pid="org.cishell.reference.prefs.admin.PrefAdmin"> - <Object ocdref="org.cishell.reference.prefs.admin.PrefAdmin.OCD" /> + <Designate pid="org.cishell.reference.service.database.DatabaseServiceImpl"> + <Object ocdref="org.cishell.reference.service.database.DatabaseServiceImpl.OCD" /> </Designate> </metatype:MetaData> Modified: trunk/core/org.cishell.reference.service.database/build.properties =================================================================== --- trunk/core/org.cishell.reference.service.database/build.properties 2009-01-21 20:56:31 UTC (rev 845) +++ trunk/core/org.cishell.reference.service.database/build.properties 2009-01-21 20:57:39 UTC (rev 846) @@ -1,4 +1,5 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ - . + .,\ + OSGI-INF/ Modified: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-21 20:56:31 UTC (rev 845) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-21 20:57:39 UTC (rev 846) @@ -2,10 +2,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -import java.util.Dictionary; -import javax.sql.DataSource; - import org.apache.commons.dbcp.ConnectionFactory; import org.apache.commons.dbcp.DriverManagerConnectionFactory; import org.apache.commons.dbcp.PoolableConnectionFactory; @@ -13,89 +10,123 @@ import org.apache.commons.pool.KeyedObjectPoolFactory; import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory; import org.apache.commons.pool.impl.GenericObjectPool; +import org.cishell.framework.algorithm.AlgorithmExecutionException; +import org.cishell.service.database.DataSourceWithID; import org.cishell.service.database.DatabaseCopyException; import org.cishell.service.database.DatabaseCreationException; import org.cishell.service.database.DatabaseService; import org.osgi.service.component.ComponentContext; import org.osgi.service.log.LogService; + public class DatabaseServiceImpl implements DatabaseService { - - //TODO: These variables should be abstracted out in a Preferences page at some point (I guess) - private static final String DEFAULT_DRIVER_NAME = "org.apache.derby.jdbc.EmbeddedDriver"; - private static final String DEFAULT_CONNECTION_STRING_PREFIX = "jdbc:derby"; - private static final String DEFAULT_CONNECTION_STRING_SUFFIX = ";create=true"; + /* TODO: These variables should be abstracted out in a Preferences page at some + point (I guess). + */ + private static final String DEFAULT_DRIVER_NAME = + "org.apache.derby.jdbc.EmbeddedDriver"; + private static final String DEFAULT_PROTOCOL = "jdbc:derby:"; + private static final String DEFAULT_CREATE_CONNECTION_STRING = ";create=true"; + private static final String DEFAULT_DB_NAME = "ultra_sasquatch"; - private static final String DEFAULT_DB_NAME = "ultra_sasquatch"; - //Give each db a unique (but meaningless) name by counting up from 0 for each new database - //TODO: Using a rolling counter like this may have bad implications later on, but it's decent for now + // Give each db a unique (but meaningless) name by counting up from 0 for each + // new database. + /* TODO: Using a rolling counter like this may have bad implications later on, + but it's decent for now. + */ private static int dbNameCounter = 0; - private LogService log; + private static PoolingDataSource poolingDataSource = null; + private String driver; + private LogService logger; + protected void activate(ComponentContext ctxt) { - - this.log = (LogService) ctxt.locateService("LOG"); + this.driver = DEFAULT_DRIVER_NAME; + this.logger = (LogService)ctxt.locateService("LOG"); } protected void deactivate(ComponentContext ctxt) { } - private void ensureConnectionPoolIsEstablished() { - try { - Class.forName(DEFAULT_DRIVER_NAME); + // If one hasn't been created yet, create a connection pool and return it. + private PoolingDataSource getConnectionPool() throws AlgorithmExecutionException + { + if (poolingDataSource != null) + return poolingDataSource; - String newDatabaseName = DEFAULT_DB_NAME + Integer.toString(dbNameCounter); - String newDatabaseConnectionURL = DEFAULT_CONNECTION_STRING_PREFIX + - newDatabaseName + - DEFAULT_CONNECTION_STRING_SUFFIX; - - ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(newDatabaseConnectionURL, null, null); - GenericObjectPool connectionPool = new GenericObjectPool(); - } catch (ClassNotFoundException e) { - throw new AlgorithmExecutionException("Database driver not found: " + driver, e); - } - } - - public DataSource createDatabase() throws DatabaseCreationException { - - javax.sql.DataSource dataSource; - try { + // This loads the database driver. Class.forName(DEFAULT_DRIVER_NAME); - //Driver jdbcDriver = (Driver) Class.forName(driver).newInstance(); //we can use this later to check acceptsUrl for better error reporting - String newDatabaseName = DEFAULT_DB_NAME + Integer.toString(dbNameCounter); - String newDatabaseConnectionURL = DEFAULT_CONNECTION_STRING_PREFIX + + // We can use this later to check acceptsUrl for better error reporting. + // Driver jdbcDriver = (Driver) Class.forName(driver).newInstance(); + + String newDatabaseName = + DEFAULT_DB_NAME + Integer.toString(dbNameCounter); + String newDatabaseConnectionURL = DEFAULT_PROTOCOL + newDatabaseName + - DEFAULT_CONNECTION_STRING_SUFFIX; + DEFAULT_CREATE_CONNECTION_STRING; - ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(newDatabaseConnectionURL, null, null); - GenericObjectPool connectionPool = new GenericObjectPool(); - dataSource = new PoolingDataSource(connectionPool); + // This connection factory actually uses the loaded database driver to + // generate connections. + ConnectionFactory connectionFactory = new DriverManagerConnectionFactory + (newDatabaseConnectionURL, null, null); + + // This is a generic object pool. It must be linked to a poolable + // object factory (PoolableObjectFactory), which the new + // PoolableConnectionFactory below is. + GenericObjectPool connectionPool = new GenericObjectPool(); - try { - dataSource.getConnection().close(); - } catch (SQLException e) { - logger.log(LogService.LOG_WARNING, "Problem opening test connection.", e); - } + // Not sure what this does? + KeyedObjectPoolFactory stmtPool = new GenericKeyedObjectPoolFactory(null); - //prefuseConnection = prefuse.data.io.sql.ConnectionFactory.getDatabaseConnection(connection); + // This is a poolable object factory (PoolableObjectFactory) used to + // create connections for an object pool. It is the glue between the + // connection factory and the object pool. + // It links itself up to the connect pool inside its constructor, which + // is why it's not assigned to a variable out here. + new PoolableConnectionFactory(connectionFactory, connectionPool, stmtPool, null, false, true); + // Finally, create the connection pool. + poolingDataSource = new PoolingDataSource(connectionPool); - - } catch (ClassNotFoundException e) { - throw new AlgorithmExecutionException("Database driver not found: " + driver, e); + // TODO: Remove this? + // Make sure we can get a connection from the connection pool. + try { + poolingDataSource.getConnection().close(); + } + catch (SQLException e) { + this.logger.log(LogService.LOG_WARNING, + "Problem opening test connection.", + e); + + throw new AlgorithmExecutionException + ("Could not properly initiate database.", e); + } } + catch (ClassNotFoundException e) { + throw new AlgorithmExecutionException + ("Database driver (" + driver + ") could not be found", e); + } + + return poolingDataSource; } + + public DataSourceWithID createDatabase() throws DatabaseCreationException { + DataSourceWithID dataSource = null; + + return dataSource; + } - public DataSource copyDatabase(DataSource database) throws DatabaseCopyException { - // TODO Auto-generated method stub + public DataSourceWithID copyDatabase(DataSourceWithID database) + throws DatabaseCopyException { + // TODO Auto-generated method stub. return null; } - public DataSource createDatabase(ResultSet resultSet) throws DatabaseCreationException { + public DataSourceWithID createDatabase(ResultSet resultSet) + throws DatabaseCreationException { // TODO Auto-generated method stub return null; } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-21 20:56:38
|
Revision: 845 http://cishell.svn.sourceforge.net/cishell/?rev=845&view=rev Author: pataphil Date: 2009-01-21 20:56:31 +0000 (Wed, 21 Jan 2009) Log Message: ----------- Implemented part of the database service, but didn't finish. Modified Paths: -------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java Added Paths: ----------- trunk/core/org.cishell.service.database/.settings/org.eclipse.jdt.core.prefs trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java Added: trunk/core/org.cishell.service.database/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/core/org.cishell.service.database/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/core/org.cishell.service.database/.settings/org.eclipse.jdt.core.prefs 2009-01-21 20:56:31 UTC (rev 845) @@ -0,0 +1,12 @@ +#Wed Jan 21 13:34:47 EST 2009 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.4 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.source=1.3 Added: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DataSourceWithID.java 2009-01-21 20:56:31 UTC (rev 845) @@ -0,0 +1,56 @@ +package org.cishell.service.database; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +import javax.sql.DataSource; + +public class DataSourceWithID implements DataSource { + private static int idCounter = 0; + + private DataSource wrappedDataSource; + private int id; + + private static int generateNewID() { + int newID = idCounter; + + idCounter++; + + return newID; + } + + public DataSourceWithID(DataSource wrappedDataSource) { + this.wrappedDataSource = wrappedDataSource; + this.id = generateNewID(); + } + + public int getID() { + return id; + } + + public Connection getConnection() throws SQLException { + return this.wrappedDataSource.getConnection(); + } + + public Connection getConnection(String username, String password) + throws SQLException { + return this.wrappedDataSource.getConnection(username, password); + } + + public PrintWriter getLogWriter() throws SQLException { + return this.wrappedDataSource.getLogWriter(); + } + + public void setLogWriter(PrintWriter out) throws SQLException { + this.wrappedDataSource.setLogWriter(out); + } + + public int getLoginTimeout() throws SQLException { + return this.wrappedDataSource.getLoginTimeout(); + } + + public void setLoginTimeout(int seconds) throws SQLException { + this.wrappedDataSource.setLoginTimeout(seconds); + } +} \ No newline at end of file Modified: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-20 16:45:20 UTC (rev 844) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-21 20:56:31 UTC (rev 845) @@ -6,7 +6,7 @@ public interface DatabaseService { - public DataSource createDatabase() throws DatabaseCreationException; - public DataSource createDatabase(ResultSet resultSet) throws DatabaseCreationException; - public DataSource copyDatabase(DataSource database) throws DatabaseCopyException; + public DataSourceWithID createDatabase() throws DatabaseCreationException; + public DataSourceWithID createDatabase(ResultSet resultSet) throws DatabaseCreationException; + public DataSourceWithID copyDatabase(DataSourceWithID database) throws DatabaseCopyException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-20 16:45:23
|
Revision: 844 http://cishell.svn.sourceforge.net/cishell/?rev=844&view=rev Author: pataphil Date: 2009-01-20 16:45:20 +0000 (Tue, 20 Jan 2009) Log Message: ----------- Added appropriate constants for PostScript and raster image object data manager object type( icon)s. Modified Paths: -------------- trunk/core/org.cishell.framework/src/org/cishell/framework/data/DataProperty.java Modified: trunk/core/org.cishell.framework/src/org/cishell/framework/data/DataProperty.java =================================================================== --- trunk/core/org.cishell.framework/src/org/cishell/framework/data/DataProperty.java 2009-01-16 14:56:21 UTC (rev 843) +++ trunk/core/org.cishell.framework/src/org/cishell/framework/data/DataProperty.java 2009-01-20 16:45:20 UTC (rev 844) @@ -81,4 +81,10 @@ /** Says this data model is abstractly a data plot */ public static String PLOT_TYPE = "Plot"; + + /** Says this data model is a PostScript file */ + public static String POST_SCRIPT_TYPE = "PostScript"; + + /** Says this data model is a JPEG object */ + public static String IMAGE_OBJECT_TYPE = "Image Object"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-16 14:56:24
|
Revision: 843 http://cishell.svn.sourceforge.net/cishell/?rev=843&view=rev Author: mwlinnem Date: 2009-01-16 14:56:21 +0000 (Fri, 16 Jan 2009) Log Message: ----------- Added stub for createDatabase from Result Set Modified Paths: -------------- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java Modified: trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-15 21:41:50 UTC (rev 842) +++ trunk/core/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-16 14:56:21 UTC (rev 843) @@ -1,5 +1,6 @@ package org.cishell.reference.service.database; +import java.sql.ResultSet; import java.sql.SQLException; import java.util.Dictionary; @@ -92,4 +93,9 @@ return null; } + public DataSource createDatabase(ResultSet resultSet) throws DatabaseCreationException { + // TODO Auto-generated method stub + return null; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 23:56:41
|
Revision: 839 http://cishell.svn.sourceforge.net/cishell/?rev=839&view=rev Author: mwlinnem Date: 2009-01-15 21:36:27 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Replacing with a non-botched plugin setup. Removed Paths: ------------- trunk/core/org.cishell.service.database/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 23:56:28
|
Revision: 840 http://cishell.svn.sourceforge.net/cishell/?rev=840&view=rev Author: mwlinnem Date: 2009-01-15 21:37:41 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Initial import. Same code as the old one, but a working plugin setup. Added Paths: ----------- trunk/core/org.cishell.service.database/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 23:56:26
|
Revision: 842 http://cishell.svn.sourceforge.net/cishell/?rev=842&view=rev Author: mwlinnem Date: 2009-01-15 21:41:50 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Added createDatabase method that utilizes a ResultSet. Hopefully a good idea to do it this way. Modified Paths: -------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java Modified: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-15 21:38:00 UTC (rev 841) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-15 21:41:50 UTC (rev 842) @@ -1,9 +1,12 @@ package org.cishell.service.database; +import java.sql.ResultSet; + import javax.sql.DataSource; public interface DatabaseService { public DataSource createDatabase() throws DatabaseCreationException; + public DataSource createDatabase(ResultSet resultSet) throws DatabaseCreationException; public DataSource copyDatabase(DataSource database) throws DatabaseCopyException; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 23:56:17
|
Revision: 841 http://cishell.svn.sourceforge.net/cishell/?rev=841&view=rev Author: mwlinnem Date: 2009-01-15 21:38:00 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Initial import. Same code as the old one, but a working plugin setup. Added Paths: ----------- trunk/core/org.cishell.service.database/.classpath trunk/core/org.cishell.service.database/.project trunk/core/org.cishell.service.database/.settings/ trunk/core/org.cishell.service.database/META-INF/ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF trunk/core/org.cishell.service.database/build.properties trunk/core/org.cishell.service.database/src/ trunk/core/org.cishell.service.database/src/org/ trunk/core/org.cishell.service.database/src/org/cishell/ trunk/core/org.cishell.service.database/src/org/cishell/service/ trunk/core/org.cishell.service.database/src/org/cishell/service/database/ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java Added: trunk/core/org.cishell.service.database/.classpath =================================================================== --- trunk/core/org.cishell.service.database/.classpath (rev 0) +++ trunk/core/org.cishell.service.database/.classpath 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/core/org.cishell.service.database/.project =================================================================== --- trunk/core/org.cishell.service.database/.project (rev 0) +++ trunk/core/org.cishell.service.database/.project 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.service.database</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF (rev 0) +++ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Database Plug-in +Bundle-SymbolicName: org.cishell.service.database +Bundle-Version: 1.0.0 +Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Export-Package: org.cishell.service.database Added: trunk/core/org.cishell.service.database/build.properties =================================================================== --- trunk/core/org.cishell.service.database/build.properties (rev 0) +++ trunk/core/org.cishell.service.database/build.properties 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . Added: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,38 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Jan 13, 2009 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.service.database; + +public class DatabaseCopyException extends Exception { + + private static final long serialVersionUID = 1L; + + //Constructors from Exception superclass + + public DatabaseCopyException() { + super(); + } + + public DatabaseCopyException(String arg0) { + super(arg0); + } + + public DatabaseCopyException(Throwable arg0) { + super(arg0); + } + + public DatabaseCopyException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} Added: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,25 @@ +package org.cishell.service.database; + +public class DatabaseCreationException extends Exception { + + private static final long serialVersionUID = 1L; + + //Constructors from Exception superclass + + public DatabaseCreationException() { + super(); + } + + public DatabaseCreationException(String arg0) { + super(arg0); + } + + public DatabaseCreationException(Throwable arg0) { + super(arg0); + } + + public DatabaseCreationException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} Added: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-15 21:38:00 UTC (rev 841) @@ -0,0 +1,9 @@ +package org.cishell.service.database; + +import javax.sql.DataSource; + +public interface DatabaseService { + + public DataSource createDatabase() throws DatabaseCreationException; + public DataSource copyDatabase(DataSource database) throws DatabaseCopyException; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 20:32:41
|
Revision: 838 http://cishell.svn.sourceforge.net/cishell/?rev=838&view=rev Author: mwlinnem Date: 2009-01-15 20:32:32 +0000 (Thu, 15 Jan 2009) Log Message: ----------- When will this madness cease? Modified Paths: -------------- trunk/core/org.cishell.service.database/.classpath Modified: trunk/core/org.cishell.service.database/.classpath =================================================================== --- trunk/core/org.cishell.service.database/.classpath 2009-01-15 20:23:21 UTC (rev 837) +++ trunk/core/org.cishell.service.database/.classpath 2009-01-15 20:32:32 UTC (rev 838) @@ -3,5 +3,7 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="lib" path="/home/mwlinnem/apps/eclipse/plugins/org.eclipse.osgi.services_3.1.200.v20071203.jar"/> + <classpathentry kind="lib" path="/home/mwlinnem/apps/eclipse/plugins/org.eclipse.osgi_3.4.0.v20080605-1900.jar"/> <classpathentry kind="output" path="bin"/> </classpath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 20:23:31
|
Revision: 837 http://cishell.svn.sourceforge.net/cishell/?rev=837&view=rev Author: mwlinnem Date: 2009-01-15 20:23:21 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Blurf. Modified Paths: -------------- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF Modified: trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 19:57:54 UTC (rev 836) +++ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 20:23:21 UTC (rev 837) @@ -1,7 +1,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CIShell Platform API -Bundle-SymbolicName: org.cishell.framework +Bundle-SymbolicName: org.cishell.service.database Bundle-Version: 1.0.0 Bundle-Vendor: Cyberinfrastructure for Network Science Center Import-Package: org.cishell.framework, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 19:57:59
|
Revision: 836 http://cishell.svn.sourceforge.net/cishell/?rev=836&view=rev Author: mwlinnem Date: 2009-01-15 19:57:54 +0000 (Thu, 15 Jan 2009) Log Message: ----------- More manifest fiddling. How I hate you, exporting and importing! Modified Paths: -------------- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF Modified: trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 19:30:25 UTC (rev 835) +++ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 19:57:54 UTC (rev 836) @@ -7,8 +7,10 @@ Import-Package: org.cishell.framework, org.osgi.framework, org.osgi.service.log, - org.osgi.service.metatype, - org.osgi.service.prefs + org.cishell.app.service.datamanager;version="1.0.0", + org.cishell.app.service.scheduler;version="1.0.0", + org.cishell.framework;version="1.0.0", + org.cishell.framework.algorithm;version="1.0.0", + org.cishell.framework.data;version="1.0.0" Export-Package: org.cishell.service.database -Bundle-ActivationPolicy: lazy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-15 19:30:33
|
Revision: 835 http://cishell.svn.sourceforge.net/cishell/?rev=835&view=rev Author: mwlinnem Date: 2009-01-15 19:30:25 +0000 (Thu, 15 Jan 2009) Log Message: ----------- Added import that may clear up some issues. Modified Paths: -------------- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF Modified: trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-14 22:20:41 UTC (rev 834) +++ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-15 19:30:25 UTC (rev 835) @@ -4,7 +4,8 @@ Bundle-SymbolicName: org.cishell.framework Bundle-Version: 1.0.0 Bundle-Vendor: Cyberinfrastructure for Network Science Center -Import-Package: org.osgi.framework, +Import-Package: org.cishell.framework, + org.osgi.framework, org.osgi.service.log, org.osgi.service.metatype, org.osgi.service.prefs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-14 22:32:22
|
Revision: 833 http://cishell.svn.sourceforge.net/cishell/?rev=833&view=rev Author: mwlinnem Date: 2009-01-14 22:18:44 +0000 (Wed, 14 Jan 2009) Log Message: ----------- Does not build. This is a code crime commit. Added Paths: ----------- trunk/core/org.cishell.docs/org.cishell.reference.service.database/.classpath trunk/core/org.cishell.docs/org.cishell.reference.service.database/.project trunk/core/org.cishell.docs/org.cishell.reference.service.database/.settings/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/META-INF/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/META-INF/MANIFEST.MF trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/component.xml trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/l10n/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/l10n/bundle_en.properties trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/metatype/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/service.properties trunk/core/org.cishell.docs/org.cishell.reference.service.database/build.properties trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/database/ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/.classpath =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/.classpath (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/.classpath 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/.project =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/.project (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/.project 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.cishell.reference.service.database</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/META-INF/MANIFEST.MF (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/META-INF/MANIFEST.MF 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Database Plug-in +Bundle-SymbolicName: org.cishell.reference.service.database +Bundle-Version: 1.0.0 +Bundle-Activator: org.cishell.reference.service.database.DatabaseServiceImpl +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: J2SE-1.4 +Import-Package: org.apache.commons.dbcp, + org.apache.commons.pool, + org.apache.commons.pool.impl, + org.cishell.service.database, + org.osgi.framework;version="1.4.0", + org.osgi.service.component;version="1.0.0", + org.osgi.service.log;version="1.3.0" Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/component.xml =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/component.xml (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/component.xml 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<component name="org.cishell.reference.service.database.DatabaseService.component" immediate="true"> + <implementation class="org.cishell.reference.service.database.DatabaseServiceImpl.component"/> + <properties entry="OSGI-INF/service.properties"/> + <reference name="LOG" interface="org.osgi.service.log.LogService"/> + + <service> + <provide interface= + "org.cishell.service.database.DatabaseService"/> + </service> +</component> + + + \ No newline at end of file Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/l10n/bundle_en.properties =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/l10n/bundle_en.properties (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/l10n/bundle_en.properties 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,7 @@ +#Localization variables for OSGI-INF/metatatype/METADATA.XML +# +#Samples: +#input=Input +#desc=Enter an integer (that will be converted to a string) +#name=Input->String +#name_desc=Converts inputted integer to string Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/metatype/METADATA.XML 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> + <Designate pid="org.cishell.reference.prefs.admin.PrefAdmin"> + <Object ocdref="org.cishell.reference.prefs.admin.PrefAdmin.OCD" /> + </Designate> +</metatype:MetaData> Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/service.properties =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/service.properties (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/OSGI-INF/service.properties 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,2 @@ +service.pid=org.cishell.reference.service.database.DatabaseServiceImpl +remoteable=true Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/build.properties =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/build.properties (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/build.properties 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . Added: trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java =================================================================== --- trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java (rev 0) +++ trunk/core/org.cishell.docs/org.cishell.reference.service.database/src/org/cishell/reference/service/database/DatabaseServiceImpl.java 2009-01-14 22:18:44 UTC (rev 833) @@ -0,0 +1,95 @@ +package org.cishell.reference.service.database; + +import java.sql.SQLException; +import java.util.Dictionary; + +import javax.sql.DataSource; + +import org.apache.commons.dbcp.ConnectionFactory; +import org.apache.commons.dbcp.DriverManagerConnectionFactory; +import org.apache.commons.dbcp.PoolableConnectionFactory; +import org.apache.commons.dbcp.PoolingDataSource; +import org.apache.commons.pool.KeyedObjectPoolFactory; +import org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory; +import org.apache.commons.pool.impl.GenericObjectPool; +import org.cishell.service.database.DatabaseCopyException; +import org.cishell.service.database.DatabaseCreationException; +import org.cishell.service.database.DatabaseService; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.log.LogService; +public class DatabaseServiceImpl implements DatabaseService { + + //TODO: These variables should be abstracted out in a Preferences page at some point (I guess) + private static final String DEFAULT_DRIVER_NAME = "org.apache.derby.jdbc.EmbeddedDriver"; + private static final String DEFAULT_CONNECTION_STRING_PREFIX = "jdbc:derby"; + private static final String DEFAULT_CONNECTION_STRING_SUFFIX = ";create=true"; + + private static final String DEFAULT_DB_NAME = "ultra_sasquatch"; + //Give each db a unique (but meaningless) name by counting up from 0 for each new database + //TODO: Using a rolling counter like this may have bad implications later on, but it's decent for now + private static int dbNameCounter = 0; + + private LogService log; + + protected void activate(ComponentContext ctxt) { + + this.log = (LogService) ctxt.locateService("LOG"); + } + + protected void deactivate(ComponentContext ctxt) { + } + + private void ensureConnectionPoolIsEstablished() { + try { + Class.forName(DEFAULT_DRIVER_NAME); + + String newDatabaseName = DEFAULT_DB_NAME + Integer.toString(dbNameCounter); + String newDatabaseConnectionURL = DEFAULT_CONNECTION_STRING_PREFIX + + newDatabaseName + + DEFAULT_CONNECTION_STRING_SUFFIX; + + ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(newDatabaseConnectionURL, null, null); + GenericObjectPool connectionPool = new GenericObjectPool(); + } catch (ClassNotFoundException e) { + throw new AlgorithmExecutionException("Database driver not found: " + driver, e); + } + } + + public DataSource createDatabase() throws DatabaseCreationException { + + javax.sql.DataSource dataSource; + + try { + Class.forName(DEFAULT_DRIVER_NAME); + //Driver jdbcDriver = (Driver) Class.forName(driver).newInstance(); //we can use this later to check acceptsUrl for better error reporting + + String newDatabaseName = DEFAULT_DB_NAME + Integer.toString(dbNameCounter); + String newDatabaseConnectionURL = DEFAULT_CONNECTION_STRING_PREFIX + + newDatabaseName + + DEFAULT_CONNECTION_STRING_SUFFIX; + + ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(newDatabaseConnectionURL, null, null); + GenericObjectPool connectionPool = new GenericObjectPool(); + dataSource = new PoolingDataSource(connectionPool); + + try { + dataSource.getConnection().close(); + } catch (SQLException e) { + logger.log(LogService.LOG_WARNING, "Problem opening test connection.", e); + } + + //prefuseConnection = prefuse.data.io.sql.ConnectionFactory.getDatabaseConnection(connection); + + + + } catch (ClassNotFoundException e) { + throw new AlgorithmExecutionException("Database driver not found: " + driver, e); + } + } + + public DataSource copyDatabase(DataSource database) throws DatabaseCopyException { + // TODO Auto-generated method stub + return null; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-14 22:32:22
|
Revision: 832 http://cishell.svn.sourceforge.net/cishell/?rev=832&view=rev Author: mwlinnem Date: 2009-01-14 22:18:02 +0000 (Wed, 14 Jan 2009) Log Message: ----------- Initial import. Does not build. This is a code crime. Added Paths: ----------- trunk/core/org.cishell.docs/org.cishell.reference.service.database/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-14 22:32:19
|
Revision: 834 http://cishell.svn.sourceforge.net/cishell/?rev=834&view=rev Author: mwlinnem Date: 2009-01-14 22:20:41 +0000 (Wed, 14 Jan 2009) Log Message: ----------- Moved to the correct place. Added Paths: ----------- trunk/core/org.cishell.reference.service.database/ Removed Paths: ------------- trunk/core/org.cishell.docs/org.cishell.reference.service.database/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-13 16:20:24
|
Revision: 831 http://cishell.svn.sourceforge.net/cishell/?rev=831&view=rev Author: mwlinnem Date: 2009-01-13 16:20:12 +0000 (Tue, 13 Jan 2009) Log Message: ----------- Changed package name to better express contents. Modified Paths: -------------- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF Added Paths: ----------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java Removed Paths: ------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/ Modified: trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF =================================================================== --- trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-13 15:26:57 UTC (rev 830) +++ trunk/core/org.cishell.service.database/META-INF/MANIFEST.MF 2009-01-13 16:20:12 UTC (rev 831) @@ -9,5 +9,5 @@ org.osgi.service.metatype, org.osgi.service.prefs Export-Package: - org.cishell.service.database.databasefactory + org.cishell.service.database Bundle-ActivationPolicy: lazy Copied: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java (from rev 830, trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCopyException.java) =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java 2009-01-13 16:20:12 UTC (rev 831) @@ -0,0 +1,38 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Jan 13, 2009 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.service.database; + +public class DatabaseCopyException extends Exception { + + private static final long serialVersionUID = 1L; + + //Constructors from Exception superclass + + public DatabaseCopyException() { + super(); + } + + public DatabaseCopyException(String arg0) { + super(arg0); + } + + public DatabaseCopyException(Throwable arg0) { + super(arg0); + } + + public DatabaseCopyException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} Property changes on: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCopyException.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java (from rev 829, trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCreationException.java) =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java 2009-01-13 16:20:12 UTC (rev 831) @@ -0,0 +1,25 @@ +package org.cishell.service.database; + +public class DatabaseCreationException extends Exception { + + private static final long serialVersionUID = 1L; + + //Constructors from Exception superclass + + public DatabaseCreationException() { + super(); + } + + public DatabaseCreationException(String arg0) { + super(arg0); + } + + public DatabaseCreationException(Throwable arg0) { + super(arg0); + } + + public DatabaseCreationException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} Property changes on: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseCreationException.java ___________________________________________________________________ Added: svn:mergeinfo + Copied: trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java (from rev 830, trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java) =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/DatabaseService.java 2009-01-13 16:20:12 UTC (rev 831) @@ -0,0 +1,9 @@ +package org.cishell.service.database; + +import javax.sql.DataSource; + +public interface DatabaseService { + + public DataSource createDatabase() throws DatabaseCreationException; + public DataSource copyDatabase(DataSource database) throws DatabaseCopyException; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mwl...@us...> - 2009-01-13 15:27:06
|
Revision: 830 http://cishell.svn.sourceforge.net/cishell/?rev=830&view=rev Author: mwlinnem Date: 2009-01-13 15:26:57 +0000 (Tue, 13 Jan 2009) Log Message: ----------- Added databaseCopy() method and associated exception to the DatabaseService. Added Paths: ----------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCopyException.java trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java Removed Paths: ------------- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseFactory.java Added: trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCopyException.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCopyException.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseCopyException.java 2009-01-13 15:26:57 UTC (rev 830) @@ -0,0 +1,38 @@ +/* **************************************************************************** + * CIShell: Cyberinfrastructure Shell, An Algorithm Integration Framework. + * + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Apache License v2.0 which accompanies + * this distribution, and is available at: + * http://www.apache.org/licenses/LICENSE-2.0.html + * + * Created on Jan 13, 2009 at Indiana University. + * + * Contributors: + * Indiana University - + * ***************************************************************************/ +package org.cishell.service.database.databasefactory; + +public class DatabaseCopyException extends Exception { + + private static final long serialVersionUID = 1L; + + //Constructors from Exception superclass + + public DatabaseCopyException() { + super(); + } + + public DatabaseCopyException(String arg0) { + super(arg0); + } + + public DatabaseCopyException(Throwable arg0) { + super(arg0); + } + + public DatabaseCopyException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} Deleted: trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseFactory.java =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseFactory.java 2009-01-05 19:57:49 UTC (rev 829) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseFactory.java 2009-01-13 15:26:57 UTC (rev 830) @@ -1,8 +0,0 @@ -package org.cishell.service.database.databasefactory; - -import javax.sql.DataSource; - -public interface DatabaseFactory { - - public DataSource createDatabase() throws DatabaseCreationException; -} Copied: trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java (from rev 829, trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseFactory.java) =================================================================== --- trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java (rev 0) +++ trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java 2009-01-13 15:26:57 UTC (rev 830) @@ -0,0 +1,9 @@ +package org.cishell.service.database.databasefactory; + +import javax.sql.DataSource; + +public interface DatabaseService { + + public DataSource createDatabase() throws DatabaseCreationException; + public DataSource copyDatabase(DataSource database) throws DatabaseCopyException; +} Property changes on: trunk/core/org.cishell.service.database/src/org/cishell/service/database/databasefactory/DatabaseService.java ___________________________________________________________________ Added: svn:mergeinfo + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2009-01-05 19:57:55
|
Revision: 829 http://cishell.svn.sourceforge.net/cishell/?rev=829&view=rev Author: pataphil Date: 2009-01-05 19:57:49 +0000 (Mon, 05 Jan 2009) Log Message: ----------- Made the logging of stack traces more proper. (It only worked before as an indirect hack.) Modified Paths: -------------- trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogToFile.java Modified: trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogToFile.java =================================================================== --- trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogToFile.java 2009-01-05 17:55:56 UTC (rev 828) +++ trunk/clients/gui/org.cishell.reference.gui.log/src/org/cishell/reference/gui/log/LogToFile.java 2009-01-05 19:57:49 UTC (rev 829) @@ -90,21 +90,9 @@ javaLogLevel = Level.INFO; } // edited by Felix Terkhorn. ter...@gm... May-9-2007 - // Log the exception? - Throwable throwableToBeLogged = entry.getException(); - - // Log the exception's stack trace? - if (throwableToBeLogged != null) { - // TODO: Log to a different file? This would possibly be where we'd - // check the preferences/etc. - StringWriter stackTraceStringWriter = new StringWriter(); - - throwableToBeLogged.printStackTrace(new PrintWriter(stackTraceStringWriter)); - logger.log(javaLogLevel, "Stace Trace: " + stackTraceStringWriter.toString() + "\r\n"); - } - if (goodMessage(message)) { - logger.log(javaLogLevel, message + "\r\n"); // stdout printing happens here, despite having 1 handler only + // stdout printing happens here, despite having 1 handler only. + logger.log(javaLogLevel, message + "\r\n", entry.getException()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |