r148 - in trunk: . wikitty-hessian-client wikitty-hessian-client/src wikitty-hessian-client/src/main wikitty-hessian-client/src/main/java wikitty-hessian-client/src/main/java/org wikitty-hessian-client/src/main/java/org/wikitty wikitty-hessian-client/src/main/java/org/wikitty/hessian wikitty-hessian-client/src/test
Author: echatellier Date: 2010-06-23 10:13:18 +0200 (Wed, 23 Jun 2010) New Revision: 148 Url: http://nuiton.org/repositories/revision/wikitty/148 Log: Link wikitty-ui-zk to build. Add wikitty-hessian-client module and hessian dependency Added: trunk/wikitty-hessian-client/ trunk/wikitty-hessian-client/LICENSE.txt trunk/wikitty-hessian-client/README.txt trunk/wikitty-hessian-client/changelog.txt trunk/wikitty-hessian-client/pom.xml trunk/wikitty-hessian-client/src/ trunk/wikitty-hessian-client/src/main/ trunk/wikitty-hessian-client/src/main/java/ trunk/wikitty-hessian-client/src/main/java/org/ trunk/wikitty-hessian-client/src/main/java/org/wikitty/ trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/ trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java trunk/wikitty-hessian-client/src/test/ trunk/wikitty-hessian-client/src/test/java/ Modified: trunk/pom.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-06-23 08:11:37 UTC (rev 147) +++ trunk/pom.xml 2010-06-23 08:13:18 UTC (rev 148) @@ -26,7 +26,9 @@ <module>wikitty-jdbc-impl</module> <module>wikitty-multistorage-impl</module> <module>wikitty-jms-impl</module> - <!--module>wikitty-ui-gwt</module--> + <module>wikitty-ui-zk</module> + <module>wikitty-hessian-client</module> + <!-- module>wikitty-hessian-server</module--> </modules> <dependencyManagement> @@ -93,6 +95,13 @@ <version>1.6.0</version> <scope>test</scope> </dependency> + + <dependency> + <groupId>com.caucho</groupId> + <artifactId>hessian</artifactId> + <version>3.1.5</version> + <scope>compile</scope> + </dependency> <!-- GWT dependencies for GWT projects <dependency> Added: trunk/wikitty-hessian-client/pom.xml =================================================================== --- trunk/wikitty-hessian-client/pom.xml (rev 0) +++ trunk/wikitty-hessian-client/pom.xml 2010-06-23 08:13:18 UTC (rev 148) @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.nuiton</groupId> + <artifactId>wikitty</artifactId> + <version>2.0-SNAPSHOT</version> + </parent> + + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> + <groupId>org.nuiton.wikitty</groupId> + <artifactId>wikitty-hessian-client</artifactId> + + <dependencies> + <dependency> + <groupId>org.nuiton.wikitty</groupId> + <artifactId>wikitty-api</artifactId> + <version>${project.version}</version> + <scope>compile</scope> + </dependency> + + <dependency> + <groupId>com.caucho</groupId> + <artifactId>hessian</artifactId> + <version>3.1.5</version> + <scope>compile</scope> + </dependency> + </dependencies> + + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + + <name>Wikitty :: hessian client</name> + + <description>Wikitty hessian client</description> + <inceptionYear>2010</inceptionYear> + + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> + + <packaging>jar</packaging> + + <properties> + + </properties> + + <build> + + </build> + + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> + +</project> Added: trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java =================================================================== --- trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java (rev 0) +++ trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java 2010-06-23 08:13:18 UTC (rev 148) @@ -0,0 +1,65 @@ +/* *##% + * Copyright (C) 2010 Code Lutin, Chatellier Eric + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *##%*/ + +package org.wikitty.hessian; + +import java.net.MalformedURLException; + +import org.nuiton.wikitty.WikittyException; + +import com.caucho.hessian.client.HessianProxyFactory; + +/** + * Wikitty hessian client factory. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class WikittyHessianFactory { + + /** + * Get hessian service proxy on remove endpoint. + * + * @param <S> service type + * @param serviceInterface service interface + * @param serviceEndpoint service endpoint (full url) + * @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 { + + HessianProxyFactory factory = new HessianProxyFactory(); + // Fix : com.caucho.hessian.io.HessianProtocolException: '���' is an unknown code + factory.setHessian2Request(true); + // pour que les méthodes aux noms dupliquées fonctionnent (arguments different) + factory.setOverloadEnabled(true); + + // service proxy + S hessianProxy; + try { + hessianProxy = (S)factory.create(serviceInterface, serviceEndpoint); + } catch (MalformedURLException eee) { + throw new WikittyException("Can't create hessian proxy", eee); + } + + return hessianProxy; + } +} Property changes on: trunk/wikitty-hessian-client/src/main/java/org/wikitty/hessian/WikittyHessianFactory.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL
participants (1)
-
echatellier@users.nuiton.org