AKAI TSUKI

System development or Technical something

リングプロトコル REP

  • REP

CISCO独自プロトコル。マスタースイッチを指定しない。
それぞれのスイッチがやりとりをする。プライマリーポートもない。
障害発生時には、障害ポートを持つスイッチが全スイッチに通知を行う。
ブロックポートはどこにでも設定可。障害からの復旧時も、
ブロックポートをオープンにしたままでよい。

  • 普通のリングプロトコル

マスタースイッチを一つ決める。
そのマスタースイッチのプライマリーポートからHelloメッセージを
定期的に送信することで、正常稼動を確認する。

CORBA関連

  • ns
C:\Java\JacORB\bin>ns -Djacorb.naming.ior_filename=C:/Java/JacORB/data/NS_Ref
java version "1.4.2_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)
[jacorb.orb.singleton] INFO : created ORBSingleton
  • server
C:\Java\JacORB\classes>jaco demo.grid.Server
java version "1.4.2_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)
[jacorb.orb.singleton] INFO : created ORBSingleton
  • client
C:\Java\JacORB\classes>jaco demo.grid.Client
java version "1.4.2_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)
[jacorb.orb.singleton] INFO : created ORBSingleton
Height = 31
Width = 14
Old value at (30,13): 470.11
Setting (30,13) to 470.11
New value at (30,13): 470.11
MyException, reason: This is only a test exception, no harm done :-)
done.

C:\Java\JacORB\classes>
  • server起動直後のclientの実行は上手くいかない
C:\Java\JacORB\classes>jaco demo.grid.Client
java version "1.4.2_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_19-b04)
Java HotSpot(TM) Client VM (build 1.4.2_19-b04, mixed mode)
[jacorb.orb.singleton] INFO : created ORBSingleton
org.omg.CORBA.TRANSIENT: Retries exceeded, couldn't reconnect to 192.168.129.24:2903
        at org.jacorb.orb.iiop.ClientIIOPConnection.connect(ClientIIOPConnection.java:232)
        at org.jacorb.orb.giop.GIOPConnection.sendMessage(GIOPConnection.java:934)
        at org.jacorb.orb.giop.GIOPConnection.sendRequest(GIOPConnection.java:900)
        at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:323)
        at org.jacorb.orb.giop.ClientConnection.sendRequest(ClientConnection.java:304)
        at org.jacorb.orb.Delegate.invoke_internal(Delegate.java:1024)
        at org.jacorb.orb.Delegate.invoke(Delegate.java:939)
        at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:80)
        at demo.grid._MyServerStub.height(_MyServerStub.java:32)
        at demo.grid.Client.main(Client.java:34)

C:\Java\JacORB\classes>

JacORBのつづき

javaはC:\j2sdk1.4.2_19\bin\javaに配置しています。

  • jaco.bat
@echo off
rem call java interpreter
set CLASSPATH=.;C:\Java\JacORB\lib
C:\j2sdk1.4.2_19\bin\java -Djava.endorsed.dirs=%JACORB_HOME%\lib -Djacorb.home=%JACORB_HOME% -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton -classpath %CLASSPATH% %*
  • ns.bat(Naming Service)
@echo off
rem Starts the JacORB name server
jaco org.jacorb.naming.NameServer %*
  • ntfy.bat(Notification Service)
@echo off
rem Starts the JacORB Notification Service
set CLASSPATH="..\lib\backport-util-concurrent.jar;..\lib\picocontainer-1.2.jar;..\lib\antlr-2.7.2.jar"
jaco org.jacorb.notification.ConsoleMain %*


さらに、naming serviceに登録されているオブジェクトを見ることができるっぽい。

  • nmg.bat(the JacORB name manager)
@echo off
rem Starts the JacORB name manager

jaco org.jacorb.naming.namemanager.NameManager %*


んで、idlのクラス生成用

  • idl.bat.tplをidl.batにリネームする。
  • 以下の値を適宜変更する
    • @JAVA_CMD@
    • @JACORB_HOME@
  • idl.bat
@echo off
C:\j2sdk1.4.2_19\bin\java -classpath "%JACORB_HOME%\lib\idl.jar;%JACORB_HOME%\lib\logkit-1.2.jar;%CLASSPATH%" org.jacorb.idl.parser %*

JacORBの起動

  • JacORBをダウンロード

http://www.jacorb.org/download.html

  • version 2.3.0

> Download the latest JacORB version
> The latest release is JacORB 2.3.0. For details, please see the release notes.

  • 展開する。
    • C:/Java/JacORBの下に配置されるようにした。
  • batファイル修正
    • jaco.bat.tpl → jaco.batにリネーム
    • jaco.batを環境に合わせて以下の点を修正した。
      • @JAVA_CMD@
      • @JACORB_HOME@

設定ファイルの修正

  • orb.properties
    • 以下の設定を行う。
      • jacorb.config.dir=c:/Java/JacORB
      • ORBInitRef.NameService=file:/c:/Java/JacORB/data/NS_Ref
      • jacorb.logfile=c:/Java/JacORB/log/jacorb.log
  • jacorb.properties
    • jacorb_properties.templateをjacorb.propertiesに名前を修正。
    • 以下の設定を行う。
      • ORBInitRef.NameService=file:/c:/Java/JacORB/data/NS_Ref
      • ORBInitRef.NotificationService=file:/c:/Java/JacORB/data/ES_Ref
      • ORBInitRef.InterfaceRepository=file:/c:/Java/JacORB/data/IR_Ref (これいるんかな?)
      • jacorb.naming.ior_filename=c:/Java/JacORB/data/NS_Ref

Naming Service実行

以下のようになればよい?

C:\Java\JacORB\bin>ns
[jacorb.orb.print_ver] INFO :
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        JacORB V 2.3.0, www.jacorb.org
        (C) The JacORB project 17-Feb-2007
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[jacorb.orb] INFO : Property "jacorb.hashtable_class" is set to: java.util.Hashtable
[org.jacorb.orb.codes] WARN : Warning - unknown codeset (windows-31j) - defaulting to ISO-8859-1
[jacorb.orb.intercept] INFO : InterceptorManager started with 0 Server 
Interceptors, 0 Client Interceptors and 1 IOR Interceptors
[jacorb.orb.singleton] INFO : created ORBSingleton
[jacorb.naming] INFO : NS up
[jacorb.orb] INFO : ORB run

Notification Service実行

以下のようになればよい?

C:\Java\JacORB\bin>ntfy.bat
[jacorb.orb.print_ver] INFO :
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        JacORB V 2.3.0, www.jacorb.org
        (C) The JacORB project 17-Feb-2007
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[jacorb.orb] INFO : Property "jacorb.hashtable_class" is set to: java.util.Hashtable
[org.jacorb.orb.codes] WARN : Warning - unknown codeset (windows-31j) - defaulting to ISO-8859-1
[jacorb.orb.intercept] INFO : InterceptorManager started with 0 Server 
Interceptors, 0 Client Interceptors and 1 IOR Interceptors
[jacorb.poa] INFO : oid:5F 45 43 46 61 63 74 6F 72 79                               _ECFactory
object is activated
[jacorb.poa] INFO : Using server ID (4188962439) for transient POA
[jacorb.orb.singleton] INFO : created ORBSingleton
[jacorb.orb.giop] INFO : ClientConnectionManager: created new ClientGIOPConnection to 192.168.129.24:4514 (b64435)
[jacorb.orb] INFO : ORB run