1 29 30 package com.caucho.soa.client; 31 32 import com.caucho.soa.rest.RestProxy; 33 34 import javax.xml.bind.JAXBException; 35 import java.lang.reflect.Proxy ; 36 import java.net.MalformedURLException ; 37 38 public class RestEncodingProxyFactory implements EncodingProxyFactory { 39 public Object getProxy(Class serviceInterface, String url) 40 throws MalformedURLException , JAXBException 41 { 42 return Proxy.newProxyInstance(serviceInterface.getClassLoader(), 43 new Class [] { serviceInterface }, 44 new RestProxy(serviceInterface, url)); 45 } 46 47 public Object getProxy(Class serviceInterface, String url, 48 String jaxbPackages) 49 throws MalformedURLException , JAXBException 50 { 51 RestProxy proxy = new RestProxy(serviceInterface, url, jaxbPackages); 52 53 return Proxy.newProxyInstance(serviceInterface.getClassLoader(), 54 new Class [] { serviceInterface }, proxy); 55 } 56 57 public Object getProxy(Class serviceInterface, String url, 58 Class [] jaxbClasses) 59 throws MalformedURLException , JAXBException 60 { 61 RestProxy proxy = new RestProxy(serviceInterface, url, jaxbClasses); 62 63 return Proxy.newProxyInstance(serviceInterface.getClassLoader(), 64 new Class [] { serviceInterface }, proxy); 65 } 66 } 67 | Popular Tags |