public class CompositeSignal extends java.lang.Object implements RoutingSignal
RoutingSignal. The primary is consulted first; when it
returns TargetRole.NO_DECISION, the fallback is consulted. This lets the auto plugin route
primarily on SQL (at prepare time) while still honoring setReadOnly.| Constructor and Description |
|---|
CompositeSignal(RoutingSignal primary,
RoutingSignal fallback) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<java.lang.String> |
extraSubscribedMethods()
Extra JDBC method names this signal needs subscribed beyond the plugin's defaults (e.g.
|
TargetRole |
resolve(RwSplitContext ctx,
java.lang.String methodName,
@Nullable java.lang.Object[] args)
Resolves the desired role for this call.
|
TargetRole |
resolveForBoundStatement(RwSplitContext ctx)
Resolves the desired role for an already-bound plain
Statement from the parsed SQL,
used only for the optional statement-rebinding path. |
public CompositeSignal(RoutingSignal primary, RoutingSignal fallback)
public java.util.Set<java.lang.String> extraSubscribedMethods()
RoutingSignalextraSubscribedMethods in interface RoutingSignalpublic TargetRole resolve(RwSplitContext ctx, java.lang.String methodName, @Nullable java.lang.Object[] args) throws java.sql.SQLException
RoutingSignalTargetRole.NO_DECISION means the method is not
a routing trigger for this signal (the signal abstains).resolve in interface RoutingSignalctx - the read/write splitting contextmethodName - the JDBC method being invokedargs - the method arguments (may be null)java.sql.SQLExceptionpublic TargetRole resolveForBoundStatement(RwSplitContext ctx) throws java.sql.SQLException
RoutingSignalStatement from the parsed SQL,
used only for the optional statement-rebinding path. Returns TargetRole.NO_DECISION
by default (signals that do not route on SQL do not reroute bound statements).resolveForBoundStatement in interface RoutingSignalctx - the read/write splitting contextTargetRole.NO_DECISION if this signal does not applyjava.sql.SQLException