com.coxautodev.graphql.tools.Spring4AopProxyHandler.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graphql-java-tools Show documentation
Show all versions of graphql-java-tools Show documentation
Tools to help map a GraphQL schema to existing Java objects.
package com.coxautodev.graphql.tools
import org.springframework.aop.support.AopUtils
/**
* @author Andrew Potter
*/
class Spring4AopProxyHandler: ProxyHandler {
val isEnabled: Boolean =
try {
Class.forName("org.springframework.aop.support.AopUtils")
true
} catch (_: ClassNotFoundException) {
false
}
override fun canHandle(resolver: GraphQLResolver<*>?): Boolean {
return isEnabled && AopUtils.isAopProxy(resolver)
}
override fun getTargetClass(resolver: GraphQLResolver<*>?): Class<*> = AopUtils.getTargetClass(resolver)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy