Class AbstractNoSqlConnection<W,T extends NoSqlObject<W>>
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.nosql.AbstractNoSqlConnection<W,T>
-
- Type Parameters:
W- SeeNoSqlConnection.T- SeeNoSqlConnection.
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,NoSqlConnection<W,T>
- Direct Known Subclasses:
CouchDbConnection
public abstract class AbstractNoSqlConnection<W,T extends NoSqlObject<W>> extends java.lang.Object implements NoSqlConnection<W,T>
Facilitates implementations ofNoSqlConnection.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicBooleanclosed
-
Constructor Summary
Constructors Constructor Description AbstractNoSqlConnection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying connection.protected abstract voidcloseImpl()booleanisClosed()Indicates whether the underlying connection is closed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.appender.nosql.NoSqlConnection
createList, createObject, insertObject
-
-
-
-
Method Detail
-
close
public void close()
Description copied from interface:NoSqlConnectionCloses the underlying connection. This method call should be idempotent. Only the first call should have any effect; all further calls should be ignored. It's possible the underlying connection is stateless (such as an HTTP web service), in which case this method would be a no-op. This method should also commit any open transactions, if applicable and if not already committed.If this connection is part of a connection pool, executing this method should commit the transaction and return the connection to the pool, but it should not actually close the underlying connection.
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceNoSqlConnection<W,T extends NoSqlObject<W>>
-
closeImpl
protected abstract void closeImpl()
-
isClosed
public boolean isClosed()
Description copied from interface:NoSqlConnectionIndicates whether the underlying connection is closed. If the underlying connection is stateless (such as an HTTP web service), this method would likely always return true. Essentially, this method should only returntrueif a call toNoSqlConnection.insertObject(NoSqlObject)will fail due to the state of this object.- Specified by:
isClosedin interfaceNoSqlConnection<W,T extends NoSqlObject<W>>- Returns:
trueif this object is considered closed.
-
-