Author: echatellier Date: 2010-06-29 15:59:21 +0200 (Tue, 29 Jun 2010) New Revision: 169 Url: http://nuiton.org/repositories/revision/wikitty/169 Log: Add method to create a hessian proxy on a remote WikittyService Modified: trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java Modified: trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java =================================================================== --- trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java 2010-06-29 13:50:57 UTC (rev 168) +++ trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java 2010-06-29 13:59:21 UTC (rev 169) @@ -21,6 +21,7 @@ import java.net.MalformedURLException; import org.nuiton.wikitty.WikittyException; +import org.nuiton.wikitty.WikittyService; import com.caucho.hessian.client.HessianProxyFactory; @@ -36,6 +37,17 @@ public class WikittyHessianFactory { /** + * Get hessian wikitty service proxy on remove endpoint. + * + * @param serviceEndpoint service endpoint (full url) + * @return hessian proxy implementing {@code WikittyService} + * @throws WikittyException if hessian proxy can't be created + */ + public static WikittyService getWikittyService(String serviceEndpoint) throws WikittyException { + return getService(WikittyService.class, serviceEndpoint); + } + + /** * Get hessian service proxy on remove endpoint. * * @param <S> service type @@ -44,7 +56,7 @@ * @return hessian proxy implementing {@code S} * @throws WikittyException if hessian proxy can't be created */ - public <S> S getService(Class<S> serviceInterface, String serviceEndpoint) throws WikittyException { + public static <S> S getService(Class<S> serviceInterface, String serviceEndpoint) throws WikittyException { HessianProxyFactory factory = new HessianProxyFactory(); // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code