com.bugsnag.SpringWebMvcLoadedCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bugsnag-spring Show documentation
Show all versions of bugsnag-spring Show documentation
'Official Bugsnag notifier for Spring applications'
package com.bugsnag;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
/**
* Check whether spring-webmvc is available to the application.
*/
class SpringWebMvcLoadedCondition implements Condition {
@Override
public boolean matches(ConditionContext context,
AnnotatedTypeMetadata metadata) {
return context.getClassLoader() != null
&& context.getClassLoader().getResource("org/springframework/web/servlet") != null;
}
}