S2Hessian

概要

下記URLのHessian Protcolを使用し、S2ContainerのComponentをURLで指定し、 処理出来る物。 WSDLが不要であり、Dicon Fileの指定だけで呼び出せるので、開発が容易であり またSOAPに比べ Overheadが少ないので、Responseも良いと思います。 Character(コマンド)とBinary(Data) での送信ですので、DebugもTCPMONなどを使えば容易です。

http://www.caucho.com/hessian/index.xtp

なお .NETからの呼び出しのProgramも開発中です。 下記からLinkして下さい。

Sandbox/S2HessianDotNet

Rich Clinetを .NETで作る事も考えての事です。ご意見をよろしくお願いします。

下記が ClientのSampleです。

app.dicon

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN"
"http://www.seasar.org/dtd/components.dtd">
<components>
	<component name="testcomp" class="org.seasar.s2hessian.example.SeasarTest">
		<aspect>
			<component class="org.seasar.s2hessian.S2HessianInterceptor">
				<property name="serviceUrl">"http://localhost:8080/s2hessian/s2h/test"</property>
			</component>
		</aspect>
	</component>
	<component name="testburlap" class="org.seasar.s2hessian.example.SeasarTest">
		<aspect>
			<component class="org.seasar.s2hessian.S2BurlapInterceptor">
				<property name="serviceUrl">"http://localhost:8080/s2hessian/s2b/test"</property>
			</component>
		</aspect>
	</component>
</components>

TestAop.java

package org.seasar.s2hessian.example;

import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable; 

import org.seasar.framework.container.S2Container;
import org.seasar.framework.container.factory.S2ContainerFactory;

import org.seasar.s2hessian.example.SeasarTest;
/**
 * @author shimura
 *
 * To change the template for this generated type comment go to
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
 */
public class TestAop { 

    public static void main(String[] args) {
        
		S2Container container  = S2ContainerFactory.create("app.dicon");
		
		SeasarTest seasarTest =   (SeasarTest)container.getComponent("testcomp");
    	        /* Test1 */
	        int ires=seasarTest.intPlus(30,50);
	        System.out.println("Test1 intPlus result: " +ires);
 
 
		SeasarTest seasarTestb = (SeasarTest)container.getComponent("testburlap");

		/* Test21 */
		ires=seasarTestb.intPlus(83,5);
		System.out.println("BurlapTest21 intPlus result: " +ires);
   }
}

開発者

志村 正信 http://seasarproject.g.hatena.ne.jp/mshimura/

開発情報

ダウンロード

S2Remoting の Interfaceに合わせて Clientを修正しました。

またKOICHIKさんに リファクタリングして頂きました。

files2-hessian-clientV0.3.zip

下記の様な設定になります。

org.seasar.s2hessian.example.TestAopを実行するとSample実行出来ます。

(S2HessianがServerで動いているのが前提です)

<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN"
"http://www.seasar.org/dtd/components.dtd">
<components>
<component name="remoting"    class="org.seasar.remoting.client.interceptors.RemotingInterceptor"/>

<component  class="org.seasar.remoting.caucho.client.HessianConnector">
   <property name="baseURL">"http://localhost:8080/s2hessian/s2h/"</property>
</component>
	<component name="test" class="org.seasar.s2hessian.example.SeasarTest">
		<aspect>remoting</aspect>
	</component>
</components>

最低限必要な Documentを添付した V0.31を公開しました。

files2hessian-v0.31.zip

よしなかさんの提案で、Burlap Protocolも対応した V0.3を公開しました。 utf-8の処理をSkipする事を考えたのですが、当面良い案が見つかりませんので、 Hessianの 処理をそのまま使うことにしました。(よしなかさんの実装を参考に させていただきました)

必要な LIBは、Seaser2のLIBをそのまま使用して下さい。また下記も必要です。

http://www.caucho.com/hessian/download/hessian-3.0.8.jar 
追加機能が必要であればコメントをお願いします。

files2hessian-v0.3.zip

よしなかさんの S2HessianInterceptorを使用した ClientのSampleを 追加し V0.2として公開しました。 なお Clientは s2hessian_clientと Projectを分けて明確にしました。 Version 0.1 を公開します。下記を解凍し、Eclipse 3.0 にImportして下さい。 必要な LIBは、Seaser2のLIBをそのまま使用して下さい。 S2Hessian自体は何も LIBを必要としません。

files2hessian-v0.2.zip

志村さんに了解をいただけたので、S2CauchoRemotingを公開します。

まだ志村さんのほうの実装を見れていないのですが、目指すところは同じだと思うので、いずれは志村さんの方にマージできればと思います。

fileS2CauchoRemoting.zip

Version 0.1 を公開します。下記をEclipse 3.0 にImportして下さい。 必要な LIBは、Seaser2のLIBをそのまま使用して下さい。 S2Hessian自体は何も LIBを必要としません。

org.seasar.s2hessian.example.TestClinet を実行すると、11Caseの Sampleが走ります。

files2hessian-V0.1.ZIP

コメント

最新の10件を表示しています。 コメントページを参照

  • Resignのライセンスには商用利用の場合は購入が必要であるという記述があるようなのですが、hessian-3.0.8.jarの使用に関するラインセンスはどうなっているのでしょうか? -- sam 2004-12-09 (木) 01:07:31
  • 下記の様に ASL 1.1となっている様です。(Sourceに付いています)ご確認下さい

志村

/*
* Copyright (c) 2001-2004 Caucho Technology, Inc.  All rights reserved.
*
* The Apache Software License, Version 1.1
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
*    notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
*    notice, this list of conditions and the following disclaimer in
*    the documentation and/or other materials provided with the
*    distribution.
*
* 3. The end-user documentation included with the redistribution, if
*    any, must include the following acknowlegement:
*       "This product includes software developed by the
*        Caucho Technology (http://www.caucho.com/)."
*    Alternately, this acknowlegement may appear in the software itself,
*    if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "Hessian", "Resin", and "Caucho" must not be used to
*    endorse or promote products derived from this software without prior
*    written permission. For written permission, please contact
*    info@caucho.com.
*
* 5. Products derived from this software may not be called "Resin"
*    nor may "Resin" appear in their names without prior written
*    permission of Caucho Technology.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.  IN NO EVENT SHALL CAUCHO TECHNOLOGY OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @author Scott Ferguson
*/
  • ありがとうございます。 -- sam 2004-12-12 (日) 02:53:15
  • プロキシ経由でhessianサーバにアクセスってできますでしょうか? -- masayuki 2005-06-27 12:49:40 (月)
お名前:

添付ファイル: files2-hessian-clientV0.2.zip 1605件 [詳細] files2-hessian-clientV0.3.zip 2573件 [詳細] files2hessian-v0.31.zip 2537件 [詳細] files2hessian-v0.3.zip 2452件 [詳細] files2hessian-v0.2.zip 2470件 [詳細] fileS2CauchoRemoting.zip 2477件 [詳細] files2hessian-V0.1.ZIP 2421件 [詳細]

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2005-04-25 (月) 00:00:00