SourceForge: bina/bina_plugin_bnppsqldriver: changeset 8:ef9aff41e694
Help added default tip
authorgerasch
Wed Nov 04 15:00:37 2009 +0100 (6 weeks ago)
changeset 8ef9aff41e694
parent 7 e3e208d0693d
Help added
build.xml
src/org/bnplusplus/driver/sql/BNPlusPlusBasicSQLDataSource.java
     1.1 --- a/build.xml	Fri Oct 02 13:44:44 2009 +0200
     1.2 +++ b/build.xml	Wed Nov 04 15:00:37 2009 +0100
     1.3 @@ -1,12 +1,9 @@
     1.4  <project name="BiNA BN++ Basic SQL Data Source Plugin" default="publish" basedir=".">
     1.5  	<description>
     1.6 -        Ant build script for BiNA Core
     1.7 +        Ant build script for BiNAs Basic SQL Data Source Plugin
     1.8      </description>
     1.9  
    1.10 -
    1.11 -	<import file="../bina_platform/global.xml"/>
    1.12 -			
    1.13 -	<target name="init" depends="base_init">
    1.14 +	<target name="init">
    1.15  		<tstamp/>
    1.16  		<property name="plugin_id" value="bnpp_sql_driver"/>
    1.17  		
    1.18 @@ -31,7 +28,7 @@
    1.19  		<property name="bnpp_model_jar" value="${platform_dir}plugins/org.bnplusplus.model/bnpp_model.jar"/>
    1.20  		<property name="bcp_jar" value="${platform_dir}plugins/org.bina.bcp/bcp.jar"/>
    1.21  				
    1.22 -		<property name="bina_jar" value="${platform_dir}${platform_jar}" />
    1.23 +		<property name="bina_jar" value="${platform_dir}BiNA.jar" />
    1.24  		<property name="classpath" value="${bina_jar}:${bnpp_model_jar}:${bcp_jar}" />
    1.25  		
    1.26  		
    1.27 @@ -93,10 +90,6 @@
    1.28  		</copy>
    1.29  	</target>
    1.30  	
    1.31 -	<target name="Upload Plugin" depends="plugin">
    1.32 -		<antcall target="upload_plugin" />
    1.33 -	</target>
    1.34 -	
    1.35  	<!-- ====================================================== -->
    1.36  	<!-- JavaDocs -->
    1.37  	<!-- ====================================================== -->
    1.38 @@ -127,9 +120,5 @@
    1.39  		</javadoc>
    1.40  	</target>
    1.41  	
    1.42 -	<target name="Upload API" depends="docs">
    1.43 -		<antcall target="upload_api" />
    1.44 -	</target>
    1.45 -	
    1.46  </project>
    1.47  
     2.1 --- a/src/org/bnplusplus/driver/sql/BNPlusPlusBasicSQLDataSource.java	Fri Oct 02 13:44:44 2009 +0200
     2.2 +++ b/src/org/bnplusplus/driver/sql/BNPlusPlusBasicSQLDataSource.java	Wed Nov 04 15:00:37 2009 +0100
     2.3 @@ -629,6 +629,14 @@
     2.4  		public ResultSet getResult() {
     2.5  			return this.result;
     2.6  		}
     2.7 +		
     2.8 +		@Override
     2.9 +		public ResultSet waitForResult() {
    2.10 +			while (!hasEvent())
    2.11 +				Thread.yield();
    2.12 +			
    2.13 +			return getResult();
    2.14 +		}
    2.15  	}
    2.16  	
    2.17  	public SQLQueryHandler executeSQL(String sql) throws SQLException {
    2.18 @@ -754,8 +762,9 @@
    2.19  					new Thread() {
    2.20  						@Override
    2.21  						public void run() {
    2.22 -							while (!getChild().hasEvent())
    2.23 -								Thread.yield();
    2.24 +							getChild().waitForResult();
    2.25 +//							while (!getChild().hasEvent())
    2.26 +//								Thread.yield();
    2.27  
    2.28  							if (getChild().isFinished() && !isCanceled()) {
    2.29  								ResultSet l = getChild().getResult();
    2.30 @@ -1023,8 +1032,9 @@
    2.31  					Thread t = new Thread() {
    2.32  						@Override
    2.33  						public void run() {
    2.34 -							while (!getChild().hasEvent())
    2.35 -								Thread.yield();
    2.36 +							getChild().waitForResult();
    2.37 +//							while (!getChild().hasEvent())
    2.38 +//								Thread.yield();
    2.39  							
    2.40  							if (getChild().isFinished() && !isCanceled()) {
    2.41  								ResultSet rs = getChild().getResult();
    2.42 @@ -1130,10 +1140,12 @@
    2.43  					public void run() {
    2.44  						QueryHandler<List<String>> child = getChild();
    2.45  						
    2.46 -						while (!child.hasEvent())
    2.47 -							try {
    2.48 -								Thread.sleep(300);
    2.49 -							} catch (InterruptedException e) {}
    2.50 +						child.waitForResult();
    2.51 +						
    2.52 +//						while (!child.hasEvent())
    2.53 +//							try {
    2.54 +//								Thread.sleep(300);
    2.55 +//							} catch (InterruptedException e) {}
    2.56  							
    2.57  						if (child.isFinished() && !isCanceled()) {
    2.58  							List<T> r = new ArrayList<T>();
    2.59 @@ -1225,6 +1237,14 @@
    2.60  			return this.result;
    2.61  		}
    2.62  		
    2.63 +		@Override
    2.64 +		public T waitForResult() {
    2.65 +			while (!hasEvent())
    2.66 +				Thread.yield();
    2.67 +			
    2.68 +			return getResult();
    2.69 +		}
    2.70 +		
    2.71  		/**
    2.72  		 * @return the child
    2.73  		 */
    2.74 @@ -1332,8 +1352,9 @@
    2.75  					Thread t = new Thread() {
    2.76  						@Override
    2.77  						public void run() {
    2.78 -							while (!getChild().hasEvent())
    2.79 -								Thread.yield();
    2.80 +							getChild().waitForResult();
    2.81 +//							while (!getChild().hasEvent())
    2.82 +//								Thread.yield();
    2.83  							
    2.84  							if (getChild().isFinished() && !isCanceled()) {
    2.85  								ResultSet rs = getChild().getResult();
    2.86 @@ -1385,8 +1406,12 @@
    2.87  					Thread t = new Thread() {
    2.88  						@Override
    2.89  						public void run() {
    2.90 -							while (!getChild().hasEvent())
    2.91 -								Thread.yield();;
    2.92 +							
    2.93 +							getChild().waitForResult();
    2.94 +//							
    2.95 +//							while (!getChild().hasEvent())
    2.96 +//								Thread.yield();;
    2.97 +							
    2.98  							if (getChild().isFinished() && !isCanceled()) {
    2.99  								ResultSet rs = getChild().getResult();
   2.100  
   2.101 @@ -1432,7 +1457,8 @@
   2.102  					Thread t = new Thread() {
   2.103  						@Override
   2.104  						public void run() {
   2.105 -							while (!getChild().hasEvent());
   2.106 +							getChild().waitForResult();
   2.107 +//							while (!getChild().hasEvent());
   2.108  							if (getChild().isFinished() && !isCanceled()) {
   2.109  								ResultSet rs = getChild().getResult();
   2.110  								if (rs != null) {