You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2016/05/29 22:18:02 UTC
svn commit: r1746066 - in /db/derby/code/trunk/java:
build/org/apache/derbyBuild/lastgoodjarcontents/
client/org/apache/derby/jdbc/ engine/org/apache/derby/iapi/services/monitor/
engine/org/apache/derby/iapi/store/raw/xact/ engine/org/apache/derby/impl...
Author: rhillegas
Date: Sun May 29 22:18:02 2016
New Revision: 1746066
URL: http://svn.apache.org/viewvc?rev=1746066&view=rev
Log:
DERBY-6856: Remove deprecation warnings related to Observer/Observable by adding Derby implementations of the observable behavior.
Added:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java (with props)
db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java (with props)
Modified:
db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents
db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents
db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java
db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java
db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java
db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerActionOnCommit.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/DropOnCommit.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainerHandle.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/SyncOnCommit.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/TruncateOnCommit.java
db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSourceInterface.java
Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents Sun May 29 22:18:02 2016
@@ -202,6 +202,8 @@ org.apache.derby.iapi.services.locks.ShE
org.apache.derby.iapi.services.locks.ShExQual.class
org.apache.derby.iapi.services.locks.VirtualLockTable.class
org.apache.derby.iapi.services.memory.LowMemory.class
+org.apache.derby.iapi.services.monitor.DerbyObservable.class
+org.apache.derby.iapi.services.monitor.DerbyObserver.class
org.apache.derby.iapi.services.monitor.ModuleControl.class
org.apache.derby.iapi.services.monitor.ModuleFactory.class
org.apache.derby.iapi.services.monitor.ModuleSupportable.class
Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents Sun May 29 22:18:02 2016
@@ -203,6 +203,8 @@ org.apache.derby.iapi.services.locks.ShE
org.apache.derby.iapi.services.locks.ShExQual.class
org.apache.derby.iapi.services.locks.VirtualLockTable.class
org.apache.derby.iapi.services.memory.LowMemory.class
+org.apache.derby.iapi.services.monitor.DerbyObservable.class
+org.apache.derby.iapi.services.monitor.DerbyObserver.class
org.apache.derby.iapi.services.monitor.ModuleControl.class
org.apache.derby.iapi.services.monitor.ModuleFactory.class
org.apache.derby.iapi.services.monitor.ModuleSupportable.class
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java Sun May 29 22:18:02 2016
@@ -21,7 +21,9 @@
package org.apache.derby.jdbc;
+import java.sql.ShardingKeyBuilder;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
@@ -56,4 +58,11 @@ public class BasicClientXADataSource40
return getXAConnectionMinion(user, password);
}
+
+ /** Added by Java 9 */
+ public ShardingKeyBuilder createShardingKeyBuilder()
+ throws SQLException
+ {
+ throw new java.sql.SQLFeatureNotSupportedException();
+ }
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource.java Sun May 29 22:18:02 2016
@@ -21,6 +21,9 @@
package org.apache.derby.jdbc;
+import java.sql.ShardingKeyBuilder;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLException;
import javax.sql.XAConnection;
@@ -66,4 +69,11 @@ public class ClientXADataSource
public XAConnection getXAConnection(String user, String password) throws SQLException {
return getXAConnectionMinion(user, password);
}
+
+ /** Added by Java 9 */
+ public ShardingKeyBuilder createShardingKeyBuilder()
+ throws SQLException
+ {
+ throw new java.sql.SQLFeatureNotSupportedException();
+ }
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSource40.java Sun May 29 22:18:02 2016
@@ -21,6 +21,9 @@
package org.apache.derby.jdbc;
+import java.sql.ShardingKeyBuilder;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import javax.sql.XADataSource;
/**
@@ -35,5 +38,12 @@ import javax.sql.XADataSource;
public class ClientXADataSource40 extends ClientXADataSource
implements XADataSource /* compile-time check for 4.1 extension */
{
- private static final long serialVersionUID = -3463444509507830926L;
+ private static final long serialVersionUID = -3463444509507830926L;
+
+ /** Added by Java 9 */
+ public ShardingKeyBuilder createShardingKeyBuilder()
+ throws SQLException
+ {
+ throw new java.sql.SQLFeatureNotSupportedException();
+ }
}
Modified: db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientXADataSourceInterface.java Sun May 29 22:18:02 2016
@@ -21,6 +21,9 @@
package org.apache.derby.jdbc;
+import java.sql.ShardingKeyBuilder;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import javax.sql.XADataSource;
/**
@@ -28,4 +31,11 @@ import javax.sql.XADataSource;
*/
public interface ClientXADataSourceInterface
extends ClientDataSourceInterface, XADataSource {
+
+ /** Added by Java 9 */
+ public default ShardingKeyBuilder createShardingKeyBuilder()
+ throws SQLException
+ {
+ throw new java.sql.SQLFeatureNotSupportedException();
+ }
}
Added: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java?rev=1746066&view=auto
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java (added)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java Sun May 29 22:18:02 2016
@@ -0,0 +1,134 @@
+/*
+
+ Derby - Class org.apache.derby.iapi.services.monitor.DerbyObservable
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ */
+
+package org.apache.derby.iapi.services.monitor;
+
+import java.util.Vector;
+
+/**
+ * <p>
+ * Created to provide the Observable behavior which Derby has depended
+ * on since Java 1.2 but which as deprecated in JDK 9 build 118. A DerbyObservable
+ * is an object whose state changes are being tracked.
+ * </p>
+ */
+public class DerbyObservable
+{
+ //////////////////////////////////////////////////////////////////////
+ //
+ // STATE
+ //
+ //////////////////////////////////////////////////////////////////////
+
+ private boolean _hasChanged = false;
+ private Vector<DerbyObserver> _observers;
+
+ //////////////////////////////////////////////////////////////////////
+ //
+ // CONSTRUCTORS
+ //
+ //////////////////////////////////////////////////////////////////////
+
+ /** No-arg constructor */
+ public DerbyObservable() { _observers = new Vector<DerbyObserver>(); }
+
+ //////////////////////////////////////////////////////////////////////
+ //
+ // PUBLIC BEHAVIOR
+ //
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * Add another observer who wants to be told about changes to this object.
+ *
+ * @param observer The object which wants to be notified when this object changes
+ *
+ * @throw IllegalArgumentException If the argument is bad (e.g., null)
+ */
+ public void addObserver(DerbyObserver observer)
+ {
+ if (observer == null) { throw new IllegalArgumentException("Null arguments not allowed."); }
+
+ if (!_observers.contains(observer)) { _observers.addElement(observer); }
+ }
+
+ /**
+ * Return the number of observers who are watching this object.
+ *
+ * @return The number of watchers
+ */
+ public int countObservers() { return _observers.size(); }
+
+ /**
+ * Remove a specific observer from the list of watchers. Null is ignored.
+ *
+ * @param observer The observer to remove.
+ */
+ public void deleteObserver(DerbyObserver observer) { _observers.removeElement(observer); }
+
+ /**
+ * This method is equivalent to notifyObservers(null);
+ */
+ public void notifyObservers() { notifyObservers(null); }
+
+ /**
+ * If this object has changed, then notify all observers. Pass
+ * them this object and the extraInfo. This object is then marked
+ * as unchanged again.
+ *
+ * @param extraInfo Extra information to be passed to the observer's callback method.
+ */
+ public void notifyObservers(Object extraInfo)
+ {
+ // Shield the observers from further changes to the list of watchers
+ DerbyObserver[] cachedObservers;
+
+ synchronized (this)
+ {
+ if (!_hasChanged) { return; }
+
+ cachedObservers = new DerbyObserver[_observers.size()];
+ _observers.toArray(cachedObservers);
+ _hasChanged = false;
+ }
+
+ int lastIndex = cachedObservers.length - 1;
+ for (int idx = lastIndex; idx >= 0; idx--)
+ {
+ cachedObservers[idx].update(this, extraInfo);
+ }
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ //
+ // PROTECTED BEHAVIOR TO BE CALLED BY SUBCLASSES
+ //
+ //////////////////////////////////////////////////////////////////////
+
+ /**
+ * When the object state changes, the object calls this method
+ * in order to flag that fact. After this method has been called,
+ * then the notifyObservers() will wake up the observers which are
+ * watching this object.
+ */
+ protected void setChanged() { _hasChanged = true; }
+
+}
Propchange: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObservable.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java?rev=1746066&view=auto
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java (added)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java Sun May 29 22:18:02 2016
@@ -0,0 +1,41 @@
+/*
+
+ Derby - Class org.apache.derby.iapi.services.monitor.DerbyObserver
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to you under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ */
+
+package org.apache.derby.iapi.services.monitor;
+
+/**
+ * <p>
+ * Created to provide the Observable behavior which Derby has depended
+ * on since Java 1.2 but which as deprecated in JDK 9 build 118. A DerbyObserver
+ * is an object which registers it interest in being notified when events occur.
+ * </p>
+ */
+public interface DerbyObserver
+{
+ /**
+ * This is the callback method which is invoked when a change happens
+ * to the object which is being observed.
+ *
+ * @param observable The object which is being observed
+ * @param extraInfo Extra information being passed to the callback
+ */
+ public void update(DerbyObservable observable, Object extraInfo);
+}
Propchange: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/DerbyObserver.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/xact/RawTransaction.java Sun May 29 22:18:02 2016
@@ -24,6 +24,7 @@ package org.apache.derby.iapi.store.raw.
import org.apache.derby.iapi.store.raw.ContainerKey;
import org.apache.derby.iapi.services.locks.LockFactory;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
import org.apache.derby.iapi.store.raw.data.DataFactory;
import org.apache.derby.iapi.store.raw.Compensation;
@@ -39,8 +40,6 @@ import org.apache.derby.iapi.error.Stand
import org.apache.derby.iapi.util.ByteArray;
import org.apache.derby.iapi.services.io.DynamicByteArrayOutputStream;
-import java.util.Observable;
-
import org.apache.derby.iapi.services.io.LimitObjectInput;
/**
@@ -64,7 +63,8 @@ import org.apache.derby.iapi.services.io
@see java.util.Observer
*/
-public abstract class RawTransaction extends Observable implements Transaction {
+public abstract class RawTransaction extends DerbyObservable implements Transaction
+{
public static final Integer COMMIT = 0;
public static final Integer ABORT = 1;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseContainerHandle.java Sun May 29 22:18:02 2016
@@ -25,6 +25,8 @@ import org.apache.derby.iapi.reference.S
import org.apache.derby.iapi.services.locks.Lockable;
import org.apache.derby.iapi.services.locks.VirtualLockTable;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
+import org.apache.derby.iapi.services.monitor.DerbyObserver;
import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.store.access.SpaceInfo;
@@ -45,15 +47,13 @@ import org.apache.derby.iapi.util.ByteAr
import org.apache.derby.catalog.UUID;
import java.util.Hashtable;
-import java.util.Observable;
-import java.util.Observer;
import java.util.Properties;
/**
A handle to an open container, implememts RawContainerHandle.
<P>
- This class is an Observer to observe RawTransactions
- and is also a Observable to
+ This class is a DerbyObserver to observe RawTransactions
+ and is also a DerbyObservable to
handle the list of pages accessed thorough this handle.
<BR>
This class implements Lockable (defined to be ContainerHandle) and is
@@ -62,8 +62,8 @@ import java.util.Properties;
<BR> MT - Mutable - Immutable identity - Thread Aware
*/
-public class BaseContainerHandle extends Observable
- implements RawContainerHandle, Observer
+public class BaseContainerHandle extends DerbyObservable
+ implements RawContainerHandle, DerbyObserver
{
/*
@@ -687,7 +687,7 @@ public class BaseContainerHandle extends
/*
- ** Methods of Observer
+ ** Methods of DerbyObserver
*/
/**
@@ -695,7 +695,7 @@ public class BaseContainerHandle extends
@see Observer#update
*/
- public void update(Observable obj, Object arg)
+ public void update(DerbyObservable obj, Object arg)
{
if (SanityManager.DEBUG)
{
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BasePage.java Sun May 29 22:18:02 2016
@@ -30,6 +30,8 @@ import org.apache.derby.shared.common.sa
import org.apache.derby.iapi.services.io.LimitObjectInput;
import org.apache.derby.iapi.services.io.TypedFormat;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
+import org.apache.derby.iapi.services.monitor.DerbyObserver;
import org.apache.derby.iapi.error.StandardException;
@@ -51,8 +53,6 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.ObjectInput;
-import java.util.Observer;
-import java.util.Observable;
/**
@@ -76,7 +76,7 @@ import java.util.Observable;
**/
-abstract class BasePage implements Page, Observer, TypedFormat
+abstract class BasePage implements Page, DerbyObserver, TypedFormat
{
/**
@@ -1638,7 +1638,7 @@ abstract class BasePage implements Page,
@see Observer#update
*/
- public void update(Observable obj, Object arg) {
+ public void update(DerbyObservable obj, Object arg) {
if (SanityManager.DEBUG) {
SanityManager.ASSERT(isLatched());
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerActionOnCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerActionOnCommit.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerActionOnCommit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/ContainerActionOnCommit.java Sun May 29 22:18:02 2016
@@ -21,17 +21,16 @@
package org.apache.derby.impl.store.raw.data;
+import org.apache.derby.iapi.services.monitor.DerbyObserver;
import org.apache.derby.iapi.store.raw.ContainerKey;
-import java.util.Observer;
-
/**
An Observer that can be attached to a transaction to
implement some action when the transaction
commits or rollsback in some way.
*/
-abstract class ContainerActionOnCommit implements Observer {
+abstract class ContainerActionOnCommit implements DerbyObserver {
protected ContainerKey identity;
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/DropOnCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/DropOnCommit.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/DropOnCommit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/DropOnCommit.java Sun May 29 22:18:02 2016
@@ -21,6 +21,7 @@
package org.apache.derby.impl.store.raw.data;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
import org.apache.derby.iapi.store.raw.ContainerHandle;
import org.apache.derby.iapi.store.raw.ContainerLock;
@@ -41,8 +42,6 @@ import org.apache.derby.iapi.error.Stand
import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.store.raw.ContainerKey;
-import java.util.Observable;
-
/**
Drop a table on a commit or abort
*/
@@ -71,7 +70,7 @@ public class DropOnCommit extends Contai
@see java.util.Observer#update
*/
- public void update(Observable obj, Object arg) {
+ public void update(DerbyObservable obj, Object arg) {
if (SanityManager.DEBUG) {
if (arg == null)
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainerHandle.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainerHandle.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainerHandle.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainerHandle.java Sun May 29 22:18:02 2016
@@ -22,6 +22,8 @@
package org.apache.derby.impl.store.raw.data;
import org.apache.derby.iapi.services.locks.Lockable;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
+import org.apache.derby.iapi.services.monitor.DerbyObserver;
import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.store.raw.StreamContainerHandle;
@@ -34,8 +36,6 @@ import org.apache.derby.impl.store.raw.d
import org.apache.derby.catalog.UUID;
-import java.util.Observable;
-import java.util.Observer;
import java.util.Properties;
/**
@@ -47,7 +47,7 @@ import java.util.Properties;
*/
final class StreamFileContainerHandle
- implements StreamContainerHandle, Observer
+ implements StreamContainerHandle, DerbyObserver
{
/*
@@ -213,7 +213,7 @@ final class StreamFileContainerHandle
@see Observer#update
*/
- public void update(Observable obj, Object arg)
+ public void update(DerbyObservable obj, Object arg)
{
if (SanityManager.DEBUG) {
if (arg == null)
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/SyncOnCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/SyncOnCommit.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/SyncOnCommit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/SyncOnCommit.java Sun May 29 22:18:02 2016
@@ -21,6 +21,8 @@
package org.apache.derby.impl.store.raw.data;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
+
import org.apache.derby.iapi.store.raw.ContainerHandle;
import org.apache.derby.iapi.store.raw.ContainerLock;
import org.apache.derby.iapi.store.raw.Page;
@@ -40,8 +42,6 @@ import org.apache.derby.iapi.error.Stand
import org.apache.derby.shared.common.sanity.SanityManager;
-import java.util.Observable;
-
/**
Flush all pages for a table on a commit
*/
@@ -53,7 +53,7 @@ public class SyncOnCommit extends Contai
super(identity);
}
- public void update(Observable obj, Object arg) {
+ public void update(DerbyObservable obj, Object arg) {
if (SanityManager.DEBUG) {
if (arg == null)
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/TruncateOnCommit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/TruncateOnCommit.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/TruncateOnCommit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/TruncateOnCommit.java Sun May 29 22:18:02 2016
@@ -21,6 +21,8 @@
package org.apache.derby.impl.store.raw.data;
+import org.apache.derby.iapi.services.monitor.DerbyObservable;
+
import org.apache.derby.iapi.store.raw.ContainerHandle;
import org.apache.derby.iapi.store.raw.ContainerLock;
import org.apache.derby.iapi.store.raw.Page;
@@ -40,8 +42,6 @@ import org.apache.derby.iapi.error.Stand
import org.apache.derby.shared.common.sanity.SanityManager;
-import java.util.Observable;
-
/**
Truncate a temp table on a commit, abort or rollback to savepoint
*/
@@ -64,7 +64,7 @@ public class TruncateOnCommit extends Co
}
}
- public void update(Observable obj, Object arg) {
+ public void update(DerbyObservable obj, Object arg) {
if (SanityManager.DEBUG) {
if (arg == null)
SanityManager.THROWASSERT("still on observer list " + this);
Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSourceInterface.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSourceInterface.java?rev=1746066&r1=1746065&r2=1746066&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSourceInterface.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedXADataSourceInterface.java Sun May 29 22:18:02 2016
@@ -21,12 +21,24 @@
package org.apache.derby.jdbc;
+import java.sql.ShardingKeyBuilder;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+
import org.apache.derby.iapi.jdbc.ResourceAdapter;
/**
* Common interface of Derby embedded XA data sources.
*/
-public interface EmbeddedXADataSourceInterface extends EmbeddedDataSourceInterface, javax.sql.XADataSource {
- ResourceAdapter getResourceAdapter();
+public interface EmbeddedXADataSourceInterface extends EmbeddedDataSourceInterface, javax.sql.XADataSource
+{
+ public ResourceAdapter getResourceAdapter();
+
+ /** Added by Java 9 */
+ public default ShardingKeyBuilder createShardingKeyBuilder()
+ throws SQLException
+ {
+ throw new java.sql.SQLFeatureNotSupportedException();
+ }
}