Interface DialectSelector

  • All Superinterfaces:
    LazyServiceResolver<Dialect>, Serializable, Service
    All Known Implementing Classes:
    AggregatedDialectSelector, DefaultDialectSelector

    public interface DialectSelector
    extends Service, LazyServiceResolver<Dialect>
    Service which acts as a registry for named strategy implementations.

    Strategies are more open ended than services, though a strategy managed here might very well also be a service. The strategy is any interface that has multiple, (possibly short) named implementations.

    StrategySelector manages resolution of particular implementation by (possibly short) name via the #selectStrategyImplementor method, which is the main contract here. As indicated in the docs of that method the given name might be either a short registered name or the implementation FQN. As an example, consider resolving the TransactionCoordinatorBuilder implementation to use. To use the JDBC-based TransactionCoordinatorBuilder the passed name might be either "jdbc" or "org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl" (which is the FQN).

    Strategy implementations can be managed by #registerStrategyImplementor and #unRegisterStrategyImplementor. Originally designed to help the OSGi use case, though no longer used there.

    The service also exposes a general typing API via #resolveStrategy and #resolveDefaultableStrategy which accept implementation references rather than implementation names, allowing for a multitude of interpretations of said "implementation reference". See the docs for #resolveDefaultableStrategy for details.