@Override public ConditionOutcome getMatchOutcome( ConditionContext context, AnnotatedTypeMetadata metadata) { if (anyMatches(context, metadata, this.nonEmbedded)) { return ConditionOutcome.noMatch("existing non-embedded database detected"); } EmbeddedDatabaseType type = EmbeddedDatabaseConnection.get(context.getClassLoader()).getType(); if (type == null) { return ConditionOutcome.noMatch("no embedded database detected"); } return ConditionOutcome.match("embedded database " + type + " detected"); }
@Override public void afterPropertiesSet() throws Exception { this.embeddedDatabaseConnection = EmbeddedDatabaseConnection.get(this.classLoader); }