Class ConnectionCloseHolder
- java.lang.Object
-
- pro.chenggang.project.reactive.mybatis.support.r2dbc.connection.ConnectionCloseHolder
-
public class ConnectionCloseHolder extends Object
Holder for a connection that makes sure the close action is invoked atomically only once.- Version:
- 1.0.0
- Author:
- Gang Cheng
-
-
Constructor Summary
Constructors Constructor Description ConnectionCloseHolder(io.r2dbc.spi.Connection connection, Function<io.r2dbc.spi.Connection,org.reactivestreams.Publisher<Void>> closeFunction)Instantiates a new Connection close holder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<Void>close()closeio.r2dbc.spi.ConnectiongetTarget()get targetbooleanisClosed()Is closed boolean.
-
-
-
Method Detail
-
getTarget
public io.r2dbc.spi.Connection getTarget()
get target- Returns:
- connection
-
close
public reactor.core.publisher.Mono<Void> close()
close- Returns:
- mono
-
isClosed
public boolean isClosed()
Is closed boolean.- Returns:
- the boolean
-
-