OpenCCM - The OpenCCM's Compilation Chain | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Table of ContentsWarning: The OpenCCM User's Guide is now split into the following documents:
The OpenCCM's Compilation ChainThe OpenCCM's Compilation Chain is composed of the following tools:
Starting the OpenCCM's OMG IDL 3.0 RepositoryThe OpenCCM's Compilation Chain is mainly based on the use of an OMG IDL 3.0 Repository. Note that before using any OpenCCM's Compilation Chain tool, it is required to start the OpenCCM's OMG IDL 3.0 Repository (called IR3).
The $ ir3_start The OpenCCM's OMG IDL3 Repository will be started. Creating the $OpenCCM_CONFIG_DIR directory. Launching the OpenCCM's IR3. Feeding the OpenCCM's IR3 with the IFR_3_0.idl file. . . . Feeding the OpenCCM's IR3 with the Components.idl file. . . . The OpenCCM's OMG IDL3 Repository is started. $
Note that this script automatically creates the Moreover, the IOR, PID, and standard output of the started OpenCCM's IR3 are stored into the OpenCCM's Configuration Repository, e.g.: $ ls $OpenCCM_CONFIG_DIR IR3.IOR IR3.PID IR3.output IR3.start $ Warning: Only one OpenCCM's IR3 can be started for an OpenCCM's Configuration Repository, e.g.: $ ir3_start Error: The OpenCCM's OMG IDL3 Repository is already started! $
See the Checking if the OpenCCM's OMG IDL 3.0 Repository is started
The $ ir3_stop . . . $ ir3_started Error: The OpenCCM's OMG IDL3 Repository is not started! $ Note that this OpenCCM script is mainly used by other OpenCCM scripts to check if the OpenCCM's IR3 is started or not. Stopping the OpenCCM's OMG IDL 3.0 Repository
The $ ir3_start . . . $ ir3_stop The OpenCCM's OMG IDL3 Repository will be stopped. Removing the $OpenCCM_CONFIG_DIR directory. The OpenCCM's OMG IDL3 Repository is stopped. $
Note that this script shutdowns the OpenCCM's IR3 process, removes its
associated IOR, PID, and standard output files, and removes the
Checking an OMG IDL 3.0 file
The $ cat test/sample.idl3 // This file is the OMG IDL 3.0 example used in the OpenCCM User's Guide. #pragma prefix "ccm.objectweb.org" module sample { component MyComponent {}; home MyHome manages MyComponent {}; }; $ $ idl3_check test/sample.idl3 idl3_check 0.6: Reading from file test/sample.idl3... idl3_check 0.6: Preprocessing file test/sample.idl3... idl3_check 0.6: File test/sample.idl3 preprocessed. idl3_check 0.6: Compiling test/sample.idl3 file... idl3_check 0.6: Compilation completed: 0 warning. $
The
To obtain usage and help information, do: $ idl3_check --help Usage: idl3_check [-h|--help] [--version] [--silent] [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR] omg_idl_file Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages --cpp path Set the path to the external C preprocessor used -P Inhibit generation of #-lines with line-number information -DNAME, -DNAME=DEF Define NAME as DEF, default is 1 -UNAME Remove any definition for NAME -IDIR Put DIR in the include file search path Description: Compile and check an OMG IDL file $ To obtain version information, do: $ idl3_check --version OpenCCM idl3_check 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ idl3_check --silent test/sample.idl3 $
By default, the $ idl3_check --cpp /usr/bin/cpp test/sample.idl3 . . . $
Note that the standard $ idl3_check -DFOO -Itest test/sample.idl3 . . . $
When some preprocessing options are often used, e.g. Feeding an OMG IDL 3.0 file into the OpenCCM's IR3Warning: To use any of the generation OpenCCM tools, it is required to feed the OpenCCM's IR3 with OMG IDL 3.0 files.
The $ ir3_feed test/sample.idl3 ir3_feed 0.6: Reading from file test/sample.idl3... ir3_feed 0.6: Preprocessing file test/sample.idl3... ir3_feed 0.6: File test/sample.idl3 preprocessed. ir3_feed 0.6: Compiling test/sample.idl3 file... ir3_feed 0.6: Compilation completed: 0 warning. $ Warning: OMG IDL files must be fed into the OpenCCM's OMG IDL 3.0 Repository only once!!!
The
To obtain usage and help information, do: $ ir3_feed --help Usage: ir3_feed [-h|--help] [--version] [--silent] [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR] omg_idl_file Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages --cpp path Set the path to the external C preprocessor used -P Inhibit generation of #-lines with line-number information -DNAME, -DNAME=DEF Define NAME as DEF, default is 1 -UNAME Remove any definition for NAME -IDIR Put DIR in the include file search path Description: Feed the OpenCCM's Interface Repository with an OMG IDL file $ To obtain version information, do: $ ir3_feed --version OpenCCM ir3_feed 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ ir3_feed --silent test/sample.idl3 $
By default, the $ ir3_feed --cpp /usr/bin/cpp test/sample.idl3 . . . $
Note that the standard $ ir3_feed -DFOO -Itest test/sample.idl3 . . . $
When some preprocessing options are often used, e.g. Destroying an IR3 object from the OpenCCM's IR3
The Destroying an object from the OpenCCM's IR3 requires to provide its full OMG IDL scope name, e.g.: $ ir3_destroy ::sample ir3_destroy 0.6: ::sample destroyed successfully. If the object to destroy does not exist in the Interface Repository, then an error is reported, e.g.: $ ir3_destroy ::sample ir3_destroy 0.6: ::sample not found in the Interface Repository! If the object is referenced by other IR3 objects, then it could not be destroyed until other objects are destroyed, e.g.: $ ir3_feed test/sample.idl3 . . . $ ir3_destroy sample::MyComponent ir3_destroy 0.6: sample::MyComponent not destroyed because dependency exits in IFR preventing destruction! $ ir3_destroy sample::MyHome ir3_destroy 0.6: sample::MyHome destroyed successfully. $ ir3_destroy sample::MyComponent ir3_destroy 0.6: sample::MyComponent destroyed successfully.
The
To obtain usage and help information, do: $ ir3_destroy --help Usage: ir3_destroy [-h|--help] [--version] [--silent] omg_idl_scoped_name Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages Description: Destroy an object from the OpenCCM's Interface Repository $ To obtain version information, do: $ ir3_destroy --version OpenCCM ir3_destroy 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ ir3_feed test/sample.idl3 . . . $ ir3_destroy --silent sample $ Generating an OMG IDL 3.0 file associated to an IR3 object
The $ ir3_idl3 sample ir3_idl3 0.6: Generating OMG IDL 3.0 for sample... ir3_idl3 0.6: OMG IDL 3.0 generated in generated.idl3. $ cat generated.idl3 . . . #pragma prefix "ccm.objectweb.org" module sample { component MyComponent; component MyComponent { }; home MyHome manages ::sample::MyComponent { }; }; $
The
To obtain usage and help information, do: $ ir3_idl3 --help Usage: ir3_idl3 [-h|--help] [--version] [--silent] [-o outputfile] [-i ir_object] declaration Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages -o outputfile Set the output file name, default is generated.idl3 -i ir_object Add import ir_object statement Description: Generate OMG IDL 3.0 for a declaration from the OpenCCM's Interface Repository $ To obtain version information, do: $ ir3_idl3 --version OpenCCM ir3_idl3 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ ir3_idl3 --silent sample $
By default, the $ ir3_idl3 -o tmp.idl3 sample ir3_idl3 0.6: Generating OMG IDL 3.0 for sample ... ir3_idl3 0.6: OMG IDL 3.0 generated in tmp.idl3. $ cat tmp.idl3 . . . #pragma prefix "ccm.objectweb.org" module sample { component MyComponent; component MyComponent { }; home MyHome manages ::sample::MyComponent { }; }; $
Using the $ ir3_idl3 -i Components sample . . . $ cat generated.idl3 . . . import Components; . . . $ Generating equivalent OMG IDL 2.4 mapping for an IR3 object
The $ ir3_idl2 sample ir3_idl2 0.6: Generating OMG IDL2 for sample... ir3_idl2 0.6: OMG IDL2 generated in generated.idl and generated_local.idl. $
The $ cat generated.idl . . . #include <Components.idl> #pragma prefix "ccm.objectweb.org" module sample { interface MyComponent; interface MyHomeExplicit; interface MyHomeImplicit; interface MyHome; interface MyComponent : ::Components::CCMObject { }; interface MyHomeExplicit : ::Components::CCMHome { }; interface MyHomeImplicit : ::Components::KeylessCCMHome { ::sample::MyComponent create() raises(::Components::CreateFailure); }; interface MyHome : ::sample::MyHomeExplicit, ::sample::MyHomeImplicit { }; }; $
The $ cat generated_local.idl . . . #include "generated.idl" #pragma prefix "ccm.objectweb.org" module sample { local interface CCM_MyComponent_Executor; local interface CCM_MyComponent; local interface CCM_MyComponent_Context; local interface CCM_MyHomeExplicit; local interface CCM_MyHomeImplicit; local interface CCM_MyHome; local interface CCM_MyComponent_Executor : ::Components::EnterpriseComponent { }; local interface CCM_MyComponent : ::sample::CCM_MyComponent_Executor { }; local interface CCM_MyComponent_Context : ::Components::CCMContext { }; local interface CCM_MyHomeExplicit : ::Components::HomeExecutorBase { }; local interface CCM_MyHomeImplicit { ::Components::EnterpriseComponent create() raises(::Components::CCMException); }; local interface CCM_MyHome : ::sample::CCM_MyHomeExplicit, ::sample::CCM_MyHomeImplicit { }; }; $ See the CORBA Component Model Specification for more information about the OMG IDL 2.4 mapping.
The
To obtain usage and help information, do: $ ir3_idl2 --help Usage: ir3_idl2 [-h|--help] [--version] [--silent] [-o outputfile] [-i file] [-ipath file] declaration Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages -o outputfile Set the output file name, default is generated.idl -i file Add a #include <file> statement -ipath file Add a #include "file" statement where file must be the complete file path Description: Generate OMG IDL2 for a declaration from the OpenCCM's Interface Repository $ To obtain version information, do: $ ir3_idl2 --version OpenCCM ir3_idl2 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ ir3_idl2 --silent sample $
By default, the $ ir3_idl2 -o tmp.idl sample ir3_idl2 0.6: Generating OMG IDL2 for sample... ir3_idl2 0.6: OMG IDL2 generated in tmp.idl and tmp_local.idl. $ cat tmp.idl tmp_local.idl . . . $
Using the $ ir3_idl2 -i file1.idl sample . . . $ cat generated.idl . . . #include <file1.idl> . . . $
Using the $ ir3_idl2 -ipath file2.idl sample . . . $ cat generated.idl . . . #include "file2.idl" . . . $ Generating the Java OpenCCM skeletons associated to an IR3 object
The $ ir3_java ::sample . . . File 'org/objectweb/ccm/sample/MyComponentCCM.java' has been generated File 'org/objectweb/ccm/sample/MyComponentSkeletonInterceptor.java' has been generated File 'org/objectweb/ccm/sample/MyComponentStubInterceptor.java' has been generated File 'org/objectweb/ccm/sample/MyComponentMonolithicWrapper.java' has been generated File 'org/objectweb/ccm/sample/MyHomeCCM.java' has been generated File 'org/objectweb/ccm/sample/MyHomeSkeletonInterceptor.java' has been generated File 'org/objectweb/ccm/sample/MyHomeStubInterceptor.java' has been generated . . . $ ls org/objectweb/ccm/sample MyComponentCCM.java MyComponentStubInterceptor.java MyHomeStubInterceptor.java MyComponentMonolithicWrapper.java MyHomeCCM.java MyComponentSkeletonInterceptor.java MyHomeSkeletonInterceptor.java $ See Generation and implementation rules for more information. Generating all the Java implementation templates associated to an IR3 object
The $ ir3_jimpl ::sample . . . File 'org/objectweb/ccm/sample/MyComponentMonolithicImpl.java' has been generated File 'org/objectweb/ccm/sample/MyHomeImpl.java' has been generated. . . . . . $ ls org/objectweb/ccm/sample MyComponentMonolithicImpl.java MyHomeImpl.java $ These generated files could be used as starting point to implement components and homes, i.e. writting their functional part. See Generation and implementation rules for more information. Generating an XMI 1.1 UML document for an IR3 object
The
The $ ir3_xmi sample <?xml version="1.0" encoding="UTF-8"?> . . . <!DOCTYPE XMI SYSTEM "xmi.dtd"> <XMI xmi.version="1.1" xmlns:UML="org.omg/UML1.3"> <XMI.header> <XMI.documentation> <XMI.exporter>OpenCCM XMI generator</XMI.exporter> </XMI.documentation> </XMI.header> <XMI.content> . . . </XMI.content> </XMI> $
By default, the $ ir3_xmi -o tmp.xml sample $ cat tmp.xml <?xml version="1.0" encoding="UTF-8"?> . . . <!DOCTYPE XMI SYSTEM "xmi.dtd"> <XMI xmi.version="1.1" xmlns:UML="org.omg/UML1.3"> <XMI.header> <XMI.documentation> <XMI.exporter>OpenCCM XMI generator</XMI.exporter> </XMI.documentation> </XMI.header> <XMI.content> . . . </XMI.content> </XMI> $
The generated XMI UML document will always declare the XMI UML DTD it refers to.
If none has been specified from the command line, the XMI document
will assume that the XMI DTD is stored in the same directory as itself
and named
Using the $ ir3_xmi -dtd UML.dtd sample <?xml version="1.0" encoding="UTF-8"?> . . . <!DOCTYPE XMI SYSTEM "UML.dtd"> . . . $ Setting the correct location of the XMI UML DTD is only required when the user wants to validate generated XMI UML documents.
Currently, the XMI 1.1 UML DTD is located in the
Compiling an OMG CIDL file and generating associated files
The
$ cat test/sample.cidl // This file is the OMG CIDL example used in the OpenCCM User's Guide. #pragma prefix "ccm.objectweb.org" module sample { composition session SampleSessionComposition { home executor HomeImpl { implements MyHome; manages ComponentImpl; }; }; }; $ cidl_cif test/sample.cidl cidl_cif 0.6: Reading from file test/sample.cidl... cidl_cif 0.6: Preprocessing file test/sample.cidl... cidl_cif 0.6: File test/sample.cidl preprocessed. cidl_cif 0.6: Compiling test/sample.cidl file... cidl_cif 0.6: Compilation completed: 0 warning. cidl_cif 0.6: Generating CIF mapping from test/sample.cidl... cidl_cif 0.6: OMG IDL mapping generated in generated_cif.idl. cidl_cif 0.6: Generating CIF implementations... File '.../generated/org/objectweb/ccm/sample/SampleSessionComposition/HomeImpl.java' has been generated File '.../generated/org/objectweb/ccm/sample/SampleSessionComposition/ComponentImpl.java' has been generated cidl_cif 0.60.6: CIF implementations generated. $
The $ cat generated_cif.idl . . . #pragma prefix "ccm.objectweb.org" module sample { module SampleSessionComposition { local interface CIF_HomeImpl; local interface CIF_SegmentBase; local interface CIF_ComponentImpl; local interface CIF_HomeImpl : ::sample::CCM_MyHome { }; local interface CIF_SegmentBase { ::sample::CCM_MyComponent_Context get_context(); ::sample::SampleSessionComposition::CIF_ComponentImpl get_main_segment(); }; local interface CIF_ComponentImpl : ::sample::SampleSessionComposition::CIF_SegmentBase, ::Components::ExecutorLocator, ::Components::SessionComponent, ::sample::CCM_MyComponent_Executor { }; }; }; $
The generated OMG IDL interfaces are implemented by the generated $ ls generated/org/objectweb/ccm/sample/SampleSessionComposition/ ComponentImpl.java HomeImpl.java $ These generated classes are the home and component executor skeletons which must be inherited by the business implementation classes.
The
To obtain usage and help information, do: $ cidl_cif --help Usage: cidl_cif [-h|--help] [--version] [--silent] [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR] [-o outputfile] [-ipath file] [-d outputdir] file Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages --cpp path Set the path to the external C preprocessor used -P Inhibit generation of #-lines with line-number information -DNAME, -DNAME=DEF Define NAME as DEF, default is 1 -UNAME Remove any definition for NAME -IDIR Put DIR in the include file search path -o outputfile Set the output file name, default is generated_cif.idl -ipath file Add a #include "file" statement where file must be the complete file path -d outputdir Generate Java implementations into directory <outputdir>, default is generated/ Description: Compile an OMG CIDL file and generate its associated: - local CIF interfaces - Java component and home executor skeletons $ To obtain version information, do: $ cidl_cif --version OpenCCM cidl_cif 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ cidl_cif --silent test/sample.cidl $
By default, the $ cidl_cif --cpp /usr/bin/cpp test/sample.cidl . . . $
Note that the standard $ cidl_cif -DFOO -Itest test/sample.cidl . . . $
By default, the $ cidl_cif -o mapping.idl test/sample.cidl . . . $ cat mapping.idl . . . $
Using the $ cidl_cif -ipath file.idl test/sample.cidl . . . $ cat generated_cif.idl . . . #include "file.idl" . . . $
By default, the $ cidl_cif -d mapping test/sample.cidl . . . $ ls mapping/org/objectweb/ccm/sample/SampleSessionComposition/ ComponentImpl.java HomeImpl.java $
When some preprocessing options are often used, e.g. Warning: The good way to generate CIF mapping is as following:
PSDL and CIDL files should have an Compiling a file and regenerating the OMG CIDL part only
The $ cidl test/sample.cidl cidl 0.6: Reading from file test/sample.cidl... cidl 0.6: Preprocessing file test/sample.cidl... cidl 0.6: File test/sample.cidl preprocessed. cidl 0.6: Compiling test/sample.cidl file... cidl 0.6: Compilation completed: 0 warning. cidl 0.6: Generating CIDL from test/sample.cidl... cidl 0.6: CIDL generated in generated.cidl. $
By default, the $ cat generated.cidl . . . #pragma prefix "ccm.objectweb.org" module sample { composition session SampleSessionComposition { home executor HomeImpl { implements ::sample::MyHome; manages ComponentImpl; }; }; }; $
The
To obtain usage and help information, do: $ cidl --help Usage: cidl [-h|--help] [--version] [--silent] [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR] [-o outputfile] file Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages --cpp path Set the path to the external C preprocessor used -P Inhibit generation of #-lines with line-number information -DNAME, -DNAME=DEF Define NAME as DEF, default is 1 -UNAME Remove any definition for NAME -IDIR Put DIR in the include file search path -o outputfile Set the output file name, default is generated.cidl Description: Compile a file and regenerate the OMG CIDL part only $ To obtain version information, do: $ cidl --version OpenCCM cidl 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ cidl --silent test/sample.cidl $
By default, the $ cidl --cpp /usr/bin/cpp test/sample.cidl . . . $
Note that the standard $ cidl -DFOO -Itest test/sample.cidl . . . $
By default, the $ cidl -o tmp.cidl test/sample.cidl . . . $ cat tmp.cidl . . . $
When some preprocessing options are often used, e.g. Compiling a file and regenerating the OMG PSDL part only
The $ cat test/sample.psdl // This file is the OMG PSDL example used in the OpenCCM User's Guide. #pragma prefix "ccm.objectweb.org" module sample { storagetype ST {}; storagehome SH of ST {}; }; $ $ psdl test/sample.psdl psdl 0.6: Reading from file test/sample.psdl... psdl 0.6: Preprocessing file test/sample.psdl... psdl 0.6: File test/sample.psdl preprocessed. psdl 0.6: Compiling test/sample.psdl file... psdl 0.6: Compilation completed: 0 warning. psdl 0.6: Generating PSDL from test/sample.psdl... psdl 0.6: PSDL generated in generated.psdl. $
By default, the $ cat generated.psdl . . . #pragma prefix "ccm.objectweb.org" module sample { storagetype ST; storagetype ST { }; storagehome SH of ::sample::ST { }; }; $
The
To obtain usage and help information, do: $ psdl --help Usage: psdl [-h|--help] [--version] [--silent] [--cpp path] [-P] [-DNAME|-DNAME=DEF] [-UNAME] [-IDIR] [-o outputfile] file Options: -h, --help Display this information and exit --version Output version information and exit --silent Silent output messages --cpp path Set the path to the external C preprocessor used -P Inhibit generation of #-lines with line-number information -DNAME, -DNAME=DEF Define NAME as DEF, default is 1 -UNAME Remove any definition for NAME -IDIR Put DIR in the include file search path -o outputfile Set the output file name, default is generated.psdl Description: Compile a file and regenerate the OMG PSDL part only $ To obtain version information, do: $ psdl --version OpenCCM psdl 0.6 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL . . . $
By default, the $ psdl --silent test/sample.psdl $
By default, the $ psdl --cpp /usr/bin/cpp test/sample.psdl . . . $
Note that the standard $ psdl -DFOO -Itest test/sample.psdl . . . $
By default, the $ psdl -o tmp.psdl test/sample.psdl . . . $ cat tmp.psdl . . . $
When some preprocessing options are often used, e.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster | Last modified at 2005-07-07 02:04 PM |