/**
* EasySOA Samples - Smart Travel
* Copyright 2011 Open Wide
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Contact : easysoa-dev@googlegroups.com
*/
/**
* Please modify this class to meet your needs
* This class is not complete
*/
package de.daenet.webservices.currencyserver;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Logger;
/**
* This class was generated by Apache CXF 2.3.3
* 2011-07-20T14:27:53.443+02:00
* Generated source version: 2.3.3
*
*/
public class CurrencyServerWebServiceSoapSpyDynWrapper implements InvocationHandler {
private static final Logger LOG = Logger.getLogger(CurrencyServerWebServiceSoapImpl.class.getName());
private CurrencyServerWebServiceSoap impl;
private CurrencyServerWebServiceSoap spyDelegate;
/*public CurrencyServerWebServiceSoapSpyDynWrapper() {
this.impl = new CurrencyServerWebServiceSoapImpl1();
this.spyDelegate = spy(this.impl);
}*/
private Object obj;
public static Object newInstance(Object obj) {
return java.lang.reflect.Proxy.newProxyInstance(obj.getClass().getClassLoader(), obj.getClass().getInterfaces(),
new CurrencyServerWebServiceSoapSpyDynWrapper(obj));
}
private CurrencyServerWebServiceSoapSpyDynWrapper(Object obj) {
this.obj = obj;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Object result;
try {
System.out.println("before method " + method.getName());
result = method.invoke(obj, args);
}
catch (InvocationTargetException e) {
throw e.getTargetException();
}
catch (Exception e) {
throw new RuntimeException("unexpected invocation exception: " + e.getMessage());
} finally {
System.out.println("after method " + method.getName());
}
return result;
}
// Add here a dynamic proxy
/*public static Object newInstance(Object object, Class[] interfaces) {
return Proxy.newProxyInstance(object.getClass().getClassLoader(), interfaces, new ViewProxy(map));
}*/
}