Fix license header violations in sal-dom-xsql
[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 public class JDBCProxy implements InvocationHandler {
17     private static final Logger LOG = LoggerFactory.getLogger(JDBCProxy.class);
18     private Object myObject = null;
19     private Class<?> myObjectClass = null;
20
21     public JDBCProxy(Object obj) {
22         this.myObject = obj;
23         this.myObjectClass = this.myObject.getClass();
24     }
25
26     @Override
27     public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
28         LOG.debug("Class {} Method {}", this.myObjectClass.getSimpleName(), method.getName());
29         return method.invoke(this.myObject, args);
30     }
31 }