* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.controller.md.sal.binding.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.lang.reflect.Method;
package org.opendaylight.controller.md.sal.binding.impl;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import java.lang.reflect.Method;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(ContextReferenceExtractor.class);
private static final ContextReferenceExtractor NULL_EXTRACTOR = new ContextReferenceExtractor() {
private static final Logger LOG = LoggerFactory.getLogger(ContextReferenceExtractor.class);
private static final ContextReferenceExtractor NULL_EXTRACTOR = new ContextReferenceExtractor() {
private static final LoadingCache<Class<?>, ContextReferenceExtractor> EXTRACTORS = CacheBuilder.newBuilder()
.weakKeys().build(new CacheLoader<Class<?>, ContextReferenceExtractor>() {
@Override
private static final LoadingCache<Class<?>, ContextReferenceExtractor> EXTRACTORS = CacheBuilder.newBuilder()
.weakKeys().build(new CacheLoader<Class<?>, ContextReferenceExtractor>() {
@Override
- * @return Instance Identifier representing context reference
- * or null, if data object does not contain context reference.
+ * @return Instance Identifier representing context reference or null, if data object does not contain
+ * context reference.
if (InstanceIdentifier.class.isAssignableFrom(returnType)) {
return DirectGetterRouteContextExtractor.create(contextGetter);
}
if (InstanceIdentifier.class.isAssignableFrom(returnType)) {
return DirectGetterRouteContextExtractor.create(contextGetter);
}
if (getValueMethod != null) {
return GetValueRouteContextExtractor.create(contextGetter, getValueMethod);
} else {
if (getValueMethod != null) {
return GetValueRouteContextExtractor.create(contextGetter, getValueMethod);
} else {
- LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.",returnType);
+ LOG.warn("Class {} can not be used to determine context, falling back to NULL_EXTRACTOR.", returnType);