da9f71a5c3bb15249c165eb4ab481e88c5f50a54
[controller.git] / opendaylight / md-sal / sal-dom-xsql / src / main / java / org / opendaylight / controller / md / sal / dom / xsql / jdbc / JDBCProxy.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.md.sal.dom.xsql.jdbc;
10
11 import java.lang.reflect.InvocationHandler;
12 import java.lang.reflect.Method;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
15
16 /**
17  * To be removed in Nitrogen
18  */
19 @Deprecated
20 public class JDBCProxy implements InvocationHandler {
21     private static final Logger LOG = LoggerFactory.getLogger(JDBCProxy.class);
22     private Object myObject = null;
23     private Class<?> myObjectClass = null;
24
25     public JDBCProxy(Object obj) {
26         this.myObject = obj;
27         this.myObjectClass = this.myObject.getClass();
28     }
29
30     @Override
31     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
32         LOG.debug("Class {} Method {}", this.myObjectClass.getSimpleName(), method.getName());
33         return method.invoke(this.myObject, args);
34     }
35 }