@Override public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { String hotRodPropertiesPath = conditionContext.getEnvironment().getProperty("infinispan.remote.client-properties"); if (hotRodPropertiesPath == null) { hotRodPropertiesPath = InfinispanProperties.Remote.DEFAULT_CLIENT_PROPERTIES; } return conditionContext.getResourceLoader().getResource(hotRodPropertiesPath).exists(); } }
private boolean isWebApplicationContext(ConditionContext context) { ResourceLoader resourceLoader = context.getResourceLoader(); if (resourceLoader instanceof ConfigurableReactiveWebApplicationContext) { return true; } if (!ClassUtils.isPresent(CLASS_NAME_WEB_APPLICATION_CONTEXT, context.getClassLoader())) { return false; } return WebApplicationContext.class.isInstance(resourceLoader); }
private boolean hasHotRodClientPropertiesFile(ConditionContext conditionContext) { String hotRodPropertiesPath = conditionContext.getEnvironment().getProperty("infinispan.remote.client-properties"); if (hotRodPropertiesPath == null) { hotRodPropertiesPath = InfinispanRemoteConfigurationProperties.DEFAULT_CLIENT_PROPERTIES; } return conditionContext.getResourceLoader().getResource(hotRodPropertiesPath).exists(); } }
@Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { YamlPropertiesFactoryBean propertiesFactoryBean = AlienYamlPropertiesFactoryBeanFactory.get(context.getResourceLoader()); Object ldapEnabled = propertiesFactoryBean.getObject().get("ldap.enabled"); if (ldapEnabled != null && ldapEnabled instanceof Boolean) { return ((Boolean) ldapEnabled).booleanValue(); } return false; } }