![]() | Documentation Contents |
idlj ????????????????????? IDL ?????????????????? Java ??????????????????????????????????????????
idlj [ options ] idl-fileidl-file ??????????????????????????????????????? (IDL) ?????????????????????????????????????????????????????????options ??????????????????????????????idl-file ??????????????????????????????????????????????????????
IDL-to-Java ???????????????????????????????????? IDL ???????????????????????? Java ?????????????????????????????????????????? ????????????????????????????????????OMG IDL to Java Language Mapping Specification ??????????????????????????????IDL-to-Java ??????????????????????????????????????????????????????idltojava ????????????????????????????????????????????????
My.idl ?????????????????? IDL ???????????????????????? Java ????????????????????????????????????????????????????????????????????????????????????idlj My.idl
??????????????????????????????????????????????????????????????????????????????????????? ????????????????????????????????????????????????????????????idlj -fclient My.idl
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????idlj -fserver My.idl
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ????????????????????????POA
(???????????????) ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? (???????????????) ???????????? 1 ????????????????????????idlj -fclient -fserver My.idl
idlj -fall My.idl??????????????????????????????????????????2 ??????????????????????????????????????????????????????????????????Tie ????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????My.idl ?????? My ?????????????????????????????????????????????????????????MyPOA.java ?????????????????????????????????????????????My ?????????????????????????????????????????????????????? _MyPOA ??????????????????????????????????????????
MyPOA.java ??? org.omg.PortableServer.Servant ????????????????????????????????????????????????????????????????????????????????????????????? IDL ??????????????????????????????????????????????????? InvokeHandler ???????????????????????????????????????????????????????????????????????????????????????
Portable Object Adapter (POA) ??? PortableServer ??????????????????????????????????????? Servant ????????????????????????Java ????????????????????????????????????Servant ?????????Java ??? org.omg.PortableServer.Servant ????????????????????????????????????????????????????????????????????? POA ?????????????????????????????????????????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????????????????????????????????????????????POA ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
???????????????????????? 1 ???????????????????????????-oldImplBase ???????????????????????????J2SE 1.4 ?????????????????????????????? Java ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????-oldImplBase ??????????????????????????????????????????????????????????????????????????????????????? API ????????????????????????????????????????????????????????????????????????J2SE 1.3 ???????????????????????????????????????????????????????????????????????????????????????????????????????????? MAKEFILE ??????????????? idlj ?????????????????? -oldImplBase ???????????????????????????????????????????????? ????????????????????????????????????POA ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
idlj -fclient -fserver -oldImplBase My.idl
My.idl ?????? My ?????????????????????????????????????????????????????????_MyImplBase.java ?????????????????????????????????????????????My ?????????????????????????????????????????????????????? _MyImplBase ?????????????????????????????????????????????
idlj -fall -oldImplBase My.idl?????? 1 ????????????????????????????????????Tie ???????????????????????????????????????????????????????????????????????????????????????????????????Tie ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Tie ????????????????????????????????????????????????????????????
idlj -fall My.idl
My ??????????????????????????????????????????????????? 2 ?????????????????????????????????MyPOATie.java ????????????????????????MyPOATie ??????????????????????????????delegate ?????????????????????????????????????????????????????? POA ?????????????????????????????????????????????????????????????????? poa ??????????????????delegate ?????????????????????????????????????????????????????????????????????????????? MyOperations ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ORB ?????????????????????????????????MyPOATie ???????????????????????????????????????????????????????????????????????????????????????????????????
idlj -fallTIE My.idl
ORB orb = ORB.init(args, System.getProperties()); // Get reference to rootpoa & activate the POAManager POA rootpoa = (POA)orb.resolve_initial_references("RootPOA"); rootpoa.the_POAManager().activate(); // create servant and register it with the ORB MyServant myDelegate = new MyServant(); myDelegate.setORB(orb); // create a tie, with servant being the delegate. MyPOATie tie = new MyPOATie(myDelegate, rootpoa); // obtain the objectRef for the tie My ref = tie._this(orb);???????????????????????????????????????????????????????????????????????????????????????????????? Tie ????????????????????????????????????????????????Java ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? 1 ??????????????????????????????????????????????????????????????????????????????????????????????????????Tie ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? 1 ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????IDL ???????????????????????? J2SE 1.4 ?????????????????????????????? Java ????????????????????????????????????????????????????????????????????? Tie ????????????????????????????????????????????????????????????????????????????????????????????????
idlj -oldImplBase -fall My.idl
idlj -oldImplBase -fallTIE My.idlMy ????????????????????????????????????????????????????????? My_Tie.java ????????????????????????My_Tie ??????????????????????????????impl ??????????????????impl ?????????????????????????????????????????????????????????????????????????????? HelloOperations ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ORB ?????????????????????????????????My_Tie ???????????????????????????????????????????????????????????????????????????????????????????????????
ORB orb = ORB.init(args, System.getProperties()); // create servant and register it with the ORB MyServant myDelegate = new MyServant(); myDelegate.setORB(orb); // create a tie, with servant being the delegate. MyPOATie tie = new MyPOATie(myDelegate); // obtain the objectRef for the tie My ref = tie._this(orb);
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????idlj -td /altdir My.idlMy ????????????????????????????????????????????????????????????./My.java ???????????????/altdir/My.java ??????????????????????????????
My.idl ????????? 1 ?????? IDL ???????????? MyOther.idl ??????????????????????????????????????????????????????????????????????????????????????????????????? MyOther.idl ?????????????????????????????????????????????????????????????????????????????? /includes ??????????????????????????????????????????????????????????????????????????????????????????idlj -i /includes My.idl
??????????????? My.idl ?????????????????? /moreIncludes ????????? Another.idl ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????idlj -i /includes -i /moreIncludes My.idl
??????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????CLASSPATH ??????????????????????????????????????????????????? idl.config ????????????????????????????????????????????????????????? idl.config ?????????????????????????????????????????????????????????includes=/includes;/moreIncludes
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? (;) ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Windows ?????????????????????????????????????????????????????????Unix ???????????????????????????????????????????????? ?????????????????????????????????????????????CLASSPATH ????????? ??????????????????????????????
?????????????????????????????????????????????????????? IDL ????????????????????????????????????????????????????????????????????????????????????????????????Java ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Java ????????????????????????????????????????????????????????????????????? 2 ?????? IDL ???????????????????????????????????????????????????
My.idl#include <MyOther.idl>
???????????????????????????My ???????????? Java ???????????????????????????????????????????????????
interface My
{
};
MyOther.idlinterface MyOther
{
};
idlj My.idl
My.idl ?????????????????????????????????My.idl ?????????????????????????????????????????? (??????????????? MyOther.idl) ???????????????????????????????????????????????? Java ????????????????????????????????????????????????????????????????????????????????????idlj -emitAll My.idl
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? #include ??????????????????????????????????????????????????????????????? #include ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? #include ?????????????????????????????? #include ????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? Java ????????????????????????????????????????????????????????????????????????
My.idl#include <MyOther.idl>
interface My
{
#include <Embedded.idl>
};
MyOther.idlinterface MyOther
{
};
Embedded.idlenum E {one, two, three};
??????????????????????????????????????????????????????
idlj My.idl
???????????????????????? Java ????????????????????????????????????./MyHolder.java
???????????????????????????????????? #include ?????????????????????????????????MyOther.java ???????????????????????????????????????????????????????????? #include ?????????????????????????????????E.java ????????????????????????????????????Embedded.idl ??? My ????????????????????????????????????????????????????????????????????????????????????My ?????????????????? (????????????MyPackage ???) ??????????????????????????????
./MyHelper.java
./_MyStub.java
./MyPackage
./MyPackage/EHolder.java
./MyPackage/EHelper.java
./MyPackage/E.java
./My.java??????????????? -emitAll ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
ABC ???????????????????????????????????????????????????????????????????????? IDL ?????????????????????????????????????????????????????????????????????????????? IDL-to-Java ????????????????????????????????????W1 ????????? W2 ???????????? Java ???????????????????????? Widgets ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????com.<?????????> ??????????????????????????????????????????????????????????????????????????????????????????Widgets ????????????????????????????????????????????????????????????????????????????????? com.abc.Widgets ?????????????????????????????????????????????????????????????????? Widgets ??????????????????????????????????????????????????????????????????????????????
Widgets.idlmodule Widgets
{
interface W1 {...};
interface W2 {...};
};
idlj -pkgPrefix Widgets com.abc Widgets.idl
Widgets.idl ????????????????????????????????? IDL ????????????????????????????????????????????????????????? -pkgPrefix ???????????????????????????????????????????????????????????????????????? IDL ??????????????????com.abc.Widgets ??????????????????????????????Widgets ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? idl.config ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
PkgPrefix.<type>=<prefix>
??????????????????????????????????????????????????????????????????????????????PkgPrefix.Widgets=com.abc
????????????????????????????????????????????????????????? ID ??????????????????????????????
???????????????????????????????????? IDL ??????????????????????????????????????????????????????????????????????????????????????????????????????????????? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????idlj -d MYDEF My.idl
My.idl ?????? #define MYDEF ???????????????????????????????????????????????????
Java ?????????????????????????????????????????????????????????????????????-keep ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? (?????????????????????????????????????????????????????????????????????????????????????????????)???-keep ?????????????????????????????????????????????????????????idlj -keep My.idl
????????????????????????????????????????????????????????????????????????????????????????????????????????????
IDL-to-Java ????????????????????????????????????????????????????????????????????????????????????????????????????????? (?????????????????????????????????) ??????????????????-v ????????????????????????????????????idlj -v My.idl
???????????????????????????????????????????????????????????????????????????????????????
IDL-to-Java ???????????????????????????????????????????????????????????????????????????????????? -version ????????????????????????????????????
idlj -version
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????
- -d symbol
- ???????????????????????????IDL ????????????????????????????????????????????????????????????????????????
#define symbol
- -emitAll
#include
????????????????????????????????????????????????????????????????????????????????????????????????
- -fside
- ?????????????????????????????????????????????????????? side ??????client???server???serverTIE???all???allTIE ????????????????????????-fserverTIE ????????? -fallTIE ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????-fclient ????????????????????????????????????????????????
- -i include-path
- ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- -keep
- ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- -noWarn
- ????????????????????????????????????????????????????????????
- -oldImplBase
- v1.4 ???????????? JDK ORB ?????????????????????????????????????????????????????????????????????????????????POA ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ImplBase ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? Java ?????????????????????????????????????????????????????????????????????
- -pkgPrefix type prefix
- type ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? Java ????????????????????? prefix ??????????????????????????????????????????type ??????????????????????????????????????????????????????????????????????????????????????????????????????????????? IDL ???????????????????????????????????????
- -pkgTranslate type package
- ???????????????????????????????????? type ??????????????????????????????????????? Java ????????????????????????????????????????????????????????????????????????????????????????????? package ??????????????????????????????????????? pkgPrefix ?????????????????????type ???????????????????????????????????????????????????????????????????????????????????????????????????????????? IDL ???????????????????????? ??????????????????????????????????????????????????????????????????????????????????????????
1 ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
-pkgTranslate foo bar -pkgTranslate foo.baz buzz.fizz?????????????????????????????????????????????
foo => bar foo.boo => bar.boo foo.baz => buzz.fizz foo.baz.bar => buzz.fizz.bar??????????????????????????????????????????????????????????????????
- org
- org.omg???????????? org.omg ????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ????????????-pkgTranslate ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- -skeletonName xxx%yyy
- xxx%yyy ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- POA ??????????????????????????????%POA???(-fserver ????????? -fall)
- oldImplBase ????????????????????????_%ImplBase???(-oldImplBase ?????? (-fserver ????????? -fall))
- -td dir
- ?????????????????????????????????????????????????????????????????????????????????dir ????????????????????????
- -tieName xxx%yyy
- ?????????????????????????????? Tie ??????????????????????????????????????????????????????????????????????????????
- POA Tie ??????????????????????????????%POATie???(-fserverTie ????????? -fallTie)
- oldImplBase Tie ????????????????????????%_Tie???(-oldImplBase ?????? (-fserverTie ????????? -fallTie))
- -verbose
- ?????????????????????????????????
- -version
- ??????????????????????????????????????????????????????
- ????????????????????????????????????????????????????????????????????????IDL ???????????????????????? Object ????????? ValueBase ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- fixed ????????? IDL ??????????????????????????????????????????
- ???????????????????????????????????????????????????????????????????????????????????????????????????????????? impl ??????????????????????????????????????????????????? ??????????????????????????????ServerDelegate DSI ??????????????? NullPointerException ????????????????????????
Copyright © 1995-2010 Sun Microsystems, Inc. All Rights Reserved. Please send comments using this Feedback page. |
![]() Java Technology |