org.datanucleus.jdo
Class JDOConnectionImpl

java.lang.Object
  extended by org.datanucleus.jdo.JDOConnectionImpl
All Implemented Interfaces:
javax.jdo.datastore.JDOConnection

public class JDOConnectionImpl
extends java.lang.Object
implements javax.jdo.datastore.JDOConnection

Implementation of a generic JDO connection for non-RDBMS datastores. Takes the NucleusConnection as input, providing all behaviour and closure of underlying connections.


Field Summary
protected static Localiser LOCALISER
          Localisation utility for output messages
protected  NucleusConnection nucConn
          Underlying NucleusConnection providing the connection.
 
Constructor Summary
JDOConnectionImpl(NucleusConnection nconn)
          Constructor taking the underlying NucleusConnection that provides the datastore access.
 
Method Summary
 void close()
          Method to close the connection.
 java.lang.Object getNativeConnection()
          Accessor for the native connection for this datastore.
protected  void throwExceptionNotAvailable()
          Throw a JDOUserException that the connection is no longer available
protected  void throwExceptionUnsupportedOperation(java.lang.String methodName)
          Convenience method that throws a JDOUserException that the specified method name is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localisation utility for output messages


nucConn

protected NucleusConnection nucConn
Underlying NucleusConnection providing the connection.

Constructor Detail

JDOConnectionImpl

public JDOConnectionImpl(NucleusConnection nconn)
Constructor taking the underlying NucleusConnection that provides the datastore access.

Parameters:
nconn - Underlying connection
Method Detail

close

public void close()
Method to close the connection.

Specified by:
close in interface javax.jdo.datastore.JDOConnection

getNativeConnection

public java.lang.Object getNativeConnection()
Accessor for the native connection for this datastore. For RDBMS this would be a java.sql.Connection, or for db4o an ObjectContainer etc.

Specified by:
getNativeConnection in interface javax.jdo.datastore.JDOConnection
Returns:
The native connection

throwExceptionNotAvailable

protected void throwExceptionNotAvailable()
Throw a JDOUserException that the connection is no longer available

Throws:
javax.jdo.JDOUserException

throwExceptionUnsupportedOperation

protected void throwExceptionUnsupportedOperation(java.lang.String methodName)
Convenience method that throws a JDOUserException that the specified method name is not supported.

Parameters:
methodName - Name of the method


Copyright © 2011. All Rights Reserved.