Skip to content

Commit ecca1ea

Browse files
committed
remove cruft, including ProxyConnection
1 parent 27c87c7 commit ecca1ea

File tree

7 files changed

+4
-347
lines changed

7 files changed

+4
-347
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/common/spi/MutinyImplementor.java

Lines changed: 0 additions & 82 deletions
This file was deleted.

hibernate-reactive-core/src/main/java/org/hibernate/reactive/mutiny/impl/MutinySessionFactoryImpl.java

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.hibernate.internal.SessionCreationOptions;
1313
import org.hibernate.internal.SessionFactoryImpl;
1414
import org.hibernate.reactive.common.spi.Implementor;
15-
import org.hibernate.reactive.common.spi.MutinyImplementor;
1615
import org.hibernate.reactive.context.Context;
1716
import org.hibernate.reactive.context.impl.BaseKey;
1817
import org.hibernate.reactive.context.impl.MultitenantKey;
@@ -40,7 +39,7 @@
4039
* <p>
4140
* Obtained by calling {@link org.hibernate.SessionFactory#unwrap(Class)}.
4241
*/
43-
public class MutinySessionFactoryImpl implements Mutiny.SessionFactory, Implementor, MutinyImplementor {
42+
public class MutinySessionFactoryImpl implements Mutiny.SessionFactory, Implementor {
4443

4544
private static final Log LOG = LoggerFactory.make( Log.class, MethodHandles.lookup() );
4645

@@ -85,24 +84,6 @@ public Context getContext() {
8584
return context;
8685
}
8786

88-
@Override
89-
public Mutiny.Session newSession() {
90-
SessionCreationOptions options = options();
91-
return new MutinySessionImpl(
92-
new ReactiveSessionImpl( delegate, options, proxyConnection( options.getTenantIdentifier() ) ),
93-
this
94-
);
95-
}
96-
97-
@Override
98-
public Mutiny.Session newSession(String tenantId) {
99-
Objects.requireNonNull( tenantId, "parameter 'tenantId' is required" );
100-
return new MutinySessionImpl(
101-
new ReactiveSessionImpl( delegate, options( tenantId ), proxyConnection( tenantId ) ),
102-
this
103-
);
104-
}
105-
10687
@Override
10788
public Uni<Mutiny.Session> openSession() {
10889
SessionCreationOptions options = options();
@@ -128,23 +109,6 @@ private <S> Uni<S> create(ReactiveConnection connection, Supplier<S> supplier) {
128109
.onFailure().call( () -> Uni.createFrom().completionStage( connection.close() ) );
129110
}
130111

131-
@Override
132-
public Mutiny.StatelessSession newStatelessSession() {
133-
SessionCreationOptions options = options();
134-
return new MutinyStatelessSessionImpl(
135-
new ReactiveStatelessSessionImpl( delegate, options, proxyConnection( options.getTenantIdentifier() ) ),
136-
this
137-
);
138-
}
139-
140-
@Override
141-
public Mutiny.StatelessSession newStatelessSession(String tenantId) {
142-
return new MutinyStatelessSessionImpl(
143-
new ReactiveStatelessSessionImpl( delegate, options( tenantId ), proxyConnection( tenantId ) ),
144-
this
145-
);
146-
}
147-
148112
@Override
149113
public Uni<Mutiny.StatelessSession> openStatelessSession() {
150114
SessionCreationOptions options = options();
@@ -167,7 +131,7 @@ private SessionCreationOptions options() {
167131
}
168132

169133
private SessionCreationOptions options(String tenantIdentifier) {
170-
return (SessionCreationOptions) new SessionFactoryImpl.SessionBuilderImpl( delegate )
134+
return new SessionFactoryImpl.SessionBuilderImpl( delegate )
171135
.tenantIdentifier( tenantIdentifier );
172136
}
173137

@@ -178,13 +142,6 @@ private CompletionStage<ReactiveConnection> connection(String tenantId) {
178142
: connectionPool.getConnection( tenantId );
179143
}
180144

181-
private ReactiveConnection proxyConnection(String tenantId) {
182-
assertUseOnEventLoop();
183-
return tenantId==null
184-
? connectionPool.getProxyConnection()
185-
: connectionPool.getProxyConnection( tenantId );
186-
}
187-
188145
@Override
189146
public <T> Uni<T> withSession(Function<Mutiny.Session, Uni<T>> work) {
190147
Objects.requireNonNull( work, "parameter 'work' is required" );

hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/ReactiveConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
* with a single {@code ReactiveConnection}. Instead, the second
2626
* operation must be chained on completion of the first operation.
2727
* This restriction might be relaxed in future, and is due to the
28-
* implementation of the {@code ProxyConnection} returned by
29-
* {@link org.hibernate.reactive.pool.impl.DefaultSqlClientPool#getProxyConnection()}.
28+
* implementation of the {@code ProxyConnection}.
3029
*
3130
* @see ReactiveConnectionPool
3231
*/

hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/ReactiveConnectionPool.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ public interface ReactiveConnectionPool extends Service {
6363
*/
6464
CompletionStage<ReactiveConnection> getConnection(String tenantId, SqlExceptionHelper sqlExceptionHelper);
6565

66-
/**
67-
* Obtain a lazily-initializing reactive connection. The
68-
* actual connection might be made when the returned
69-
* instance if {@link ReactiveConnection} is first used.
70-
*/
71-
ReactiveConnection getProxyConnection();
72-
73-
/**
74-
* Obtain a lazily-initializing reactive connection for the
75-
* given tenant id. The actual connection might be made when
76-
* the returned instance if {@link ReactiveConnection} is
77-
* first used.
78-
*/
79-
ReactiveConnection getProxyConnection(String tenantId);
80-
8166
/**
8267
* The shutdown of the pool is actually asynchronous but the
8368
* core service registry won't return the {@link CompletionStage}.

hibernate-reactive-core/src/main/java/org/hibernate/reactive/pool/impl/ProxyConnection.java

Lines changed: 0 additions & 191 deletions
This file was deleted.

0 commit comments

Comments
 (0)