diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f06da07 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,16 @@ +This is the list of people who have been involved in the development of +TIDorbJ: + +Juan J. Hierro +Juan A. Caceres +Pablo Rodriguez Archilla +Fabio Garcia Solero +Manuel Castro +Luis de la Fuente +Juan Pablo Rojas +Sergio Checa Blanco +Alvaro Vega Garcia +Irenka Redondo Grandados +Jose Alberto Garcia Daniel +Alvaro Polo Valdenebro +Maria Cruz Pajares diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..e512e6b --- /dev/null +++ b/BUGS @@ -0,0 +1,2 @@ +This document has been moved to MORFEO Forge (which is online at +https://forge.morfeo-project.org/tracker/?atid=109&group_id=8&func=browse diff --git a/BUILT b/BUILT new file mode 100644 index 0000000..b6ad40d --- /dev/null +++ b/BUILT @@ -0,0 +1,21 @@ +This release of TIDorbJ was built on a machine with kernel: +Linux dacha 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/Linux + +using the compiler: +java version "1.5.0_14" +Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) +Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing) + +kernel source package used: +linux-source-2.6.21 i686 + +applied kernel patches: +linux-image-2.6.21-2-686 2.6.21-6 + +using the following libraries: +ant 1.7.0-6 +javacc 4.0+cvs20080403-1 +libxerces27 2.7.0-5 +libxalan110 1.10-3.2 +libjaxp1.3-java 1.3.04-3 +TIDIdlc 1.3.7 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..4cacaf5 --- /dev/null +++ b/COPYING @@ -0,0 +1,390 @@ +http://www.morfeo-project.org + +Component: TIDorbJ +Programming Language: Java + + (C) Copyright 2004 Telefónica Investigación y Desarrollo + S.A.Unipersonal (Telefónica I+D) + + + 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. + + If you want to use this software an plan to distribute a + proprietary application in any way, and you are not licensing and + distributing your source code under GPL, you probably need to + purchase a commercial license of the product. More info about + licensing options is available at: + + http://www.morfeo-project.org/TIDorbJ/Licensing + + + ******************************** + * GNU General Public License * + ******************************** + + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble +======== + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have +the freedom to distribute copies of free software (and charge for this +service if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis +or for a fee, you must give the recipients all the rights that you +have. You must make sure that they, too, receive or can get the source +code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software patents. +We wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent +must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on + the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Program a copy of + this License along with the Program. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program + or any part thereof, to be licensed as a whole at no charge + to all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not + apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a + whole which is a work based on the Program, the distribution of + the whole must be on the terms of this License, whose permissions + for other licensees extend to the entire whole, and thus to each + and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Program. + + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on + a volume of a storage or distribution medium does not bring the + other work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + b. Accompany it with a written offer, valid for at least three + years, to give any third-party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts + used to control compilation and installation of the executable. + However, as a special exception, the source code distributed need + not include anything that is normally distributed (in either + source or binary form) with the major components (compiler, + kernel, and so on) of the operating system on which the executable + runs, unless that component itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this + License to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program + subject to these terms and conditions. You may not impose any + further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance + by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program by all those who + receive copies directly or indirectly through you, then the only + way you could satisfy both it and this License would be to refrain + entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 9. The Free Software Foundation may publish revised and/or new + versions of the General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies a version number of this License which applies + to it and "any later version", you have the option of following + the terms and conditions either of that version or of any later + version published by the Free Software Foundation. If the Program + does not specify a version number of this License, you may choose + any version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted + by the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision + will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT + WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE + QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY + SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY + OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YYYY NAME OF AUTHOR + + 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + SIGNATURE OF TY COON, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, +you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Library General Public License instead of this License. \ No newline at end of file diff --git a/CREDITS b/CREDITS new file mode 100644 index 0000000..c568364 --- /dev/null +++ b/CREDITS @@ -0,0 +1,299 @@ +MORFEO PROJECT CREDITS +********************** + + This is a partial credits-file of people who contributes or has + contributed to the Morfeo project. It follows a similar structure + to that of the Linux credits-file. It is sorted by name, and + formatted in a way that allows for easy grepping and beautification + by scripts. The fields are: name (N), email (E), web-address (W), + PGP key ID and fingerprint (P), description (D) and name of + company/organization plus snail-mail address (S). All the fields + are mandatory even if they are empty. + + Thanks, + + Juanjo Hierro + +------------ + + + +N: Juan A. Cáceres +E: caceres@tid.es +W: +P: +D: Juan is software Architect and developer of TIDorb, the Web Services and EJB +D: Container as well as some CORBA Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Manuel Castro +E: mcp219@tid.es +W: +P: +D: Manuel was software developer of TIDIdlc and TIDorb for Java. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Francisco Checa +E: franc@tid.es +W: +P: +D: Fran is software developer of TIDorb. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: Parque Tecnológico de Boecillo parcelas 118-119-120 +S: 47151 Boecillo (Valladolid) +S: Spain + +N: Luis de la Fuente +E: fgs07@tid.es +W: +P: +D: Luis was software developer of TIDorb for Java and some CORBA services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Rafael Fernández Gallego +E: rfdez@pegaso.ls.fi.upm.es +W: +P: +D: Rafael has participated in the design and the development of the original +D: Morfeo Project Web site. He is the Morfeo Project webmaster. +S: +S: Facultad de Informática +S: Universidad Politécnica de Madrid (UPM) +S: Campus de Montegancedo +S: 28660 Boadilla del Monte (Madrid) +S: Spain + +N: Javier Fernádez Mejuto +E: mejuto@tid.es +W: +P: +D: Javier was the first software Architect and developer of TIDIdlc for Java, also he +D: was software developer of TIDorb for Java. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Julio García-Otero +E: joulsgo@gmail.com +W: +P: +D: Julio has participated in design of the Web Services container and +D: performed some of the auxiliary tasks needed to launch the Morfeo +D: Project Community. +D: +S: + +N: Fabio García Solero +E: fgs07@tid.es +W: +P: +D: Fabio was software developer of TIDIdlc and TIDorb for Java. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Jesús M. González-Barahona +E: jgb@gsyc.escet.urjc.es +W: +P: +D: Jesús has provided advice during all steps associated to creation of the +D: Morfeo Project Community. He is the primary contact at the URJC. +D: +S: Rey Juan Carlos University (URJC) +S: ESCET C/ Tulipán S/N +S: 28933 Móstoles, Madrid. +S: Spain + + +N: Juan J. (Juanjo) Hierro +E: jhierro@tid.es +W: +P: +D: Morfeo project leader and chief software architect of TIDorb, the Web +D: Services and EJB container, TIDstateengine and CORBA Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Miguel Jimenez Gañan +E: mjimenez@pegaso.ls.fi.upm.es +W: +P: +D: Miguel has reviewed part ot the TIDorb documentation. +S: +S: Facultad de Informática +S: Universidad Politécnica de Madrid (UPM) +S: Campus de Montegancedo +S: 28660 Boadilla del Monte (Madrid) +S: Spain + +N: Pablo Jiménez-Mayor +E: pjm@tid.es +W: +P: +D: Pablo is software Architect and developer of TIDStateEngine. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Luis López-Fernández +E: llopez@escet.urjc.es +W: +P: +D: Luis has performed some of the auxiliary tasks needed to launch the Morfeo +D: Project Community. He has reviewed part ot the TIDorb documentation. +D: +S: Rey Juan Carlos University (URJC) +S: ESCET C/ Tulipán S/N +S: 28933 Móstoles, Madrid. +S: Spain + +N: Mario López-Gallego +E: mariolg@tid.es +W: +P: +D: Mario is software Architect and developer of TIDorb and some CORBA Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: Parque Tecnológico de Boecillo parcelas 118-119-120 +S: 47151 Boecillo (Valladolid) +S: Spain + +N: Genoveva López Gómez +E: glopez@fi.upm.es +W: +P: +D: Genoveva has performed some of the auxiliary tasks needed to launch the Morfeo +D: Project Community. +S: +S: Facultad de Informática +S: Universidad Politécnica de Madrid (UPM) +S: Campus de Montegancedo +S: 28660 Boadilla del Monte (Madrid) +S: Spain + +N: Andrés L. Martínez +E: almartinez@escet.urjc.es +W: +P: +D: Andrés has performed some of the auxiliary tasks needed to launch the Morfeo +D: Project Community. He has reviewed part ot the TIDorb documentation. +D: +S: Rey Juan Carlos University +S: ESCET C/ Tulipán S/N +S: 28933 Móstoles, Madrid. +S: Spain + + +N: M. Cruz Pajares +E: mcpg@tid.es +W: +P: +D: Cruz is software developer of TIDorb and some CORBA Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: Parque Tecnológico de Boecillo parcelas 118-119-120 +S: 47151 Boecillo (Valladolid) +S: Spain + +N: Javier Rayado +E: jrayado@pegaso.ls.fi.upm.es +W: +P: +D: Javier has participated in the design and the development of the original +D: Morfeo Project Web site. +S: +S: Facultad de Informática +S: Universidad Politécnica de Madrid (UPM) +S: Campus de Montegancedo +S: 28660 Boadilla del Monte (Madrid) +S: Spain + +N: Marcos Reyes +E: mru@tid.es +W: +P: +D: Marcos is software Architect and developer of TIDStateEngine. He also +D: leaded design of the original Morfeo Project Web site. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + + +N: Pablo Rodríguez-Archilla +E: pra@tid.es +W: +P: +D: Pablo is software developer of TIDorb and some CORBA Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + +N: Álvaro Rodriguez-Sánchez +E: ars07@tid.es +W: +P: +D: Álvaro is software Architect and developer of TIDNotif, the CORBA Notification Services. +D: +S: Telefónica Investigación y Desarrollo (Telefónica I+D) +S: C/ Emilio Vargas 6 +S: 28043 Madrid +S: Spain + + +N: Roberto Santos +E: roberto.santos@hispalinux.es +W: +P: +D: Roberto has provided advice during all steps associated to creation of the +D: Morfeo Project Community. +S: + +N: Javier Soriano +E: jsoriano@fi.upm.es +W: +P: +D: Javier has performed some of the auxiliary tasks needed to launch the Morfeo +D: Project Community. He has reviewed part ot the TIDorb documentation. He is +D: the primary contact at the FI-UPM. +S: +S: Facultad de Informática +S: Universidad Politécnica de Madrid (UPM) +S: Campus de Montegancedo +S: 28660 Boadilla del Monte (Madrid) +S: Spain + +N: David Velasco +E: samurai_____@hotmail.com +W: +P: +D: David was software developer of TIDIdlc for C++. +S: + + + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..7af9999 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,198 @@ +2010-01-10 Alvaro Vega Garcia + Maria Cruz Pajares + + * TIDorbJ version 6.5.0 released. + + - Feature added [#924] IPv6 support + +2010-01-10 Alvaro Vega Garcia + + * TIDorbJ version 6.4.0 released. + + - Feature added [#797] SSLIOP layer for TIDorbJ + - Feature added [#798] Secure corbalocs + +2009-11-10 Alvaro Vega Garcia + + * TIDorbJ version 6.3.5 released. + + - Feature added [#1072] CSI support for PrintIOR + - Fix bug [#1070] Inexact UTC time + +2009-07-20 Alvaro Vega Garcia + + * TIDorbJ version 6.3.4 released. + + - Fix bug [#1038] Bug in Messaging.ExeptionHolder management + - Fix bug [#1026] Unable to retrieve the factory of a custom + compressor previously registered + - Aligned with GIOP Compression (FTF Beta 2, May 2009): changes in the + way of calc 'min_ratio' value + - Fix bug [#956] Invalid call to + org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI + +2009-04-16 Alvaro Vega Garcia + + * TIDorbJ version 6.3.3 released. + + - Feature added [844] ZIOP: GIOP Compression (FTF Beta 2) + - Fix bug [942] Server listener sockets don't set SO_REUSEADDR socket + option at initializing time + - Feature [916] Add support of QoS policies to printIOR + - Feature [842] Set TAG_ORB_TYPE requested to OMG + - Fix bug [830] recover_count at IIOPCommLayer is global, not per each + connection establishment (racecondition) + - Fix bug [544] After COMM_FAILURE ORB client doesn't retry connection + with a restarted server + +2008-06-23 Alvaro Vega Garcia + + * TIDorbJ version 6.3.2 released. + + - Fix bug [545] Interoperability problems with TAO and Visibroker due + to response_flags of GIOP RequestHeader 1.2 + - Fix bug [544] After COMM_FAILURE ORB client doesn't retry connection + with a restarted server + - Feature [419] Add dump of IIOPCommLayer properties in traces + - Fix bug [413] Java null pointer exception when creates an Any from + ORBSingleton.create_any() + +2008-02-22 Alvaro Vega Garcia + + * TIDorbJ version 6.3.1 released. + + - Fix bug [345] printIOR.sh doesn't work + - Fix bug [337] Problems with ServantActivator + - Fix bug [328] CORBA.INITIALIZE due to ClassCastException: + TIDorb.trace.level > 0 && -ORBInitRef ... + - Fix bug [282] -ORB_exhaustive_equal true doesn't have any effect + +2007-03-19 Alvaro Vega Garcia + + * TIDorbJ version 6.3.0 released. + +2007-01-16 Luis de la Fuente (ldlf07 at tid dot es) + + * TIDorbJ version 6.2.1 released. + + Fix bug [126] Problems with unsigned long long parameters + Fix bug [123] Client waits max_block_time when the server closes the socket + Fix bug [22] TIDorbJ doesn't compile with Sun JDK 1.5 + +2006-03-03 Irenka Redondo Granados (iredondo at tid dot es) + + * TIDorbJ version 6.2.0 released. + + - Implemented AMI (Asynchronous Method Invocation) + +2005-06-01 Pablo Rodriguez Archilla (pra at tid dot es) + + * TIDorbJ version 6.1.0 + + - Implemented quality of the service (QoS) management + +2004-12-10 Pablo Rodriguez Archilla (pra at tid dot es) + + * TIDorbJ version 6.0.0 released. + + * Released under GNU/GPL terms + +Thu May 20 13:58:15 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.2.0 released. + + - Aligned with CORBA 2.6 + - PolicyManager implemented + - Implemented QoS RelativeRequestTimeoutPolicy to manage timeouts of request. + This policy could be applied by reference, thread or ORB (see manual) + +Mon May 03 12:07:32 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.1.1 released. + + - Compatibility with J2SDK 1.4.x + - DynUnion.get_discriminator() already doesn't throw InvalidValue exception + +Thu Apr 29 14:25:10 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.1.0 released. + + - IDL to Java compiler has been extracted from the distribution + - New distribution of IDL to C++ compiler and IDL to Java (TIDIdlc) + - ORB API compiled with TIDIdlc version 1.0.0 + +Wed Apr 28 11:44:14 2004 Juan A. Caceres (caceres at tid dot es) + * TIDorbJ version 3.0.9 + + - New argument: + es.tid.TIDorbj.iiop.socket_write_timeout (>= 0) + Sets a timeout to avoid deadlocks in a write (caused by when buffer TCP is filled) + +Mon Mar 01 13:57:26 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.8 + + - Fix in marshall of TypeCode indirections + +Fri Sep 05 13:23:55 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.7 + + - Implemented a TypeCodes Cache + - Improvements in management of bidirectional connections + - Removed bug in ServerListener + - New arguments: + es.tid.TIDorbj.typecode_cache_size (v >= 0) + es.tid.TIDorbj.iiop.server_socket_reconnect + es.tid.TIDorbj.iiop.bidirectional (BOTH-NORMAL) + +Mon Apr 21 12:44:13 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.6 + + - Improvmentes in management of IIOP connections + - New argument: es.tid.TIDorbj.iiop.socket_connect_timeout + +Mon Apr 21 12:11:32 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.5 + + - Adapted to JDK 1.4: Dynamic Invocation Interface implemented + los stubs facilitados por JDK + - Remove bug about Multithreading in Any type + +Tue Apr 08 18:30:35 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.4 + + - Changes to warranty interoperability with GIOP 1.0 + +Mon Mar 31 16:39:02 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.3 + + - Last version with chages about bugs in IDL compiler + +Thu Mar 13 10:24:41 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.2 + + - Version with TIDAgent adaptations + +Wed Jun 26 08:40:48 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.1 + + - Changes to aligned with CORBA 2.5 + +Fri Apr 19 16:21:26 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 1.11.0 + + - Version with Objects by Value implemented + +Wed Apr 17 15:21:27 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 1.0.9 + + - First stable ORB version aligned with CORBA 2.3 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..d7e8e92 --- /dev/null +++ b/INSTALL @@ -0,0 +1,188 @@ +============ +INSTALLATION +============ + +1. INSTALLATION FROM BINARY DISTRIBUTION +======================================== + + +1.1 Prerequisits +---------------- + +For the compilation of TIDNotifJ next software is needed: + + * Sun Java J2SE SDK 1.4 or later. Download + * Subversion Client. Download + * Apache Ant 1.6 or later. Download + * TIDIdlc + +See TIDorbJ Compilation and Installation HOWTO where the installation of +all this required software is explained. + +Main Linux distributions (Debian, Ubuntu, RedHat, ...) have available +installation packages for this components. + + +1.2 Installation +---------------- + +Download the zipped binaries in the applications directory +and unzip with: + + $ tar xfvz TIDorbJ_X.Y.Z.tgz +or + $ gzip -d TIDorbJ_X.Y.Z.tgz | tar xfv + + +You can download directly the TIDorbJ installation binaries from MORFEO Forge +at: https://forge.morfeo-project.org/frs/?group_id=8 + + +1.3 Execution +------------- + +To execute TIDorbJ scripts in the shell, next environment variables should be +set. + +· For Unix + -------- + + export JAVA_HOME= + export TIDORBJ_HOME=/TIDorbJ + export PATH=$PATH:$TIDNOTIFJ_HOME/bin/ + + Runs with: + + $TIDNOTIFJ_HOME/bin/start + +· For Windows + ----------- + + SET JAVA_HOME= + SET TIDORBJ_HOME=\TIDorbJ + SET PATH=%PATH;%TIDORBJ_HOME%\bin + + Runs with: + + $TIDORBJ_HOME\bin\start.bat + + + +2. INSTALLATION FROM SOURCE DISTRIBUTION +======================================== + + +2.1 Prerequisits +---------------- + +For the compilation of TIDorbJ next software is needed: + + · Sun Java J2SE SDK 1.4 or later + · Subversion Client + · Apache Ant 1.6 or later + · TIDIdlc + +Main Linux distributions (Debian, Ubuntu, RedHat, ...) have available +installation packages for this components. + +Optionally, TIDorbJ can be compiled with the Eclipse IDE. + + +· Needed Software Installation under Debian & Ubuntu Linux + -------------------------------------------------------- + + - For Ubuntu Linux: + + $ sudo apt-get install subversion ant sun-java5-jdk + + + - For Debian: + $ su + + $ apt-get install subversion ant sun-java5-jdk + + Also, Other versions of Sun's JDK can also be installed from Java at Sun + MicroSystems. + + +· Java Virtual Machine installation from binaries + ----------------------------------------------- + + Download the installation zipped file from Java at Sun MicroSystems. + You should create a directory at your $HOME directory where the installation + will be done: + + $ mkdir $HOME/java + + Unzip the installation binary file (for examle, jdk-1_5_0_07-linux-586.bin): + + $ cd $HOME/java + $ chmod +x jdk-1_5_0_07-linux-586.bin + $ ./jdk-1_5_0_07-linux-586.bin + + Follow the installation program instructions to install the Java Development + Kit. + + Finally, delete the downloaded file: + + $ rm jdk-1_5_0_07-linux-586.bin + + +2.2 TIDorbJ Compilation +----------------------- + +· Source Code Download + -------------------- + + First of all, create a work directory where the source code will be + downloaded: + + $ cd + $ mkdir Morfeo + $ cd Morfeo + + Download the sorce code from the TIDorbJ Project's Subversion repository: + + $ svn checkout https://svn.morfeo-project.org/svn/tidorbj/trunk/TIDorbJ + + The Subversion client would ask for accept the server's certificate. In this + case, Accept it. + + +· Compilation with Ant + -------------------- + + Go to the TIDorbJ directory where the source code has been downloaded and + compile it with the command: + + $ cd TIDorbJ + $ ant install + + NOTE: Change the PATH if you want to compile TIDorbJ with other JDK version + + You can check the JDK version configured in the environment with: + + $ java -version + + +2.3 TIDNotifJ Installation +------------------------ + +· Installation from compiled code + ------------------------------- + + Once compiled TIDorbJ, from the source code directory (TIDorbJ), copy the + directory dist with the generated binaries of TIDNotifJ to the usual + applications directory (for example /opt): + + $ cp -r dist /TIDorbJ_X.Y + + In Linux, update the execution flags of the scripts to launch the compiler: + + chmod +x /TIDorbJ_X.Y/bin/* + + +2.4 Execution +------------- + + Idem "1.3 Execution" previous section. diff --git a/OMG_SPEC b/OMG_SPEC new file mode 100644 index 0000000..843abb0 --- /dev/null +++ b/OMG_SPEC @@ -0,0 +1,4 @@ +This release of TIDorbJ follows: +- OMG CORBA Specification, Version 2.6 +- OMG IDL to Java Language Mapping, Version 1.3 +- OMG GIOP Compression (FTF Beta 2) diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..74f8f54 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +6.5.0 on 2011-03-27 diff --git a/bin/.svn/all-wcprops b/bin/.svn/all-wcprops new file mode 100644 index 0000000..533444a --- /dev/null +++ b/bin/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/bin +END +printIOR.sh +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/bin/printIOR.sh +END +tidorbj.bat +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/bin/tidorbj.bat +END +setup_TIDorbJ.bat +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/bin/setup_TIDorbJ.bat +END +tidorbj.sh +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/bin/tidorbj.sh +END +setup_TIDorbJ.sh +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/bin/setup_TIDorbJ.sh +END +printIOR.bat +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/bin/printIOR.bat +END diff --git a/bin/.svn/entries b/bin/.svn/entries new file mode 100644 index 0000000..e60edeb --- /dev/null +++ b/bin/.svn/entries @@ -0,0 +1,232 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/bin +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +printIOR.sh +file + + + + +2010-04-28T10:48:01.000000Z +540c1e2faf0ad2b101534f75f39fcb94 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +356 + +setup_TIDorbJ.bat +file + + + + +2009-02-16T09:48:56.000000Z +7045e93f5346df6bc89e2eb7073b0a0b +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +652 + +tidorbj.bat +file + + + + +2009-02-16T09:48:56.000000Z +60e7f77ac2c08f51e501f73af85948fb +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +355 + +setup_TIDorbJ.sh +file +478 + + + +2010-04-28T11:57:18.000000Z +86f58548a00406ef23d5e116e2d1a25a +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +755 + +tidorbj.sh +file + + + + +2010-04-28T10:48:01.000000Z +4cd0250be5666b57a2ae031dc6b5c36c +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +93 + +printIOR.bat +file + + + + +2009-02-16T09:48:56.000000Z +5371297f2b69ed3cbe184a4fd0855f07 +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +205 + diff --git a/bin/.svn/prop-base/printIOR.bat.svn-base b/bin/.svn/prop-base/printIOR.bat.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/printIOR.bat.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/prop-base/printIOR.sh.svn-base b/bin/.svn/prop-base/printIOR.sh.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/printIOR.sh.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/prop-base/setup_TIDorbJ.bat.svn-base b/bin/.svn/prop-base/setup_TIDorbJ.bat.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/setup_TIDorbJ.bat.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/prop-base/setup_TIDorbJ.sh.svn-base b/bin/.svn/prop-base/setup_TIDorbJ.sh.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/setup_TIDorbJ.sh.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/prop-base/tidorbj.bat.svn-base b/bin/.svn/prop-base/tidorbj.bat.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/tidorbj.bat.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/prop-base/tidorbj.sh.svn-base b/bin/.svn/prop-base/tidorbj.sh.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/bin/.svn/prop-base/tidorbj.sh.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/bin/.svn/text-base/printIOR.bat.svn-base b/bin/.svn/text-base/printIOR.bat.svn-base new file mode 100644 index 0000000..1f87406 --- /dev/null +++ b/bin/.svn/text-base/printIOR.bat.svn-base @@ -0,0 +1,9 @@ +@echo off + +set PRINT_IOR_CLASSPATH=.;%TIDORBJ_HOME%\lib\tidorbj.jar +set JVM=%JAVA_HOME%\bin\java + +%JVM% -classpath %PRINT_IOR_CLASSPATH% es.tid.TIDorbj.tools.PrintIOR %1 + +set PRINT_IOR_CLASSPATH= +set JVM= diff --git a/bin/.svn/text-base/printIOR.sh.svn-base b/bin/.svn/text-base/printIOR.sh.svn-base new file mode 100644 index 0000000..50840e8 --- /dev/null +++ b/bin/.svn/text-base/printIOR.sh.svn-base @@ -0,0 +1,18 @@ +#!/bin/sh +set +u + +if [ -z "$JAVA_HOME" ]; then + echo "Environment variable JAVA_HOME must be set" + exit 1 +fi + +if [ -z "$TIDORBJ_HOME" ]; then + echo "Environment variable TIDORBJ_HOME must be set" + exit 1 +fi + + +JVM=$JDK_HOME/bin/java +PRINT_IOR_CLASSPATH=.:$TIDORBJ_HOME/lib/tidorbj.jar + +$JVM -classpath $PRINT_IOR_CLASSPATH es.tid.TIDorbj.tools.PrintIOR $* diff --git a/bin/.svn/text-base/setup_TIDorbJ.bat.svn-base b/bin/.svn/text-base/setup_TIDorbJ.bat.svn-base new file mode 100644 index 0000000..897a989 --- /dev/null +++ b/bin/.svn/text-base/setup_TIDorbJ.bat.svn-base @@ -0,0 +1,30 @@ +@echo off + +rem Comprueba si las variables TIDORBJ_HOME y JDK_HOME estan definidas +if "%TIDORBJ_HOME%"=="" goto error_HOME +if "%JAVA_HOME%"=="" goto error_JDK + set SRV_DIR=%TIDORBJ_HOME% + set SRV_BIN=%SRV_DIR%\bin + set SRV_LIB=%SRV_DIR%\lib + + rem Configura el PATH para los procesos del servicio + set PATH=%SRV_BIN%;%PATH% + + rem Configura el CLASSPATH con las librerias del servicio + set CLASSPATH=%SRV_LIB%\tidorbj.jar;%CLASSPATH% + + set SRV_DIR= + set SRV_BIN= + set SRV_LIB= + goto end + +:error_HOME + echo Debe configurar la variable de entorno TIDORBJ_HOME + echo. + goto end + +:error_JDK + echo Debe configurar la variable de entorno JAVA_HOME + echo. + +:end diff --git a/bin/.svn/text-base/setup_TIDorbJ.sh.svn-base b/bin/.svn/text-base/setup_TIDorbJ.sh.svn-base new file mode 100644 index 0000000..1bbb9a8 --- /dev/null +++ b/bin/.svn/text-base/setup_TIDorbJ.sh.svn-base @@ -0,0 +1,31 @@ +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/.svn/text-base/tidorbj.bat.svn-base b/bin/.svn/text-base/tidorbj.bat.svn-base new file mode 100644 index 0000000..e444c13 --- /dev/null +++ b/bin/.svn/text-base/tidorbj.bat.svn-base @@ -0,0 +1,20 @@ +@echo off + +rem Obtiene la lista de argumentos de la linea de comandos +set ARGS=%1 %2 %3 %4 %5 %6 %7 %8 %9 + +if not "%OS%"=="Windows_NT" goto Win9x + set ARGS=%* + goto endif +:Win9x + shift + if "%9"=="" goto endif + set ARGS=%ARGS% %9 + goto Win9x +:endif + +set JVM=%JAVA_HOME%\bin\java +%JVM% -classpath .;%TIDORBJ_HOME%\lib\tidorbj.jar %ARGS% + +set ARGS= +set JVM= diff --git a/bin/.svn/text-base/tidorbj.sh.svn-base b/bin/.svn/text-base/tidorbj.sh.svn-base new file mode 100644 index 0000000..f832782 --- /dev/null +++ b/bin/.svn/text-base/tidorbj.sh.svn-base @@ -0,0 +1,6 @@ +#!/bin/sh +set +u + +JVM=$JDK_HOME/bin/java + +$JVM -classpath .:$TIDORBJ_HOME/lib/tidorbj.jar $* diff --git a/bin/.svn/tmp/setup_TIDorbJ.sh.tmp b/bin/.svn/tmp/setup_TIDorbJ.sh.tmp new file mode 100644 index 0000000..3acd50f --- /dev/null +++ b/bin/.svn/tmp/setup_TIDorbJ.sh.tmp @@ -0,0 +1,35 @@ +<<<<<<< .mine +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist +======= +DEFAULT_HOME=/home/avega/morfeo/TIDorbJ/dist +>>>>>>> .r454 + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/.svn/tmp/tempfile.2.tmp b/bin/.svn/tmp/tempfile.2.tmp new file mode 100644 index 0000000..1bbb9a8 --- /dev/null +++ b/bin/.svn/tmp/tempfile.2.tmp @@ -0,0 +1,31 @@ +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/.svn/tmp/tempfile.tmp b/bin/.svn/tmp/tempfile.tmp new file mode 100644 index 0000000..1bbb9a8 --- /dev/null +++ b/bin/.svn/tmp/tempfile.tmp @@ -0,0 +1,31 @@ +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/printIOR.bat b/bin/printIOR.bat new file mode 100644 index 0000000..1f87406 --- /dev/null +++ b/bin/printIOR.bat @@ -0,0 +1,9 @@ +@echo off + +set PRINT_IOR_CLASSPATH=.;%TIDORBJ_HOME%\lib\tidorbj.jar +set JVM=%JAVA_HOME%\bin\java + +%JVM% -classpath %PRINT_IOR_CLASSPATH% es.tid.TIDorbj.tools.PrintIOR %1 + +set PRINT_IOR_CLASSPATH= +set JVM= diff --git a/bin/printIOR.sh b/bin/printIOR.sh new file mode 100755 index 0000000..50840e8 --- /dev/null +++ b/bin/printIOR.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set +u + +if [ -z "$JAVA_HOME" ]; then + echo "Environment variable JAVA_HOME must be set" + exit 1 +fi + +if [ -z "$TIDORBJ_HOME" ]; then + echo "Environment variable TIDORBJ_HOME must be set" + exit 1 +fi + + +JVM=$JDK_HOME/bin/java +PRINT_IOR_CLASSPATH=.:$TIDORBJ_HOME/lib/tidorbj.jar + +$JVM -classpath $PRINT_IOR_CLASSPATH es.tid.TIDorbj.tools.PrintIOR $* diff --git a/bin/setup_TIDorbJ.bat b/bin/setup_TIDorbJ.bat new file mode 100644 index 0000000..897a989 --- /dev/null +++ b/bin/setup_TIDorbJ.bat @@ -0,0 +1,30 @@ +@echo off + +rem Comprueba si las variables TIDORBJ_HOME y JDK_HOME estan definidas +if "%TIDORBJ_HOME%"=="" goto error_HOME +if "%JAVA_HOME%"=="" goto error_JDK + set SRV_DIR=%TIDORBJ_HOME% + set SRV_BIN=%SRV_DIR%\bin + set SRV_LIB=%SRV_DIR%\lib + + rem Configura el PATH para los procesos del servicio + set PATH=%SRV_BIN%;%PATH% + + rem Configura el CLASSPATH con las librerias del servicio + set CLASSPATH=%SRV_LIB%\tidorbj.jar;%CLASSPATH% + + set SRV_DIR= + set SRV_BIN= + set SRV_LIB= + goto end + +:error_HOME + echo Debe configurar la variable de entorno TIDORBJ_HOME + echo. + goto end + +:error_JDK + echo Debe configurar la variable de entorno JAVA_HOME + echo. + +:end diff --git a/bin/setup_TIDorbJ.sh b/bin/setup_TIDorbJ.sh new file mode 100644 index 0000000..1bbb9a8 --- /dev/null +++ b/bin/setup_TIDorbJ.sh @@ -0,0 +1,31 @@ +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/setup_TIDorbJ.sh~ b/bin/setup_TIDorbJ.sh~ new file mode 100644 index 0000000..c127c51 --- /dev/null +++ b/bin/setup_TIDorbJ.sh~ @@ -0,0 +1,31 @@ +DEFAULT_HOME=/opt/TIDorbJ_3.2.0 + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/bin/tidorbj.bat b/bin/tidorbj.bat new file mode 100644 index 0000000..e444c13 --- /dev/null +++ b/bin/tidorbj.bat @@ -0,0 +1,20 @@ +@echo off + +rem Obtiene la lista de argumentos de la linea de comandos +set ARGS=%1 %2 %3 %4 %5 %6 %7 %8 %9 + +if not "%OS%"=="Windows_NT" goto Win9x + set ARGS=%* + goto endif +:Win9x + shift + if "%9"=="" goto endif + set ARGS=%ARGS% %9 + goto Win9x +:endif + +set JVM=%JAVA_HOME%\bin\java +%JVM% -classpath .;%TIDORBJ_HOME%\lib\tidorbj.jar %ARGS% + +set ARGS= +set JVM= diff --git a/bin/tidorbj.sh b/bin/tidorbj.sh new file mode 100644 index 0000000..f832782 --- /dev/null +++ b/bin/tidorbj.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set +u + +JVM=$JDK_HOME/bin/java + +$JVM -classpath .:$TIDORBJ_HOME/lib/tidorbj.jar $* diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..f8ffe4e --- /dev/null +++ b/build.xml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/.cvsignore b/build/.cvsignore new file mode 100644 index 0000000..751b1d0 --- /dev/null +++ b/build/.cvsignore @@ -0,0 +1 @@ +build.log diff --git a/build/.svn/all-wcprops b/build/.svn/all-wcprops new file mode 100644 index 0000000..23ccb89 --- /dev/null +++ b/build/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/build +END +Makefile.gcj +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/build/Makefile.gcj +END +build.bat +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/build/build.bat +END +build.sh +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/build/build.sh +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/build/.cvsignore +END diff --git a/build/.svn/dir-prop-base b/build/.svn/dir-prop-base new file mode 100644 index 0000000..1643502 --- /dev/null +++ b/build/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 9 +build.log +END diff --git a/build/.svn/entries b/build/.svn/entries new file mode 100644 index 0000000..b2d017e --- /dev/null +++ b/build/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/build +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Makefile.gcj +file + + + + +2010-04-28T10:47:59.000000Z +058f0a9058e94ad2f838f0bc6bc10077 +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + + + + + + + + +3408 + +build.bat +file + + + + +2009-02-16T09:48:50.000000Z +677aa2e2c4bd20515c697387ce22c41b +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1130 + +build.sh +file + + + + +2009-02-16T09:48:50.000000Z +6c62a70824b4c42b33aab291de7b8174 +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +2115 + +.cvsignore +file + + + + +2009-02-16T09:48:50.000000Z +d55ba6d60e31929c77c30ac8d0ac8022 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +10 + diff --git a/build/.svn/prop-base/.cvsignore.svn-base b/build/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/build/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/build/.svn/prop-base/build.bat.svn-base b/build/.svn/prop-base/build.bat.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/build/.svn/prop-base/build.bat.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/build/.svn/prop-base/build.sh.svn-base b/build/.svn/prop-base/build.sh.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/build/.svn/prop-base/build.sh.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/build/.svn/text-base/.cvsignore.svn-base b/build/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..751b1d0 --- /dev/null +++ b/build/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1 @@ +build.log diff --git a/build/.svn/text-base/Makefile.gcj.svn-base b/build/.svn/text-base/Makefile.gcj.svn-base new file mode 100644 index 0000000..95eb9fd --- /dev/null +++ b/build/.svn/text-base/Makefile.gcj.svn-base @@ -0,0 +1,97 @@ +DEST_DIR := ./bin + +# +# Java targeet dirs +# +IDL_OBJS_DIR := ./idl +TIDORBJ_OBJS_DIR := ./source +TOOLS_OBJS_DIR := ./tools +UTIL_OBJS_DIR := ./util + + + +# +# Java source code +# +IDL_SOURCES += $(shell find idl/BiDirPolicy/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/comm/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/CosNaming/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/DynamicAny/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Messaging/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/orb/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/SendingContext/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/TimeBase/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Compression/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Security/.java/ -name *.java -type f) + +TOOLS_SOURCES += tools/es/tid/TIDorbj/tools/PrintIOR.java +TIDORBJ_SOURCES += $(shell find source/es/tid/TIDorbj -name *.java -type f) +TIDORBJ_SOURCES += $(shell find source/es/tid/PortableServer -name *.java -type f) +UTIL_SOURCES += $(shell find util/es/tid/TIDorbj/util -name *.java -type f) + + + +# +# Java objects +# +IDL_OBJECTS := $(IDL_SOURCES:idl/%.java=$(IDL_OBJS_DIR)/%.o) +TIDORBJ_OBJECTS := $(TIDORBJ_SOURCES:source/%.java=$(TIDORBJ_OBJS_DIR)/%.o) +TOOLS_OBJECTS := $(TOOLS_SOURCES:tools/%.java=$(TOOLS_OBJS_DIR)/%.o) +UTIL_OBJECTS := $(UTIL_SOURCES:util/%.java=$(UTIL_OBJS_DIR)/%.o) + + +# +# Classpath +# +CLASSPATH := lib/bidirpolicyIdl.jar:lib/commIdl.jar:lib/dynAnyIdl.jar:lib/messagingIdl.jar:lib/namingIdl.jar:lib/orbIdl.jar:lib/SendingContextIdl.jar:lib/timebaseIdl.jar:lib/CompressionIdl.jar:lib/SecurityIdl.jar:lib/core.jar:lib/util.jar + + +GCJ := gcj-4.3 + +GCJ_FLAGS := -O9 --encoding=ISO-8859-1 -findirect-dispatch -Wl,--allow-multiple-definition +LINK_FLAGS := -O9 -fCLASSPATH=$(CLASSPATH) -findirect-dispatch -Wl,--allow-multiple-definition + +# objects in $(DEST_DIR) don't get linked into the binary +LINK_OBJECTS := $(foreach f, $(IDL_OBJECTS), \ + $(if $(filter-out $(IDL_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(TIDORBJ_OBJECTS), \ + $(if $(filter-out $(TIDORBJ_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(TOOLS_OBJECTS), \ + $(if $(filter-out $(TOOLS_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(UTIL_OBJECTS), \ + $(if $(filter-out $(UTIL_OBJS_DIR)/, $(dir $(f))), $f)) + + +PRINTIOR_BIN := printIOR.bin + +BINARIES := $(DEST_DIR)/$(PRINTIOR_BIN) + + + +all: $(BINARIES) + +build: clean all + +clean: + rm -rf $(BINARIES); + rm -f $(TIDORBJ_OBJECTS) $(TOOLS_OBJECTS) $(UTIL_OBJECTS) $(IDL_OBJECTS); + +$(IDL_OBJECTS): $(IDL_OBJS_DIR)/%.o: idl/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(TIDORBJ_OBJECTS): $(TIDORBJ_OBJS_DIR)/%.o: source/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(TOOLS_OBJECTS): $(TOOLS_OBJS_DIR)/%.o: tools/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(UTIL_OBJECTS): $(UTIL_OBJS_DIR)/%.o: util/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + + +$(DEST_DIR)/$(PRINTIOR_BIN): $(LINK_OBJECTS) + $(GCJ) --main=es.tid.TIDorbj.tools.PrintIOR \ + -o $(DEST_DIR)/$(PRINTIOR_BIN) $^ $(LINK_FLAGS) + + + diff --git a/build/.svn/text-base/build.bat.svn-base b/build/.svn/text-base/build.bat.svn-base new file mode 100644 index 0000000..0e5f882 --- /dev/null +++ b/build/.svn/text-base/build.bat.svn-base @@ -0,0 +1,19 @@ +@echo off + +rem Variables que deben revisarse segun el entorno de compilacion +SET JAVA_HOME=C:\jdk1.3.1_01 +SET ORACLE_HOME=C:\Oracle8i +SET WORKAREA_HOME=C:\workspace + +rem Variables del entorno de integracion +SET BASEPJ_HOME=I:\scib12\bases\mesa\SCIB12.pj +SET PLATFORM_HOME=I:\scib12\platform_v12.0.0 +SET TOOLS_HOME=I:\scib12\tools_v12.0.0 + +SET JWSDP_HOME=%TOOLS_HOME%\jwsdp +SET JAXP_LIB=%JWSDP_HOME%\jaxp\lib +SET ANT_HOME=%TOOLS_HOME%\apache-ant-1.6.1 +SET ANT_CLASSPATH=%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\ant-launcher.jar +SET JAXP_CLASSPATH=%JAXP_LIB%\jaxp-api.jar;%JAXP_LIB%\endorsed\dom.jar;%JAXP_LIB%\endorsed\sax.jar;%JAXP_LIB%\endorsed\xalan.jar;%JAXP_LIB%\endorsed\xsltc.jar;%JAXP_LIB%\endorsed\xercesImpl.jar +SET JAVA_TOOLS=%JAVA_HOME%\lib\tools.jar +"%JAVA_HOME%\bin\java" -Dant.home="%ANT_HOME%" -Dtools.home="%TOOLS_HOME%" -Dplatform.home="%PLATFORM_HOME%" -Dbasepj.home="%BASEPJ_HOME%" -Dworkarea.home="%WORKAREA_HOME%" -Doracle.home="%ORACLE_HOME%" -classpath "%JAVA_TOOLS%;%JAXP_CLASSPATH%;%ANT_CLASSPATH%" -Dbasedir=. org.apache.tools.ant.Main -buildfile "%WORKAREA_HOME%\Build\main.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/build/.svn/text-base/build.sh.svn-base b/build/.svn/text-base/build.sh.svn-base new file mode 100644 index 0000000..c0c1fdb --- /dev/null +++ b/build/.svn/text-base/build.sh.svn-base @@ -0,0 +1,60 @@ +# +# MORFEO Project +# http://www.morfeo-project.org +# +# Component: TIDIdlc +# Programming Language: Java +# +# File: $Source$ +# Version: $Revision$ +# Date: $Date$ +# Last modified by: $Author$ +# +# (C) Copyright 2004 Telefónica Investigación y Desarrollo +# S.A.Unipersonal (Telefónica I+D) +# +# Info about members and contributors of the MORFEO project +# is available at: +# +# http://www.morfeo-project.org/TIDIdlc/CREDITS +# +# 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. +# +# If you want to use this software an plan to distribute a +# proprietary application in any way, and you are not licensing and +# distributing your source code under GPL, you probably need to +# purchase a commercial license of the product. More info about +# licensing options is available at: +# +# http://www.morfeo-project.org/TIDIdlc/Licensing +# +#$ANT_HOME/bin/ant -f ../build.xml -Dmorfeo.dependencies.home=$MORFEO_DEPENDENCIES -verbose $* +set +u +OLD_DIR=$PWD + +cd ../../MORFEO_DEPENDENCIES +DEFAULT_MORFEO_DEPENDENCIES=$PWD +cd $OLD_DIR + +if [ -z "$MORFEO_DEPENDENCIES" ]; then + echo Configurando la variable MORFEO_DEPENDENCIIES=$DEFAULT_MORFEO_DEPENDENCIES + echo Si el valor de esta variable no es correcto ejecute el script + echo $MORFEO_DEPENDENCIES/bin/set_env.sh + cd $DEFAULT_MORFEO_DEPENDENCIES/bin + echo $DEFAULT_MORFEO_DEPENDENCIES + . ./set_env.sh + cd $OLD_DIR +fi +$MORFEO_DEPENDENCIES/build/build.sh $* diff --git a/build/Makefile.gcj b/build/Makefile.gcj new file mode 100644 index 0000000..95eb9fd --- /dev/null +++ b/build/Makefile.gcj @@ -0,0 +1,97 @@ +DEST_DIR := ./bin + +# +# Java targeet dirs +# +IDL_OBJS_DIR := ./idl +TIDORBJ_OBJS_DIR := ./source +TOOLS_OBJS_DIR := ./tools +UTIL_OBJS_DIR := ./util + + + +# +# Java source code +# +IDL_SOURCES += $(shell find idl/BiDirPolicy/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/comm/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/CosNaming/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/DynamicAny/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Messaging/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/orb/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/SendingContext/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/TimeBase/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Compression/.java/ -name *.java -type f) +IDL_SOURCES += $(shell find idl/Security/.java/ -name *.java -type f) + +TOOLS_SOURCES += tools/es/tid/TIDorbj/tools/PrintIOR.java +TIDORBJ_SOURCES += $(shell find source/es/tid/TIDorbj -name *.java -type f) +TIDORBJ_SOURCES += $(shell find source/es/tid/PortableServer -name *.java -type f) +UTIL_SOURCES += $(shell find util/es/tid/TIDorbj/util -name *.java -type f) + + + +# +# Java objects +# +IDL_OBJECTS := $(IDL_SOURCES:idl/%.java=$(IDL_OBJS_DIR)/%.o) +TIDORBJ_OBJECTS := $(TIDORBJ_SOURCES:source/%.java=$(TIDORBJ_OBJS_DIR)/%.o) +TOOLS_OBJECTS := $(TOOLS_SOURCES:tools/%.java=$(TOOLS_OBJS_DIR)/%.o) +UTIL_OBJECTS := $(UTIL_SOURCES:util/%.java=$(UTIL_OBJS_DIR)/%.o) + + +# +# Classpath +# +CLASSPATH := lib/bidirpolicyIdl.jar:lib/commIdl.jar:lib/dynAnyIdl.jar:lib/messagingIdl.jar:lib/namingIdl.jar:lib/orbIdl.jar:lib/SendingContextIdl.jar:lib/timebaseIdl.jar:lib/CompressionIdl.jar:lib/SecurityIdl.jar:lib/core.jar:lib/util.jar + + +GCJ := gcj-4.3 + +GCJ_FLAGS := -O9 --encoding=ISO-8859-1 -findirect-dispatch -Wl,--allow-multiple-definition +LINK_FLAGS := -O9 -fCLASSPATH=$(CLASSPATH) -findirect-dispatch -Wl,--allow-multiple-definition + +# objects in $(DEST_DIR) don't get linked into the binary +LINK_OBJECTS := $(foreach f, $(IDL_OBJECTS), \ + $(if $(filter-out $(IDL_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(TIDORBJ_OBJECTS), \ + $(if $(filter-out $(TIDORBJ_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(TOOLS_OBJECTS), \ + $(if $(filter-out $(TOOLS_OBJS_DIR)/, $(dir $(f))), $f)) +LINK_OBJECTS += $(foreach f, $(UTIL_OBJECTS), \ + $(if $(filter-out $(UTIL_OBJS_DIR)/, $(dir $(f))), $f)) + + +PRINTIOR_BIN := printIOR.bin + +BINARIES := $(DEST_DIR)/$(PRINTIOR_BIN) + + + +all: $(BINARIES) + +build: clean all + +clean: + rm -rf $(BINARIES); + rm -f $(TIDORBJ_OBJECTS) $(TOOLS_OBJECTS) $(UTIL_OBJECTS) $(IDL_OBJECTS); + +$(IDL_OBJECTS): $(IDL_OBJS_DIR)/%.o: idl/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(TIDORBJ_OBJECTS): $(TIDORBJ_OBJS_DIR)/%.o: source/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(TOOLS_OBJECTS): $(TOOLS_OBJS_DIR)/%.o: tools/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + +$(UTIL_OBJECTS): $(UTIL_OBJS_DIR)/%.o: util/%.java + $(GCJ) -fCLASSPATH=$(CLASSPATH) $(GCJ_FLAGS) -c $< -o $@ + + +$(DEST_DIR)/$(PRINTIOR_BIN): $(LINK_OBJECTS) + $(GCJ) --main=es.tid.TIDorbj.tools.PrintIOR \ + -o $(DEST_DIR)/$(PRINTIOR_BIN) $^ $(LINK_FLAGS) + + + diff --git a/build/build.bat b/build/build.bat new file mode 100644 index 0000000..0e5f882 --- /dev/null +++ b/build/build.bat @@ -0,0 +1,19 @@ +@echo off + +rem Variables que deben revisarse segun el entorno de compilacion +SET JAVA_HOME=C:\jdk1.3.1_01 +SET ORACLE_HOME=C:\Oracle8i +SET WORKAREA_HOME=C:\workspace + +rem Variables del entorno de integracion +SET BASEPJ_HOME=I:\scib12\bases\mesa\SCIB12.pj +SET PLATFORM_HOME=I:\scib12\platform_v12.0.0 +SET TOOLS_HOME=I:\scib12\tools_v12.0.0 + +SET JWSDP_HOME=%TOOLS_HOME%\jwsdp +SET JAXP_LIB=%JWSDP_HOME%\jaxp\lib +SET ANT_HOME=%TOOLS_HOME%\apache-ant-1.6.1 +SET ANT_CLASSPATH=%ANT_HOME%\lib\ant.jar;%ANT_HOME%\lib\ant-launcher.jar +SET JAXP_CLASSPATH=%JAXP_LIB%\jaxp-api.jar;%JAXP_LIB%\endorsed\dom.jar;%JAXP_LIB%\endorsed\sax.jar;%JAXP_LIB%\endorsed\xalan.jar;%JAXP_LIB%\endorsed\xsltc.jar;%JAXP_LIB%\endorsed\xercesImpl.jar +SET JAVA_TOOLS=%JAVA_HOME%\lib\tools.jar +"%JAVA_HOME%\bin\java" -Dant.home="%ANT_HOME%" -Dtools.home="%TOOLS_HOME%" -Dplatform.home="%PLATFORM_HOME%" -Dbasepj.home="%BASEPJ_HOME%" -Dworkarea.home="%WORKAREA_HOME%" -Doracle.home="%ORACLE_HOME%" -classpath "%JAVA_TOOLS%;%JAXP_CLASSPATH%;%ANT_CLASSPATH%" -Dbasedir=. org.apache.tools.ant.Main -buildfile "%WORKAREA_HOME%\Build\main.xml" %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/build/build.sh b/build/build.sh new file mode 100644 index 0000000..10a6085 --- /dev/null +++ b/build/build.sh @@ -0,0 +1,60 @@ +# +# MORFEO Project +# http://www.morfeo-project.org +# +# Component: TIDIdlc +# Programming Language: Java +# +# File: $Source$ +# Version: $Revision: 21 $ +# Date: $Date: 2006-07-14 14:08:38 +0200 (Fri, 14 Jul 2006) $ +# Last modified by: $Author: iredondo $ +# +# (C) Copyright 2004 Telefónica Investigación y Desarrollo +# S.A.Unipersonal (Telefónica I+D) +# +# Info about members and contributors of the MORFEO project +# is available at: +# +# http://www.morfeo-project.org/TIDIdlc/CREDITS +# +# 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. +# +# If you want to use this software an plan to distribute a +# proprietary application in any way, and you are not licensing and +# distributing your source code under GPL, you probably need to +# purchase a commercial license of the product. More info about +# licensing options is available at: +# +# http://www.morfeo-project.org/TIDIdlc/Licensing +# +#$ANT_HOME/bin/ant -f ../build.xml -Dmorfeo.dependencies.home=$MORFEO_DEPENDENCIES -verbose $* +set +u +OLD_DIR=$PWD + +cd ../../MORFEO_DEPENDENCIES +DEFAULT_MORFEO_DEPENDENCIES=$PWD +cd $OLD_DIR + +if [ -z "$MORFEO_DEPENDENCIES" ]; then + echo Configurando la variable MORFEO_DEPENDENCIIES=$DEFAULT_MORFEO_DEPENDENCIES + echo Si el valor de esta variable no es correcto ejecute el script + echo $MORFEO_DEPENDENCIES/bin/set_env.sh + cd $DEFAULT_MORFEO_DEPENDENCIES/bin + echo $DEFAULT_MORFEO_DEPENDENCIES + . ./set_env.sh + cd $OLD_DIR +fi +$MORFEO_DEPENDENCIES/build/build.sh $* diff --git a/dist/AUTHORS b/dist/AUTHORS new file mode 100644 index 0000000..f06da07 --- /dev/null +++ b/dist/AUTHORS @@ -0,0 +1,16 @@ +This is the list of people who have been involved in the development of +TIDorbJ: + +Juan J. Hierro +Juan A. Caceres +Pablo Rodriguez Archilla +Fabio Garcia Solero +Manuel Castro +Luis de la Fuente +Juan Pablo Rojas +Sergio Checa Blanco +Alvaro Vega Garcia +Irenka Redondo Grandados +Jose Alberto Garcia Daniel +Alvaro Polo Valdenebro +Maria Cruz Pajares diff --git a/dist/BUGS b/dist/BUGS new file mode 100644 index 0000000..e512e6b --- /dev/null +++ b/dist/BUGS @@ -0,0 +1,2 @@ +This document has been moved to MORFEO Forge (which is online at +https://forge.morfeo-project.org/tracker/?atid=109&group_id=8&func=browse diff --git a/dist/BUILT b/dist/BUILT new file mode 100644 index 0000000..b6ad40d --- /dev/null +++ b/dist/BUILT @@ -0,0 +1,21 @@ +This release of TIDorbJ was built on a machine with kernel: +Linux dacha 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/Linux + +using the compiler: +java version "1.5.0_14" +Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) +Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing) + +kernel source package used: +linux-source-2.6.21 i686 + +applied kernel patches: +linux-image-2.6.21-2-686 2.6.21-6 + +using the following libraries: +ant 1.7.0-6 +javacc 4.0+cvs20080403-1 +libxerces27 2.7.0-5 +libxalan110 1.10-3.2 +libjaxp1.3-java 1.3.04-3 +TIDIdlc 1.3.7 diff --git a/dist/COPYING b/dist/COPYING new file mode 100644 index 0000000..4cacaf5 --- /dev/null +++ b/dist/COPYING @@ -0,0 +1,390 @@ +http://www.morfeo-project.org + +Component: TIDorbJ +Programming Language: Java + + (C) Copyright 2004 Telefónica Investigación y Desarrollo + S.A.Unipersonal (Telefónica I+D) + + + 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. + + If you want to use this software an plan to distribute a + proprietary application in any way, and you are not licensing and + distributing your source code under GPL, you probably need to + purchase a commercial license of the product. More info about + licensing options is available at: + + http://www.morfeo-project.org/TIDorbJ/Licensing + + + ******************************** + * GNU General Public License * + ******************************** + + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble +======== + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. +Our General Public Licenses are designed to make sure that you have +the freedom to distribute copies of free software (and charge for this +service if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis +or for a fee, you must give the recipients all the rights that you +have. You must make sure that they, too, receive or can get the source +code. And you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software patents. +We wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program +proprietary. To prevent this, we have made it clear that any patent +must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on + the Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's + source code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Program a copy of + this License along with the Program. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Program or any portion + of it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program + or any part thereof, to be licensed as a whole at no charge + to all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not + apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a + whole which is a work based on the Program, the distribution of + the whole must be on the terms of this License, whose permissions + for other licensees extend to the entire whole, and thus to each + and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Program. + + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on + a volume of a storage or distribution medium does not bring the + other work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + b. Accompany it with a written offer, valid for at least three + years, to give any third-party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts + used to control compilation and installation of the executable. + However, as a special exception, the source code distributed need + not include anything that is normally distributed (in either + source or binary form) with the major components (compiler, + kernel, and so on) of the operating system on which the executable + runs, unless that component itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this + License to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program + subject to these terms and conditions. You may not impose any + further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance + by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program by all those who + receive copies directly or indirectly through you, then the only + way you could satisfy both it and this License would be to refrain + entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 9. The Free Software Foundation may publish revised and/or new + versions of the General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies a version number of this License which applies + to it and "any later version", you have the option of following + the terms and conditions either of that version or of any later + version published by the Free Software Foundation. If the Program + does not specify a version number of this License, you may choose + any version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted + by the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision + will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT + HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT + WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE + QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE + PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY + SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY + OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YYYY NAME OF AUTHOR + + 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. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than `show w' and `show +c'; they could even be mouse-clicks or menu items--whatever suits your +program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + SIGNATURE OF TY COON, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, +you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Library General Public License instead of this License. \ No newline at end of file diff --git a/dist/ChangeLog b/dist/ChangeLog new file mode 100644 index 0000000..7af9999 --- /dev/null +++ b/dist/ChangeLog @@ -0,0 +1,198 @@ +2010-01-10 Alvaro Vega Garcia + Maria Cruz Pajares + + * TIDorbJ version 6.5.0 released. + + - Feature added [#924] IPv6 support + +2010-01-10 Alvaro Vega Garcia + + * TIDorbJ version 6.4.0 released. + + - Feature added [#797] SSLIOP layer for TIDorbJ + - Feature added [#798] Secure corbalocs + +2009-11-10 Alvaro Vega Garcia + + * TIDorbJ version 6.3.5 released. + + - Feature added [#1072] CSI support for PrintIOR + - Fix bug [#1070] Inexact UTC time + +2009-07-20 Alvaro Vega Garcia + + * TIDorbJ version 6.3.4 released. + + - Fix bug [#1038] Bug in Messaging.ExeptionHolder management + - Fix bug [#1026] Unable to retrieve the factory of a custom + compressor previously registered + - Aligned with GIOP Compression (FTF Beta 2, May 2009): changes in the + way of calc 'min_ratio' value + - Fix bug [#956] Invalid call to + org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI + +2009-04-16 Alvaro Vega Garcia + + * TIDorbJ version 6.3.3 released. + + - Feature added [844] ZIOP: GIOP Compression (FTF Beta 2) + - Fix bug [942] Server listener sockets don't set SO_REUSEADDR socket + option at initializing time + - Feature [916] Add support of QoS policies to printIOR + - Feature [842] Set TAG_ORB_TYPE requested to OMG + - Fix bug [830] recover_count at IIOPCommLayer is global, not per each + connection establishment (racecondition) + - Fix bug [544] After COMM_FAILURE ORB client doesn't retry connection + with a restarted server + +2008-06-23 Alvaro Vega Garcia + + * TIDorbJ version 6.3.2 released. + + - Fix bug [545] Interoperability problems with TAO and Visibroker due + to response_flags of GIOP RequestHeader 1.2 + - Fix bug [544] After COMM_FAILURE ORB client doesn't retry connection + with a restarted server + - Feature [419] Add dump of IIOPCommLayer properties in traces + - Fix bug [413] Java null pointer exception when creates an Any from + ORBSingleton.create_any() + +2008-02-22 Alvaro Vega Garcia + + * TIDorbJ version 6.3.1 released. + + - Fix bug [345] printIOR.sh doesn't work + - Fix bug [337] Problems with ServantActivator + - Fix bug [328] CORBA.INITIALIZE due to ClassCastException: + TIDorb.trace.level > 0 && -ORBInitRef ... + - Fix bug [282] -ORB_exhaustive_equal true doesn't have any effect + +2007-03-19 Alvaro Vega Garcia + + * TIDorbJ version 6.3.0 released. + +2007-01-16 Luis de la Fuente (ldlf07 at tid dot es) + + * TIDorbJ version 6.2.1 released. + + Fix bug [126] Problems with unsigned long long parameters + Fix bug [123] Client waits max_block_time when the server closes the socket + Fix bug [22] TIDorbJ doesn't compile with Sun JDK 1.5 + +2006-03-03 Irenka Redondo Granados (iredondo at tid dot es) + + * TIDorbJ version 6.2.0 released. + + - Implemented AMI (Asynchronous Method Invocation) + +2005-06-01 Pablo Rodriguez Archilla (pra at tid dot es) + + * TIDorbJ version 6.1.0 + + - Implemented quality of the service (QoS) management + +2004-12-10 Pablo Rodriguez Archilla (pra at tid dot es) + + * TIDorbJ version 6.0.0 released. + + * Released under GNU/GPL terms + +Thu May 20 13:58:15 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.2.0 released. + + - Aligned with CORBA 2.6 + - PolicyManager implemented + - Implemented QoS RelativeRequestTimeoutPolicy to manage timeouts of request. + This policy could be applied by reference, thread or ORB (see manual) + +Mon May 03 12:07:32 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.1.1 released. + + - Compatibility with J2SDK 1.4.x + - DynUnion.get_discriminator() already doesn't throw InvalidValue exception + +Thu Apr 29 14:25:10 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.1.0 released. + + - IDL to Java compiler has been extracted from the distribution + - New distribution of IDL to C++ compiler and IDL to Java (TIDIdlc) + - ORB API compiled with TIDIdlc version 1.0.0 + +Wed Apr 28 11:44:14 2004 Juan A. Caceres (caceres at tid dot es) + * TIDorbJ version 3.0.9 + + - New argument: + es.tid.TIDorbj.iiop.socket_write_timeout (>= 0) + Sets a timeout to avoid deadlocks in a write (caused by when buffer TCP is filled) + +Mon Mar 01 13:57:26 2004 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.8 + + - Fix in marshall of TypeCode indirections + +Fri Sep 05 13:23:55 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.7 + + - Implemented a TypeCodes Cache + - Improvements in management of bidirectional connections + - Removed bug in ServerListener + - New arguments: + es.tid.TIDorbj.typecode_cache_size (v >= 0) + es.tid.TIDorbj.iiop.server_socket_reconnect + es.tid.TIDorbj.iiop.bidirectional (BOTH-NORMAL) + +Mon Apr 21 12:44:13 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.6 + + - Improvmentes in management of IIOP connections + - New argument: es.tid.TIDorbj.iiop.socket_connect_timeout + +Mon Apr 21 12:11:32 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.5 + + - Adapted to JDK 1.4: Dynamic Invocation Interface implemented + los stubs facilitados por JDK + - Remove bug about Multithreading in Any type + +Tue Apr 08 18:30:35 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.4 + + - Changes to warranty interoperability with GIOP 1.0 + +Mon Mar 31 16:39:02 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.3 + + - Last version with chages about bugs in IDL compiler + +Thu Mar 13 10:24:41 2003 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.2 + + - Version with TIDAgent adaptations + +Wed Jun 26 08:40:48 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 3.0.1 + + - Changes to aligned with CORBA 2.5 + +Fri Apr 19 16:21:26 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 1.11.0 + + - Version with Objects by Value implemented + +Wed Apr 17 15:21:27 2002 Juan A. Caceres (caceres at tid dot es) + + * TIDorbJ version 1.0.9 + + - First stable ORB version aligned with CORBA 2.3 diff --git a/dist/INSTALL b/dist/INSTALL new file mode 100644 index 0000000..d7e8e92 --- /dev/null +++ b/dist/INSTALL @@ -0,0 +1,188 @@ +============ +INSTALLATION +============ + +1. INSTALLATION FROM BINARY DISTRIBUTION +======================================== + + +1.1 Prerequisits +---------------- + +For the compilation of TIDNotifJ next software is needed: + + * Sun Java J2SE SDK 1.4 or later. Download + * Subversion Client. Download + * Apache Ant 1.6 or later. Download + * TIDIdlc + +See TIDorbJ Compilation and Installation HOWTO where the installation of +all this required software is explained. + +Main Linux distributions (Debian, Ubuntu, RedHat, ...) have available +installation packages for this components. + + +1.2 Installation +---------------- + +Download the zipped binaries in the applications directory +and unzip with: + + $ tar xfvz TIDorbJ_X.Y.Z.tgz +or + $ gzip -d TIDorbJ_X.Y.Z.tgz | tar xfv + + +You can download directly the TIDorbJ installation binaries from MORFEO Forge +at: https://forge.morfeo-project.org/frs/?group_id=8 + + +1.3 Execution +------------- + +To execute TIDorbJ scripts in the shell, next environment variables should be +set. + +· For Unix + -------- + + export JAVA_HOME= + export TIDORBJ_HOME=/TIDorbJ + export PATH=$PATH:$TIDNOTIFJ_HOME/bin/ + + Runs with: + + $TIDNOTIFJ_HOME/bin/start + +· For Windows + ----------- + + SET JAVA_HOME= + SET TIDORBJ_HOME=\TIDorbJ + SET PATH=%PATH;%TIDORBJ_HOME%\bin + + Runs with: + + $TIDORBJ_HOME\bin\start.bat + + + +2. INSTALLATION FROM SOURCE DISTRIBUTION +======================================== + + +2.1 Prerequisits +---------------- + +For the compilation of TIDorbJ next software is needed: + + · Sun Java J2SE SDK 1.4 or later + · Subversion Client + · Apache Ant 1.6 or later + · TIDIdlc + +Main Linux distributions (Debian, Ubuntu, RedHat, ...) have available +installation packages for this components. + +Optionally, TIDorbJ can be compiled with the Eclipse IDE. + + +· Needed Software Installation under Debian & Ubuntu Linux + -------------------------------------------------------- + + - For Ubuntu Linux: + + $ sudo apt-get install subversion ant sun-java5-jdk + + + - For Debian: + $ su + + $ apt-get install subversion ant sun-java5-jdk + + Also, Other versions of Sun's JDK can also be installed from Java at Sun + MicroSystems. + + +· Java Virtual Machine installation from binaries + ----------------------------------------------- + + Download the installation zipped file from Java at Sun MicroSystems. + You should create a directory at your $HOME directory where the installation + will be done: + + $ mkdir $HOME/java + + Unzip the installation binary file (for examle, jdk-1_5_0_07-linux-586.bin): + + $ cd $HOME/java + $ chmod +x jdk-1_5_0_07-linux-586.bin + $ ./jdk-1_5_0_07-linux-586.bin + + Follow the installation program instructions to install the Java Development + Kit. + + Finally, delete the downloaded file: + + $ rm jdk-1_5_0_07-linux-586.bin + + +2.2 TIDorbJ Compilation +----------------------- + +· Source Code Download + -------------------- + + First of all, create a work directory where the source code will be + downloaded: + + $ cd + $ mkdir Morfeo + $ cd Morfeo + + Download the sorce code from the TIDorbJ Project's Subversion repository: + + $ svn checkout https://svn.morfeo-project.org/svn/tidorbj/trunk/TIDorbJ + + The Subversion client would ask for accept the server's certificate. In this + case, Accept it. + + +· Compilation with Ant + -------------------- + + Go to the TIDorbJ directory where the source code has been downloaded and + compile it with the command: + + $ cd TIDorbJ + $ ant install + + NOTE: Change the PATH if you want to compile TIDorbJ with other JDK version + + You can check the JDK version configured in the environment with: + + $ java -version + + +2.3 TIDNotifJ Installation +------------------------ + +· Installation from compiled code + ------------------------------- + + Once compiled TIDorbJ, from the source code directory (TIDorbJ), copy the + directory dist with the generated binaries of TIDNotifJ to the usual + applications directory (for example /opt): + + $ cp -r dist /TIDorbJ_X.Y + + In Linux, update the execution flags of the scripts to launch the compiler: + + chmod +x /TIDorbJ_X.Y/bin/* + + +2.4 Execution +------------- + + Idem "1.3 Execution" previous section. diff --git a/dist/OMG_SPEC b/dist/OMG_SPEC new file mode 100644 index 0000000..843abb0 --- /dev/null +++ b/dist/OMG_SPEC @@ -0,0 +1,4 @@ +This release of TIDorbJ follows: +- OMG CORBA Specification, Version 2.6 +- OMG IDL to Java Language Mapping, Version 1.3 +- OMG GIOP Compression (FTF Beta 2) diff --git a/dist/VERSION b/dist/VERSION new file mode 100644 index 0000000..74f8f54 --- /dev/null +++ b/dist/VERSION @@ -0,0 +1 @@ +6.5.0 on 2011-03-27 diff --git a/dist/bin/printIOR.bat b/dist/bin/printIOR.bat new file mode 100644 index 0000000..1f87406 --- /dev/null +++ b/dist/bin/printIOR.bat @@ -0,0 +1,9 @@ +@echo off + +set PRINT_IOR_CLASSPATH=.;%TIDORBJ_HOME%\lib\tidorbj.jar +set JVM=%JAVA_HOME%\bin\java + +%JVM% -classpath %PRINT_IOR_CLASSPATH% es.tid.TIDorbj.tools.PrintIOR %1 + +set PRINT_IOR_CLASSPATH= +set JVM= diff --git a/dist/bin/printIOR.sh b/dist/bin/printIOR.sh new file mode 100755 index 0000000..50840e8 --- /dev/null +++ b/dist/bin/printIOR.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set +u + +if [ -z "$JAVA_HOME" ]; then + echo "Environment variable JAVA_HOME must be set" + exit 1 +fi + +if [ -z "$TIDORBJ_HOME" ]; then + echo "Environment variable TIDORBJ_HOME must be set" + exit 1 +fi + + +JVM=$JDK_HOME/bin/java +PRINT_IOR_CLASSPATH=.:$TIDORBJ_HOME/lib/tidorbj.jar + +$JVM -classpath $PRINT_IOR_CLASSPATH es.tid.TIDorbj.tools.PrintIOR $* diff --git a/dist/bin/setup_TIDorbJ.bat b/dist/bin/setup_TIDorbJ.bat new file mode 100644 index 0000000..897a989 --- /dev/null +++ b/dist/bin/setup_TIDorbJ.bat @@ -0,0 +1,30 @@ +@echo off + +rem Comprueba si las variables TIDORBJ_HOME y JDK_HOME estan definidas +if "%TIDORBJ_HOME%"=="" goto error_HOME +if "%JAVA_HOME%"=="" goto error_JDK + set SRV_DIR=%TIDORBJ_HOME% + set SRV_BIN=%SRV_DIR%\bin + set SRV_LIB=%SRV_DIR%\lib + + rem Configura el PATH para los procesos del servicio + set PATH=%SRV_BIN%;%PATH% + + rem Configura el CLASSPATH con las librerias del servicio + set CLASSPATH=%SRV_LIB%\tidorbj.jar;%CLASSPATH% + + set SRV_DIR= + set SRV_BIN= + set SRV_LIB= + goto end + +:error_HOME + echo Debe configurar la variable de entorno TIDORBJ_HOME + echo. + goto end + +:error_JDK + echo Debe configurar la variable de entorno JAVA_HOME + echo. + +:end diff --git a/dist/bin/setup_TIDorbJ.sh b/dist/bin/setup_TIDorbJ.sh new file mode 100755 index 0000000..1bbb9a8 --- /dev/null +++ b/dist/bin/setup_TIDorbJ.sh @@ -0,0 +1,31 @@ +DEFAULT_HOME=/home/avega/TIDorbJ_IPv6/dist + +set +u +SRV_DIR=${TIDORBJ_HOME:-$DEFAULT_HOME} +SRV_BIN=$SRV_DIR/bin +SRV_LIB=$SRV_DIR/lib + +if [ ! -d "$SRV_DIR" ]; then + echo "Directorio de instalacion $SRV_DIR incorrecto" + echo +elif [ -z "$JDK_HOME" ]; then + echo "Debe configurar la variable de entorno JDK_HOME" + echo +else + # Variable de entorno del servicio + export TIDORBJ_HOME=$SRV_DIR + + # Configura el PATH para los procesos del servicio + if [ -z "$(echo $PATH | egrep "$SRV_BIN")" ]; then + PATH=$SRV_BIN${PATH:+:$PATH} + fi + + # Configura el CLASSPATH con las librerias del servicio + for LIB in $SRV_LIB/tidorbj.jar; do + if [ -z "$(echo $CLASSPATH | egrep "$LIB")" ]; then + CLASSPATH=$LIB${CLASSPATH:+:$CLASSPATH} + fi + done + + export PATH CLASSPATH +fi diff --git a/dist/bin/tidorbj.bat b/dist/bin/tidorbj.bat new file mode 100644 index 0000000..e444c13 --- /dev/null +++ b/dist/bin/tidorbj.bat @@ -0,0 +1,20 @@ +@echo off + +rem Obtiene la lista de argumentos de la linea de comandos +set ARGS=%1 %2 %3 %4 %5 %6 %7 %8 %9 + +if not "%OS%"=="Windows_NT" goto Win9x + set ARGS=%* + goto endif +:Win9x + shift + if "%9"=="" goto endif + set ARGS=%ARGS% %9 + goto Win9x +:endif + +set JVM=%JAVA_HOME%\bin\java +%JVM% -classpath .;%TIDORBJ_HOME%\lib\tidorbj.jar %ARGS% + +set ARGS= +set JVM= diff --git a/dist/bin/tidorbj.sh b/dist/bin/tidorbj.sh new file mode 100755 index 0000000..f832782 --- /dev/null +++ b/dist/bin/tidorbj.sh @@ -0,0 +1,6 @@ +#!/bin/sh +set +u + +JVM=$JDK_HOME/bin/java + +$JVM -classpath .:$TIDORBJ_HOME/lib/tidorbj.jar $* diff --git a/dist/idl/BiDirPolicy.idl b/dist/idl/BiDirPolicy.idl new file mode 100644 index 0000000..892b7d3 --- /dev/null +++ b/dist/idl/BiDirPolicy.idl @@ -0,0 +1,23 @@ +#ifndef _BIDIRPOLICY_IDL_ +#define _BIDIRPOLICY_IDL_ + +#include + +#pragma prefix "omg.org" + +// Self contained module for Bi-directional GIOP policy +module BiDirPolicy { + + typedef unsigned short BidirectionalPolicyValue; + + const BidirectionalPolicyValue NORMAL = 0; + const BidirectionalPolicyValue BOTH = 1; + + const CORBA::PolicyType BIDIRECTIONAL_POLICY_TYPE = 37; + + interface BidirectionalPolicy : CORBA::Policy { + readonly attribute BidirectionalPolicyValue value; + }; +}; + +#endif // _BIDIRPOLICY_IDL_ diff --git a/dist/idl/CSI.idl b/dist/idl/CSI.idl new file mode 100644 index 0000000..dd035e1 --- /dev/null +++ b/dist/idl/CSI.idl @@ -0,0 +1,180 @@ +#ifndef _CSI_IDL_ +#define _CSI_IDL_ + +#pragma prefix "omg.org" + +module CSI { + + //typeprefix CSI "omg.org"; + + // The OMG VMCID; same value as CORBA::OMGVMCID. Do not change ever. + const unsigned long OMGVMCID = 0x4F4D0; + + // An X509CertificateChain contains an ASN.1 BER encoded SEQUENCE + // [1..MAX] OF X.509 certificates encapsulated in a sequence of octets. The + // subject's certificate shall come first in the list. Each following + // certificate shall directly certify the one preceding it. The ASN.1 + // representation of Certificate is as defined in [IETF RFC 2459]. + typedef sequence X509CertificateChain; + + // an X.501 type name or Distinguished Name encapsulated in a sequence of + // octets containing the ASN.1 encoding. + typedef sequence X501DistinguishedName; + + // UTF-8 Encoding of String + typedef sequence UTF8String; + + // ASN.1 Encoding of an OBJECT IDENTIFIER + typedef sequence OID; + typedef sequence OIDList; + + // A sequence of octets containing a GSStoken. Initial context tokens are + // ASN.1 encoded as defined in [IETF RFC 2743] 3.1, + // "Mechanism-Independent token Format", pp. 81-82. Initial context tokens + // contain an ASN.1 tag followed by a token length, a mechanism identifier, + // and a mechanism-specific token (i.e. a GSSUP::InitialContextToken). The + // encoding of all other GSS tokens (e.g. error tokens and final context + // tokens) is mechanism dependent. + typedef sequence GSSToken; + + // An encoding of a GSS Mechanism-Independent Exported Name Object as + // defined in [IETF RFC 2743] 3.2, "GSS Mechanism-Independent + // Exported Name Object Format," p. 84. + typedef sequence GSS_NT_ExportedName; + typedef sequence GSS_NT_ExportedNameList; + + // The MsgType enumeration defines the complete set of service context + // message types used by the CSI context management protocols, including + // those message types pertaining only to the stateful application of the + // protocols (to insure proper alignment of the identifiers between + // stateless and stateful implementations). Specifically, the + // MTMessageInContext is not sent by stateless clients (although it may + // be received by stateless targets). + typedef short MsgType; + const MsgType MTEstablishContext = 0; + const MsgType MTCompleteEstablishContext = 1; + const MsgType MTContextError = 4; + const MsgType MTMessageInContext = 5; + + // The ContextId type is used carry session identifiers. A stateless + // application of the service context protocol is indicated by a session + // identifier value of 0. + typedef unsigned long long ContextId; + + // The AuthorizationElementType defines the contents and encoding of + // the_element field of the AuthorizationElement. + // The high order 20-bits of each AuthorizationElementType constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the element type. The low order 12 bits + // shall contain the organization-scoped element type identifier. The + // high-order 20 bits of all element types defined by the OMG shall + // contain the VMCID allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long AuthorizationElementType; + + // An AuthorizationElementType of X509AttributeCertChain indicates that + // the_element field of the AuthorizationElement contains an ASN.1 BER + // SEQUENCE composed of an (X.509) AttributeCertificate followed by a + // SEQUENCE OF (X.509) Certificate. The two-part SEQUENCE is encapsulated + // in an octet stream. // The chain of identity certificates is provided + // shall directly certify the one preceding it. The first certificate + // in the chain shall certify the attribute certificate. The ASN.1 + // representation of (X.509) Certificate is as defined in [IETF RFC 2459]. + // The ASN.1 representation of (X.509) AtributeCertificate is as defined + // in [IETF ID PKIXAC]. + const AuthorizationElementType X509AttributeCertChain = OMGVMCID | 1; + typedef sequence AuthorizationElementContents; + + // The AuthorizationElement contains one element of an authorization token. + // Each element of an authorization token is logically a PAC. + struct AuthorizationElement { + AuthorizationElementType the_type; + AuthorizationElementContents the_element; + }; + + // The AuthorizationToken is made up of a sequence of + // AuthorizationElements + typedef sequence AuthorizationToken; + typedef unsigned long IdentityTokenType; + + // Additional standard identity token types shall only be defined by the + // OMG. All IdentityTokenType constants shall be a power of 2. + const IdentityTokenType ITTAbsent = 0; + const IdentityTokenType ITTAnonymous = 1; + const IdentityTokenType ITTPrincipalName = 2; + const IdentityTokenType ITTX509CertChain = 4; + const IdentityTokenType ITTDistinguishedName = 8; + + typedef sequence IdentityExtension; + + union IdentityToken switch ( IdentityTokenType ) { + case ITTAbsent: boolean absent; + case ITTAnonymous: boolean anonymous; + case ITTPrincipalName: GSS_NT_ExportedName principal_name; + case ITTX509CertChain: X509CertificateChain certificate_chain; + case ITTDistinguishedName: X501DistinguishedName dn; + default: IdentityExtension id; + }; + + struct EstablishContext { + ContextId client_context_id; + AuthorizationToken authorization_token; + IdentityToken identity_token; + GSSToken client_authentication_token; + }; + + struct CompleteEstablishContext { + ContextId client_context_id; + boolean context_stateful; + GSSToken final_context_token; + }; + + struct ContextError { + ContextId client_context_id; + long major_status; + long minor_status; + GSSToken error_token; + }; + + // Not sent by stateless clients. If received by a stateless server, a + // ContextError message should be returned, indicating the session does + // not exist. + struct MessageInContext { + ContextId client_context_id; + boolean discard_context; + }; + + union SASContextBody switch ( MsgType ) { + case MTEstablishContext: EstablishContext establish_msg; + case MTCompleteEstablishContext: CompleteEstablishContext complete_msg; + case MTContextError: ContextError error_msg; + case MTMessageInContext: MessageInContext in_context_msg; + }; + + // The following type represents the string representation of an ASN.1 + // OBJECT IDENTIFIER (OID). OIDs are represented by the string "oid:" + // followed by the integer base 10 representation of the OID separated + // by dots. For example, the OID corresponding to the OMG is represented + // as: "oid:2.23.130" + typedef string StringOID; + + // The GSS Object Identifier for the KRB5 mechanism is: + // { iso(1) member-body(2) United States(840) mit(113554) infosys(1) + // gssapi(2) krb5(2) } + const StringOID KRB5MechOID = "oid:1.2.840.113554.1.2.2"; + + // The GSS Object Identifier for name objects of the Mechanism-independent + // Exported Name Object type is: + // { iso(1) org(3) dod(6) internet(1) security(5) nametypes(6) + // gss-api-exported-name(4) } + const StringOID GSS_NT_Export_Name_OID = "oid:1.3.6.1.5.6.4"; + + // The GSS Object Identifier for the scoped-username name form is: + // { iso-itu-t (2) international-organization (23) omg (130) security (1) + // naming (2) scoped-username(1) } + const StringOID GSS_NT_Scoped_Username_OID = "oid:2.23.130.1.2.1"; + +}; // CSI + +#endif + + diff --git a/dist/idl/CSIIOP.idl b/dist/idl/CSIIOP.idl new file mode 100644 index 0000000..07128a5 --- /dev/null +++ b/dist/idl/CSIIOP.idl @@ -0,0 +1,116 @@ +#ifndef _CSIIOP_IDL_ +#define _CSIIOP_IDL_ + +#include +#include "CSI.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module CSIIOP { + + //typeprefix CIIOP "omg.org"; + + // Association options + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + const AssociationOptions IdentityAssertion = 1024; + const AssociationOptions DelegationByClient = 2048; + + // The high order 20-bits of each ServiceConfigurationSyntax constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the syntax. The low order 12 bits shall + // contain the organization-scoped syntax identifier. The high-order 20 + // bits of all syntaxes defined by the OMG shall contain the VMCID + // allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long ServiceConfigurationSyntax; + const ServiceConfigurationSyntax SCS_GeneralNames = CSI::OMGVMCID | 0; + const ServiceConfigurationSyntax SCS_GSSExportedName = CSI::OMGVMCID | 1; + typedef sequence ServiceSpecificName; + + // The name field of the ServiceConfiguration structure identifies a + // privilege authority in the format identified in the syntax field. If the + // syntax is SCS_GeneralNames, the name field contains an ASN.1 (BER) + // SEQUENCE [1..MAX] OF GeneralName, as defined by the type GeneralNames in + // [IETF RFC 2459]. If the syntax is SCS_GSSExportedName, the name field + // contains a GSS exported name encoded according to the rules in + // [IETF RFC 2743] 3.2, "Mechanism-Independent Exported Name + // Object Format," p. 84. + struct ServiceConfiguration { + ServiceConfigurationSyntax syntax; + ServiceSpecificName name; + }; + typedef sequence ServiceConfigurationList; + + // The body of the TAG_NULL_TAG component is a sequence of octets of + // length 0. + // type used to define AS layer functionality within a compound mechanism + // definition + struct AS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID client_authentication_mech; + CSI::GSS_NT_ExportedName target_name; + }; + + // type used to define SAS layer functionality within a compound mechanism + // definition + struct SAS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + ServiceConfigurationList privilege_authorities; + CSI::OIDList supported_naming_mechanisms; + CSI::IdentityTokenType supported_identity_types; + }; + + // type used in the body of a TAG_CSI_SEC_MECH_LIST component to + // describe a compound mechanism + struct CompoundSecMech { + AssociationOptions target_requires; + IOP::TaggedComponent transport_mech; + AS_ContextSec as_context_mech; + SAS_ContextSec sas_context_mech; + }; + typedef sequence CompoundSecMechanisms; + + // type corresponding to the body of a TAG_CSI_SEC_MECH_LIST + // component + struct CompoundSecMechList { + boolean stateful; + CompoundSecMechanisms mechanism_list; + }; + struct TransportAddress { + string host_name; + unsigned short port; + }; + typedef sequence TransportAddressList; + + // Tagged component for configuring SECIOP as a CSIv2 transport mechanism + const IOP::ComponentId TAG_SECIOP_SEC_TRANS = 35; + + struct SECIOP_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID mech_oid; + CSI::GSS_NT_ExportedName target_name; + TransportAddressList addresses; + }; + // tagged component for configuring TLS/SSL as a CSIv2 transport mechanism + const IOP::ComponentId TAG_TLS_SEC_TRANS = 36; + struct TLS_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + TransportAddressList addresses; + }; + +}; //CSIIOP +#endif diff --git a/dist/idl/Compression.idl b/dist/idl/Compression.idl new file mode 100644 index 0000000..18894ee --- /dev/null +++ b/dist/idl/Compression.idl @@ -0,0 +1,185 @@ +// -*- IDL -*- + +#ifndef _COMPRESSION_ +#define _COMPRESSION_ + +#include + +#pragma prefix "omg.org" + +module Compression +{ + + /** + * Exception thrown when an error occurs during a compress or decompress + * operation. + */ + exception CompressionException + { + long reason; + string description; + }; + + /** + * Exception thrown if a CompressorFactory with the same CompressorId is + * already registered with the CompressionManager. + */ + exception FactoryAlreadyRegistered + { + }; + + /** + * Exception thrown if a CompressorId is not known. + */ + exception UnknownCompressorId + { + }; + + /** + * CompressorId type. + */ + typedef unsigned short CompressorId; + const CompressorId COMPRESSORID_NONE = 0; + const CompressorId COMPRESSORID_GZIP = 1; + const CompressorId COMPRESSORID_PKZIP = 2; + const CompressorId COMPRESSORID_BZIP2 = 3; + const CompressorId COMPRESSORID_ZLIB = 4; + const CompressorId COMPRESSORID_LZMA = 5; + const CompressorId COMPRESSORID_LZOP = 6; + const CompressorId COMPRESSORID_RZIP = 7; + const CompressorId COMPRESSORID_7X = 8; + const CompressorId COMPRESSORID_XAR = 9; + + + + /** + * CompressorIdList type. + */ + //typedef sequence CompressorIdList; + + + + /** + * CompressionLevel type. + */ + typedef unsigned short CompressionLevel; + typedef float CompressionRatio; + + struct CompressorIdLevel { + CompressorId compressor_id; + CompressionLevel compression_level; + }; + typedef sequence CompressorIdLevelList; + + typedef CORBA::OctetSeq Buffer; + + local interface CompressorFactory; + + /** + * Compressor - abstraction of a compressor and decompressor. + */ + local interface Compressor + { + /** + * Operation that compresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the compression, it + * throws CompressionException + */ + void compress(in Buffer source, inout Buffer target) + raises (CompressionException); + /** + * Operation that decompresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the decompression, it + * throws CompressionException + */ + void decompress(in Buffer source, inout Buffer target) + raises(CompressionException); + /** + * The CompressorFactory associated with this Compressor. + */ + readonly attribute CompressorFactory compressor_factory; + /** + * The (implementation and algorithm specific) compression level + * associated with this Compressor. + */ + readonly attribute CompressionLevel compression_level; + /** + * The total number of compressed bytes read and written by Compressors + * that were created by this CompressorFactory + * (i.e. the "target" side of Compressor::compress and + * the "source" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long compressed_bytes; + /** + * The total number of uncompressed bytes read and written by + * Compressors that were created by this CompressorFactory + * (i.e. the "source" side of Compressor::compress and + * the "target" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long uncompressed_bytes; + /** + * This attribute represents the compression ratio achieved by + * this compressor. The ratio can be obtained with the following + * formula: 100 - (compressed_length / original_length)*100. + */ + readonly attribute CompressionRatio compression_ratio; + + }; + + local interface CompressorFactory + { + /** + * The CompressorId associated with this CompressorFactory + */ + readonly attribute CompressorId compressor_id; + + /** + * Create a Compressor instance with the given compression level. + */ + Compressor get_compressor(in CompressionLevel compression_level); + }; + + typedef sequence CompressorFactorySeq; + + /** + * Per-ORB interface to register and unregister CompressorFactories. + * Initial reference: "CompressionManager" + */ + local interface CompressionManager + { + /** + * Register a new CompressorFactory + */ + void register_factory(in CompressorFactory compressor_factory) + raises(FactoryAlreadyRegistered); + /** + * Unregister a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + void unregister_factory(in CompressorId compressor_id) + raises (UnknownCompressorId); + /** + * Retrieve a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + CompressorFactory get_factory(in CompressorId compressor_id) + raises(UnknownCompressorId); + /** + * Create a Compressor with the given compression_level from the + * CompressorFactory with the given CompressorId + */ + Compressor get_compressor(in CompressorId compressor_id, + in CompressionLevel compression_level) + raises(UnknownCompressorId); + /** + * List all registered CompressorFactories + */ + CompressorFactorySeq get_factories(); + + + }; + + +}; + +#endif diff --git a/dist/idl/CosNaming.idl b/dist/idl/CosNaming.idl new file mode 100644 index 0000000..2cdb8f7 --- /dev/null +++ b/dist/idl/CosNaming.idl @@ -0,0 +1,108 @@ +// File: CosNaming.idl + +#ifndef _COSNAMING_IDL_ +#define _COSNAMING_IDL_ + +#pragma prefix "omg.org" + +module CosNaming { + typedef string Istring; + + struct NameComponent { + Istring id; + Istring kind; + }; + + typedef sequence Name; + + enum BindingType { nobject, ncontext }; + + struct Binding { + Name binding_name; + BindingType binding_type; + }; + + // Note: In struct Binding, binding_name is incorrectly defined + // as a Name instead of a NameComponent. This definition is + // unchanged for compatibility reasons. + + typedef sequence BindingList; + + interface BindingIterator; + + interface NamingContext { + enum NotFoundReason { missing_node, not_context, not_object }; + + exception NotFound { + NotFoundReason why; + Name rest_of_name; + }; + + exception CannotProceed { + NamingContext cxt; + Name rest_of_name; + }; + + exception InvalidName{}; + exception AlreadyBound {}; + exception NotEmpty{}; + + void bind(in Name n, in Object obj) + raises( NotFound, CannotProceed, InvalidName, AlreadyBound ); + + void rebind(in Name n, in Object obj) + raises(NotFound, CannotProceed, InvalidName); + + void bind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + + void rebind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName); + + Object resolve (in Name n) raises(NotFound, CannotProceed, InvalidName); + + void unbind(in Name n) raises(NotFound, CannotProceed, InvalidName); + + NamingContext new_context(); + + NamingContext bind_new_context(in Name n) + raises( NotFound, AlreadyBound, CannotProceed, InvalidName ); + + void destroy() raises(NotEmpty); + + void list( in unsigned long how_many, out BindingList bl, out BindingIterator bi ); + + }; + + interface BindingIterator { + + boolean next_one(out Binding b); + + boolean next_n(in unsigned long how_many, out BindingList bl); + + void destroy(); + + }; + + interface NamingContextExt: NamingContext { + + typedef string StringName; + typedef string Address; + typedef string URLString; + + StringName to_string(in Name n) raises(InvalidName); + + Name to_name(in StringName sn) raises(InvalidName); + + exception InvalidAddress {}; + + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); + + Object resolve_str(in StringName sn) + raises( NotFound, CannotProceed, InvalidName); + }; + +}; + +#endif // _COSNAMING_IDL_ diff --git a/dist/idl/Dynamic.idl b/dist/idl/Dynamic.idl new file mode 100644 index 0000000..0c10554 --- /dev/null +++ b/dist/idl/Dynamic.idl @@ -0,0 +1,19 @@ +// File: Dynamic.idl +// CORBA 3.0, Chapter 21 + +#pragma prefix "omg.org" +#include + +module Dynamic { + + struct Parameter { + any argument; + CORBA::ParameterMode mode; + }; + + typedef sequence ParameterList; + typedef CORBA::StringSeq ContextList; + typedef sequence ExceptionList; + typedef CORBA::StringSeq RequestContext; + +}; // module Dynamic diff --git a/dist/idl/DynamicAny.idl b/dist/idl/DynamicAny.idl new file mode 100644 index 0000000..c588842 --- /dev/null +++ b/dist/idl/DynamicAny.idl @@ -0,0 +1,290 @@ +// IDL +// File: DynamicAny.idl +#ifndef _DYNAMIC_ANY_IDL_ +#define _DYNAMIC_ANY_IDL_ + +#include + +#pragma prefix "omg.org" + +module DynamicAny { + local interface DynAny { + + exception InvalidValue {}; + exception TypeMismatch {}; + + CORBA::TypeCode type(); + + void assign(in DynAny dyn_any) raises(TypeMismatch); + + void from_any(in any value) raises(TypeMismatch, InvalidValue); + + any to_any(); + + boolean equal(in DynAny dyn_any); + + void destroy(); + + DynAny copy(); + + void insert_boolean(in boolean value) raises(TypeMismatch, InvalidValue); + void insert_octet(in octet value) raises(TypeMismatch, InvalidValue); + void insert_char(in char value) raises(TypeMismatch, InvalidValue); + void insert_short(in short value) raises(TypeMismatch, InvalidValue); + void insert_ushort(in unsigned short value) raises(TypeMismatch,InvalidValue); + void insert_long(in long value) raises(TypeMismatch, InvalidValue); + void insert_ulong(in unsigned long value) raises(TypeMismatch,InvalidValue); + void insert_float(in float value) raises(TypeMismatch, InvalidValue); + void insert_double(in double value) raises(TypeMismatch, InvalidValue); + void insert_string(in string value) raises(TypeMismatch, InvalidValue); + void insert_reference(in Object value) raises(TypeMismatch, InvalidValue); + void insert_typecode(in CORBA::TypeCode value) raises(TypeMismatch,InvalidValue); + void insert_longlong(in long long value) raises(TypeMismatch,InvalidValue); + void insert_ulonglong(in unsigned long long value) raises(TypeMismatch,InvalidValue); + //void insert_longdouble(in long double value) raises(TypeMismatch,InvalidValue); + void insert_wchar(in wchar value) raises(TypeMismatch, InvalidValue); + void insert_wstring(in wstring value) raises(TypeMismatch, InvalidValue); + void insert_any(in any value) raises(TypeMismatch, InvalidValue); + void insert_dyn_any(in DynAny value) raises(TypeMismatch, InvalidValue); + void insert_val(in ValueBase value) raises(TypeMismatch, InvalidValue); + + boolean get_boolean() raises(TypeMismatch, InvalidValue); + octet get_octet() raises(TypeMismatch, InvalidValue); + char get_char() raises(TypeMismatch, InvalidValue); + short get_short() raises(TypeMismatch, InvalidValue); + unsigned short get_ushort() raises(TypeMismatch, InvalidValue); + long get_long() raises(TypeMismatch, InvalidValue); + unsigned long get_ulong() raises(TypeMismatch, InvalidValue); + float get_float() raises(TypeMismatch, InvalidValue); + double get_double() raises(TypeMismatch, InvalidValue); + string get_string() raises(TypeMismatch, InvalidValue); + Object get_reference() raises(TypeMismatch, InvalidValue); + CORBA::TypeCode get_typecode() raises(TypeMismatch, InvalidValue); + long long get_longlong() raises(TypeMismatch, InvalidValue); + unsigned long long get_ulonglong() raises(TypeMismatch, InvalidValue); + //long double get_longdouble() raises(TypeMismatch, InvalidValue); + wchar get_wchar() raises(TypeMismatch, InvalidValue); + wstring get_wstring() raises(TypeMismatch, InvalidValue); + any get_any() raises(TypeMismatch, InvalidValue); + DynAny get_dyn_any() raises(TypeMismatch, InvalidValue); + ValueBase get_val() raises(TypeMismatch, InvalidValue); + + boolean seek(in long index); + void rewind(); + boolean next(); + unsigned long component_count(); + DynAny current_component() raises(TypeMismatch); + + void insert_abstract(in CORBA::AbstractBase value) + raises(TypeMismatch, InvalidValue); + + CORBA::AbstractBase get_abstract() + raises(TypeMismatch, InvalidValue); + + void insert_boolean_seq(in CORBA::BooleanSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_octet_seq(in CORBA::OctetSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_char_seq(in CORBA::CharSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_short_seq(in CORBA::ShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ushort_seq(in CORBA::UShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_long_seq(in CORBA::LongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulong_seq(in CORBA::ULongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_float_seq(in CORBA::FloatSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_double_seq(in CORBA::DoubleSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_longlong_seq(in CORBA::LongLongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulonglong_seq(in CORBA::ULongLongSeq value) + raises(TypeMismatch, InvalidValue); + + // void insert_longdouble_seq(in CORBA::LongDoubleSeq value) + // raises(TypeMismatch, InvalidValue); + + void insert_wchar_seq(in CORBA::WCharSeq value) + raises(TypeMismatch, InvalidValue); + + CORBA::BooleanSeq get_boolean_seq() raises(TypeMismatch, InvalidValue); + + CORBA::OctetSeq get_octet_seq() raises(TypeMismatch, InvalidValue); + + CORBA::CharSeq get_char_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ShortSeq get_short_seq() raises(TypeMismatch, InvalidValue); + + CORBA::UShortSeq get_ushort_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongSeq get_long_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongSeq get_ulong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::FloatSeq get_float_seq() raises(TypeMismatch, InvalidValue); + + CORBA::DoubleSeq get_double_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongLongSeq get_longlong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongLongSeq get_ulonglong_seq() raises(TypeMismatch, InvalidValue); + + // CORBA::LongDoubleSeq get_longdouble_seq() raises(TypeMismatch, InvalidValue); + + CORBA::WCharSeq get_wchar_seq() raises(TypeMismatch, InvalidValue); + + }; + + local interface DynFixed: DynAny { + string get_value(); + boolean set_value(in string val) raises(TypeMismatch, InvalidValue); + }; + + + local interface DynEnum : DynAny { + string get_as_string(); + void set_as_string(in string value) raises(InvalidValue); + unsigned long get_as_ulong(); + void set_as_ulong(in unsigned long value) raises(InvalidValue); + }; + + typedef string FieldName; + struct NameValuePair { + FieldName id; + any value; + }; + + typedef sequence NameValuePairSeq; + + struct NameDynAnyPair { + FieldName id; + DynAny value; + }; + + typedef sequence NameDynAnyPairSeq; + + local interface DynStruct : DynAny { + + FieldName current_member_name() raises(TypeMismatch, InvalidValue); + + CORBA::TCKind current_member_kind() raises(TypeMismatch, InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) + raises(TypeMismatch, InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) + raises(TypeMismatch, InvalidValue); + }; + + + local interface DynUnion : DynAny { + + DynAny get_discriminator(); + + void set_discriminator(in DynAny d) raises(TypeMismatch); + + void set_to_default_member() raises(TypeMismatch); + + void set_to_no_active_member() raises(TypeMismatch); + + boolean has_no_active_member(); + + CORBA::TCKind discriminator_kind(); + + DynAny member() raises(InvalidValue); + + FieldName member_name() raises(InvalidValue); + + CORBA::TCKind member_kind() raises(InvalidValue); + + }; + + typedef sequence AnySeq; + + typedef sequence DynAnySeq; + + local interface DynSequence : DynAny { + + unsigned long get_length(); + + void set_length(in unsigned long len) raises(InvalidValue); + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch,InvalidValue); + + }; + + local interface DynArray : DynAny { + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch, InvalidValue); + + }; + + local interface DynValueCommon : DynAny { + + boolean is_null(); + + void set_to_null(); + + void set_to_value(); + + }; + + local interface DynValue : DynValueCommon { + + FieldName current_member_name()raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + CORBA::TCKind current_member_kind() raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + }; + + local interface DynAnyFactory { + + exception InconsistentTypeCode {}; + + DynAny create_dyn_any(in any value) raises(InconsistentTypeCode); + + DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) raises(InconsistentTypeCode); + + }; + +}; // module DynamicAny + +#endif // _DYNAMIC_ANY_IDL_ + diff --git a/dist/idl/GIOP.idl b/dist/idl/GIOP.idl new file mode 100644 index 0000000..263497f --- /dev/null +++ b/dist/idl/GIOP.idl @@ -0,0 +1,200 @@ + +#include "IOP.idl" + +#pragma prefix "omg.org" + +module GIOP { // IDL extended for version 1.1 and 1.2 + + struct Version { + octet major; + octet minor; + }; + + #ifndef GIOP_1_1 + // GIOP 1.0 + enum MsgType_1_0{ // rename from MsgType + Request, Reply, CancelRequest, + LocateRequest, LocateReply, + CloseConnection, MessageError + }; + #else + // GIOP 1.1 + enum MsgType_1_1{ + Request, Reply, CancelRequest, + LocateRequest, LocateReply, + CloseConnection, MessageError, + Fragment // GIOP 1.1 addition + }; + #endif + + // GIOP 1.0 + struct MessageHeader_1_0 {// Renamed from MessageHeader + char magic [4]; + Version GIOP_version; + boolean byte_order; + octet message_type; + unsigned long message_size; + }; + + // GIOP 1.1 + struct MessageHeader_1_1 { + char magic [4]; + Version GIOP_version; + octet flags; // GIOP 1.1 change + octet message_type; + unsigned long message_size; + }; + + // GIOP 1.2 + typedef MessageHeader_1_1 MessageHeader_1_2; + + // GIOP 1.0 + struct RequestHeader _1_0 { + IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + sequence object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.1 + struct RequestHeader_1_1 { + IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + octet reserved[3]; // Added in GIOP 1.1 + sequence object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.2 + typedef short AddressingDisposition; + const short KeyAddr = 0; + const short ProfileAddr = 1; + const short ReferenceAddr = 2; + + struct IORAddressingInfo { + unsigned long selected_profile_index; + IOP::IOR ior; + }; + + union TargetAddress switch (AddressingDisposition) { + case KeyAddr: sequence object_key; + case ProfileAddr: IOP::TaggedProfile profile; + case ReferenceAddr: IORAddressingInfo ior; + }; + + struct RequestHeader_1_2 { + unsigned long request_id; + octet response_flags; + octet reserved[3]; + TargetAddress target; + string operation; + // requesting_principal not in GIOP 1.2 + IOP::ServiceContextList service_context; // 1.2 change + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum ReplyStatusType_1_0 {// Renamed from ReplyStatusType + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD + }; + + // GIOP 1.0 + struct ReplyHeader_1_0 {// Renamed from ReplyHeader + IOP::ServiceContextList service_context; + unsigned long request_id; + ReplyStatusType_1_0 reply_status; + }; + + // GIOP 1.1 + typedef ReplyHeader_1_0 ReplyHeader_1_1; + + // Same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum ReplyStatusType_1_2 { + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD, + LOCATION_FORWARD_PERM, // new value for 1.2 + NEEDS_ADDRESSING_MODE // new value for 1.2 + }; + struct ReplyHeader_1_2 { + unsigned long request_id; + ReplyStatusType_1_2 reply_status; + IOP:ServiceContextList service_context; // 1.2 change + }; + #endif // GIOP_1_2 + + struct SystemExceptionReplyBody { + string exception_id; + unsigned long minor_code_value; + unsigned long completion_status; + }; + + struct CancelRequestHeader { + unsigned long request_id; + }; + + // GIOP 1.0 + struct LocateRequestHeader_1_0 { + // Renamed LocationRequestHeader + unsigned long request_id; + sequence object_key; + }; + // GIOP 1.1 + typedef LocateRequestHeader_1_0 LocateRequestHeader_1_1; + // Same Header contents for 1.0 and 1.1 + + // GIOP 1.2 + struct LocateRequestHeader_1_2 { + unsigned long request_id; + TargetAddress target; + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum LocateStatusType_1_0 {// Renamed from LocateStatusType + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD + }; + + // GIOP 1.0 + struct LocateReplyHeader_1_0 { + // Renamed from LocateReplyHeader + unsigned long request_id; + LocateStatusType_1_0 locate_status; + }; + + // GIOP 1.1 + typedef LocateReplyHeader_1_0 LocateReplyHeader_1_1; + // same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum LocateStatusType_1_2 { + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD, + OBJECT_FORWARD_PERM, // new value for GIOP 1.2 + LOC_SYSTEM_EXCEPTION, // new value for GIOP 1.2 + LOC_NEEDS_ADDRESSING_MODE // new value for GIOP 1.2 + }; + struct LocateReplyHeader_1_2 { + unsigned long request_id; + LocateStatusType_1_2 locate_status; + }; + #endif // GIOP_1_2 + + // GIOP 1.2 + struct FragmentHeader_1_2 { + unsigned long request_id; + }; +}; \ No newline at end of file diff --git a/dist/idl/IIOP.idl b/dist/idl/IIOP.idl new file mode 100644 index 0000000..cefadf1 --- /dev/null +++ b/dist/idl/IIOP.idl @@ -0,0 +1,37 @@ +#include "IOP.idl" + +#pragma prefix "omg.org" + +module IIOP { // IDL extended for version 1.1 and 1.2 + struct Version { + octet major; + octet minor; + }; + + struct ProfileBody_1_0 {// renamed from ProfileBody + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + }; + + struct ProfileBody_1_1 {// also used for 1.2 + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + // Added in 1.1 unchanged for 1.2 + sequence components; + }; + + struct ListenPoint { + string host; + unsigned short port; + }; + + typedef sequence ListenPointList; + + struct BiDirIIOPServiceContext {// BI_DIR_IIOP Service Context + ListenPointList listen_points; + }; +}; \ No newline at end of file diff --git a/dist/idl/IOP.idl b/dist/idl/IOP.idl new file mode 100644 index 0000000..e73d551 --- /dev/null +++ b/dist/idl/IOP.idl @@ -0,0 +1,134 @@ + +#include + +#pragma prefix "omg.org" + +module IOP { + + // Standard Protocol Profile tag values + + typedef unsigned long ProfileId; + + const ProfileId TAG_INTERNET_IOP = 0; + + const ProfileId TAG_MULTIPLE_COMPONENTS = 1; + + struct TaggedProfile { + ProfileId tag; + sequence profile_data; + }; + + // an Interoperable Object Reference is a sequence of + // object-specific protocol profiles, plus a type ID. + struct IOR { + string type_id; + sequence profiles; + }; + + // Standard way of representing multicomponent profiles. + + // This would be encapsulated in a TaggedProfile. + + typedef unsigned long ComponentId; + + struct TaggedComponent { + ComponentId tag; + sequence component_data; + }; + + + typedef sequence MultipleComponentProfile; + + typedef sequence TaggedComponentSeq; + + // CORBA 2.4 + const ComponentId TAG_ORB_TYPE = 0; + const ComponentId TAG_CODE_SETS = 1; + const ComponentId TAG_POLICIES = 2; + const ComponentId TAG_ALTERNATE_IIOP_ADDRESS = 3; + const ComponentId TAG_ASSOCIATION_OPTIONS = 13; + const ComponentId TAG_SEC_NAME = 14; + const ComponentId TAG_SPKM_1_SEC_MECH = 15; + const ComponentId TAG_SPKM_2_SEC_MECH = 16; + const ComponentId TAG_KerberosV5_SEC_MECH = 17; + const ComponentId TAG_CSI_ECMA_Secret_SEC_MECH = 18; + const ComponentId TAG_CSI_ECMA_Hybrid_SEC_MECH = 19; + const ComponentId TAG_SSL_SEC_TRANS = 20; + const ComponentId TAG_CSI_ECMA_Public_SEC_MECH = 21; + const ComponentId TAG_GENERIC_SEC_MECH = 22; + const ComponentId TAG_FIREWALL_TRANS = 23; + const ComponentId TAG_SCCP_CONTACT_INFO = 24; + const ComponentId TAG_JAVA_CODEBASE = 25; + const ComponentId TAG_TRANSACTION_POLICY = 26; + const ComponentId TAG_MESSAGE_ROUTERS = 30; + const ComponentId TAG_OTS_POLICY = 31; + const ComponentId TAG_INV_POLICY = 32; + const ComponentId TAG_CSI_SEC_MECH_LIST = 33; + const ComponentId TAG_NULL_TAG = 34; + const ComponentId TAG_TLS_SEC_TRANS = 36; + const ComponentId TAG_INET_SEC_TRANS = 123; + const ComponentId TAG_COMPLETE_OBJECT_KEY = 5; + const ComponentId TAG_ENDPOINT_ID_POSITION = 6; + const ComponentId TAG_LOCATION_POLICY = 12; + const ComponentId TAG_DCE_STRING_BINDING = 100; + const ComponentId TAG_DCE_BINDING_NAME = 101; + const ComponentId TAG_DCE_NO_PIPES = 102; + const ComponentId TAG_DCE_SEC_MECH = 103; // Security Service + + typedef unsigned long ServiceId; + + struct ServiceContext { + ServiceId context_id; + sequence context_data; + }; + + typedef sequence ServiceContextList; + + const ServiceId TransactionService = 0; + const ServiceId CodeSets = 1; + const ServiceId ChainBypassCheck = 2; + const ServiceId ChainBypassInfo = 3; + const ServiceId LogicalThreadId = 4; + const ServiceId BI_DIR_IIOP = 5; + const ServiceId SendingContextRunTime = 6; + const ServiceId INVOCATION_POLICIES = 7; + const ServiceId FORWARDED_IDENTITY = 8; + const ServiceId UnknownExceptionInfo = 9; + const ServiceId RTCorbaPriority = 10; + const ServiceId RTCorbaPriorityRange = 11; + const ServiceId ExceptionDetailMessage = 14; + const ServiceId SecurityAttributeService = 15; + + local interface Codec { + + exception InvalidTypeForEncoding {}; + exception FormatMismatch {}; + exception TypeMismatch {}; + + CORBA::OctetSeq encode (in any data) raises (InvalidTypeForEncoding); + + any decode (in CORBA::OctetSeq data) raises (FormatMismatch); + + CORBA::OctetSeq encode_value (in any data) raises (InvalidTypeForEncoding); + + any decode_value (in CORBA::OctetSeq data, in CORBA::TypeCode tc) + raises (FormatMismatch, TypeMismatch); + }; + + + typedef short EncodingFormat; + + const EncodingFormat ENCODING_CDR_ENCAPS = 0; + + struct Encoding { + EncodingFormat format; + octet major_version; + octet minor_version; + }; + + local interface CodecFactory { + exception UnknownEncoding {}; + + Codec create_codec (in Encoding enc) raises (UnknownEncoding); + }; +}; diff --git a/dist/idl/Messaging.idl b/dist/idl/Messaging.idl new file mode 100644 index 0000000..c1cde05 --- /dev/null +++ b/dist/idl/Messaging.idl @@ -0,0 +1,171 @@ +#ifndef __CORBA_MESSAGING_ +#define __CORBA_MESSAGING_ + +#include +#include "IOP.idl" +#include "TimeBase.idl" +#include "Dynamic.idl" + +#pragma prefix "omg.org" + +module Messaging { + + typedef short RebindMode; + const RebindMode TRANSPARENT = 0; + const RebindMode NO_REBIND = 1; + const RebindMode NO_RECONNECT = 2; + + typedef short SyncScope; + const SyncScope SYNC_NONE = 0; + const SyncScope SYNC_WITH_TRANSPORT = 1; + const SyncScope SYNC_WITH_SERVER = 2; + const SyncScope SYNC_WITH_TARGET = 3; + + typedef short RoutingType; + const RoutingType ROUTE_NONE = 0; + const RoutingType ROUTE_FORWARD = 1; + const RoutingType ROUTE_STORE_AND_FORWARD = 2; + + + typedef short Priority; + + typedef unsigned short Ordering; + const Ordering ORDER_ANY = 0x01; + const Ordering ORDER_TEMPORAL = 0x02; + const Ordering ORDER_PRIORITY = 0x04; + const Ordering ORDER_DEADLINE = 0x08; + + // Rebind Policy (default = TRANSPARENT) + + const CORBA::PolicyType REBIND_POLICY_TYPE = 23; + + local interface RebindPolicy : CORBA::Policy { + readonly attribute RebindMode rebind_mode; + }; + + // Synchronization Policy (default = SYNC_WITH_TRANSPORT) + + const CORBA::PolicyType SYNC_SCOPE_POLICY_TYPE = 24; + local interface SyncScopePolicy : CORBA::Policy { + readonly attribute SyncScope synchronization; + }; + + // Priority Policies + + const CORBA::PolicyType REQUEST_PRIORITY_POLICY_TYPE = 25; + + struct PriorityRange { + Priority min; + Priority max; + }; + + local interface RequestPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + const CORBA::PolicyType REPLY_PRIORITY_POLICY_TYPE = 26; + + interface ReplyPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + // Timeout Policies + + const CORBA::PolicyType REQUEST_START_TIME_POLICY_TYPE = 27; + + local interface RequestStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REQUEST_END_TIME_POLICY_TYPE = 28; + + local interface RequestEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType REPLY_START_TIME_POLICY_TYPE = 29; + + local interface ReplyStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REPLY_END_TIME_POLICY_TYPE = 30; + + local interface ReplyEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType RELATIVE_REQ_TIMEOUT_POLICY_TYPE = 31; + + local interface RelativeRequestTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType RELATIVE_RT_TIMEOUT_POLICY_TYPE = 32; + + local interface RelativeRoundtripTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType ROUTING_POLICY_TYPE = 33; + + struct RoutingTypeRange { + RoutingType min; + RoutingType max; + }; + + local interface RoutingPolicy : CORBA::Policy { + readonly attribute RoutingTypeRange routing_range; + }; + + const CORBA::PolicyType MAX_HOPS_POLICY_TYPE = 34; + + local interface MaxHopsPolicy : CORBA::Policy { + readonly attribute unsigned short max_hops; + }; + + // Router Delivery-ordering Policy (default = ORDER_TEMPORAL) + + const CORBA::PolicyType QUEUE_ORDER_POLICY_TYPE = 35; + + local interface QueueOrderPolicy : CORBA::Policy { + readonly attribute Ordering allowed_orders; + }; + + + struct PolicyValue { + CORBA::PolicyType ptype; + sequence pvalue; + }; + + typedef sequence PolicyValueSeq; + + const IOP::ComponentId TAG_POLICIES = 2; + const IOP::ServiceId INVOCATION_POLICIES = 7; + + // + // Exception Delivery in the Callback Model + // + + typedef CORBA::OctetSeq MarshaledException; + native UserExceptionBase; + + valuetype ExceptionHolder { + void raise_exception() raises (UserExceptionBase); + void raise_exception_with_list(in Dynamic::ExceptionList exc_list) + raises (UserExceptionBase); + + private boolean is_system_exception; + private boolean byte_order; + private MarshaledException marshaled_exception; + }; + + + // + // Base interface for the Callback model + // + + interface ReplyHandler { }; +}; + +#endif diff --git a/dist/idl/SSLIOP.idl b/dist/idl/SSLIOP.idl new file mode 100644 index 0000000..d985dd0 --- /dev/null +++ b/dist/idl/SSLIOP.idl @@ -0,0 +1,20 @@ +#if !defined(_SSLIOP_IDL) +#define _SSLIOP_IDL + +#pragma prefix "omg.org" + +#include +#include + +module SSLIOP { + // Security mechanism SSL + const IOP::ComponentId TAG_SSL_SEC_TRANS = 20; + + struct SSL { + Security::AssociationOptions target_supports; + Security::AssociationOptions target_requires; + unsigned short port; + }; + +}; +#endif /* _SSLIOP_IDL */ diff --git a/dist/idl/Security.idl b/dist/idl/Security.idl new file mode 100644 index 0000000..b78dabd --- /dev/null +++ b/dist/idl/Security.idl @@ -0,0 +1,329 @@ +//Security Service, v1.8 - OMG IDL Summary File +//Object Management Group, Inc. +// +//Copyright 1995, AT&T Global Information Solutions Company +//Copyright 1995, Digital Equipment Corporation +//Copyright 1995, Expersoft Corporation +//Copyright 1995, Groupe Bull +//Copyright 1995, Hewlett-Packard Company +//Copyright 1995, IBM (in collaboration with Taligent, Inc.) +//Copyright 1995, International Computers Limited +//Copyright 2000, Object Management Group, Inc. +//Copyright 1995, Netscape Communications Corporation +//Copyright 1997, Northern Telecom Limited +//Copyright 1995, Novell, Inc. +//Copyright 1995, Siemens Nixdorf Informationssysteme AG +//Copyright 1995, 1997, SunSoft, Inc. +//Copyright 1995, Tandem Computer, Inc. (in collaboration with Odyssey Research Assoc, Inc.) +//Copyright 1995, Tivoli Systems, Inc. +//Copyright 1997, Visigenic Software, Inc. +// +//The companies listed above have granted to the Object Management Group, Inc. +//(OMG) a nonexclusive, royalty-free, paid up, worldwide license to copy and +//distribute this document and to modify this document and distribute copies of +//the modified version. Each of the copyright holders listed above has agreed +//that no person shall be deemed to have infringed the copyright in the included +//material of any such copyright holder by reason of having used the +//specification set forth herein or having conformed any computer software to +//the specification. +// +//This file contains OMG IDL from the Security Service, v1.8 specification. +//OMG regularly publishes a summary file that contains all the "code" parts of +//an OMG formal document. Every formal document line that is IDL, PIDL, or +//language code is included in the summary file. The reason for such a listing +//is to give readers an electronic version of the "code" so that they can +//extract pieces of it. Readers might want to test an example, include it in +//their own code, or use it for documentation purposes. Having the code lines +//available electronically means there is less likelihood of a transcription +//error. +// +//This subsection defines the OMG IDL for security data types common to the //other security modules, which is the module Security. The Security module //depends on the TimeBase module and the CORBA module. + + +#if !defined(_SECURITY_IDL_) +#define _SECURITY_IDL_ + +#include +#include + +#pragma prefix "omg.org" + +module Security { + //# pragma version Security 1.8 + typedef string SecurityName; + typedef sequence Opaque; + // Constant declarations for Security Service Options + const CORBA::ServiceOption SecurityLevel1 = 1; + const CORBA::ServiceOption SecurityLevel2 = 2; + const CORBA::ServiceOption NonRepudiation = 3; + const CORBA::ServiceOption SecurityORBServiceReady = 4; + const CORBA::ServiceOption SecurityServiceReady = 5; + const CORBA::ServiceOption ReplaceORBServices = 6; + const CORBA::ServiceOption ReplaceSecurityServices = 7; + const CORBA::ServiceOption StandardSecureInteroperability = 8; + const CORBA::ServiceOption DCESecureInteroperability = 9; + // Service options for Common Secure Interoperability + const CORBA::ServiceOption CommonInteroperabilityLevel0 = 10; + const CORBA::ServiceOption CommonInteroperabilityLevel1 = 11; + const CORBA::ServiceOption CommonInteroperabilityLevel2 = 12; + // Security mech types supported for secure association + const CORBA::ServiceDetailType SecurityMechanismType = 1; + // privilege types supported in standard access policy + const CORBA::ServiceDetailType SecurityAttribute = 2; + // extensible families for standard data types + struct ExtensibleFamily { + unsigned short family_definer; + unsigned short family; + }; + typedef sequence OID; + typedef sequence OIDList; + // security attributes + typedef unsigned long SecurityAttributeType; + // other attributes; family = 0 + const SecurityAttributeType AuditId = 1; + const SecurityAttributeType AccountingId = 2; + const SecurityAttributeType NonRepudiationId = 3; + // privilege attributes; family = 1 + const SecurityAttributeType _Public = 1; + const SecurityAttributeType AccessId = 2; + const SecurityAttributeType PrimaryGroupId = 3; + const SecurityAttributeType GroupId = 4; + const SecurityAttributeType Role = 5; + const SecurityAttributeType AttributeSet = 6; + const SecurityAttributeType Clearance = 7; + const SecurityAttributeType Capability = 8; + struct AttributeType { + ExtensibleFamily attribute_family; + SecurityAttributeType attribute_type; + }; + typedef sequence AttributeTypeList; + struct SecAttribute { + AttributeType attribute_type; + OID defining_authority; + Opaque value; + // the value of this attribute can be + // decoded only with knowledge of defining_authority + }; + typedef sequence AttributeList; + // Authentication return status + enum AuthenticationStatus { + SecAuthSuccess, + SecAuthFailure, + SecAuthContinue, + SecAuthExpired + }; + // Association return status + enum AssociationStatus { + SecAssocSuccess, + SecAssocFailure, + SecAssocContinue + }; + // Authentication method + typedef unsigned long AuthenticationMethod; + typedef sequence AuthenticationMethodList; + // Credential types + enum InvocationCredentialsType { + SecOwnCredentials, + SecReceivedCredentials, + SecTargetCredentials + }; + // Declarations related to Rights + struct Right { + ExtensibleFamily rights_family; + string the_right; + }; + typedef sequence RightsList; + enum RightsCombinator { + SecAllRights , + SecAnyRight + }; + // Delegation related + enum DelegationState { + SecInitiator, + SecDelegate + }; + enum DelegationDirective { + Delegate, + NoDelegate + }; + // pick up from TimeBase + typedef TimeBase::UtcT UtcT; + typedef TimeBase::IntervalT IntervalT; + typedef TimeBase::TimeT TimeT; + // Security features available on credentials. + enum SecurityFeature { + SecNoDelegation, + SecSimpleDelegation, + SecCompositeDelegation, + SecNoProtection, + SecIntegrity, + SecConfidentiality, + SecIntegrityAndConfidentiality, + SecDetectReplay, + SecDetectMisordering, + SecEstablishTrustInTarget, + SecEstablishTrustInClient + }; + // Quality of protection which can be specified + // for an object reference and used to protect messages + enum QOP { + SecQOPNoProtection, + SecQOPIntegrity, + SecQOPConfidentiality, + SecQOPIntegrityAndConfidentiality + }; + // Type of SecurityContext + enum SecurityContextType { + SecClientSecurityContext, + SecServerSecurityContext + }; + // Operational State of a Security Context + enum SecurityContextState { + SecContextInitialized, + SecContextContinued, + SecContextClientEstablished, + SecContextEstablished, + SecContextEstablishExpired, + SecContextExpired, + SecContextInvalid + }; + struct ChannelBindings { + unsigned long initiator_addrtype; + sequence initiator_address; + unsigned long acceptor_addrtype; + sequence acceptor_address; + sequence application_data; + }; + // For use with SecurityReplaceable + struct OpaqueBuffer { + Opaque buffer; + unsigned long startpos; + unsigned long endpos; + // startpos <= endpos + // OpaqueBuffer is said to be empty if startpos == endpos + }; + + // Association options which can be administered + // on secure invocation policy and used to + // initialize security context + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + + // Flag to indicate whether association options being + // administered are the "required" or "supported" set + enum RequiresSupports { + SecRequires, + SecSupports + }; + // Direction of communication for which + // secure invocation policy applies + enum CommunicationDirection { + SecDirectionBoth, + SecDirectionRequest, + SecDirectionReply + }; + // security association mechanism type + typedef string MechanismType; + typedef sequence MechanismTypeList; + // AssociationOptions-Direction pair + struct OptionsDirectionPair { + AssociationOptions options; + CommunicationDirection direction; + }; + typedef sequence OptionsDirectionPairList; + // Delegation mode which can be administered + enum DelegationMode { + SecDelModeNoDelegation, // i.e. use own credentials + SecDelModeSimpleDelegation, // delegate received credentials + SecDelModeCompositeDelegation // delegate both; + }; + // Association options supported by a given mech type + struct MechandOptions { + MechanismType mechanism_type; + AssociationOptions options_supported; + }; + typedef sequence MechandOptionsList; + // Attribute of the SecurityLevel2::EstablishTrustPolicy + struct EstablishTrust { + boolean trust_in_client; + boolean trust_in_target; + }; + // Audit + typedef unsigned long AuditChannelId; + typedef unsigned short EventType; + const EventType AuditAll = 0; + const EventType AuditPrincipalAuth = 1; + const EventType AuditSessionAuth = 2; + const EventType AuditAuthorization = 3; + const EventType AuditInvocation = 4; + const EventType AuditSecEnvChange = 5; + const EventType AuditPolicyChange = 6; + const EventType AuditObjectCreation = 7; + const EventType AuditObjectDestruction =8; + const EventType AuditNonRepudiation = 9; + enum DayOfTheWeek { + Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; + enum AuditCombinator { + SecAllSelectors, + SecAnySelector + }; + struct AuditEventType { + ExtensibleFamily event_family; + EventType event_type; + }; + typedef sequence AuditEventTypeList; + typedef unsigned long SelectorType; + const SelectorType InterfaceName = 1; + const SelectorType ObjectRef = 2; + const SelectorType Operation = 3; + const SelectorType Initiator = 4; + const SelectorType SuccessFailure = 5; + const SelectorType Time = 6; + const SelectorType DayOfWeek = 7; + + // values defined for audit_needed and audit_write are: + // InterfaceName: CORBA::RepositoryId + // ObjectRef: object reference + // Operation: op_name + // Initiator: Credentials + // SuccessFailure: boolean + // Time: utc time on audit_write; time picked up from + // environment in audit_needed if required + // DayOfWeek: DayOfTheWeek + struct SelectorValue { + SelectorType selector; + any value; + }; + typedef sequence SelectorValueList; + + // Constant declaration for valid Security Policy Types + // General administrative policies + const CORBA::PolicyType SecClientInvocationAccess = 1; + const CORBA::PolicyType SecTargetInvocationAccess = 2; + const CORBA::PolicyType SecApplicationAccess = 3; + const CORBA::PolicyType SecClientInvocationAudit = 4; + const CORBA::PolicyType SecTargetInvocationAudit = 5; + const CORBA::PolicyType SecApplicationAudit = 6; + const CORBA::PolicyType SecDelegation = 7; + const CORBA::PolicyType SecClientSecureInvocation = 8; + const CORBA::PolicyType SecTargetSecureInvocation = 9; + const CORBA::PolicyType SecNonRepudiation = 10; + // Policies used to control attributes of a binding to a target + const CORBA::PolicyType SecMechanismsPolicy = 12; + const CORBA::PolicyType SecInvocationCredentialsPolicy = 13; + const CORBA::PolicyType SecFeaturePolicy = 14; // obsolete + const CORBA::PolicyType SecQOPPolicy = 15; + const CORBA::PolicyType SecDelegationDirectivePolicy = 38; + const CORBA::PolicyType SecEstablishTrustPolicy = 39; +}; +#endif /* _SECURITY_IDL_ */ + diff --git a/dist/idl/SecurityLevel1.idl b/dist/idl/SecurityLevel1.idl new file mode 100644 index 0000000..ee46e4b --- /dev/null +++ b/dist/idl/SecurityLevel1.idl @@ -0,0 +1,18 @@ +#if !defined(_SECURITY_LEVEL_1_IDL_) +#define _SECURITY_LEVEL_1_IDL_ + +#include +#pragma prefix "omg.org" + +module SecurityLevel1 { + //# pragma version SecurityLevel1 1.8 + local interface Current : CORBA::Current { + //# pragma version Current 1.8 + // thread specific operations + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + }; +}; +#endif /* _SECURITY_LEVEL_1_IDL_ */ + diff --git a/dist/idl/SecurityLevel2.idl b/dist/idl/SecurityLevel2.idl new file mode 100644 index 0000000..dd3e11a --- /dev/null +++ b/dist/idl/SecurityLevel2.idl @@ -0,0 +1,196 @@ +#if !defined(_SECURITY_LEVEL_2_IDL_) +#define _SECURITY_LEVEL_2_IDL_ + +#include + +#pragma prefix "omg.org" + +module SecurityLevel2 { + //# pragma version SecurityLevel2 1.8 + // Forward declaration of interfaces + local interface PrincipalAuthenticator; + local interface Credentials; + local interface Current; + +// Interface PrincipalAuthenticator + local interface PrincipalAuthenticator { + //# pragma version PrincipalAuthenticator 1.8 + Security::AuthenticationMethodList + get_supported_authen_methods( + in Security::MechanismType mechanism + ); + Security::AuthenticationStatus authenticate ( + in Security::AuthenticationMethod method, + in Security::MechanismType mechanism, + in Security::SecurityName security_name, + in any auth_data, + in Security::AttributeList privileges, + out Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + Security::AuthenticationStatus continue_authentication ( + in any response_data, + in Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + }; + + // Interface Credentials + local interface Credentials { + //# pragma version Credentials 1.8 + Credentials copy (); + void destroy(); + readonly attribute Security::InvocationCredentialsType credentials_type; + readonly attribute Security::AuthenticationStatus authentication_state; + readonly attribute Security::MechanismType mechanism; + attribute Security::AssociationOptions accepting_options_supported; + attribute Security::AssociationOptions accepting_options_required; + attribute Security::AssociationOptions invocation_options_supported; + attribute Security::AssociationOptions invocation_options_required; + boolean get_security_feature( + in Security::CommunicationDirection direction, + in Security::SecurityFeature feature + ); + boolean set_attributes ( + in Security::AttributeList requested_attributes, + out Security::AttributeList actual_attributes + ); + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + boolean is_valid ( + out Security::UtcT expiry_time + ); + boolean refresh( + in any refresh_data + ); + }; + + typedef sequence CredentialsList; + + local interface ReceivedCredentials : Credentials { + //# pragma version ReceivedCredentials 1.8 + readonly attribute Credentials accepting_credentials; + readonly attribute Security::AssociationOptions association_options_used; + readonly attribute Security::DelegationState delegation_state; + readonly attribute Security::DelegationMode delegation_mode; + }; + + local interface TargetCredentials : Credentials { + //# pragma version TargetCredentials 1.8 + readonly attribute Credentials initiating_credentials; + readonly attribute Security::AssociationOptions association_options_used; + }; + + // RequiredRights Interface + interface RequiredRights{ + void get_required_rights( + in Object obj, + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + out Security::RightsList rights, + out Security::RightsCombinator rights_combinator + ); + void set_required_rights( + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + in Security::RightsList rights, + in Security::RightsCombinator rights_combinator + ); + }; + + // interface audit channel + local interface AuditChannel { + //# pragma version AuditChannel 1.8 + void audit_write ( + in Security::AuditEventType event_type, + in CredentialsList creds, + in Security::UtcT time, + in Security::SelectorValueList descriptors, + in any event_specific_data + ); + readonly attribute Security::AuditChannelId audit_channel_id; + }; + + // interface for Audit Decision + local interface AuditDecision { + // #pragma version AuditDecision 1.8 + boolean audit_needed ( + in Security::AuditEventType event_type, + in Security::SelectorValueList value_list + ); + readonly attribute AuditChannel audit_channel; + }; + + local interface AccessDecision { + // #pragma version AccessDecision 1.8 + boolean access_allowed ( + in SecurityLevel2::CredentialsList cred_list, + in Object target, + in CORBA::Identifier operation_name, + in CORBA::Identifier target_interface_name + ); + }; + + // Policy interfaces to control bindings + local interface QOPPolicy : CORBA::Policy { + // #pragma version QOPPolicy 1.8 + readonly attribute Security::QOP qop; + }; + + local interface MechanismPolicy : CORBA::Policy { + // #pragma version MechanismPolicy 1.8 + readonly attribute Security::MechanismTypeList mechanisms; + }; + + local interface InvocationCredentialsPolicy : CORBA::Policy { + // #pragma version InvocationCredentialsPolicy 1.8 + readonly attribute CredentialsList creds; + }; + + local interface EstablishTrustPolicy : CORBA::Policy { + // #pragma version EstablishTrustPolicy 1.8 + readonly attribute Security::EstablishTrust trust; + }; + + local interface DelegationDirectivePolicy : CORBA::Policy { + // #pragma version DelegationDirectivePolicy 1.8 + readonly attribute Security::DelegationDirective delegation_directive; + }; + + local interface SecurityManager { + // #pragma version SecurityManager 1.8 + // Process/Capsule/ORB Instance specific operations + readonly attribute Security::MechandOptionsList supported_mechanisms; + readonly attribute CredentialsList own_credentials; + readonly attribute RequiredRights required_rights_object; + readonly attribute PrincipalAuthenticator principal_authenticator; + readonly attribute AccessDecision access_decision; + readonly attribute AuditDecision audit_decision; + TargetCredentials get_target_credentials ( + in Object obj_ref + ); + void remove_own_credentials( + in Credentials creds + ); + CORBA::Policy get_security_policy ( + in CORBA::PolicyType policy_type + ); + }; + + // Interface Current derived from SecurityLevel1::Current providing + // additional operations on Current at this security level. + // This is implemented by the ORB + local interface Current : SecurityLevel1::Current { + //# pragma version Current 1.8 + // Thread specific + readonly attribute ReceivedCredentials received_credentials; + }; +}; + +#endif /* _SECURITY_LEVEL_2_IDL_ */ + + + diff --git a/dist/idl/SecurityLevel3.idl b/dist/idl/SecurityLevel3.idl new file mode 100644 index 0000000..e3251eb --- /dev/null +++ b/dist/idl/SecurityLevel3.idl @@ -0,0 +1,2041 @@ +//*********************************************************************** +// ORBAsec SL3 +// ---------------------------------------------------------------------- +// Copyright (C) 2001 Adiron, LLC. +// All rights reserved. +// ---------------------------------------------------------------------- +//*********************************************************************** + +//*********************************************************************** +/** + * @note Some interfaces in this IDL module have been altered from the + * original Adiron sources. + */ +//*********************************************************************** + + +#ifndef _SecurityLevel3_ +#define _SecurityLevel3_ + +#include +#include "TimeBase.idl" + +#pragma prefix "adiron.com" + +/** + * The Security Level 3 module contains the data definitions and + * the Application Programmers Interface for dealing with the + * ORBAsec SL3 Security, and the new CSIv2 Security Protocol, which has + * been adopted by the OMG. + *

+ * The SecurityLevel3 interfaces and its security data structures + * are based on the Principal Calculus. This is a mathematical + * model of representing principals for the use of access control + * and auditing. + *

+ * The SecurityLevel3 Security Service is represented by two objects + * that are returned by the ORB's resolve_initial_reference call. + * Those two objects are the SecurityManager and the SecurityCurrent. + * Other objects associated with the security service emanate from + * these two objects. + *

+ * The SecurityLevel3 Security Service has a Credentials model. This + * model, which is heavily based on the Principal Calculus, yields + * an API for accessing principal information. The credentials + * represent a principal's credentials, as well as the establishment + * of security contexts between client and servers. + *

+ * The SecurityLevel3 Security Service is currently CSIv2 Level 2 + * compliant: + *

    + *
  • + * It works over TLS and plain TCPIP. + *
  • + * It handles the GSSUP (Username/Password) mechanism for + * CSI level Client Authentication. + *
  • + * It has the ability to "quote" an identity, i.e. CSIv2 + * Identity Assertion. + *
  • + * It has the ability to "push" privileges, which it does + * ATLAS enabled servers. + *
  • + * It has the ability to install your own authorization + * token process that can allow for delegation. + *
+ *

+ * The Security Level 3 ORB Security Service does supports retention + * of CSI state. Client Authentication information and Identity + * assertion information is transmitted on each request. + *

+ * The Security Level 3 ORB Security Service does not automatically + * support endorsement at this time (CSIv2 Level 2 compliance), but + * does give you facility to do so. + */ +module SecurityLevel3 { + + /** + * The Adiron VMCID, which is used in Minor Error Codes, + * Policy Tags, etc. + */ + const unsigned long ADIRON_VMCID = 0xA11C000; + + //------------------------------------------------------------- + // Security Level 3 Data Representations + // + //------------------------------------------------------------- + + // + // A Principal Name + // A principal name always has a type, and a path of + // name components. They are ordered from least significant + // to most significant. For example, if a principal is represented + // by a single X.509 certificate, the first element in the path + // is the SubjectDN, and the second is the IssuerDN. + // + /** + * A NameType is used for typing a PrincipalName data structure. + * A NameType is a string that represents an ASN.1 + * OBJECT IDENTIFIER. Its representation usually of the form + * "oid:1.2.3.4". Other forms may be possible. It is used + * for encoding name type identifiers, which are ASN.1 DER encoded + * OBJECT IDENTIFIERs, in the CSI protocol. + * @see NameComponent + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef string NameType; + + /** + * A NameComponent is an ordered component of a NamePath. The + * least significant component is always the first component. + * It is the type of a wstring to handle international character + * values. + * @see NameType + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef wstring NameComponent; + + /** + * A NamePath is an ordered collection of NameComponents, ordered + * from the least significant to most significant. For example, + * an identity that is defined by a certificate that has a + * SubjectDN of "C=US,CN=Joe,O=Adiron" and an IssuerDN of + * "C=US,CN=AdironCA,O=Adiron" will have the following + * name components: + *

+     *  NameComponent[0] = "C=US,CN=Joe,O=Adiron"
+     *  NameComponent[1] = "C=US,CN=AdironCA,O=Adiron"
+     * 
+ * @see NameType + * @see NameComponent + * @see NameValue + * @see PrincipalName + */ + typedef sequence NamePath; + + /** + * A NameValue is the value component of a PrincipalName, + * which is a "type-value" pair. It is defined as a NamePath. + * @see NameType + * @see NameComponent + * @see NamePath + * @see PrincipalName + */ + typedef NamePath NameValue; + + /** + * A PrincipalName is a "type-value" structure. The type directs + * what the encoding and format of the components in the the + * value component are. For example, a type of "X509DirectoryPath" + * means that the value contains the DNs of the subject and + * subsequent issuers. + * @see NameType + * @see NameComponent + * @see NamePath + * @see NameValue + */ + struct PrincipalName { + NameType the_type; + NameValue the_name; + }; + + /** + * A list of PrincipalNames. + * @see PrincipalName + */ + typedef sequence PrincipalNameList; + + + // + // Attributes for privileges and other things. They are type value pairs. + // + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + *

+ * The type of a PrinAttribute is represented by a string. + *

+ * Privilege Attribute Types, that might come from X.509 certificates + * might be represented by OIDs. OIDs are represented as: + *

+     *   oid:n1.n2.n3.n4.n5.n6....
+     *             for an OID where ni are non-negative integers.
+     * 
+ * These OIDs are meant to be used to direct the "type-value" encoding + * of a GSS-API ExportName, which uses an OID as a type that directs + * the encoding of the value. + *

+ * Example Environmental Attribute Types + *

+     *   SL3:ChannelIdentifier
+     *   SL3:LocalAddress
+     *   SL3:LocalPort
+     *   SL3:TransportMechanism
+     *   SL3:TLSCipherSuite
+     * 
+ * @see PrinAttribute + */ + typedef string PrinAttributeType; + + /** + * A PrinAttributeValue is a wide character string that encodes + * or decodes the value of an attribute. An attempt is always + * meant to represent an attribute's value in a human readable + * string form. If the value cannot be decoded this way, and its + * native form is binary, then it is represented in a Hex encoding + * of the binary form. + * @see PrinAttribute + */ + typedef wstring PrinAttributeValue; + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + * @see PrinAttribute + */ + struct PrinAttribute { + PrinAttributeType the_type; + PrinAttributeValue the_value; + }; + + /** + * A list of PrinAttributes. + * @see PrinAttribute + */ + typedef sequence PrinAttributeList; + + + /** + * This is just a sequence of strings that make + * up the components of a ResourceName. + * @see ResourceName + */ + typedef sequence ResourceNameComponents; + + /** + * A ResourceName is the constructed name of a "resource". A + * ResourceName is closely modeled after CORBAmed's Resource + * Access Decision (RAD) facility's "Resource". It contains + * a sequence of strings. + */ + struct ResourceName { + ResourceNameComponents components; + }; + + /** + * A List of Resource Names. + * @See ResourceName + */ + typedef sequence ResourceNameList; + + + // + // NameTypes used in SL3 + // + + /** + * An NT_KerberosName is a NameType that signifies that the + * value of a PrincipalName is a Kerberos formated name. + * A KerberosName is a single string encoded in the + * familiar "name@REALM" format. + *

+ * From GSS-Kerboeros RFC 1964: + *

+ * 2.1.1. Kerberos Principal Name Form + *

+ * This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5_name(1)}. + */ + const NameType NT_KerberosName = "oid:1.2.840.113554.1.2.2.1"; + + /** + * An NT_X509DirectoryNamePath is a NameType that signifies that + * the value of a PrincipalName is constructed from a chain + * of certificates, such that the end entity is the least + * significant position, with the subsequent issuers following + * in order of signature. + *

+ * The coding of the names is the string encoding of + * complete X.500 DN's, such as "C=US, CN=Joe, O=Adiron". + * There is no indication whether the last DN in the path is a + * "root", i.e. it's issuer is the same. + */ + const NameType NT_X509DirectoryNamePath = "SL3:X509DirectoryPathName"; + + /** + * The NT_Anonymous is a name type that specifies that the + * PrincipalName is representing the "anonymous" principal. + * Its value always as a single name component of "anonymous" + */ + const NameType NT_Anonymous = "SL3:anonymous"; + + /** + * The NT_StringName is a NameType that specifies that the + * PrincipalName is represented by a single NameComponent + * of name in a "scoped" name space. The name and scope + * are separated by a single "@" character. The escape character + * is "\". This string name as we call it is the same form + * used for the GSSUP (GSS-UserPassword NameType). This + * oid is the OID defined by the OMG CSIv2 specification. It + * is the value defined by the CSI::GSS_NT_Scoped_Username_OID + * constant. + */ + const NameType NT_StringName = "oid:2.23.130.1.2.1"; + + // + // Privileges + // + + /** + * A ScopedPrivileges structure represents privileges that + * belong to a scope defined by a principal. This structure + * is used to represent a principal that is a privilege authority + * that issues privileges. Privileges are represented as + * PrinAttributes. + */ + struct ScopedPrivileges { + PrincipalName privilege_authority; + PrinAttributeList privileges; + }; + + /** + * A list of ScopedPrivileges + * @see ScopedPrivileges + */ + typedef sequence ScopedPrivilegesList; + + // + // Principals + // + + /** + * A Principal comes in three forms, which correspond to the + * Principal Calculus. The forms are "Simple", "Quoting", and + * "Proxy". Simple is a principal that represents a single + * entity, usually "speaking for" itself. A "Quoting" principal + * is a "compound" principal that says that one principal is + * speaking on behalf of another, usually denoted by "(A|B)", i.e. + * "A is quoting B", which means that "A is speaking on behalf of B". + * A "Proxy" principal is almost the same as a "Quoting" principal. + * However, the security service has determined that enough evidence + * exists that proves that Principal A is authorized to speak in + * B's behalf. This principal is denoted in the calculus as "(A for B)" + * in contrast to the quoting principal "(A|B)". + */ + typedef unsigned long PrincipalType; + + /** + * The Simple Principal Type (A) + * @see PrincipalType + */ + const PrincipalType PT_Simple = 0; // A, valuetype SimplePrincipal + /** + * The Quoting Principal Type (A|B) + * @see PrincipalType + */ + const PrincipalType PT_Quoting = 1; // B | A, valuetype QuotingPrincipal + /** + * The Proxy Principal Type (A for B) + * @see PrincipalType + */ + const PrincipalType PT_Proxy = 2; // B for A, valuetype ProxyPrincipal + + /** + * A Principal is represented by a base value type, which is extended + * for the various principals, Simple, Quoting, and Proxy. This base + * type of a Principal may be sufficient for access control in + * most systems. + * @param the_type contains the corresponding identifier + * @param the_name contains the logical name of the most derived + * Principal. Such as if the Principal is a nested + * ProxyPrincipal (i.e. C for B for A) the name here + * is A. + * @param environmental_attributes + * The attributes name certain things that do are + * environmental, such as IP addresses. + * @param with_privileges + * These are the privileges associated with Principal A + * restricted_resources. + * This attribute contains a collection of resources on which + * the principal is authorized to perform actions. + */ + valuetype Principal { + /** This field contains the type of the Principal. */ + public PrincipalType the_type; + /** This field contains the name of the Principal */ + public PrincipalName the_name; + /** + * This field contains the attributes of the principal + * that are considered environmental, such as authentication + * mechanism, authentication channel identifier, etc. + */ + public PrinAttributeList environmental_attributes; + /** + * This field contains the list of scoped privileges the + * security service has determined belong to the particular + * principal. + */ + public ScopedPrivilegesList with_privileges; + }; + + /** + * A list of Principals. + * @see Principal + */ + typedef sequence PrincipalList; + + /** + * A Simple Principal represents a single entity. It is usually + * derived by credentials acquisition, authentication, trust rules concerning quoting, + * or trust rules and certificates concerning Proxying. + * It has one extra field over the base Principal, which is + * "alternate_names". + */ + valuetype SimplePrincipal : /* truncatable */ Principal { + /** + * This field indicates whether the principal was derived or is + * going to be derived from an authentication mechanism. + *

+ * If the SimplePrincipal is directly or indirectly + * (as part of a composite Principal) in the + * ClientCredentials.client_principal or + * TargetCredentials.target_principal field, + * the authenticated field indicates the authentication + * status of the SimplePrincipal in the client or target + * principal, respectively. + *

+ * If the SimplePricipal is directly or indirectly in + * the ClientCredentials.target_principal + * (or TargetCredentials.client_principal) field, + * the authenticated field indicates the target's + * (or client's belief) about its authentication status to the other + * party. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of the initiator or acceptor + * of OwnCredentials, the authenticated + * field indicates the expectation of being authenticated to the other + * side of the communication when the initiator or acceptor is used. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of a + * PrincipalIdentityStatement, + * the authenticated field indicates only the + * "best effort" of knowing whether the principal has been possibly + * authenticated or not. In other word, if this field is + * TRUE, it is for sure that the principal has been + * authenticated (or is expecting to be authenticated). + * If this field is FALSE, the principal may or may not + * have been authenticated. The reason for this ambiguity is that + * a PrincipalIdentityStatement may be created before + * the authentication of the principal being performed. In general, + * the authenticated field of a + * SimplePrincipal inside the the_principal + * field of a PrincipalIdentityStatement should not be + * taken as a definite answer for the authentication status of the + * SimplePrincipal. + * + * @see ClientCredentials.client_authentication + * @see ClientCredentials.target_authentication + * @see TargetCredentials.client_authentication + * @see TargetCredentials.target_authentication + */ + // For example, if a client uses the User/Password mechanism to + // communicate with a target, the client's OwnCredentials, created + // using a PasswordGenerator, will have the authenticated + // field in the principal in the initiator being true, + // although the client may not have been authenticated to the target. + // + public boolean authenticated; + /** + * This field contains the other name types, such as + * that appear in the X.509 alternate name fields. + */ + public PrincipalNameList alternate_names; + + }; + + /** + * A ProxyPrincipal represents a principal that speaks for another. + * The principal is proved that it is authorized to speak for another. + * The system believes this, either by trust rules of its own, + * or by delivered endorsement from the principal such as + * Principal (B for A) where the endorsement takes the form + * in the Principal Calculus as (T says B serves A) + * where T is some entity trusted by the security service + * to make those statements. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * speaks_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype ProxyPrincipal : /* truncatable */ Principal { + + /** + * In a Proxy Principal of (A for B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Proxy Principal of (A for B) the speaks_for field + * represents the principal B. + */ + public Principal speaks_for; + + }; + + /** + * A QuotingPrincipal represents a principal that speaks for another. + * The principal is not proved that it is authorized to speak for another. + * The system derives principals like this based on statements in the + * Pricipal Calculus, such as "A says B says r", which results in the + * quoting principal (A|B) says r, where "r" is a statement, such as + * a CORBA request. The security service derives principals like + * this from the CSI Identity Assertion mechanism. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * quotes_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype QuotingPrincipal : /* truncatable */ Principal { + + /** + * In a Quoting Principal of (A|B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Quoting Principal of (A|B) the quotes_for field + * represents the principal B. + */ + public Principal quotes_for; + + }; + + // + // Statements + // + + /** + * A Statement is a value type that has extensions which + * represent the different relevant data directed by its StatementType. + * There are two basic Statement Types, an IdentityStatement and + * an EndorsementStatement. An identity statement is a statement that + * asserts an identity. It may represent a the components of + * an X.509 certificate during an authentication. An EndorsementStatement + * may represent the contents of an X.509 AttributeCertificate or + * some other notion of an endorsement, such as a certificate in + * BizTalk XML. + *

+ * Statements are contained in the Credentials Objects. They + * represent pieces of evidence collected from which the security + * service deduces the Principal of the Credentials Objects. + */ + typedef unsigned long StatementType; + + /** + * The Identity Statement Type. + *

+ * A statement of this type at least extends to the + * IdentityStatement valuetype, if not truncated + * @see IdentityStatement + */ + const StatementType ST_IdentityStatement = 1; //valuetype IdentityStatement + + /** + * The Endorsement Statement Type. + *

+ * A statement of this type at least extends to the + * EndorsementStatement valuetype, if not truncated + * @see EndorsementStatement + */ + const StatementType ST_EndorsementStatement = 2; //valuetype EndorsementStatement + + /** + * An encoding is a sequence of bytes. + */ + typedef sequence Encoding; + + /** + * Statement encoding type. + *

+ * Statements carry their original encoding information, if + * they came from an encoding, such as list of X.509 identity + * certificates (i.e. a chain). The encoding type may be derivable + * from the encoding itself. For example, it's easy to tell the + * difference between a PEM encoded certificate, and a DER encoded + * certificate. Therefore, the encoding type may default to "Unknown". + * Other types may exist than the ones provided as constants in + * this module. + */ + typedef string EncodingType; + + /** + * The ET_NoEncoding type signifies that the statement + * has been generated solely by the security service + * and has no encoding. + */ + const EncodingType ET_NoEncoding = "NoEncoding"; + + /** + * The ET_Unknown encoding type may always be used if the encoding + * type can only be figured out from encoding itself. + */ + const EncodingType ET_Unknown = "Unknown"; + + /** + * User Exception for a bad encoding. + */ + exception BadEncoding {}; + + /** + * User Exception for a bad or unsupported encoding type. + */ + exception BadEncodingType {}; + + /** + * The Statement Layer is the layer of the protocol or security + * service from which the statement emanated, derived, or was collected. + */ + typedef unsigned long StatementLayer; + + /** + * Default type for a Statement Layer + */ + const StatementLayer SL_Unknown = 0; + /** + * The SL_Transport statement type signifies that the associated + * statement is derived from the transport layer, such as + * an X.509 Certificate from a TLS handshake. + */ + const StatementLayer SL_Transport = 1; + /** + * The SL_CSIAuthorization statement type signifies that the associated + * statement is derived from the CSI Authorization Layer in the CSIv2 + * protocol. + */ + const StatementLayer SL_CSIAuthorization = 2; + /** + * The SL_CSIClientAuth statement type signifies that the associated + * statement is derived from the CSI Client Authentication Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIClientAuth = 3; + /** + * The SL_CSIIdentity statement type signifies that the associated + * statement is derived from the CSI Identity Assertion Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIIdentity = 4; + + /** + * The SL_UserDefined statement layer signifies that the associate + * statement is derived or created by a user or some other + * entity than the security service. + */ + const StatementLayer SL_UserDefined = 5; + + /** + * The Statement base type contains the information common + * to all statements. A statement has an "external" encoding, such + * as an X509 Certificate. Some statements may not have an encoding, + * but its extension may carry the pertinent marshable information, + * such as a PrincipalIdentityStatement for anonymous, which is + * generated by the security service. + */ + valuetype Statement { + /** + * This field contains an identifier of the + * service layer that generated the statement. + * The layer that generated or delivered + * the statement, i.e. Transport, CSIv2 Authentication, + * CSIv2 Authorization, or CSIv2 Identity Assertion. + */ + public StatementLayer the_layer; + /** + * The type of statement, which indicates its extension + * such as an Identity Statement or an Endorsement + * Statement. + */ + public StatementType the_type; + /** + * This field indicates the type of encoding. + * The encoding may be contrived, at the encoding + * may not exist, however, the extension of the + * statement type may contain data that can + * be marshaled across the wire. See the Principal + * Identity Statement. + */ + private EncodingType encoding_type; + /** + * The bytes of the encoding, if it exists. + */ + private Encoding the_encoding; + + /** + * Returns the encoding type + */ + EncodingType get_encoding_type(); + + /** + * Returns an encoding of this statement. Some implementations + * may be able to convert. Using and encoding_type of + * ET_Unknown, will always yield the default encoding, + * if it exists. If the encoding does not exist, + * a successful return containing an empty + * sequence will result. + */ + Encoding get_encoding( + in EncodingType encoding_type + ) raises ( + BadEncodingType + ); + + /** + * This factory method allows users to create their + * own Statements from an encoding. The statements created + * by this factory method may have a type which is a further + * extension of the valuetype Statement. + */ + factory create( + in EncodingType encoding_type, + in Encoding the_encoding + ); + }; + typedef sequence StatementList; + + /** + * The Identity Statement further classifies the encoding + * as a statement that if verified asserts an identity. + */ + valuetype IdentityStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + /** + * The Principal Identity Statement is the minimal version of an + * Identity statement that asserts a single identity that the + * security service can translate into a principal. + *

+ * An example of an identity statement is an X.509 certificate in + * which its attributes are exposed into the principal, such as + * privileges. This valuetype may also be further extended by the + * security service depending on its encoding and the capabilities + * of the security service. + */ + valuetype PrincipalIdentityStatement : IdentityStatement { + public Principal the_principal; + }; + + /** + * The Endorsement Statement is a statement that is used for + * authorization. An Endorsement statement endorses a + * principal with certain characteristics, such as privileges + * or the authority to act on behalf of another principal, sometimes + * called "delegation". + *

+ * According to our research, an endorsement statement may be a + * complex entity containing matching rules for the endorsement. + * An endorsement may have the following general form: + *

+     *     I says Principal A matching [(P1 with [p1,...,pn]) or ....]
+     *        speaks_for
+     *          Principal B matching [(T1 with [t1,...,tn]) or ... ]
+     *        has [s1,...,sm]
+     *        on Resources matching [R1, .... Rn]
+     * 
+ * Actual semantic reduction of principals is directed by the + * the matching rules, and may depend on other statements as well, + * such as local trust rules in the security service configuration. + * Also, much of the capability of an endorsement statement is + * dependent on its encoding. + *

+ * This approach to authorization is a largely unexplored research + * topic. There are not many or well known encodings of endorsement + * statements. Therefore, we are reluctant to produce interfaces + * just yet, that go beyond the encoding. However, we do expose the + * Endorsement statement type, which may further direct the interpretation + * of it's encoding. + */ + valuetype EndorsementStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + + + // + // TODO: The following contruction is not supported by TIDIdlc + // + /** + * An X509IdentityStatement is one that extends the Principal Identity + * Statement. If one does get an X509 IdentityStatement, it is + * currently supported with IAIK in both DER and PEM formats. + */ + valuetype X509IdentityStatement : PrincipalIdentityStatement { +// Already defined in Statement +// /** +// * This factory method allows users to create their +// * own X509Identity statements from an encoding. +// */ +// factory create( +// in EncodingType encoding_type, +// in Encoding the_encoding +// ); + }; + typedef sequence X509IdentityStatementList; + + //------------------------------------------------------------- + // Security Level 3 Application Users Interface + // + //------------------------------------------------------------- + + // + // The Security Level 3 Credentials Model + // + + /** + * Credentials come in three types. OwnCredentials, ClientCredentials, + * and TargetCredentials. OwnCredentials represent the ORB instance's + * credentials. Each Credentials has initiating and accepting capability. + * ClientCredentials represent an established security context with + * a client. TargetCredentials represent an established security context + * with a Target's Server. + */ + typedef unsigned long CredentialsType; + + /** + * The CT_OwnCredentials CredentialsType signifies that the + * Credentials can be extended to the OwnCredentials Type. + */ + const CredentialsType CT_OwnCredentials = 0; + /** + * The CT_ClientCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_ClientCredentials = 1; + /** + * The CT_TargetCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_TargetCredentials = 2; + + /** + * A Credentials object has a validity state. Some credentials + * may be time or use dependent. + */ + typedef long CredentialsState; + + /** + * The Credentials with a CredentialsState of CS_Invalid cannot be + * used in any the initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Invalid = -3; + + /** + * Credentials with a CredentialsState of CS_Expired can no longer + * be used for initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Expired = -2; + /** + * Credentials with a CredentialsState of CS_PendingRelease can no longer + * be used for initiating or accepting establishment of any + * security contexts. It means that "release_credentials" has been + * called on the credentials. + */ + const CredentialsState CS_PendingRelease = -1; + /** + * Credentials with a CredentialsState of CS_Initialized cannot + * be used for initiating or accepting establishment of any + * security contexts. It means that credentials are in an initial + * state. This value is for internal use, and there is no + * reason a SecurityLevel3 user should see credentials in this state. + */ + const CredentialsState CS_Initialized = 0; + /** + * Credentials with a CredentialsState of CS_Valid can + * be used for initiating or accepting establishment of + * security contexts. + */ + const CredentialsState CS_Valid = 1; + + /** + * Credentials have system generated identifiers + * to which they can be referred and retrieved. + */ + typedef string CredentialsId; + typedef sequence CredentialsIdList; + + /** + * A Context Id is a system generated unique identifier for identifying + * a security context to the application. + * Security Contexts may be long lived and not established on + * every request. Therefore, an identifier is assigned. + *

+ * Note that this Context Id is not directly related to the context + * defined in the CSIv2 specification. + */ + typedef string ContextId; + + /** + * Credentials Usage + *

+ * Credentials Usage refers to the concept that Credentials may + * be used to initiate security context, accept security contexts, + * or do both. its values are used in the acquisition + * of credentials for the purpose of designating the abilities + * of the credentials acquired. + */ + typedef unsigned long CredentialsUsage; + /** + * The CU_Indefinite CredentialsUsage type is a value that + * signifies the default. Depending on some other acquisition + * arguments, the credentials usage may be able to be implicitly + * determined. + */ + const CredentialsUsage CU_Indefinite = 1; + /** + * The CU_None CredentialsUsage type is a value that states the + * credentials cannot be used to make or accept security + * contexts. ClientCredentials and TargetCredentials have + * this credentials usage. + */ + const CredentialsUsage CU_None = 2; + /** + * The CU_AcceptOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to accept the establishment + * of security contexts. + */ + const CredentialsUsage CU_AcceptOnly = 3; + /** + * The CU_InitiateOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to initiate the establishment + * of security contexts. + */ + const CredentialsUsage CU_InitiateOnly = 4; + /** + * The CU_InitiateAndAccept CredentialsUsage type is a value that + * signifies that the credentials can be used to both initiate + * and accept the establishment of security contexts. + */ + const CredentialsUsage CU_InitiateAndAccept = 5; + + /** + * A CredsDirective is a directive on a invocation as to the + * effects of the initiated security context will have on the + * the accepting side. Please see ContextEstablishmentPolicy + * for is use in context with establishing security contexts. + * @see ContextEstablishmentPolicy + */ + typedef unsigned long CredsDirective; + /** + * The CD_Default CredsDirective is a value that signifies to + * use the capabilities of the selected credentials. + */ + const CredsDirective CD_Default = 0; + /** + * The CD_InvokeTarget CredsDirective is a value that signifies that + * the selected credentials should only be used in a simple + * invocation fashion. They shall not attempt to endorse or embody + * the target to act on its behalf. + */ + const CredsDirective CD_InvokeTarget = 1; + /** + * The CD_EndorseTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to endorse + * the target. In other words, it gives the accepting side the ability + * to act on behalf of the initiating side. + */ + const CredsDirective CD_EndorseTarget = 2; + /** + * The CD_EmbodyTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to embody + * the target. In other words, it gives the accepting side the ability + * to impersonate the initiating side. + */ + const CredsDirective CD_EmbodyTarget = 3; + + /** + * A Feature Directive is a general directive used in policy that + * stipulates the of a particular feature. Such examples include, + * confidentiality, integrity, client authentication, etc. + */ + typedef long FeatureDirective; + + /** + * The FD_DoNotUse FeatureDirective means definitely not to use + * the feature. + */ + const FeatureDirective FD_DoNotUse = -2; + /** + * The FD_DoNotUseIfPossible FeatureDirective means not to use + * the feature if it is possible. Note, some mechanisms may always + * use confidentiality. + */ + const FeatureDirective FD_DoNotUseIfPossible = -1; + /** + * The FD_UseDefault FeatureDirective means to use or not to use + * the feature depending on defaults. + */ + const FeatureDirective FD_UseDefault = 0; + /** + * The FD_UseIfPossible FeatureDirective means to use the feature + * if it is possible. + */ + const FeatureDirective FD_UseIfPossible = 1; + /** + * The FD_Use FeatureDirective means definitely to use the feature. + */ + const FeatureDirective FD_Use = 2; + + + /** + * The Initiator Type of the Initiator Side of the Credentials states + * the kind of Initiator it is. There are three types that mirror + * the type of Principal, Simple, Quoting, and Proxy, that the + * initiator intends to represent to a server while trying to + * establish a security context with the server. + */ + typedef unsigned long InitiatorType; + /** + * The IT_None InitiatorType is a value that is defined for + * completeness, and has no real use. + */ + const InitiatorType IT_None = 0; + /** + * The IT_Simple InitiatorType is a value that states that the + * initiator is a "Simple" Principal. + */ + const InitiatorType IT_Simple = 1; + /** + * The IT_Quoting InitiatorType is a value that states that the + * initiator will quote another principal to the server. This + * principal is denoted in the Principal Calculus as (A|B), i.e. + * A quoting B. + */ + const InitiatorType IT_Quoting = 2; + /** + * The IT_Proxy InitiatorType is a value that states that the + * initiator will quote another principal to the server along with + * getting or providing proof to the server that it can act on + * behalf of the quoted principals. This + * principal is denoted in the Principal Calculus as (A for B). + */ + const InitiatorType IT_Proxy = 3; + + /** + * The CredsInitiator object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "initiator" side of the credentials. + */ + local interface CredsInitiator { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * client principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute Principal the_principal; + /** + * The supporting statements attribute contains a list of statements + * supporting the principal associated with this initiator. + */ + readonly attribute StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The initiator_type attribute signifies the intent of the + * initiator as to the principal it presents for the + * security context establishment. It should correspond + * to the type of the Principal. However, it might be slightly + * different, because using CSIv2 Client Authentication + * technically creates a "QuotingPrincipal" however, the + * initiator type will still be simple as no CSIv2 Identity + * Assertion will be used in establishing the security + * context. + */ + readonly attribute InitiatorType initiator_type; + /** + * The supports_embodiment attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to give the + * the accepting end of a context establishment the ability + * to impersonate this initiator principal. + */ + readonly attribute boolean supports_embodiment; + /** + * The supports_endorsement attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to endorse + * the accepting end of a context establishment to act + * on behalf of this initiator principal. + */ + readonly attribute boolean supports_endorsement; + /** + * The supports_quoting attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to simply + * quote another principal on top of these credentials. + */ + readonly attribute boolean supports_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + }; + + /** + * The CredsAcceptor object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "acceptor" side of the credentials. + */ + local interface CredsAcceptor { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * target principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute SecurityLevel3::Principal the_principal; + /** + * The supporting_statements attribute contains a list of statements + * supporting the principal associated with this acceptor. + */ + readonly attribute SecurityLevel3::StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The accepts_endorsement attribute is TRUE if these credentials + * supports and accepts CSIv2 endorsement information. + */ + readonly attribute boolean accepts_endorsement; + /** + * The accepts_quoting attribute is TRUE if these credentials + * supports and accepts CSIv2 Identity Assertion information. + */ + readonly attribute boolean accepts_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + }; + + /** + * This type is used to identify listeners for removal. + * A Listener identity will be assigned to a listener when + * it is assigned to a particular object. + */ + typedef string ListenerId; + + /** + * This local interface is used to notify the user when the credentials + * have been relinquished. When credentials are "released" they may + * stay around until their work is finished. At that point they + * will be relinquished. Also, if the underlying transport credentials + * are released, then the SecurityLevel3 Credentials get released + * as well. This listener will get informed of this event. + */ + local interface RelinquishedCredentialsListener { + void relinquished_notify( + in CredentialsId creds_id + ); + }; + + /** + * The Credentials base interface contains the common items for + * the different types of credentials. + * @see OwnCredentials + * @see ClientCredentials + * @see TargetCredentials + */ + local interface Credentials { + + /** + * The creds_id attribute contains a system generated + * identifier with which can uniquely reference the credentials + * object. + */ + readonly attribute CredentialsId creds_id; + + /** + * The creds_type stipulates the type of credentials, i.e. + * to which type of credentials it may be narrowed, e.g., + * Own, Client, or Target. + */ + readonly attribute CredentialsType creds_type; + + /** + * The creds_usage attribute stipulates the intended usage of the + * credentials. For OwnCredentials, it will be one of + * CU_AcceptOnly, CU_Initiate, CU_InitiateAndAccept. + * For ClientCredentials and TargetCredentials it will be + * CU_None. + */ + readonly attribute CredentialsUsage creds_usage; + + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + /** + * The creds_state attribute contains the + * validity state of the credentials. + */ + readonly attribute CredentialsState creds_state; + + /** + * Add a listener that will get notified when the + * OwnCredentials are finally done with any pending + * work and are relinquished by the security service. + */ + ListenerId add_relinquished_listener( + in RelinquishedCredentialsListener listener + ); + + /** + * Removes a listener. This function raises a BAD_PARAM + * exception if the listener is not registered. + */ + void remove_relinquished_listener( + in ListenerId id + ); + }; + /** + * A list of credentials. + */ + typedef sequence CredentialsList; + + /** + * OwnCredentials are created as a result of Credentials acquisition + * from the CredentialsCurator's CredentialsAcquirers. + * The Credentials have an initiator and an acceptor based + * upon its intended usage and capability. Some OwnCredentials + * that were acquired solely for initiating contexts (i.e. client side) + * will not have an acceptor, and visa versa. + */ + local interface OwnCredentials : Credentials { + + /** + * The creds_initiator attribute contains a reference to the + * local credentials initiator associated with these credentials. + * It is null if the creds_usage is AcceptOnly. + */ + readonly attribute CredsInitiator creds_initiator; + + /** + * The creds_acceptor attribute contains a reference to the + * local credentials acceptor associated with these credentials. + * It is null if the creds_usage is InitiateOnly. + */ + readonly attribute CredsAcceptor creds_acceptor; + + /** + * The release_credentials operation disables the credentials + * from further initiating and/or accepting contexts. + * Formal destruction of the Credentials object is delayed until + * its pending work is done, at which time it becomes Invalid. + */ + void release_credentials (); + }; + + /** + * A list of OwnCredentials + */ + typedef sequence OwnCredentialsList; + + /** + * An object of this interface represents the security context for + * a CSIv2 based remote client. It is created as the result of accepting + * a security context for the remote client. + * This object is only available during the servicing of a CORBA request. + * It can be retrieved from the + * SecurityLevel3::SecurityCurrent object, + * as it is thread based. + *

+ * This object contains only the information used from the + * OwnCredentials that was pertinent in establishing the + * context. There is a pointer back to that OwnCredentials + * object. Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface ClientCredentials : Credentials { + + /** + * The context_id attribute contains a system generated unique identifier + * for the context, + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service can deduce is the client from the + * information and mechanisms used. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the statements that + * delivered from CSIv2 protocol along with any from the associated + * OwnCredentials that are used to deduce the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains the names of the + * resources that the security service deduces from the CSIv2 + * information and information from the associated OwnCredentials. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service believes is representative of the + * clients version of the target's principal. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements that + * support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of resources + * on which the target is restricted. This information may come + * from the OwnCredentials. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * This attribute refers to the OwnCredentials that were used in + * establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * This attribute is TRUE if the target has + * authenticated the client, either over the transport, or at + * the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * This attribute is TRUE if the target believes that + * the client has authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * This attribute is TRUE if the context is providing + * confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * This attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + }; + + /** + * The TargetCredentials object is created as the result of accepting a + * security context for a target. It represents that context. + * It contains only the information used from the OwnCredentials + * that was pertinent in establishing the context. + * There is a pointer back to that OwnCredentials object. + * Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface TargetCredentials : Credentials { + + /** + * The context_id attribute contains a system generated + * unique identifier for the context. + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service believe is the target's + * ClientCredentials client_principal attribute. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the + * statements that support the deduction of the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains names of + * resources on which the client believes the client is restricted. + * This information may be derived from newly acquired endorsement + * information. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service deduces to be the target. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements + * that support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of + * resources on which the target is restricted. This information + * may not be available. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * The parent_credentials attribute refers to the OwnCredentials + * that were used in establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * The client_authentication attribute is TRUE if the client + * believes that the target has authenticated the client, either + * over the transport, or at the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * The target_authentication attribute is TRUE if the client has + * authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * The confidentiality attribute is TRUE if the context is + * providing confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * The integrity attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + + /** + * The target_embodied attribute is TRUE if the security service + * believes that the target is embodied to impersonate the client + * side principal. + */ + readonly attribute boolean target_embodied; + + /** + * The target_endorsed attribute is TRUE if the security service + * believes that the target is endorsed to act on behalf of the + * client side principal. + */ + readonly attribute boolean target_endorsed; + + /** + * The release operation indicates to the CSIv2 protocol, that if + * state is being retained for these credentials, they + * will be discarded with the pending next request that + * may have not yet gone out. + *

+ * Any objects references that are binded to these + * credentials after you release them will become unusable. + * + * This operation is experimental. + */ + void release(); + }; + + + //-------------------------------------------------------------------- + // Security Invocation Policy + // + //-------------------------------------------------------------------- + + /** + * The ContextEstablishmentPolicy policy object directs the + * establishment of security contexts with a target. + *

+ * The CredsDirective usage is the following: + *

+ *
+ * CD_Default + *
+ * This directive means to use the default set + * up by the thread, the ORB, the ORB configuration, + * available credentials, or other policies. + *
+ * CD_InvokeTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. Do not endorse or embody the target. + * Credentials may be IT_Simple, IT_Quoting, or IT_Proxy. + *
+ * CD_EndorseTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. + * The credentials must be + * IT_Simple, IT_Quoting, or IT_Proxy own credentials + * that supports endorsement. + * Note, a Initiator Credentials that is a IT_Proxy + * may have an endorsement statement that not only + * endorses this immediate client, but may very well + * apply to the next target. + *
+ * CD_EmbodyTarget + *
+ * If possible give the target the ability to + * impersonate the client, is performed using + * transports that can forward their credentials + * in the transport that give the ability to the + * target to work in their own behalf. Alternatively, + * the authenticator may be able to be passed on. + * IT_Simple credentials must have or have the + * ability to forward credentials. This is analogous + * to flipping the DELEGATE bit on GSS-Kerberos Forwardable + * credentials. IT_Quoting principals means + * that you can forward the transport credentials, + * authenticator plus the Quoting statement. + * IT_Proxy principals means that you can forward + * the transport credentials, authenticator, + * and associated proxy statements. + *
+ *

+ * On using Own Credentials. The creds_ids name Own Credentials. + * Also, they restrict the invocation to use only certain credentials. + * If the cred_ids list is empty, then the own credentials for the + * invocation are selected from a default, which may be + * set on the thread or the ORB instance. + */ + local interface ContextEstablishmentPolicy : CORBA::Policy { + + readonly attribute CredsDirective creds_directive; + readonly attribute OwnCredentialsList creds_list; + readonly attribute FeatureDirective use_client_auth; + readonly attribute FeatureDirective use_target_auth; + readonly attribute FeatureDirective use_confidentiality; + readonly attribute FeatureDirective use_integrity; + }; + + /** + * Type to be passed to ContextEstablishmentPolicy PolicyFactory + * through an Any. + */ + struct ContextEstablishmentPolicyArgument + { + CredsDirective creds_directive; + OwnCredentialsList creds_list; + FeatureDirective use_client_auth; + FeatureDirective use_target_auth; + FeatureDirective use_confidentiality; + FeatureDirective use_integrity; + }; + + /** + * The ContextEstablishmentPolicyType constant is + * holds value used to denote the ContextEstablishmentPolicy. + */ + const CORBA::PolicyType ContextEstablishmentPolicyType = ADIRON_VMCID | 1001; + + + /** + * The ObjectCredentialsPolicy object is placed on the policy list + * of a POA to indicate the own credentials + * that govern the accepting contexts for objects underneath + * that POA. The credentials listed here, only if they have Accepting + * capability, are used to created security components in the + * IOR of the object's reference when created. + */ + local interface ObjectCredentialsPolicy : CORBA::Policy { + readonly attribute OwnCredentialsList creds_list; + }; + + /** + * Type to be passed to ObjectCredentialsPolicy PolicyFactory + * through an Any. + */ + typedef OwnCredentialsList ObjectCredentialsPolicyArgument; + + /** + * The ObjectCredentialsPolicyType constant is + * holds value used to denote the ObjectCredentialsPolicy. + */ + const CORBA::PolicyType ObjectCredentialsPolicyType = ADIRON_VMCID | 1002; + + + //-------------------------------------------------------------------- + // Security Level 3 Credentials Acquisition Mechanism + // + //-------------------------------------------------------------------- + + /** + * Credentials are acquired by a Credentials Acquirer by some + * acquisition mechanism specified in the Credentials Curator. + * Acquisition methods are available on the curator. The + * specifics of arguments needed and the acquisition process + * are defined by the method itself. + */ + typedef string AcquisitionMethod; + typedef sequence AcquisitionMethodList; + + /** + * An acquisition of credentials may quite possibly fail as well + * as be a multistep process. A status defines the current + * state of an acquisition. + */ + typedef long AcquisitionStatus; + /** Acquisition has failed. */ + const AcquisitionStatus AQST_Failed = -2; + /** Acquisition has expired. */ + const AcquisitionStatus AQST_Expired = -1; + /** Acquisition is initialized. */ + const AcquisitionStatus AQST_Initialized = 0; + /** Acquisition needs more processing. */ + const AcquisitionStatus AQST_Continued = 1; + /** Acquisition has succeeded. */ + const AcquisitionStatus AQST_Succeeded = 2; + + /** + * The CredentialsAcquirer object is created by the Credentials + * Curator based on the selected method and initial acquisition + * arguments. When this acquisition is complete and successful, + * the created credentials can be retrieved using the get_credentials + * operation. Once get_credentials is called, this object is destroyed. + */ + local interface CredentialsAcquirer { + + /** + * This attribute contains the acquisition method + * identifier naming the method by which these credentials + * are being acquired. + */ + readonly attribute AcquisitionMethod acquisition_method; + + /** + * This attribute contains the current acquisition + * status of the acquisition process. + */ + readonly attribute AcquisitionStatus current_status; + + /** + * If the acquisition process is a multistep process through calls + * to this acquirer, then this attribute contains the current + * iteration. + */ + readonly attribute unsigned long nth_iteration; + + /** + * If the current_status attribute contains + * the AQST_Continued value, + * this operation returns, if necessary and supported + * by the acquisition method, any data that may direct the + * acquisition. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Continued value, + * a BAD_INV_ORDER exception will be raised. + */ + any get_continuation_data(); + + /** + * This operation continues the acquisition. The argument + * data is dependent on the acquisition method. + */ + AcquisitionStatus continue_acquisition( + in any acquisition_arguments + ); + + /** + * Once the current_status attribute has the + * AQST_Succeeded value, a call to this operation + * is used to retrieve the acquired OwnCredentials + * and, optionally, place the credentials on the curator's default own + * credentials list (for use with default ContextEstablishmentPolicy + * and ObjectCredentialsPolicy). + *

+ * The CredentialsAcquirer object is destroyed after + * this call. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Succeeded value, + * a BAD_INV_ORDER exception will be raised. + * + * @param on_list TRUE if these credentials go on the + * default own credentials list of the + * CredentialsCurator. + */ + OwnCredentials get_credentials( + in boolean on_list + ); + + /** + * This operation is used to destroy the + * CredentialsAcquirer object before + * get_credentials is called. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + */ + void destroy(); + }; + + /** + * The CredentialsCurator object is a single object per an ORB + * instance's Security Service. It has the ability to create + * CredentialsAcquirers and keeps a list of active default + * credentials. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     * 
+ * Or it may be retrieved from the SecurityManager's + * credentials_curator attribute. + *

+ * The following pseudo code describes the process of credentials + * acquisition using CredentialsCurator. + *

+     * // Resolve the Credentials Curator
+     * CredentialsCurator curator = ....
+     *     resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     *
+     * // Build up an acquisition argument (e.g., using SL3CSI::CSIArgBuilder)
+     * Any arg = ...
+     *
+     * // Acquire credentials and get a Credentials Acquirer
+     * CredentialsAcquirer acquirer =
+     *     curator.acquire_credentials("SL3CSIAQArgs",arg);
+     *
+     * // Get credentials and destroy the Credentials Acquirer
+     * OwnCredentials own = acquirer.get_credentials(false);
+     * 
+ */ + local interface CredentialsCurator { + + /** + * This attribute contains a list of + * acquisition methods that are supported. Method identifiers + * are defined in modules that signify their support. + * + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + readonly attribute SecurityLevel3::AcquisitionMethodList + supported_methods; + + /** + * This operation starts the process of credentials acquisition and + * create a CredentialsAcquirer for a particular + * acquisition method. It takes an initial set of arguments for + * the acquisition. The content of the arguments are based on the + * acquisiton method. Depending on the method, it is possible that + * the credentials may be immediately available from a call to + * get_credentials on the returned + * CredentialsAcquirer. + *

+ * If the process of credentials acquisition is not completed upon + * the return of the acquire_credentials operation, + * the returned CredentialsAcquirer object shall have + * its current_status at AQST_Continued. + * In this case, the get_continuation_data and + * continue_acquisition operations shall be used to + * complete the credentials acquisition process. + *

+ * If the process of credentials acquisition fails, it is up to the + * implementation to either throw a system exception or return a + * CredentialsAcquirer with the AQST_Failed + * status. + *

+ * The acquisition_arguments parameter is a CORBA + * any that is constructed according to the acquisition + * method used. The ArgumentFactory from the + * SL3AQArgs module is a local object that helps + * immensely with the construction of this complex argument. + * Extensions of that object are defined in their own separate + * modules that pertain to the particular acquisition mechanism, + * such as the SL3CSI, SL3TLS, SL3TCPIP, SL3KRB5 modules. + * + * @param acquisition_method + * The identifier of the desired acquisition method. + * A CORBA BAD_PARAM exception will be raised + * if the named method is not supported. + * @param acquisition_arguments + * The argument of the desired acquisition method. + * This CORBA any type is constructed according + * to the particular acquisition method. + * + * @see "SL3AQArgs" + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + CredentialsAcquirer acquire_credentials( + in SecurityLevel3::AcquisitionMethod acquisition_method, + in any acquisition_arguments + ); + + /** + * The Curator's Default Own Credentials list. + */ + readonly attribute OwnCredentialsList default_creds_list; + + /** + * The Curator's ids of the credentials on the default list. + */ + readonly attribute CredentialsIdList default_creds_ids; + + /** + * This operation retrieves Own Credentials by identifier. + * It is not required that the identifier name a credentials + * on the default_credentials_list. The Curator keeps track + * of all OwnCredentials it creates, until they are explicitly + * released. + */ + OwnCredentials get_own_credentials( + in CredentialsId credentials_id + ); + + /** + * This operation releases credentials from the default_creds_list, + * if there, and also disables the credentials from further use, + * provided that all their pending work is done. + */ + void release_own_credentials ( + in CredentialsId credentials_id + ); + + }; + + //-------------------------------------------------------------------- + // Security Service ORB Objects + // Retrieved from the ORB by "resolve_initial_references". + // + //-------------------------------------------------------------------- + + /** + * The SecurityManager object represents the Security Level 3 + * Security Service. There is one object of this type per ORB + * instance. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityManager");
+     * 
+ */ + local interface SecurityManager { + + /** + * The credentials_curator attribute contains the reference + * to the SecurityLevel3 Credentials Curator. There is only + * one instance per ORB. + */ + readonly attribute CredentialsCurator credentials_curator; + + /** + * The get_target_credentials operation retrieves the + * TargetCredentials that represents a CSIv2 security association + * with a Target. This operation causes communication with + * the target in order to establish a security context. + */ + TargetCredentials get_target_credentials( + in Object the_object + ); + + /** + * The create_context_estab_policy operation is a policy factory + * operation that creates the Security Level 3 + * ContextEstablishmentPolicy object. This policy is placed on + * the policy override lists of object references to direct + * the security characteristics when communicating through + * that object reference. + *

+ * If this policy is not put on an object reference, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the object references policy list, + * then the default credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ContextEstablishmentPolicy create_context_estab_policy( + in CredsDirective creds_directive, + in OwnCredentialsList creds_list, + in FeatureDirective use_client_auth, + in FeatureDirective use_target_auth, + in FeatureDirective use_confidentiality, + in FeatureDirective use_integrity + ); + + /** + * The create_object_creds_policy is a policy factory operation + * that creates the ObjectCredentialsPolicy object. This policy + * is solely for use with policies place on POAs with "POA.create_POA". + * It restricts the POAs use of credentials. If this policy is + * not put on a POA, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the POA policy list, then the default + * credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ObjectCredentialsPolicy create_object_creds_policy( + in OwnCredentialsList creds_list + ); + }; + + /** + * The SecurityCurrent object references thread specific + * data pertaining to the security service. It is used to retrieve + * the client's credentials during an invocation on the server side. + *

+ * There is only one instance of this object per ORB instance. + * It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityCurrent");
+     * 
+ */ + local interface SecurityCurrent { + + /** + * From inside the execution of a target object implementation, + * this attribute contains the representation of the remote client's + * credentials. This attribute is null if the client is not CSIv2 + * based, or the client is from a collocated call. + *

+ * The value of this attribute, if not null, represents the + * security context with a remote CSIv2 client. + * If the request_is_local attribute is FALSE, + * the current thread of execution is directly servicing a remote + * request for the target object within the target's implemenation. + * If the request_is_local attribute is TRUE, + * the current thread of execution is servicing an ORB mediated call + * on a collocated object. + *

+ * If the client is not CSIv2 based, there are no CSIv2 Client + * Credentials, and this attribute is null. In this case, + * the user should try the + * URLSeq; + typedef sequence < CORBA::ValueDef::FullValueDescription > ValueDescSeq; + + // Operation to obtain the IR from the sending context + CORBA::Repository get_ir(); + + // Operations to obtain a location of the implementation code + URL implementation(in CORBA::RepositoryId x); + + URLSeq implementations(in CORBA::RepositoryIdSeq x); + + // Operations to obtain complete meta information about a Value + // This is just a performance optimization the IR can provide + // the same information + CORBA::ValueDef::FullValueDescription meta(in CORBA::RepositoryId x); + + ValueDescSeq metas(in CORBA::RepositoryIdSeq x); + + // To obtain a type graph for a value type + // same comment as before the IR can provide similar + // information + CORBA::RepositoryIdSeq bases(in CORBA::RepositoryId x); + }; +}; \ No newline at end of file diff --git a/dist/idl/TimeBase.idl b/dist/idl/TimeBase.idl new file mode 100644 index 0000000..3574c0a --- /dev/null +++ b/dist/idl/TimeBase.idl @@ -0,0 +1,42 @@ +//File: TimeBase.idl +//Part of the Time Service +// Note: if your IDL compiler does not yet support the +// "long long" data type, compile this module with the +// preprocessor definition "NOLONGLONG". With many +// compilers this would be done with a qualifier on +// the command line, something like -DNOLONGLONG + +#ifndef _TIME_BASE_IDL_ +#define _TIME_BASE_IDL_ + +#pragma prefix "omg.org" + +module TimeBase { + +#ifdef NOLONGLONG + struct ulonglong{ + unsigned long low; + unsigned long high; + }; + typedef ulonglong TimeT; +#else + typedef unsigned long long TimeT; +#endif + + typedef TimeT InaccuracyT; + typedef short TdfT; + struct UtcT { + TimeT time; // 8 octets + unsigned long inacclo; // 4 octets + unsigned short inacchi; // 2 octets + TdfT tdf; // 2 octets + // total 16 octets. + }; + + struct IntervalT { + TimeT lower_bound; + TimeT upper_bound; + }; +}; +#endif /* ifndef _TIME_BASE_IDL_ */ + diff --git a/dist/idl/ZIOP.idl b/dist/idl/ZIOP.idl new file mode 100644 index 0000000..59f5120 --- /dev/null +++ b/dist/idl/ZIOP.idl @@ -0,0 +1,123 @@ +// -*- IDL -*- + +#ifndef _ZIOP_ +#define _ZIOP_ + +#include +#include "Compression.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module ZIOP +{ + + // + // Some attachments for GIOP messages, defined in OMG IDL: + // + + /** + * GIOP Message of a ZIOP message + */ + + struct CompressedData { + + /** + * CompressorId used to compress data + * Must be unique, not a list + */ + + Compression::CompressorId compressorid; + + /** + * Lenght of RequestBody or ReplyBody fields. Usefully for: + * - To checksum + * - To alloc memory at decompress time (in some algorithms) + */ + + unsigned long original_length; + + /** + * RequestBody or ReplyBody compressed + */ + + //CORBA::OctetSeq data; + Compression::Buffer data; + + }; + + + // + // CORBA Policies for ZIOP + // + + typedef boolean CompressionEnablingPolicyValue; + + /** + * Tag Id for CompressionEnablingPolicy + */ + const CORBA::PolicyType COMPRESSION_ENABLING_POLICY_ID = 64; + + /** + * The ZIOP CompressionEnablingPolicy. Has an boolean attribute indicating + * if compression is enabled or not. + */ + local interface CompressionEnablingPolicy : CORBA::Policy + { + readonly attribute CompressionEnablingPolicyValue compression_enabled; + }; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSOR_ID_LEVEL_LIST_POLICY_ID = 65; + + /** + * The ZIOP CompressorIdPolicy. Has an CompressorId attribute indicating + * the compression algorithms that can be used. + */ + local interface CompressorIdLevelListPolicy : CORBA::Policy + { + readonly attribute Compression::CompressorIdLevelList compressor_ids; + }; + + + typedef unsigned long CompressionLowValuePolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_LOW_VALUE_POLICY_ID = 66; + + /** + * The ZIOP LowValuePolicy. Has an low_value attribute indicating the + * minimun size of application data that has tp be send with in a ZIOP Message. + */ + local interface CompressionLowValuePolicy : CORBA::Policy + { + readonly attribute CompressionLowValuePolicyValue low_value; + }; + + + typedef float CompressionMinRatioPolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_MIN_RATIO_POLICY_ID = 67; + + /** + * The ZIOP CompressionMinRatioPolicy. + * + */ + local interface CompressionMinRatioPolicy : CORBA::Policy + { + readonly attribute CompressionMinRatioPolicyValue ratio; + }; + + + + +}; + +#endif diff --git a/dist/lib/tidorbj.jar b/dist/lib/tidorbj.jar new file mode 100644 index 0000000..fcc9d48 Binary files /dev/null and b/dist/lib/tidorbj.jar differ diff --git a/doc/.cvsignore b/doc/.cvsignore new file mode 100644 index 0000000..eedd89b --- /dev/null +++ b/doc/.cvsignore @@ -0,0 +1 @@ +api diff --git a/doc/.svn/all-wcprops b/doc/.svn/all-wcprops new file mode 100644 index 0000000..d35d684 --- /dev/null +++ b/doc/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/doc +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/doc/.cvsignore +END diff --git a/doc/.svn/dir-prop-base b/doc/.svn/dir-prop-base new file mode 100644 index 0000000..570c589 --- /dev/null +++ b/doc/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 3 +api +END diff --git a/doc/.svn/entries b/doc/.svn/entries new file mode 100644 index 0000000..d091fc2 --- /dev/null +++ b/doc/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/doc +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +.cvsignore +file + + + + +2009-02-16T09:48:54.000000Z +f4f0d2154f338fd8edb38fc3839f22dd +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4 + diff --git a/doc/.svn/prop-base/.cvsignore.svn-base b/doc/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/doc/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/doc/.svn/text-base/.cvsignore.svn-base b/doc/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..eedd89b --- /dev/null +++ b/doc/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1 @@ +api diff --git a/idl/.svn/all-wcprops b/idl/.svn/all-wcprops new file mode 100644 index 0000000..32a329b --- /dev/null +++ b/idl/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl +END +properties.xml +K 25 +svn:wc:ra_dav:version-url +V 66 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/properties.xml +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/build.xml +END diff --git a/idl/.svn/entries b/idl/.svn/entries new file mode 100644 index 0000000..2bbef96 --- /dev/null +++ b/idl/.svn/entries @@ -0,0 +1,135 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + + + +() + +Compression +dir + +orb +dir + +Security +dir + +BiDirPolicy +dir + +TimeBase +dir + +comm +dir + +properties.xml +file + + + + +2010-04-28T10:47:59.000000Z +f7697c366c9fe783a5915979c94cc47d +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3237 + +DynamicAny +dir + +SendingContext +dir + +Messaging +dir + +CosNaming +dir + +build.xml +file + + + + +2010-04-28T11:50:13.000000Z +c6481ef4243d640bf16650c876099c51 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3953 + diff --git a/idl/.svn/prop-base/build.xml.svn-base b/idl/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/.svn/prop-base/properties.xml.svn-base b/idl/.svn/prop-base/properties.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/.svn/prop-base/properties.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/.svn/text-base/build.xml.svn-base b/idl/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..b851753 --- /dev/null +++ b/idl/.svn/text-base/build.xml.svn-base @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/.svn/text-base/properties.xml.svn-base b/idl/.svn/text-base/properties.xml.svn-base new file mode 100644 index 0000000..688ba8f --- /dev/null +++ b/idl/.svn/text-base/properties.xml.svn-base @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.class new file mode 100644 index 0000000..f2da851 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BOTH.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BOTH.class new file mode 100644 index 0000000..bb6fedd Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BOTH.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicy.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicy.class new file mode 100644 index 0000000..b86960a Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicy.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHelper.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHelper.class new file mode 100644 index 0000000..7f455d9 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHelper.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHolder.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHolder.class new file mode 100644 index 0000000..b2c29e2 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyHolder.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyOperations.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyOperations.class new file mode 100644 index 0000000..99d32fc Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyOperations.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOA.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOA.class new file mode 100644 index 0000000..2498b13 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOA.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.class new file mode 100644 index 0000000..0ae2466 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.class new file mode 100644 index 0000000..cf48d41 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/NORMAL.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/NORMAL.class new file mode 100644 index 0000000..ee23885 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/NORMAL.class differ diff --git a/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/_BidirectionalPolicyStub.class b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/_BidirectionalPolicyStub.class new file mode 100644 index 0000000..25b7510 Binary files /dev/null and b/idl/BiDirPolicy/.class/org/omg/BiDirPolicy/_BidirectionalPolicyStub.class differ diff --git a/idl/BiDirPolicy/.cvsignore b/idl/BiDirPolicy/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/BiDirPolicy/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.java new file mode 100644 index 0000000..f6c32f5 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BIDIRECTIONAL_POLICY_TYPE.java @@ -0,0 +1,12 @@ +// +// BIDIRECTIONAL_POLICY_TYPE.java (const) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public interface BIDIRECTIONAL_POLICY_TYPE { + int value = (int)37; +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BOTH.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BOTH.java new file mode 100644 index 0000000..3069f4b --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BOTH.java @@ -0,0 +1,12 @@ +// +// BOTH.java (const) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public interface BOTH { + short value = (short)1; +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicy.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicy.java new file mode 100644 index 0000000..6317b42 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicy.java @@ -0,0 +1,16 @@ +// +// BidirectionalPolicy.java (interface) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public interface BidirectionalPolicy + extends BidirectionalPolicyOperations, + org.omg.CORBA.Policy, + org.omg.CORBA.Object, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHelper.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHelper.java new file mode 100644 index 0000000..52088e6 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHelper.java @@ -0,0 +1,76 @@ +// +// BidirectionalPolicyHelper.java (helper) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +abstract public class BidirectionalPolicyHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "BidirectionalPolicy"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, BidirectionalPolicy value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static BidirectionalPolicy extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + BidirectionalPolicy value = narrow(obj); + return value; + }; + + public static BidirectionalPolicy read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, BidirectionalPolicy val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static BidirectionalPolicy narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static BidirectionalPolicy unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static BidirectionalPolicy narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof BidirectionalPolicy) { + return (BidirectionalPolicy)obj; + } + if (is_a || obj._is_a(id())) { + _BidirectionalPolicyStub result = (_BidirectionalPolicyStub)new _BidirectionalPolicyStub(); + ((org.omg.CORBA.portable.ObjectImpl) result)._set_delegate + (((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate()); + return (BidirectionalPolicy)result; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHolder.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHolder.java new file mode 100644 index 0000000..7a1ac17 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyHolder.java @@ -0,0 +1,33 @@ +// +// BidirectionalPolicyHolder.java (holder) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +final public class BidirectionalPolicyHolder + implements org.omg.CORBA.portable.Streamable { + + public BidirectionalPolicy value; + public BidirectionalPolicyHolder() { + } + + public BidirectionalPolicyHolder(BidirectionalPolicy initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.BiDirPolicy.BidirectionalPolicyHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.BiDirPolicy.BidirectionalPolicyHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.BiDirPolicy.BidirectionalPolicyHelper.type(); + }; + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyOperations.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyOperations.java new file mode 100644 index 0000000..7b138e2 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyOperations.java @@ -0,0 +1,16 @@ +// +// BidirectionalPolicy.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public interface BidirectionalPolicyOperations + extends org.omg.CORBA.PolicyOperations { + + short value(); + + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOA.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOA.java new file mode 100644 index 0000000..b810360 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOA.java @@ -0,0 +1,81 @@ +// +// BidirectionalPolicyPOA.java (skeleton) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +abstract public class BidirectionalPolicyPOA + extends org.omg.PortableServer.DynamicImplementation + implements BidirectionalPolicyOperations { + + public BidirectionalPolicy _this() { + return BidirectionalPolicyHelper.narrow(super._this_object()); + }; + + public BidirectionalPolicy _this(org.omg.CORBA.ORB orb) { + return BidirectionalPolicyHelper.narrow(super._this_object(orb)); + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0", + "IDL:omg.org/CORBA/Policy:1.0" + }; + + private static java.util.Dictionary _methods = new java.util.Hashtable(); + static { + _methods.put("_get_value", new Integer(0)); + _methods.put("_get_policy_type", new Integer(1)); + _methods.put("copy", new Integer(2)); + _methods.put("destroy", new Integer(3)); + } + + public void invoke(org.omg.CORBA.ServerRequest _request) { + java.lang.Object _method = _methods.get(_request.operation()); + if (_method == null) { + throw new org.omg.CORBA.BAD_OPERATION(_request.operation()); + } + int _method_id = ((java.lang.Integer)_method).intValue(); + switch(_method_id) { + case 0: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + short _result = this.value(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_ushort(_result); + _request.set_result(_resultAny); + return; + } + case 1: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + int _result = this.policy_type(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_ulong(_result); + _request.set_result(_resultAny); + return; + } + case 2: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.Policy _result = this.copy(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.PolicyHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 3: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + this.destroy(); + return; + } + } + } +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.java new file mode 100644 index 0000000..5f8e386 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyPOATie.java @@ -0,0 +1,51 @@ +// +// BidirectionalPolicyPOATie.java (tie) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public class BidirectionalPolicyPOATie + extends BidirectionalPolicyPOA + implements BidirectionalPolicyOperations { + + private BidirectionalPolicyOperations _delegate; + public BidirectionalPolicyPOATie(BidirectionalPolicyOperations delegate) { + this._delegate = delegate; + }; + + public BidirectionalPolicyOperations _delegate() { + return this._delegate; + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0", + "IDL:omg.org/CORBA/Policy:1.0" }; + + public short value() { + return this._delegate.value(); + } + + public int policy_type() { + return this._delegate.policy_type(); + } + + public org.omg.CORBA.Policy copy() { + return this._delegate.copy( + ); + }; + + public void destroy() { + this._delegate.destroy( + ); + }; + + + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.java new file mode 100644 index 0000000..16fd231 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/BidirectionalPolicyValueHelper.java @@ -0,0 +1,57 @@ +// +// BidirectionalPolicyValueHelper.java (helper) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +abstract public class BidirectionalPolicyValueHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, short value) { + any.insert_Streamable(new org.omg.CORBA.ShortHolder(value)); + }; + + public static short extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.ShortHolder){ + return ((org.omg.CORBA.ShortHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort); + _type = _orb().create_alias_tc(id(), "BidirectionalPolicyValue", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/BiDirPolicy/BidirectionalPolicyValue:1.0"; + }; + + public static short read(org.omg.CORBA.portable.InputStream is) { + short result; + result = is.read_ushort(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, short val) { + os.write_ushort(val); + }; + +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/NORMAL.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/NORMAL.java new file mode 100644 index 0000000..0cf0475 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/NORMAL.java @@ -0,0 +1,12 @@ +// +// NORMAL.java (const) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public interface NORMAL { + short value = (short)0; +} diff --git a/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/_BidirectionalPolicyStub.java b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/_BidirectionalPolicyStub.java new file mode 100644 index 0000000..5e1b341 --- /dev/null +++ b/idl/BiDirPolicy/.java/org/omg/BiDirPolicy/_BidirectionalPolicyStub.java @@ -0,0 +1,78 @@ +// +// _BidirectionalPolicyStub.java (stub) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.BiDirPolicy; + +public class _BidirectionalPolicyStub + extends org.omg.CORBA.portable.ObjectImpl + implements BidirectionalPolicy { + + public java.lang.String[] _ids() { + return __ids; + } + + private static java.lang.String[] __ids = { + "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0", + "IDL:omg.org/CORBA/Policy:1.0" }; + + public short value() { + org.omg.CORBA.Request _request = this._request("_get_value"); + _request.set_return_type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort)); + _request.invoke(); + java.lang.Exception _exception = _request.env().exception(); + if (_exception != null) { + throw (org.omg.CORBA.SystemException) _exception; + }; + short _result; + _result = _request.return_value().extract_ushort(); + return _result; } + + public int policy_type() { + org.omg.CORBA.Request _request = this._request("_get_policy_type"); + _request.set_return_type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); + _request.invoke(); + java.lang.Exception _exception = _request.env().exception(); + if (_exception != null) { + throw (org.omg.CORBA.SystemException) _exception; + }; + int _result; + _result = _request.return_value().extract_ulong(); + return _result; } + + public org.omg.CORBA.Policy copy() { + org.omg.CORBA.Request _request = this._request("copy"); + _request.set_return_type(org.omg.CORBA.PolicyHelper.type()); + _request.invoke(); + java.lang.Exception _exception = _request.env().exception(); + if (_exception != null) { + if (_exception instanceof org.omg.CORBA.UnknownUserException) { + org.omg.CORBA.UnknownUserException _userException = + (org.omg.CORBA.UnknownUserException) _exception; + } + throw (org.omg.CORBA.SystemException) _exception; + }; + org.omg.CORBA.Policy _result; + _result = org.omg.CORBA.PolicyHelper.extract(_request.return_value()); + return _result; + } + + public void destroy() { + org.omg.CORBA.Request _request = this._request("destroy"); + _request.invoke(); + java.lang.Exception _exception = _request.env().exception(); + if (_exception != null) { + if (_exception instanceof org.omg.CORBA.UnknownUserException) { + org.omg.CORBA.UnknownUserException _userException = + (org.omg.CORBA.UnknownUserException) _exception; + } + throw (org.omg.CORBA.SystemException) _exception; + }; + } + + + +} diff --git a/idl/BiDirPolicy/.svn/all-wcprops b/idl/BiDirPolicy/.svn/all-wcprops new file mode 100644 index 0000000..8bbd5bd --- /dev/null +++ b/idl/BiDirPolicy/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/BiDirPolicy +END +BiDirPolicy.idl +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/BiDirPolicy/BiDirPolicy.idl +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/BiDirPolicy/.cvsignore +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/BiDirPolicy/build.xml +END diff --git a/idl/BiDirPolicy/.svn/dir-prop-base b/idl/BiDirPolicy/.svn/dir-prop-base new file mode 100644 index 0000000..7208e29 --- /dev/null +++ b/idl/BiDirPolicy/.svn/dir-prop-base @@ -0,0 +1,6 @@ +K 10 +svn:ignore +V 12 +.class +.java +END diff --git a/idl/BiDirPolicy/.svn/entries b/idl/BiDirPolicy/.svn/entries new file mode 100644 index 0000000..d059041 --- /dev/null +++ b/idl/BiDirPolicy/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/BiDirPolicy +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +BiDirPolicy.idl +file + + + + +2010-04-28T10:47:59.000000Z +72b9574f19a9e303fa313b18da31a0a6 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +532 + +.cvsignore +file + + + + +2009-02-16T09:48:56.000000Z +a81562d70b7d74bef8f9f4c7fce04811 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +13 + +build.xml +file + + + + +2009-02-16T09:48:56.000000Z +63c179c959ff0df9186e7ba5d6ef769b +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2601 + diff --git a/idl/BiDirPolicy/.svn/prop-base/.cvsignore.svn-base b/idl/BiDirPolicy/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/BiDirPolicy/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/BiDirPolicy/.svn/prop-base/BiDirPolicy.idl.svn-base b/idl/BiDirPolicy/.svn/prop-base/BiDirPolicy.idl.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/BiDirPolicy/.svn/prop-base/BiDirPolicy.idl.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/BiDirPolicy/.svn/prop-base/build.xml.svn-base b/idl/BiDirPolicy/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/BiDirPolicy/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/BiDirPolicy/.svn/text-base/.cvsignore.svn-base b/idl/BiDirPolicy/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/BiDirPolicy/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/BiDirPolicy/.svn/text-base/BiDirPolicy.idl.svn-base b/idl/BiDirPolicy/.svn/text-base/BiDirPolicy.idl.svn-base new file mode 100644 index 0000000..892b7d3 --- /dev/null +++ b/idl/BiDirPolicy/.svn/text-base/BiDirPolicy.idl.svn-base @@ -0,0 +1,23 @@ +#ifndef _BIDIRPOLICY_IDL_ +#define _BIDIRPOLICY_IDL_ + +#include + +#pragma prefix "omg.org" + +// Self contained module for Bi-directional GIOP policy +module BiDirPolicy { + + typedef unsigned short BidirectionalPolicyValue; + + const BidirectionalPolicyValue NORMAL = 0; + const BidirectionalPolicyValue BOTH = 1; + + const CORBA::PolicyType BIDIRECTIONAL_POLICY_TYPE = 37; + + interface BidirectionalPolicy : CORBA::Policy { + readonly attribute BidirectionalPolicyValue value; + }; +}; + +#endif // _BIDIRPOLICY_IDL_ diff --git a/idl/BiDirPolicy/.svn/text-base/build.xml.svn-base b/idl/BiDirPolicy/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..96d64dd --- /dev/null +++ b/idl/BiDirPolicy/.svn/text-base/build.xml.svn-base @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/BiDirPolicy/BiDirPolicy.idl b/idl/BiDirPolicy/BiDirPolicy.idl new file mode 100644 index 0000000..892b7d3 --- /dev/null +++ b/idl/BiDirPolicy/BiDirPolicy.idl @@ -0,0 +1,23 @@ +#ifndef _BIDIRPOLICY_IDL_ +#define _BIDIRPOLICY_IDL_ + +#include + +#pragma prefix "omg.org" + +// Self contained module for Bi-directional GIOP policy +module BiDirPolicy { + + typedef unsigned short BidirectionalPolicyValue; + + const BidirectionalPolicyValue NORMAL = 0; + const BidirectionalPolicyValue BOTH = 1; + + const CORBA::PolicyType BIDIRECTIONAL_POLICY_TYPE = 37; + + interface BidirectionalPolicy : CORBA::Policy { + readonly attribute BidirectionalPolicyValue value; + }; +}; + +#endif // _BIDIRPOLICY_IDL_ diff --git a/idl/BiDirPolicy/build.xml b/idl/BiDirPolicy/build.xml new file mode 100644 index 0000000..f5337fa --- /dev/null +++ b/idl/BiDirPolicy/build.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/Compression/.class/org/omg/Compression/BufferHelper.class b/idl/Compression/.class/org/omg/Compression/BufferHelper.class new file mode 100644 index 0000000..8ab0bf9 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/BufferHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_7X.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_7X.class new file mode 100644 index 0000000..be13cd8 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_7X.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_BZIP2.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_BZIP2.class new file mode 100644 index 0000000..ce105d5 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_BZIP2.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_GZIP.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_GZIP.class new file mode 100644 index 0000000..8cd112d Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_GZIP.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZMA.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZMA.class new file mode 100644 index 0000000..74538aa Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZMA.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZOP.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZOP.class new file mode 100644 index 0000000..9bac2b5 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_LZOP.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_NONE.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_NONE.class new file mode 100644 index 0000000..56b195f Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_NONE.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_PKZIP.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_PKZIP.class new file mode 100644 index 0000000..006da5d Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_PKZIP.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_RZIP.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_RZIP.class new file mode 100644 index 0000000..54b3719 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_RZIP.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_XAR.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_XAR.class new file mode 100644 index 0000000..669751c Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_XAR.class differ diff --git a/idl/Compression/.class/org/omg/Compression/COMPRESSORID_ZLIB.class b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_ZLIB.class new file mode 100644 index 0000000..c624713 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/COMPRESSORID_ZLIB.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionException.class b/idl/Compression/.class/org/omg/Compression/CompressionException.class new file mode 100644 index 0000000..c1d2d0d Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionException.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionExceptionHelper.class b/idl/Compression/.class/org/omg/Compression/CompressionExceptionHelper.class new file mode 100644 index 0000000..4409284 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionExceptionHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionExceptionHolder.class b/idl/Compression/.class/org/omg/Compression/CompressionExceptionHolder.class new file mode 100644 index 0000000..4ba3cdc Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionExceptionHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionLevelHelper.class b/idl/Compression/.class/org/omg/Compression/CompressionLevelHelper.class new file mode 100644 index 0000000..570d1f1 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionLevelHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManager.class b/idl/Compression/.class/org/omg/Compression/CompressionManager.class new file mode 100644 index 0000000..380fec7 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManager.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManagerHelper.class b/idl/Compression/.class/org/omg/Compression/CompressionManagerHelper.class new file mode 100644 index 0000000..b9da8d2 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManagerHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManagerHolder.class b/idl/Compression/.class/org/omg/Compression/CompressionManagerHolder.class new file mode 100644 index 0000000..ec0766f Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManagerHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalBase.class b/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalBase.class new file mode 100644 index 0000000..89026ee Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalTie.class b/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalTie.class new file mode 100644 index 0000000..991b472 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManagerLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionManagerOperations.class b/idl/Compression/.class/org/omg/Compression/CompressionManagerOperations.class new file mode 100644 index 0000000..046fb1d Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionManagerOperations.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressionRatioHelper.class b/idl/Compression/.class/org/omg/Compression/CompressionRatioHelper.class new file mode 100644 index 0000000..74b9c5a Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressionRatioHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/Compressor.class b/idl/Compression/.class/org/omg/Compression/Compressor.class new file mode 100644 index 0000000..8d6857a Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/Compressor.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactory.class b/idl/Compression/.class/org/omg/Compression/CompressorFactory.class new file mode 100644 index 0000000..ec6c529 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactory.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactoryHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorFactoryHelper.class new file mode 100644 index 0000000..73a6aa4 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactoryHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactoryHolder.class b/idl/Compression/.class/org/omg/Compression/CompressorFactoryHolder.class new file mode 100644 index 0000000..bd35d3b Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactoryHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalBase.class b/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalBase.class new file mode 100644 index 0000000..9ba3005 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalTie.class b/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalTie.class new file mode 100644 index 0000000..2440efa Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactoryLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactoryOperations.class b/idl/Compression/.class/org/omg/Compression/CompressorFactoryOperations.class new file mode 100644 index 0000000..0ee4d3a Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactoryOperations.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHelper.class new file mode 100644 index 0000000..f217700 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHolder.class b/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHolder.class new file mode 100644 index 0000000..9547fcf Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorFactorySeqHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorHelper.class new file mode 100644 index 0000000..e4b8918 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorHolder.class b/idl/Compression/.class/org/omg/Compression/CompressorHolder.class new file mode 100644 index 0000000..02cfcc8 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorIdHelper.class new file mode 100644 index 0000000..345f360 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdLevel.class b/idl/Compression/.class/org/omg/Compression/CompressorIdLevel.class new file mode 100644 index 0000000..ade5fff Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdLevel.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHelper.class new file mode 100644 index 0000000..7684047 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHolder.class b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHolder.class new file mode 100644 index 0000000..1c0c071 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHelper.class b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHelper.class new file mode 100644 index 0000000..44c7197 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHolder.class b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHolder.class new file mode 100644 index 0000000..6daa366 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorIdLevelListHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorLocalBase.class b/idl/Compression/.class/org/omg/Compression/CompressorLocalBase.class new file mode 100644 index 0000000..0625018 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorLocalTie.class b/idl/Compression/.class/org/omg/Compression/CompressorLocalTie.class new file mode 100644 index 0000000..c99e455 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/Compression/CompressorOperations.class b/idl/Compression/.class/org/omg/Compression/CompressorOperations.class new file mode 100644 index 0000000..6f9e201 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/CompressorOperations.class differ diff --git a/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegistered.class b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegistered.class new file mode 100644 index 0000000..c46b951 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegistered.class differ diff --git a/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHelper.class b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHelper.class new file mode 100644 index 0000000..818283d Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHolder.class b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHolder.class new file mode 100644 index 0000000..84df24f Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/FactoryAlreadyRegisteredHolder.class differ diff --git a/idl/Compression/.class/org/omg/Compression/UnknownCompressorId.class b/idl/Compression/.class/org/omg/Compression/UnknownCompressorId.class new file mode 100644 index 0000000..9590535 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/UnknownCompressorId.class differ diff --git a/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHelper.class b/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHelper.class new file mode 100644 index 0000000..d1818bc Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHelper.class differ diff --git a/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHolder.class b/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHolder.class new file mode 100644 index 0000000..d1c4191 Binary files /dev/null and b/idl/Compression/.class/org/omg/Compression/UnknownCompressorIdHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_ENABLING_POLICY_ID.class b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_ENABLING_POLICY_ID.class new file mode 100644 index 0000000..ee83b66 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_ENABLING_POLICY_ID.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_LOW_VALUE_POLICY_ID.class b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_LOW_VALUE_POLICY_ID.class new file mode 100644 index 0000000..744f7ec Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_LOW_VALUE_POLICY_ID.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_MIN_RATIO_POLICY_ID.class b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_MIN_RATIO_POLICY_ID.class new file mode 100644 index 0000000..6705f6c Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/COMPRESSION_MIN_RATIO_POLICY_ID.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.class b/idl/Compression/.class/org/omg/ZIOP/COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.class new file mode 100644 index 0000000..2409b5a Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressedData.class b/idl/Compression/.class/org/omg/ZIOP/CompressedData.class new file mode 100644 index 0000000..a58ff68 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressedData.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressedDataHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressedDataHelper.class new file mode 100644 index 0000000..17f9c2b Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressedDataHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressedDataHolder.class b/idl/Compression/.class/org/omg/ZIOP/CompressedDataHolder.class new file mode 100644 index 0000000..5982673 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressedDataHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicy.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicy.class new file mode 100644 index 0000000..7e7f9bd Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicy.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHelper.class new file mode 100644 index 0000000..713650e Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHolder.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHolder.class new file mode 100644 index 0000000..d46e326 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalBase.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalBase.class new file mode 100644 index 0000000..1d947d3 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalTie.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalTie.class new file mode 100644 index 0000000..4f6d93e Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyOperations.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyOperations.class new file mode 100644 index 0000000..85cf4e3 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyOperations.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyValueHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyValueHelper.class new file mode 100644 index 0000000..80c0298 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionEnablingPolicyValueHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicy.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicy.class new file mode 100644 index 0000000..27ef723 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicy.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHelper.class new file mode 100644 index 0000000..adcf870 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHolder.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHolder.class new file mode 100644 index 0000000..6255ca0 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalBase.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalBase.class new file mode 100644 index 0000000..90b78f7 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalTie.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalTie.class new file mode 100644 index 0000000..6c2e0e2 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyOperations.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyOperations.class new file mode 100644 index 0000000..5c53b4f Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyOperations.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyValueHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyValueHelper.class new file mode 100644 index 0000000..b11e422 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionLowValuePolicyValueHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicy.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicy.class new file mode 100644 index 0000000..fbadc42 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicy.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHelper.class new file mode 100644 index 0000000..1100e4b Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHolder.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHolder.class new file mode 100644 index 0000000..8fe4542 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalBase.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalBase.class new file mode 100644 index 0000000..3f2f77b Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalTie.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalTie.class new file mode 100644 index 0000000..0e668f2 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyOperations.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyOperations.class new file mode 100644 index 0000000..a67c103 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyOperations.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyValueHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyValueHelper.class new file mode 100644 index 0000000..d2b85d5 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressionMinRatioPolicyValueHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicy.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicy.class new file mode 100644 index 0000000..9d66c33 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicy.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHelper.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHelper.class new file mode 100644 index 0000000..482e326 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHelper.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHolder.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHolder.class new file mode 100644 index 0000000..10223ba Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyHolder.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalBase.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalBase.class new file mode 100644 index 0000000..a4ab6bc Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalBase.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalTie.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalTie.class new file mode 100644 index 0000000..506f908 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyLocalTie.class differ diff --git a/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyOperations.class b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyOperations.class new file mode 100644 index 0000000..40d6d10 Binary files /dev/null and b/idl/Compression/.class/org/omg/ZIOP/CompressorIdLevelListPolicyOperations.class differ diff --git a/idl/Compression/.java/org/omg/Compression/BufferHelper.java b/idl/Compression/.java/org/omg/Compression/BufferHelper.java new file mode 100644 index 0000000..ea422b0 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/BufferHelper.java @@ -0,0 +1,57 @@ +// +// BufferHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class BufferHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, byte[] value) { + any.insert_Streamable(new org.omg.CORBA.OctetSeqHolder(value)); + }; + + public static byte[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.OctetSeqHolder){ + return ((org.omg.CORBA.OctetSeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.OctetSeqHelper.type(); + _type = _orb().create_alias_tc(id(), "Buffer", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Compression/Buffer:1.0"; + }; + + public static byte[] read(org.omg.CORBA.portable.InputStream is) { + byte[] result; + result = org.omg.CORBA.OctetSeqHelper.read(is); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, byte[] val) { + org.omg.CORBA.OctetSeqHelper.write(os,val); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_7X.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_7X.java new file mode 100644 index 0000000..0ae2e7b --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_7X.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_7X.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_7X { + short value = (short)8; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_BZIP2.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_BZIP2.java new file mode 100644 index 0000000..0d4465f --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_BZIP2.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_BZIP2.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_BZIP2 { + short value = (short)3; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_GZIP.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_GZIP.java new file mode 100644 index 0000000..5b9f95e --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_GZIP.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_GZIP.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_GZIP { + short value = (short)1; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZMA.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZMA.java new file mode 100644 index 0000000..e011d92 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZMA.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_LZMA.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_LZMA { + short value = (short)5; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZOP.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZOP.java new file mode 100644 index 0000000..70ede3a --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_LZOP.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_LZOP.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_LZOP { + short value = (short)6; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_NONE.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_NONE.java new file mode 100644 index 0000000..dbb4091 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_NONE.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_NONE.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_NONE { + short value = (short)0; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_PKZIP.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_PKZIP.java new file mode 100644 index 0000000..c33043b --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_PKZIP.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_PKZIP.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_PKZIP { + short value = (short)2; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_RZIP.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_RZIP.java new file mode 100644 index 0000000..5974979 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_RZIP.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_RZIP.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_RZIP { + short value = (short)7; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_XAR.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_XAR.java new file mode 100644 index 0000000..056b661 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_XAR.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_XAR.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_XAR { + short value = (short)9; +} diff --git a/idl/Compression/.java/org/omg/Compression/COMPRESSORID_ZLIB.java b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_ZLIB.java new file mode 100644 index 0000000..7191ac6 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/COMPRESSORID_ZLIB.java @@ -0,0 +1,12 @@ +// +// COMPRESSORID_ZLIB.java (const) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface COMPRESSORID_ZLIB { + short value = (short)4; +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionException.java b/idl/Compression/.java/org/omg/Compression/CompressionException.java new file mode 100644 index 0000000..72b262d --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionException.java @@ -0,0 +1,34 @@ +// +// CompressionException.java (exception) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +final public class CompressionException + extends org.omg.CORBA.UserException { + + public int reason; + public java.lang.String description; + + public CompressionException() { + super(CompressionExceptionHelper.id()); + } + + public CompressionException(int _reason, java.lang.String _description) { + super(CompressionExceptionHelper.id()); + + this.reason = _reason; + this.description = _description; + } + + public CompressionException(String reason, int _reason, java.lang.String _description) { + super(CompressionExceptionHelper.id()+" "+reason); + + this.reason = _reason; + this.description = _description; + } + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionExceptionHelper.java b/idl/Compression/.java/org/omg/Compression/CompressionExceptionHelper.java new file mode 100644 index 0000000..2fc2ac4 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionExceptionHelper.java @@ -0,0 +1,65 @@ +// +// CompressionExceptionHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressionExceptionHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, CompressionException value) { + any.insert_Streamable(new CompressionExceptionHolder(value)); + }; + + public static CompressionException extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof CompressionExceptionHolder){ + return ((CompressionExceptionHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; + members[0] = new org.omg.CORBA.StructMember("reason", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_long), null); + members[1] = new org.omg.CORBA.StructMember("description", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string), null); + _type = _orb().create_exception_tc(id(), "CompressionException", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Compression/CompressionException:1.0"; + }; + + public static CompressionException read(org.omg.CORBA.portable.InputStream is) { + if (! is.read_string().equals(id())) { + throw new org.omg.CORBA.MARSHAL("Invalid repository id."); + }; + CompressionException result = new CompressionException(); + result.reason = is.read_long(); + result.description = is.read_string(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, CompressionException val) { + os.write_string(id()); + os.write_long(val.reason); + os.write_string(val.description); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionExceptionHolder.java b/idl/Compression/.java/org/omg/Compression/CompressionExceptionHolder.java new file mode 100644 index 0000000..a5af2b6 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionExceptionHolder.java @@ -0,0 +1,33 @@ +// +// CompressionExceptionHolder.java (holder) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +final public class CompressionExceptionHolder + implements org.omg.CORBA.portable.Streamable { + + public CompressionException value; + public CompressionExceptionHolder() { + } + + public CompressionExceptionHolder(CompressionException initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.Compression.CompressionExceptionHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.Compression.CompressionExceptionHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.Compression.CompressionExceptionHelper.type(); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionLevelHelper.java b/idl/Compression/.java/org/omg/Compression/CompressionLevelHelper.java new file mode 100644 index 0000000..cfc69ce --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionLevelHelper.java @@ -0,0 +1,57 @@ +// +// CompressionLevelHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressionLevelHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, short value) { + any.insert_Streamable(new org.omg.CORBA.ShortHolder(value)); + }; + + public static short extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.ShortHolder){ + return ((org.omg.CORBA.ShortHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort); + _type = _orb().create_alias_tc(id(), "CompressionLevel", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Compression/CompressionLevel:1.0"; + }; + + public static short read(org.omg.CORBA.portable.InputStream is) { + short result; + result = is.read_ushort(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, short val) { + os.write_ushort(val); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManager.java b/idl/Compression/.java/org/omg/Compression/CompressionManager.java new file mode 100644 index 0000000..54bb420 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManager.java @@ -0,0 +1,15 @@ +// +// CompressionManager.java (interface) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface CompressionManager + extends CompressionManagerOperations, + org.omg.CORBA.LocalInterface, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManagerHelper.java b/idl/Compression/.java/org/omg/Compression/CompressionManagerHelper.java new file mode 100644 index 0000000..1375541 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManagerHelper.java @@ -0,0 +1,70 @@ +// +// CompressionManagerHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressionManagerHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "CompressionManager"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/Compression/CompressionManager:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, CompressionManager value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static CompressionManager extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + CompressionManager value = narrow(obj); + return value; + }; + + public static CompressionManager read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, CompressionManager val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static CompressionManager narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static CompressionManager unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static CompressionManager narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof CompressionManager) { + return (CompressionManager)obj; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManagerHolder.java b/idl/Compression/.java/org/omg/Compression/CompressionManagerHolder.java new file mode 100644 index 0000000..797818d --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManagerHolder.java @@ -0,0 +1,33 @@ +// +// CompressionManagerHolder.java (holder) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +final public class CompressionManagerHolder + implements org.omg.CORBA.portable.Streamable { + + public CompressionManager value; + public CompressionManagerHolder() { + } + + public CompressionManagerHolder(CompressionManager initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.Compression.CompressionManagerHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.Compression.CompressionManagerHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.Compression.CompressionManagerHelper.type(); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalBase.java b/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalBase.java new file mode 100644 index 0000000..d5165c9 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalBase.java @@ -0,0 +1,20 @@ +// +// CompressionManagerLocalBase.java (LocalBase) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public abstract class CompressionManagerLocalBase extends + org.omg.CORBA.LocalObject implements org.omg.Compression.CompressionManager{ + + private String [] _type_ids = { + "IDL:omg.org/Compression/CompressionManager:1.0" }; + + public String [] _ids(){ + return (String[]) _type_ids.clone(); } + + } + diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalTie.java b/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalTie.java new file mode 100644 index 0000000..9e55327 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManagerLocalTie.java @@ -0,0 +1,58 @@ +// +// CompressionManagerLocalTie.java (tie) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public class CompressionManagerLocalTie + extends CompressionManagerLocalBase + { + + private CompressionManagerOperations _delegate; + public CompressionManagerLocalTie(CompressionManagerOperations delegate) { + this._delegate = delegate; + }; + + public CompressionManagerOperations _delegate() { + return this._delegate; + }; + + public void register_factory(org.omg.Compression.CompressorFactory compressor_factory) + throws org.omg.Compression.FactoryAlreadyRegistered { + this._delegate.register_factory( + compressor_factory + ); + }; + + public void unregister_factory(short compressor_id) + throws org.omg.Compression.UnknownCompressorId { + this._delegate.unregister_factory( + compressor_id + ); + }; + + public org.omg.Compression.CompressorFactory get_factory(short compressor_id) + throws org.omg.Compression.UnknownCompressorId { + return this._delegate.get_factory( + compressor_id + ); + }; + + public org.omg.Compression.Compressor get_compressor(short compressor_id, short compression_level) + throws org.omg.Compression.UnknownCompressorId { + return this._delegate.get_compressor( + compressor_id, + compression_level + ); + }; + + public org.omg.Compression.CompressorFactory[] get_factories() { + return this._delegate.get_factories( + ); + }; + + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionManagerOperations.java b/idl/Compression/.java/org/omg/Compression/CompressionManagerOperations.java new file mode 100644 index 0000000..996cf4e --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionManagerOperations.java @@ -0,0 +1,27 @@ +// +// CompressionManager.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface CompressionManagerOperations { + + void register_factory(org.omg.Compression.CompressorFactory compressor_factory) + throws org.omg.Compression.FactoryAlreadyRegistered; + + void unregister_factory(short compressor_id) + throws org.omg.Compression.UnknownCompressorId; + + org.omg.Compression.CompressorFactory get_factory(short compressor_id) + throws org.omg.Compression.UnknownCompressorId; + + org.omg.Compression.Compressor get_compressor(short compressor_id, short compression_level) + throws org.omg.Compression.UnknownCompressorId; + + org.omg.Compression.CompressorFactory[] get_factories(); + + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressionRatioHelper.java b/idl/Compression/.java/org/omg/Compression/CompressionRatioHelper.java new file mode 100644 index 0000000..6020b49 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressionRatioHelper.java @@ -0,0 +1,57 @@ +// +// CompressionRatioHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressionRatioHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, float value) { + any.insert_Streamable(new org.omg.CORBA.FloatHolder(value)); + }; + + public static float extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.FloatHolder){ + return ((org.omg.CORBA.FloatHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_float); + _type = _orb().create_alias_tc(id(), "CompressionRatio", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Compression/CompressionRatio:1.0"; + }; + + public static float read(org.omg.CORBA.portable.InputStream is) { + float result; + result = is.read_float(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, float val) { + os.write_float(val); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/Compressor.java b/idl/Compression/.java/org/omg/Compression/Compressor.java new file mode 100644 index 0000000..750e87f --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/Compressor.java @@ -0,0 +1,15 @@ +// +// Compressor.java (interface) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface Compressor + extends CompressorOperations, + org.omg.CORBA.LocalInterface, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactory.java b/idl/Compression/.java/org/omg/Compression/CompressorFactory.java new file mode 100644 index 0000000..b876afd --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactory.java @@ -0,0 +1,15 @@ +// +// CompressorFactory.java (interface) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface CompressorFactory + extends CompressorFactoryOperations, + org.omg.CORBA.LocalInterface, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactoryHelper.java b/idl/Compression/.java/org/omg/Compression/CompressorFactoryHelper.java new file mode 100644 index 0000000..5fd2f0c --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactoryHelper.java @@ -0,0 +1,70 @@ +// +// CompressorFactoryHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressorFactoryHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "CompressorFactory"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/Compression/CompressorFactory:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, CompressorFactory value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static CompressorFactory extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + CompressorFactory value = narrow(obj); + return value; + }; + + public static CompressorFactory read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, CompressorFactory val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static CompressorFactory narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static CompressorFactory unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static CompressorFactory narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof CompressorFactory) { + return (CompressorFactory)obj; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactoryHolder.java b/idl/Compression/.java/org/omg/Compression/CompressorFactoryHolder.java new file mode 100644 index 0000000..4248865 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactoryHolder.java @@ -0,0 +1,33 @@ +// +// CompressorFactoryHolder.java (holder) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +final public class CompressorFactoryHolder + implements org.omg.CORBA.portable.Streamable { + + public CompressorFactory value; + public CompressorFactoryHolder() { + } + + public CompressorFactoryHolder(CompressorFactory initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.Compression.CompressorFactoryHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.Compression.CompressorFactoryHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.Compression.CompressorFactoryHelper.type(); + }; + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalBase.java b/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalBase.java new file mode 100644 index 0000000..2622466 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalBase.java @@ -0,0 +1,20 @@ +// +// CompressorFactoryLocalBase.java (LocalBase) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public abstract class CompressorFactoryLocalBase extends + org.omg.CORBA.LocalObject implements org.omg.Compression.CompressorFactory{ + + private String [] _type_ids = { + "IDL:omg.org/Compression/CompressorFactory:1.0" }; + + public String [] _ids(){ + return (String[]) _type_ids.clone(); } + + } + diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalTie.java b/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalTie.java new file mode 100644 index 0000000..c4a1b0f --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactoryLocalTie.java @@ -0,0 +1,34 @@ +// +// CompressorFactoryLocalTie.java (tie) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public class CompressorFactoryLocalTie + extends CompressorFactoryLocalBase + { + + private CompressorFactoryOperations _delegate; + public CompressorFactoryLocalTie(CompressorFactoryOperations delegate) { + this._delegate = delegate; + }; + + public CompressorFactoryOperations _delegate() { + return this._delegate; + }; + + public short compressor_id() { + return this._delegate.compressor_id(); + } + + public org.omg.Compression.Compressor get_compressor(short compression_level) { + return this._delegate.get_compressor( + compression_level + ); + }; + + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactoryOperations.java b/idl/Compression/.java/org/omg/Compression/CompressorFactoryOperations.java new file mode 100644 index 0000000..1f1f195 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactoryOperations.java @@ -0,0 +1,17 @@ +// +// CompressorFactory.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +public interface CompressorFactoryOperations { + + short compressor_id(); + + org.omg.Compression.Compressor get_compressor(short compression_level); + + +} diff --git a/idl/Compression/.java/org/omg/Compression/CompressorFactorySeqHelper.java b/idl/Compression/.java/org/omg/Compression/CompressorFactorySeqHelper.java new file mode 100644 index 0000000..f9f5b03 --- /dev/null +++ b/idl/Compression/.java/org/omg/Compression/CompressorFactorySeqHelper.java @@ -0,0 +1,64 @@ +// +// CompressorFactorySeqHelper.java (helper) +// +// File generated: Thu May 19 07:31:43 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Compression; + +abstract public class CompressorFactorySeqHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.Compression.CompressorFactory[] value) { + any.insert_Streamable(new CompressorFactorySeqHolder(value)); + }; + + public static org.omg.Compression.CompressorFactory[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof CompressorFactorySeqHolder){ + return ((CompressorFactorySeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.Compression.CompressorFactoryHelper.type()); + _type = _orb().create_alias_tc(id(), "CompressorFactorySeq", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Compression/CompressorFactorySeq:1.0"; + }; + + public static org.omg.Compression.CompressorFactory[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.Compression.CompressorFactory[] result; + int length0 = is.read_ulong(); + result = new org.omg.Compression.CompressorFactory[length0]; + for (int i0=0; i0 + +#pragma prefix "omg.org" + +module Compression +{ + + /** + * Exception thrown when an error occurs during a compress or decompress + * operation. + */ + exception CompressionException + { + long reason; + string description; + }; + + /** + * Exception thrown if a CompressorFactory with the same CompressorId is + * already registered with the CompressionManager. + */ + exception FactoryAlreadyRegistered + { + }; + + /** + * Exception thrown if a CompressorId is not known. + */ + exception UnknownCompressorId + { + }; + + /** + * CompressorId type. + */ + typedef unsigned short CompressorId; + const CompressorId COMPRESSORID_NONE = 0; + const CompressorId COMPRESSORID_GZIP = 1; + const CompressorId COMPRESSORID_PKZIP = 2; + const CompressorId COMPRESSORID_BZIP2 = 3; + const CompressorId COMPRESSORID_ZLIB = 4; + const CompressorId COMPRESSORID_LZMA = 5; + const CompressorId COMPRESSORID_LZOP = 6; + const CompressorId COMPRESSORID_RZIP = 7; + const CompressorId COMPRESSORID_7X = 8; + const CompressorId COMPRESSORID_XAR = 9; + + + + /** + * CompressorIdList type. + */ + //typedef sequence CompressorIdList; + + + + /** + * CompressionLevel type. + */ + typedef unsigned short CompressionLevel; + typedef float CompressionRatio; + + struct CompressorIdLevel { + CompressorId compressor_id; + CompressionLevel compression_level; + }; + typedef sequence CompressorIdLevelList; + + typedef CORBA::OctetSeq Buffer; + + local interface CompressorFactory; + + /** + * Compressor - abstraction of a compressor and decompressor. + */ + local interface Compressor + { + /** + * Operation that compresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the compression, it + * throws CompressionException + */ + void compress(in Buffer source, inout Buffer target) + raises (CompressionException); + /** + * Operation that decompresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the decompression, it + * throws CompressionException + */ + void decompress(in Buffer source, inout Buffer target) + raises(CompressionException); + /** + * The CompressorFactory associated with this Compressor. + */ + readonly attribute CompressorFactory compressor_factory; + /** + * The (implementation and algorithm specific) compression level + * associated with this Compressor. + */ + readonly attribute CompressionLevel compression_level; + /** + * The total number of compressed bytes read and written by Compressors + * that were created by this CompressorFactory + * (i.e. the "target" side of Compressor::compress and + * the "source" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long compressed_bytes; + /** + * The total number of uncompressed bytes read and written by + * Compressors that were created by this CompressorFactory + * (i.e. the "source" side of Compressor::compress and + * the "target" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long uncompressed_bytes; + /** + * This attribute represents the compression ratio achieved by + * this compressor. The ratio can be obtained with the following + * formula: 100 - (compressed_length / original_length)*100. + */ + readonly attribute CompressionRatio compression_ratio; + + }; + + local interface CompressorFactory + { + /** + * The CompressorId associated with this CompressorFactory + */ + readonly attribute CompressorId compressor_id; + + /** + * Create a Compressor instance with the given compression level. + */ + Compressor get_compressor(in CompressionLevel compression_level); + }; + + typedef sequence CompressorFactorySeq; + + /** + * Per-ORB interface to register and unregister CompressorFactories. + * Initial reference: "CompressionManager" + */ + local interface CompressionManager + { + /** + * Register a new CompressorFactory + */ + void register_factory(in CompressorFactory compressor_factory) + raises(FactoryAlreadyRegistered); + /** + * Unregister a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + void unregister_factory(in CompressorId compressor_id) + raises (UnknownCompressorId); + /** + * Retrieve a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + CompressorFactory get_factory(in CompressorId compressor_id) + raises(UnknownCompressorId); + /** + * Create a Compressor with the given compression_level from the + * CompressorFactory with the given CompressorId + */ + Compressor get_compressor(in CompressorId compressor_id, + in CompressionLevel compression_level) + raises(UnknownCompressorId); + /** + * List all registered CompressorFactories + */ + CompressorFactorySeq get_factories(); + + + }; + + +}; + +#endif diff --git a/idl/Compression/.svn/text-base/ZIOP.idl.svn-base b/idl/Compression/.svn/text-base/ZIOP.idl.svn-base new file mode 100644 index 0000000..59f5120 --- /dev/null +++ b/idl/Compression/.svn/text-base/ZIOP.idl.svn-base @@ -0,0 +1,123 @@ +// -*- IDL -*- + +#ifndef _ZIOP_ +#define _ZIOP_ + +#include +#include "Compression.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module ZIOP +{ + + // + // Some attachments for GIOP messages, defined in OMG IDL: + // + + /** + * GIOP Message of a ZIOP message + */ + + struct CompressedData { + + /** + * CompressorId used to compress data + * Must be unique, not a list + */ + + Compression::CompressorId compressorid; + + /** + * Lenght of RequestBody or ReplyBody fields. Usefully for: + * - To checksum + * - To alloc memory at decompress time (in some algorithms) + */ + + unsigned long original_length; + + /** + * RequestBody or ReplyBody compressed + */ + + //CORBA::OctetSeq data; + Compression::Buffer data; + + }; + + + // + // CORBA Policies for ZIOP + // + + typedef boolean CompressionEnablingPolicyValue; + + /** + * Tag Id for CompressionEnablingPolicy + */ + const CORBA::PolicyType COMPRESSION_ENABLING_POLICY_ID = 64; + + /** + * The ZIOP CompressionEnablingPolicy. Has an boolean attribute indicating + * if compression is enabled or not. + */ + local interface CompressionEnablingPolicy : CORBA::Policy + { + readonly attribute CompressionEnablingPolicyValue compression_enabled; + }; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSOR_ID_LEVEL_LIST_POLICY_ID = 65; + + /** + * The ZIOP CompressorIdPolicy. Has an CompressorId attribute indicating + * the compression algorithms that can be used. + */ + local interface CompressorIdLevelListPolicy : CORBA::Policy + { + readonly attribute Compression::CompressorIdLevelList compressor_ids; + }; + + + typedef unsigned long CompressionLowValuePolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_LOW_VALUE_POLICY_ID = 66; + + /** + * The ZIOP LowValuePolicy. Has an low_value attribute indicating the + * minimun size of application data that has tp be send with in a ZIOP Message. + */ + local interface CompressionLowValuePolicy : CORBA::Policy + { + readonly attribute CompressionLowValuePolicyValue low_value; + }; + + + typedef float CompressionMinRatioPolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_MIN_RATIO_POLICY_ID = 67; + + /** + * The ZIOP CompressionMinRatioPolicy. + * + */ + local interface CompressionMinRatioPolicy : CORBA::Policy + { + readonly attribute CompressionMinRatioPolicyValue ratio; + }; + + + + +}; + +#endif diff --git a/idl/Compression/.svn/text-base/build.xml.svn-base b/idl/Compression/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..ba1ffbd --- /dev/null +++ b/idl/Compression/.svn/text-base/build.xml.svn-base @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/Compression/Compression.idl b/idl/Compression/Compression.idl new file mode 100644 index 0000000..18894ee --- /dev/null +++ b/idl/Compression/Compression.idl @@ -0,0 +1,185 @@ +// -*- IDL -*- + +#ifndef _COMPRESSION_ +#define _COMPRESSION_ + +#include + +#pragma prefix "omg.org" + +module Compression +{ + + /** + * Exception thrown when an error occurs during a compress or decompress + * operation. + */ + exception CompressionException + { + long reason; + string description; + }; + + /** + * Exception thrown if a CompressorFactory with the same CompressorId is + * already registered with the CompressionManager. + */ + exception FactoryAlreadyRegistered + { + }; + + /** + * Exception thrown if a CompressorId is not known. + */ + exception UnknownCompressorId + { + }; + + /** + * CompressorId type. + */ + typedef unsigned short CompressorId; + const CompressorId COMPRESSORID_NONE = 0; + const CompressorId COMPRESSORID_GZIP = 1; + const CompressorId COMPRESSORID_PKZIP = 2; + const CompressorId COMPRESSORID_BZIP2 = 3; + const CompressorId COMPRESSORID_ZLIB = 4; + const CompressorId COMPRESSORID_LZMA = 5; + const CompressorId COMPRESSORID_LZOP = 6; + const CompressorId COMPRESSORID_RZIP = 7; + const CompressorId COMPRESSORID_7X = 8; + const CompressorId COMPRESSORID_XAR = 9; + + + + /** + * CompressorIdList type. + */ + //typedef sequence CompressorIdList; + + + + /** + * CompressionLevel type. + */ + typedef unsigned short CompressionLevel; + typedef float CompressionRatio; + + struct CompressorIdLevel { + CompressorId compressor_id; + CompressionLevel compression_level; + }; + typedef sequence CompressorIdLevelList; + + typedef CORBA::OctetSeq Buffer; + + local interface CompressorFactory; + + /** + * Compressor - abstraction of a compressor and decompressor. + */ + local interface Compressor + { + /** + * Operation that compresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the compression, it + * throws CompressionException + */ + void compress(in Buffer source, inout Buffer target) + raises (CompressionException); + /** + * Operation that decompresses data contained in the source Buffer into + * the target Buffer. If an error occurs during the decompression, it + * throws CompressionException + */ + void decompress(in Buffer source, inout Buffer target) + raises(CompressionException); + /** + * The CompressorFactory associated with this Compressor. + */ + readonly attribute CompressorFactory compressor_factory; + /** + * The (implementation and algorithm specific) compression level + * associated with this Compressor. + */ + readonly attribute CompressionLevel compression_level; + /** + * The total number of compressed bytes read and written by Compressors + * that were created by this CompressorFactory + * (i.e. the "target" side of Compressor::compress and + * the "source" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long compressed_bytes; + /** + * The total number of uncompressed bytes read and written by + * Compressors that were created by this CompressorFactory + * (i.e. the "source" side of Compressor::compress and + * the "target" side of Compressor::decompress operations). + */ + readonly attribute unsigned long long uncompressed_bytes; + /** + * This attribute represents the compression ratio achieved by + * this compressor. The ratio can be obtained with the following + * formula: 100 - (compressed_length / original_length)*100. + */ + readonly attribute CompressionRatio compression_ratio; + + }; + + local interface CompressorFactory + { + /** + * The CompressorId associated with this CompressorFactory + */ + readonly attribute CompressorId compressor_id; + + /** + * Create a Compressor instance with the given compression level. + */ + Compressor get_compressor(in CompressionLevel compression_level); + }; + + typedef sequence CompressorFactorySeq; + + /** + * Per-ORB interface to register and unregister CompressorFactories. + * Initial reference: "CompressionManager" + */ + local interface CompressionManager + { + /** + * Register a new CompressorFactory + */ + void register_factory(in CompressorFactory compressor_factory) + raises(FactoryAlreadyRegistered); + /** + * Unregister a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + void unregister_factory(in CompressorId compressor_id) + raises (UnknownCompressorId); + /** + * Retrieve a CompressorFactory with the given CompressorId from the + * CompressionManager + */ + CompressorFactory get_factory(in CompressorId compressor_id) + raises(UnknownCompressorId); + /** + * Create a Compressor with the given compression_level from the + * CompressorFactory with the given CompressorId + */ + Compressor get_compressor(in CompressorId compressor_id, + in CompressionLevel compression_level) + raises(UnknownCompressorId); + /** + * List all registered CompressorFactories + */ + CompressorFactorySeq get_factories(); + + + }; + + +}; + +#endif diff --git a/idl/Compression/ZIOP.idl b/idl/Compression/ZIOP.idl new file mode 100644 index 0000000..59f5120 --- /dev/null +++ b/idl/Compression/ZIOP.idl @@ -0,0 +1,123 @@ +// -*- IDL -*- + +#ifndef _ZIOP_ +#define _ZIOP_ + +#include +#include "Compression.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module ZIOP +{ + + // + // Some attachments for GIOP messages, defined in OMG IDL: + // + + /** + * GIOP Message of a ZIOP message + */ + + struct CompressedData { + + /** + * CompressorId used to compress data + * Must be unique, not a list + */ + + Compression::CompressorId compressorid; + + /** + * Lenght of RequestBody or ReplyBody fields. Usefully for: + * - To checksum + * - To alloc memory at decompress time (in some algorithms) + */ + + unsigned long original_length; + + /** + * RequestBody or ReplyBody compressed + */ + + //CORBA::OctetSeq data; + Compression::Buffer data; + + }; + + + // + // CORBA Policies for ZIOP + // + + typedef boolean CompressionEnablingPolicyValue; + + /** + * Tag Id for CompressionEnablingPolicy + */ + const CORBA::PolicyType COMPRESSION_ENABLING_POLICY_ID = 64; + + /** + * The ZIOP CompressionEnablingPolicy. Has an boolean attribute indicating + * if compression is enabled or not. + */ + local interface CompressionEnablingPolicy : CORBA::Policy + { + readonly attribute CompressionEnablingPolicyValue compression_enabled; + }; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSOR_ID_LEVEL_LIST_POLICY_ID = 65; + + /** + * The ZIOP CompressorIdPolicy. Has an CompressorId attribute indicating + * the compression algorithms that can be used. + */ + local interface CompressorIdLevelListPolicy : CORBA::Policy + { + readonly attribute Compression::CompressorIdLevelList compressor_ids; + }; + + + typedef unsigned long CompressionLowValuePolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_LOW_VALUE_POLICY_ID = 66; + + /** + * The ZIOP LowValuePolicy. Has an low_value attribute indicating the + * minimun size of application data that has tp be send with in a ZIOP Message. + */ + local interface CompressionLowValuePolicy : CORBA::Policy + { + readonly attribute CompressionLowValuePolicyValue low_value; + }; + + + typedef float CompressionMinRatioPolicyValue; + + /** + * Tag Id for CompressorIdPolicy + */ + const CORBA::PolicyType COMPRESSION_MIN_RATIO_POLICY_ID = 67; + + /** + * The ZIOP CompressionMinRatioPolicy. + * + */ + local interface CompressionMinRatioPolicy : CORBA::Policy + { + readonly attribute CompressionMinRatioPolicyValue ratio; + }; + + + + +}; + +#endif diff --git a/idl/Compression/build.xml b/idl/Compression/build.xml new file mode 100644 index 0000000..ba1ffbd --- /dev/null +++ b/idl/Compression/build.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/CosNaming/.class/org/omg/CosNaming/Binding.class b/idl/CosNaming/.class/org/omg/CosNaming/Binding.class new file mode 100644 index 0000000..ccbcae6 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/Binding.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingHelper.class new file mode 100644 index 0000000..a3ed44a Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingHolder.class new file mode 100644 index 0000000..55a0fce Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIterator.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIterator.class new file mode 100644 index 0000000..a9571ef Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIterator.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHelper.class new file mode 100644 index 0000000..adb9782 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHolder.class new file mode 100644 index 0000000..0586a31 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorOperations.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorOperations.class new file mode 100644 index 0000000..65accb3 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorOperations.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOA.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOA.class new file mode 100644 index 0000000..1a867b0 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOA.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOATie.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOATie.class new file mode 100644 index 0000000..0cfc6a9 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingIteratorPOATie.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingListHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingListHelper.class new file mode 100644 index 0000000..4b75ddb Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingListHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingListHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingListHolder.class new file mode 100644 index 0000000..fcc131d Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingListHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingType.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingType.class new file mode 100644 index 0000000..3e6fdc4 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingType.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHelper.class new file mode 100644 index 0000000..d6d1275 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHolder.class new file mode 100644 index 0000000..cceaf17 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/BindingTypeHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/IstringHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/IstringHelper.class new file mode 100644 index 0000000..bda665d Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/IstringHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NameComponent.class b/idl/CosNaming/.class/org/omg/CosNaming/NameComponent.class new file mode 100644 index 0000000..f35f146 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NameComponent.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHelper.class new file mode 100644 index 0000000..fd112ef Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHolder.class new file mode 100644 index 0000000..31030c3 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NameComponentHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NameHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NameHelper.class new file mode 100644 index 0000000..ff40934 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NameHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NameHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NameHolder.class new file mode 100644 index 0000000..751fa5d Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NameHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContext.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContext.class new file mode 100644 index 0000000..3220d86 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContext.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExt.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExt.class new file mode 100644 index 0000000..38df790 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExt.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHelper.class new file mode 100644 index 0000000..46633cc Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHolder.class new file mode 100644 index 0000000..9ea4274 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtOperations.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtOperations.class new file mode 100644 index 0000000..90f4a86 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtOperations.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOA.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOA.class new file mode 100644 index 0000000..bfc2ccc Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOA.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOATie.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOATie.class new file mode 100644 index 0000000..78c4cf4 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPOATie.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class new file mode 100644 index 0000000..be657b7 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/AddressHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class new file mode 100644 index 0000000..1a0279e Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddress.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class new file mode 100644 index 0000000..59f4c97 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class new file mode 100644 index 0000000..f063848 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/InvalidAddressHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class new file mode 100644 index 0000000..d404854 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/StringNameHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class new file mode 100644 index 0000000..2befc4e Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextExtPackage/URLStringHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHelper.class new file mode 100644 index 0000000..4ee7f27 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHolder.class new file mode 100644 index 0000000..295a04a Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextOperations.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextOperations.class new file mode 100644 index 0000000..beef171 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextOperations.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOA.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOA.class new file mode 100644 index 0000000..e5e94b4 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOA.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOATie.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOATie.class new file mode 100644 index 0000000..090f75e Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPOATie.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class new file mode 100644 index 0000000..8ddc4df Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBound.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class new file mode 100644 index 0000000..92c553b Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class new file mode 100644 index 0000000..044d374 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/AlreadyBoundHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceed.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceed.class new file mode 100644 index 0000000..f63c9cc Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceed.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class new file mode 100644 index 0000000..b6fef5e Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class new file mode 100644 index 0000000..b94fbcb Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/CannotProceedHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidName.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidName.class new file mode 100644 index 0000000..6d1bf3c Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidName.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class new file mode 100644 index 0000000..fd5e40a Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class new file mode 100644 index 0000000..7d936f3 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/InvalidNameHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmpty.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmpty.class new file mode 100644 index 0000000..f26cba7 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmpty.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class new file mode 100644 index 0000000..7ad8cb4 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class new file mode 100644 index 0000000..8bea992 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotEmptyHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFound.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFound.class new file mode 100644 index 0000000..a37fb44 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFound.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class new file mode 100644 index 0000000..f7c6562 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class new file mode 100644 index 0000000..7df727e Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class new file mode 100644 index 0000000..36944ca Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReason.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class new file mode 100644 index 0000000..5fce046 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHelper.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class new file mode 100644 index 0000000..2bce953 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/NamingContextPackage/NotFoundReasonHolder.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/_BindingIteratorStub.class b/idl/CosNaming/.class/org/omg/CosNaming/_BindingIteratorStub.class new file mode 100644 index 0000000..679d4d9 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/_BindingIteratorStub.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextExtStub.class b/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextExtStub.class new file mode 100644 index 0000000..876d41c Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextExtStub.class differ diff --git a/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextStub.class b/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextStub.class new file mode 100644 index 0000000..7809046 Binary files /dev/null and b/idl/CosNaming/.class/org/omg/CosNaming/_NamingContextStub.class differ diff --git a/idl/CosNaming/.cvsignore b/idl/CosNaming/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/CosNaming/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/CosNaming/.java/org/omg/CosNaming/Binding.java b/idl/CosNaming/.java/org/omg/CosNaming/Binding.java new file mode 100644 index 0000000..9ca354b --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/Binding.java @@ -0,0 +1,24 @@ +// +// Binding.java (struct) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +public class Binding + implements org.omg.CORBA.portable.IDLEntity { + + public org.omg.CosNaming.NameComponent[] binding_name; + public org.omg.CosNaming.BindingType binding_type; + + public Binding() { + } + + public Binding(org.omg.CosNaming.NameComponent[] binding_name, org.omg.CosNaming.BindingType binding_type) { + this.binding_name = binding_name; + this.binding_type = binding_type; + } + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingHelper.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingHelper.java new file mode 100644 index 0000000..5958a5d --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingHelper.java @@ -0,0 +1,61 @@ +// +// BindingHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +abstract public class BindingHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, Binding value) { + any.insert_Streamable(new BindingHolder(value)); + }; + + public static Binding extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof BindingHolder){ + return ((BindingHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; + members[0] = new org.omg.CORBA.StructMember("binding_name", org.omg.CosNaming.NameHelper.type(), null); + members[1] = new org.omg.CORBA.StructMember("binding_type", org.omg.CosNaming.BindingTypeHelper.type(), null); + _type = _orb().create_struct_tc(id(), "Binding", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CosNaming/Binding:1.0"; + }; + + public static Binding read(org.omg.CORBA.portable.InputStream is) { + Binding result = new Binding(); + result.binding_name = org.omg.CosNaming.NameHelper.read(is); + result.binding_type = org.omg.CosNaming.BindingTypeHelper.read(is); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, Binding val) { + org.omg.CosNaming.NameHelper.write(os,val.binding_name); + org.omg.CosNaming.BindingTypeHelper.write(os,val.binding_type); + }; + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingHolder.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingHolder.java new file mode 100644 index 0000000..00ee57e --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingHolder.java @@ -0,0 +1,33 @@ +// +// BindingHolder.java (holder) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +final public class BindingHolder + implements org.omg.CORBA.portable.Streamable { + + public Binding value; + public BindingHolder() { + } + + public BindingHolder(Binding initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.CosNaming.BindingHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.CosNaming.BindingHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CosNaming.BindingHelper.type(); + }; + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIterator.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIterator.java new file mode 100644 index 0000000..1875295 --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIterator.java @@ -0,0 +1,15 @@ +// +// BindingIterator.java (interface) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +public interface BindingIterator + extends BindingIteratorOperations, + org.omg.CORBA.Object, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHelper.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHelper.java new file mode 100644 index 0000000..e485e42 --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHelper.java @@ -0,0 +1,76 @@ +// +// BindingIteratorHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +abstract public class BindingIteratorHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "BindingIterator"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/CosNaming/BindingIterator:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, BindingIterator value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static BindingIterator extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + BindingIterator value = narrow(obj); + return value; + }; + + public static BindingIterator read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, BindingIterator val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static BindingIterator narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static BindingIterator unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static BindingIterator narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof BindingIterator) { + return (BindingIterator)obj; + } + if (is_a || obj._is_a(id())) { + _BindingIteratorStub result = (_BindingIteratorStub)new _BindingIteratorStub(); + ((org.omg.CORBA.portable.ObjectImpl) result)._set_delegate + (((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate()); + return (BindingIterator)result; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHolder.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHolder.java new file mode 100644 index 0000000..c30b7f7 --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorHolder.java @@ -0,0 +1,33 @@ +// +// BindingIteratorHolder.java (holder) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +final public class BindingIteratorHolder + implements org.omg.CORBA.portable.Streamable { + + public BindingIterator value; + public BindingIteratorHolder() { + } + + public BindingIteratorHolder(BindingIterator initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.CosNaming.BindingIteratorHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.CosNaming.BindingIteratorHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CosNaming.BindingIteratorHelper.type(); + }; + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorOperations.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorOperations.java new file mode 100644 index 0000000..a79fd18 --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorOperations.java @@ -0,0 +1,19 @@ +// +// BindingIterator.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +public interface BindingIteratorOperations { + + boolean next_one(org.omg.CosNaming.BindingHolder b); + + boolean next_n(int how_many, org.omg.CosNaming.BindingListHolder bl); + + void destroy(); + + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOA.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOA.java new file mode 100644 index 0000000..4e11b3e --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOA.java @@ -0,0 +1,85 @@ +// +// BindingIteratorPOA.java (skeleton) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +abstract public class BindingIteratorPOA + extends org.omg.PortableServer.DynamicImplementation + implements BindingIteratorOperations { + + public BindingIterator _this() { + return BindingIteratorHelper.narrow(super._this_object()); + }; + + public BindingIterator _this(org.omg.CORBA.ORB orb) { + return BindingIteratorHelper.narrow(super._this_object(orb)); + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/CosNaming/BindingIterator:1.0" + }; + + private static java.util.Dictionary _methods = new java.util.Hashtable(); + static { + _methods.put("next_one", new Integer(0)); + _methods.put("next_n", new Integer(1)); + _methods.put("destroy", new Integer(2)); + } + + public void invoke(org.omg.CORBA.ServerRequest _request) { + java.lang.Object _method = _methods.get(_request.operation()); + if (_method == null) { + throw new org.omg.CORBA.BAD_OPERATION(_request.operation()); + } + int _method_id = ((java.lang.Integer)_method).intValue(); + switch(_method_id) { + case 0: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $b = _orb().create_any(); + $b.type(org.omg.CosNaming.BindingHelper.type()); + _params.add_value("b", $b, org.omg.CORBA.ARG_OUT.value); + _request.arguments(_params); + org.omg.CosNaming.BindingHolder b = new org.omg.CosNaming.BindingHolder(); + boolean _result = this.next_one(b); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_boolean(_result); + _request.set_result(_resultAny); + org.omg.CosNaming.BindingHelper.insert($b,b.value); + return; + } + case 1: { + org.omg.CORBA.NVList _params = _orb().create_list(2); + org.omg.CORBA.Any $how_many = _orb().create_any(); + $how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); + _params.add_value("how_many", $how_many, org.omg.CORBA.ARG_IN.value); + org.omg.CORBA.Any $bl = _orb().create_any(); + $bl.type(org.omg.CosNaming.BindingListHelper.type()); + _params.add_value("bl", $bl, org.omg.CORBA.ARG_OUT.value); + _request.arguments(_params); + int how_many; + how_many = $how_many.extract_ulong(); + org.omg.CosNaming.BindingListHolder bl = new org.omg.CosNaming.BindingListHolder(); + boolean _result = this.next_n(how_many, bl); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_boolean(_result); + _request.set_result(_resultAny); + org.omg.CosNaming.BindingListHelper.insert($bl,bl.value); + return; + } + case 2: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + this.destroy(); + return; + } + } + } +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOATie.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOATie.java new file mode 100644 index 0000000..d49e80c --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingIteratorPOATie.java @@ -0,0 +1,49 @@ +// +// BindingIteratorPOATie.java (tie) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +public class BindingIteratorPOATie + extends BindingIteratorPOA + implements BindingIteratorOperations { + + private BindingIteratorOperations _delegate; + public BindingIteratorPOATie(BindingIteratorOperations delegate) { + this._delegate = delegate; + }; + + public BindingIteratorOperations _delegate() { + return this._delegate; + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/CosNaming/BindingIterator:1.0" }; + + public boolean next_one(org.omg.CosNaming.BindingHolder b) { + return this._delegate.next_one( + b + ); + }; + + public boolean next_n(int how_many, org.omg.CosNaming.BindingListHolder bl) { + return this._delegate.next_n( + how_many, + bl + ); + }; + + public void destroy() { + this._delegate.destroy( + ); + }; + + +} diff --git a/idl/CosNaming/.java/org/omg/CosNaming/BindingListHelper.java b/idl/CosNaming/.java/org/omg/CosNaming/BindingListHelper.java new file mode 100644 index 0000000..e494699 --- /dev/null +++ b/idl/CosNaming/.java/org/omg/CosNaming/BindingListHelper.java @@ -0,0 +1,64 @@ +// +// BindingListHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CosNaming; + +abstract public class BindingListHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.CosNaming.Binding[] value) { + any.insert_Streamable(new BindingListHolder(value)); + }; + + public static org.omg.CosNaming.Binding[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof BindingListHolder){ + return ((BindingListHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CosNaming.BindingHelper.type()); + _type = _orb().create_alias_tc(id(), "BindingList", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CosNaming/BindingList:1.0"; + }; + + public static org.omg.CosNaming.Binding[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.CosNaming.Binding[] result; + int length0 = is.read_ulong(); + result = new org.omg.CosNaming.Binding[length0]; + for (int i0=0; i0 Name; + + enum BindingType { nobject, ncontext }; + + struct Binding { + Name binding_name; + BindingType binding_type; + }; + + // Note: In struct Binding, binding_name is incorrectly defined + // as a Name instead of a NameComponent. This definition is + // unchanged for compatibility reasons. + + typedef sequence BindingList; + + interface BindingIterator; + + interface NamingContext { + enum NotFoundReason { missing_node, not_context, not_object }; + + exception NotFound { + NotFoundReason why; + Name rest_of_name; + }; + + exception CannotProceed { + NamingContext cxt; + Name rest_of_name; + }; + + exception InvalidName{}; + exception AlreadyBound {}; + exception NotEmpty{}; + + void bind(in Name n, in Object obj) + raises( NotFound, CannotProceed, InvalidName, AlreadyBound ); + + void rebind(in Name n, in Object obj) + raises(NotFound, CannotProceed, InvalidName); + + void bind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + + void rebind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName); + + Object resolve (in Name n) raises(NotFound, CannotProceed, InvalidName); + + void unbind(in Name n) raises(NotFound, CannotProceed, InvalidName); + + NamingContext new_context(); + + NamingContext bind_new_context(in Name n) + raises( NotFound, AlreadyBound, CannotProceed, InvalidName ); + + void destroy() raises(NotEmpty); + + void list( in unsigned long how_many, out BindingList bl, out BindingIterator bi ); + + }; + + interface BindingIterator { + + boolean next_one(out Binding b); + + boolean next_n(in unsigned long how_many, out BindingList bl); + + void destroy(); + + }; + + interface NamingContextExt: NamingContext { + + typedef string StringName; + typedef string Address; + typedef string URLString; + + StringName to_string(in Name n) raises(InvalidName); + + Name to_name(in StringName sn) raises(InvalidName); + + exception InvalidAddress {}; + + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); + + Object resolve_str(in StringName sn) + raises( NotFound, CannotProceed, InvalidName); + }; + +}; + +#endif // _COSNAMING_IDL_ diff --git a/idl/CosNaming/.svn/text-base/build.xml.svn-base b/idl/CosNaming/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..92b9ba8 --- /dev/null +++ b/idl/CosNaming/.svn/text-base/build.xml.svn-base @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/CosNaming/CosNaming.idl b/idl/CosNaming/CosNaming.idl new file mode 100644 index 0000000..2cdb8f7 --- /dev/null +++ b/idl/CosNaming/CosNaming.idl @@ -0,0 +1,108 @@ +// File: CosNaming.idl + +#ifndef _COSNAMING_IDL_ +#define _COSNAMING_IDL_ + +#pragma prefix "omg.org" + +module CosNaming { + typedef string Istring; + + struct NameComponent { + Istring id; + Istring kind; + }; + + typedef sequence Name; + + enum BindingType { nobject, ncontext }; + + struct Binding { + Name binding_name; + BindingType binding_type; + }; + + // Note: In struct Binding, binding_name is incorrectly defined + // as a Name instead of a NameComponent. This definition is + // unchanged for compatibility reasons. + + typedef sequence BindingList; + + interface BindingIterator; + + interface NamingContext { + enum NotFoundReason { missing_node, not_context, not_object }; + + exception NotFound { + NotFoundReason why; + Name rest_of_name; + }; + + exception CannotProceed { + NamingContext cxt; + Name rest_of_name; + }; + + exception InvalidName{}; + exception AlreadyBound {}; + exception NotEmpty{}; + + void bind(in Name n, in Object obj) + raises( NotFound, CannotProceed, InvalidName, AlreadyBound ); + + void rebind(in Name n, in Object obj) + raises(NotFound, CannotProceed, InvalidName); + + void bind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName, AlreadyBound); + + void rebind_context(in Name n, in NamingContext nc) + raises(NotFound, CannotProceed, InvalidName); + + Object resolve (in Name n) raises(NotFound, CannotProceed, InvalidName); + + void unbind(in Name n) raises(NotFound, CannotProceed, InvalidName); + + NamingContext new_context(); + + NamingContext bind_new_context(in Name n) + raises( NotFound, AlreadyBound, CannotProceed, InvalidName ); + + void destroy() raises(NotEmpty); + + void list( in unsigned long how_many, out BindingList bl, out BindingIterator bi ); + + }; + + interface BindingIterator { + + boolean next_one(out Binding b); + + boolean next_n(in unsigned long how_many, out BindingList bl); + + void destroy(); + + }; + + interface NamingContextExt: NamingContext { + + typedef string StringName; + typedef string Address; + typedef string URLString; + + StringName to_string(in Name n) raises(InvalidName); + + Name to_name(in StringName sn) raises(InvalidName); + + exception InvalidAddress {}; + + URLString to_url(in Address addr, in StringName sn) + raises(InvalidAddress, InvalidName); + + Object resolve_str(in StringName sn) + raises( NotFound, CannotProceed, InvalidName); + }; + +}; + +#endif // _COSNAMING_IDL_ diff --git a/idl/CosNaming/build.xml b/idl/CosNaming/build.xml new file mode 100644 index 0000000..0730ca3 --- /dev/null +++ b/idl/CosNaming/build.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHelper.class new file mode 100644 index 0000000..03a2cd2 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHolder.class new file mode 100644 index 0000000..02d35d8 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/AnySeqHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAny.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAny.class new file mode 100644 index 0000000..b497892 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAny.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactory.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactory.class new file mode 100644 index 0000000..8b29ffd Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactory.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHelper.class new file mode 100644 index 0000000..146691d Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHolder.class new file mode 100644 index 0000000..7f4888e Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalBase.class new file mode 100644 index 0000000..5c11ae0 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalTie.class new file mode 100644 index 0000000..34f9e3c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryOperations.class new file mode 100644 index 0000000..d81905d Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class new file mode 100644 index 0000000..39798e3 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCode.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class new file mode 100644 index 0000000..ddda684 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.class new file mode 100644 index 0000000..7122037 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyFactoryPackage/InconsistentTypeCodeHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHelper.class new file mode 100644 index 0000000..7c3c88b Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHolder.class new file mode 100644 index 0000000..3a4a787 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalBase.class new file mode 100644 index 0000000..34539fe Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalTie.class new file mode 100644 index 0000000..77a01ea Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyOperations.class new file mode 100644 index 0000000..a003dd8 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class new file mode 100644 index 0000000..8694b92 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValue.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class new file mode 100644 index 0000000..2d1c7a3 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.class new file mode 100644 index 0000000..b162b33 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/InvalidValueHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class new file mode 100644 index 0000000..7ac9c90 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatch.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class new file mode 100644 index 0000000..857fce0 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.class new file mode 100644 index 0000000..94249ed Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnyPackage/TypeMismatchHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHelper.class new file mode 100644 index 0000000..c515ebd Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHolder.class new file mode 100644 index 0000000..357499b Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynAnySeqHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArray.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArray.class new file mode 100644 index 0000000..26f2d2c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArray.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHelper.class new file mode 100644 index 0000000..e2fa662 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHolder.class new file mode 100644 index 0000000..2728449 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalBase.class new file mode 100644 index 0000000..fd0f2ad Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalTie.class new file mode 100644 index 0000000..919532d Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayOperations.class new file mode 100644 index 0000000..380038b Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynArrayOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnum.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnum.class new file mode 100644 index 0000000..e13c747 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnum.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHelper.class new file mode 100644 index 0000000..7d18e26 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHolder.class new file mode 100644 index 0000000..1db3b68 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalBase.class new file mode 100644 index 0000000..982141c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalTie.class new file mode 100644 index 0000000..d1c5fbf Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumOperations.class new file mode 100644 index 0000000..b44b879 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynEnumOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixed.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixed.class new file mode 100644 index 0000000..620e37c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixed.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHelper.class new file mode 100644 index 0000000..9d15269 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHolder.class new file mode 100644 index 0000000..f465919 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalBase.class new file mode 100644 index 0000000..b277ea6 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalTie.class new file mode 100644 index 0000000..4b6a998 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedOperations.class new file mode 100644 index 0000000..aeb6a0a Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynFixedOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequence.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequence.class new file mode 100644 index 0000000..366f6b4 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequence.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHelper.class new file mode 100644 index 0000000..c49911c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHolder.class new file mode 100644 index 0000000..031690d Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalBase.class new file mode 100644 index 0000000..cc85f07 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalTie.class new file mode 100644 index 0000000..703fd97 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceOperations.class new file mode 100644 index 0000000..305def9 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynSequenceOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStruct.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStruct.class new file mode 100644 index 0000000..ef73368 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStruct.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHelper.class new file mode 100644 index 0000000..061508e Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHolder.class new file mode 100644 index 0000000..5440d65 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalBase.class new file mode 100644 index 0000000..576c368 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalTie.class new file mode 100644 index 0000000..9621964 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructOperations.class new file mode 100644 index 0000000..22840f6 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynStructOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnion.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnion.class new file mode 100644 index 0000000..a2efbd6 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnion.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHelper.class new file mode 100644 index 0000000..fd2b585 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHolder.class new file mode 100644 index 0000000..89785ab Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalBase.class new file mode 100644 index 0000000..ec1ccdb Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalTie.class new file mode 100644 index 0000000..6af13e5 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionOperations.class new file mode 100644 index 0000000..a6eede6 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynUnionOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValue.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValue.class new file mode 100644 index 0000000..010f748 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValue.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommon.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommon.class new file mode 100644 index 0000000..f1dde90 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommon.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHelper.class new file mode 100644 index 0000000..15eb55e Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHolder.class new file mode 100644 index 0000000..303af4c Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalBase.class new file mode 100644 index 0000000..f9b2ffb Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalTie.class new file mode 100644 index 0000000..07ca787 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonOperations.class new file mode 100644 index 0000000..d952cb7 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueCommonOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHelper.class new file mode 100644 index 0000000..9cba792 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHolder.class new file mode 100644 index 0000000..1611c2d Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalBase.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalBase.class new file mode 100644 index 0000000..70b4c04 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalBase.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalTie.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalTie.class new file mode 100644 index 0000000..7de23c1 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueLocalTie.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueOperations.class b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueOperations.class new file mode 100644 index 0000000..8414f63 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/DynValueOperations.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/FieldNameHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/FieldNameHelper.class new file mode 100644 index 0000000..f108eb7 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/FieldNameHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPair.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPair.class new file mode 100644 index 0000000..14fdbe8 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPair.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHelper.class new file mode 100644 index 0000000..d08349a Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHolder.class new file mode 100644 index 0000000..2c289a1 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class new file mode 100644 index 0000000..f8aebbd Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHolder.class new file mode 100644 index 0000000..06be337 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameDynAnyPairSeqHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePair.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePair.class new file mode 100644 index 0000000..5174f4f Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePair.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHelper.class new file mode 100644 index 0000000..35916c0 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHolder.class new file mode 100644 index 0000000..19374ec Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairHolder.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHelper.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHelper.class new file mode 100644 index 0000000..3ce8741 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHelper.class differ diff --git a/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHolder.class b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHolder.class new file mode 100644 index 0000000..f615264 Binary files /dev/null and b/idl/DynamicAny/.class/org/omg/DynamicAny/NameValuePairSeqHolder.class differ diff --git a/idl/DynamicAny/.cvsignore b/idl/DynamicAny/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/DynamicAny/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/DynamicAny/.java/org/omg/DynamicAny/AnySeqHelper.java b/idl/DynamicAny/.java/org/omg/DynamicAny/AnySeqHelper.java new file mode 100644 index 0000000..64d33d9 --- /dev/null +++ b/idl/DynamicAny/.java/org/omg/DynamicAny/AnySeqHelper.java @@ -0,0 +1,64 @@ +// +// AnySeqHelper.java (helper) +// +// File generated: Thu May 19 07:31:41 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.DynamicAny; + +abstract public class AnySeqHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.CORBA.Any[] value) { + any.insert_Streamable(new AnySeqHolder(value)); + }; + + public static org.omg.CORBA.Any[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof AnySeqHolder){ + return ((AnySeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_any)); + _type = _orb().create_alias_tc(id(), "AnySeq", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/DynamicAny/AnySeq:1.0"; + }; + + public static org.omg.CORBA.Any[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.CORBA.Any[] result; + int length0 = is.read_ulong(); + result = new org.omg.CORBA.Any[length0]; + for (int i0=0; i0 + +#pragma prefix "omg.org" + +module DynamicAny { + local interface DynAny { + + exception InvalidValue {}; + exception TypeMismatch {}; + + CORBA::TypeCode type(); + + void assign(in DynAny dyn_any) raises(TypeMismatch); + + void from_any(in any value) raises(TypeMismatch, InvalidValue); + + any to_any(); + + boolean equal(in DynAny dyn_any); + + void destroy(); + + DynAny copy(); + + void insert_boolean(in boolean value) raises(TypeMismatch, InvalidValue); + void insert_octet(in octet value) raises(TypeMismatch, InvalidValue); + void insert_char(in char value) raises(TypeMismatch, InvalidValue); + void insert_short(in short value) raises(TypeMismatch, InvalidValue); + void insert_ushort(in unsigned short value) raises(TypeMismatch,InvalidValue); + void insert_long(in long value) raises(TypeMismatch, InvalidValue); + void insert_ulong(in unsigned long value) raises(TypeMismatch,InvalidValue); + void insert_float(in float value) raises(TypeMismatch, InvalidValue); + void insert_double(in double value) raises(TypeMismatch, InvalidValue); + void insert_string(in string value) raises(TypeMismatch, InvalidValue); + void insert_reference(in Object value) raises(TypeMismatch, InvalidValue); + void insert_typecode(in CORBA::TypeCode value) raises(TypeMismatch,InvalidValue); + void insert_longlong(in long long value) raises(TypeMismatch,InvalidValue); + void insert_ulonglong(in unsigned long long value) raises(TypeMismatch,InvalidValue); + //void insert_longdouble(in long double value) raises(TypeMismatch,InvalidValue); + void insert_wchar(in wchar value) raises(TypeMismatch, InvalidValue); + void insert_wstring(in wstring value) raises(TypeMismatch, InvalidValue); + void insert_any(in any value) raises(TypeMismatch, InvalidValue); + void insert_dyn_any(in DynAny value) raises(TypeMismatch, InvalidValue); + void insert_val(in ValueBase value) raises(TypeMismatch, InvalidValue); + + boolean get_boolean() raises(TypeMismatch, InvalidValue); + octet get_octet() raises(TypeMismatch, InvalidValue); + char get_char() raises(TypeMismatch, InvalidValue); + short get_short() raises(TypeMismatch, InvalidValue); + unsigned short get_ushort() raises(TypeMismatch, InvalidValue); + long get_long() raises(TypeMismatch, InvalidValue); + unsigned long get_ulong() raises(TypeMismatch, InvalidValue); + float get_float() raises(TypeMismatch, InvalidValue); + double get_double() raises(TypeMismatch, InvalidValue); + string get_string() raises(TypeMismatch, InvalidValue); + Object get_reference() raises(TypeMismatch, InvalidValue); + CORBA::TypeCode get_typecode() raises(TypeMismatch, InvalidValue); + long long get_longlong() raises(TypeMismatch, InvalidValue); + unsigned long long get_ulonglong() raises(TypeMismatch, InvalidValue); + //long double get_longdouble() raises(TypeMismatch, InvalidValue); + wchar get_wchar() raises(TypeMismatch, InvalidValue); + wstring get_wstring() raises(TypeMismatch, InvalidValue); + any get_any() raises(TypeMismatch, InvalidValue); + DynAny get_dyn_any() raises(TypeMismatch, InvalidValue); + ValueBase get_val() raises(TypeMismatch, InvalidValue); + + boolean seek(in long index); + void rewind(); + boolean next(); + unsigned long component_count(); + DynAny current_component() raises(TypeMismatch); + + void insert_abstract(in CORBA::AbstractBase value) + raises(TypeMismatch, InvalidValue); + + CORBA::AbstractBase get_abstract() + raises(TypeMismatch, InvalidValue); + + void insert_boolean_seq(in CORBA::BooleanSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_octet_seq(in CORBA::OctetSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_char_seq(in CORBA::CharSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_short_seq(in CORBA::ShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ushort_seq(in CORBA::UShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_long_seq(in CORBA::LongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulong_seq(in CORBA::ULongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_float_seq(in CORBA::FloatSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_double_seq(in CORBA::DoubleSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_longlong_seq(in CORBA::LongLongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulonglong_seq(in CORBA::ULongLongSeq value) + raises(TypeMismatch, InvalidValue); + + // void insert_longdouble_seq(in CORBA::LongDoubleSeq value) + // raises(TypeMismatch, InvalidValue); + + void insert_wchar_seq(in CORBA::WCharSeq value) + raises(TypeMismatch, InvalidValue); + + CORBA::BooleanSeq get_boolean_seq() raises(TypeMismatch, InvalidValue); + + CORBA::OctetSeq get_octet_seq() raises(TypeMismatch, InvalidValue); + + CORBA::CharSeq get_char_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ShortSeq get_short_seq() raises(TypeMismatch, InvalidValue); + + CORBA::UShortSeq get_ushort_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongSeq get_long_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongSeq get_ulong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::FloatSeq get_float_seq() raises(TypeMismatch, InvalidValue); + + CORBA::DoubleSeq get_double_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongLongSeq get_longlong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongLongSeq get_ulonglong_seq() raises(TypeMismatch, InvalidValue); + + // CORBA::LongDoubleSeq get_longdouble_seq() raises(TypeMismatch, InvalidValue); + + CORBA::WCharSeq get_wchar_seq() raises(TypeMismatch, InvalidValue); + + }; + + local interface DynFixed: DynAny { + string get_value(); + boolean set_value(in string val) raises(TypeMismatch, InvalidValue); + }; + + + local interface DynEnum : DynAny { + string get_as_string(); + void set_as_string(in string value) raises(InvalidValue); + unsigned long get_as_ulong(); + void set_as_ulong(in unsigned long value) raises(InvalidValue); + }; + + typedef string FieldName; + struct NameValuePair { + FieldName id; + any value; + }; + + typedef sequence NameValuePairSeq; + + struct NameDynAnyPair { + FieldName id; + DynAny value; + }; + + typedef sequence NameDynAnyPairSeq; + + local interface DynStruct : DynAny { + + FieldName current_member_name() raises(TypeMismatch, InvalidValue); + + CORBA::TCKind current_member_kind() raises(TypeMismatch, InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) + raises(TypeMismatch, InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) + raises(TypeMismatch, InvalidValue); + }; + + + local interface DynUnion : DynAny { + + DynAny get_discriminator(); + + void set_discriminator(in DynAny d) raises(TypeMismatch); + + void set_to_default_member() raises(TypeMismatch); + + void set_to_no_active_member() raises(TypeMismatch); + + boolean has_no_active_member(); + + CORBA::TCKind discriminator_kind(); + + DynAny member() raises(InvalidValue); + + FieldName member_name() raises(InvalidValue); + + CORBA::TCKind member_kind() raises(InvalidValue); + + }; + + typedef sequence AnySeq; + + typedef sequence DynAnySeq; + + local interface DynSequence : DynAny { + + unsigned long get_length(); + + void set_length(in unsigned long len) raises(InvalidValue); + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch,InvalidValue); + + }; + + local interface DynArray : DynAny { + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch, InvalidValue); + + }; + + local interface DynValueCommon : DynAny { + + boolean is_null(); + + void set_to_null(); + + void set_to_value(); + + }; + + local interface DynValue : DynValueCommon { + + FieldName current_member_name()raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + CORBA::TCKind current_member_kind() raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + }; + + local interface DynAnyFactory { + + exception InconsistentTypeCode {}; + + DynAny create_dyn_any(in any value) raises(InconsistentTypeCode); + + DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) raises(InconsistentTypeCode); + + }; + +}; // module DynamicAny + +#endif // _DYNAMIC_ANY_IDL_ + diff --git a/idl/DynamicAny/.svn/text-base/build.xml.svn-base b/idl/DynamicAny/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..a781b46 --- /dev/null +++ b/idl/DynamicAny/.svn/text-base/build.xml.svn-base @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/DynamicAny/DynamicAny.idl b/idl/DynamicAny/DynamicAny.idl new file mode 100644 index 0000000..c588842 --- /dev/null +++ b/idl/DynamicAny/DynamicAny.idl @@ -0,0 +1,290 @@ +// IDL +// File: DynamicAny.idl +#ifndef _DYNAMIC_ANY_IDL_ +#define _DYNAMIC_ANY_IDL_ + +#include + +#pragma prefix "omg.org" + +module DynamicAny { + local interface DynAny { + + exception InvalidValue {}; + exception TypeMismatch {}; + + CORBA::TypeCode type(); + + void assign(in DynAny dyn_any) raises(TypeMismatch); + + void from_any(in any value) raises(TypeMismatch, InvalidValue); + + any to_any(); + + boolean equal(in DynAny dyn_any); + + void destroy(); + + DynAny copy(); + + void insert_boolean(in boolean value) raises(TypeMismatch, InvalidValue); + void insert_octet(in octet value) raises(TypeMismatch, InvalidValue); + void insert_char(in char value) raises(TypeMismatch, InvalidValue); + void insert_short(in short value) raises(TypeMismatch, InvalidValue); + void insert_ushort(in unsigned short value) raises(TypeMismatch,InvalidValue); + void insert_long(in long value) raises(TypeMismatch, InvalidValue); + void insert_ulong(in unsigned long value) raises(TypeMismatch,InvalidValue); + void insert_float(in float value) raises(TypeMismatch, InvalidValue); + void insert_double(in double value) raises(TypeMismatch, InvalidValue); + void insert_string(in string value) raises(TypeMismatch, InvalidValue); + void insert_reference(in Object value) raises(TypeMismatch, InvalidValue); + void insert_typecode(in CORBA::TypeCode value) raises(TypeMismatch,InvalidValue); + void insert_longlong(in long long value) raises(TypeMismatch,InvalidValue); + void insert_ulonglong(in unsigned long long value) raises(TypeMismatch,InvalidValue); + //void insert_longdouble(in long double value) raises(TypeMismatch,InvalidValue); + void insert_wchar(in wchar value) raises(TypeMismatch, InvalidValue); + void insert_wstring(in wstring value) raises(TypeMismatch, InvalidValue); + void insert_any(in any value) raises(TypeMismatch, InvalidValue); + void insert_dyn_any(in DynAny value) raises(TypeMismatch, InvalidValue); + void insert_val(in ValueBase value) raises(TypeMismatch, InvalidValue); + + boolean get_boolean() raises(TypeMismatch, InvalidValue); + octet get_octet() raises(TypeMismatch, InvalidValue); + char get_char() raises(TypeMismatch, InvalidValue); + short get_short() raises(TypeMismatch, InvalidValue); + unsigned short get_ushort() raises(TypeMismatch, InvalidValue); + long get_long() raises(TypeMismatch, InvalidValue); + unsigned long get_ulong() raises(TypeMismatch, InvalidValue); + float get_float() raises(TypeMismatch, InvalidValue); + double get_double() raises(TypeMismatch, InvalidValue); + string get_string() raises(TypeMismatch, InvalidValue); + Object get_reference() raises(TypeMismatch, InvalidValue); + CORBA::TypeCode get_typecode() raises(TypeMismatch, InvalidValue); + long long get_longlong() raises(TypeMismatch, InvalidValue); + unsigned long long get_ulonglong() raises(TypeMismatch, InvalidValue); + //long double get_longdouble() raises(TypeMismatch, InvalidValue); + wchar get_wchar() raises(TypeMismatch, InvalidValue); + wstring get_wstring() raises(TypeMismatch, InvalidValue); + any get_any() raises(TypeMismatch, InvalidValue); + DynAny get_dyn_any() raises(TypeMismatch, InvalidValue); + ValueBase get_val() raises(TypeMismatch, InvalidValue); + + boolean seek(in long index); + void rewind(); + boolean next(); + unsigned long component_count(); + DynAny current_component() raises(TypeMismatch); + + void insert_abstract(in CORBA::AbstractBase value) + raises(TypeMismatch, InvalidValue); + + CORBA::AbstractBase get_abstract() + raises(TypeMismatch, InvalidValue); + + void insert_boolean_seq(in CORBA::BooleanSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_octet_seq(in CORBA::OctetSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_char_seq(in CORBA::CharSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_short_seq(in CORBA::ShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ushort_seq(in CORBA::UShortSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_long_seq(in CORBA::LongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulong_seq(in CORBA::ULongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_float_seq(in CORBA::FloatSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_double_seq(in CORBA::DoubleSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_longlong_seq(in CORBA::LongLongSeq value) + raises(TypeMismatch, InvalidValue); + + void insert_ulonglong_seq(in CORBA::ULongLongSeq value) + raises(TypeMismatch, InvalidValue); + + // void insert_longdouble_seq(in CORBA::LongDoubleSeq value) + // raises(TypeMismatch, InvalidValue); + + void insert_wchar_seq(in CORBA::WCharSeq value) + raises(TypeMismatch, InvalidValue); + + CORBA::BooleanSeq get_boolean_seq() raises(TypeMismatch, InvalidValue); + + CORBA::OctetSeq get_octet_seq() raises(TypeMismatch, InvalidValue); + + CORBA::CharSeq get_char_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ShortSeq get_short_seq() raises(TypeMismatch, InvalidValue); + + CORBA::UShortSeq get_ushort_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongSeq get_long_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongSeq get_ulong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::FloatSeq get_float_seq() raises(TypeMismatch, InvalidValue); + + CORBA::DoubleSeq get_double_seq() raises(TypeMismatch, InvalidValue); + + CORBA::LongLongSeq get_longlong_seq() raises(TypeMismatch, InvalidValue); + + CORBA::ULongLongSeq get_ulonglong_seq() raises(TypeMismatch, InvalidValue); + + // CORBA::LongDoubleSeq get_longdouble_seq() raises(TypeMismatch, InvalidValue); + + CORBA::WCharSeq get_wchar_seq() raises(TypeMismatch, InvalidValue); + + }; + + local interface DynFixed: DynAny { + string get_value(); + boolean set_value(in string val) raises(TypeMismatch, InvalidValue); + }; + + + local interface DynEnum : DynAny { + string get_as_string(); + void set_as_string(in string value) raises(InvalidValue); + unsigned long get_as_ulong(); + void set_as_ulong(in unsigned long value) raises(InvalidValue); + }; + + typedef string FieldName; + struct NameValuePair { + FieldName id; + any value; + }; + + typedef sequence NameValuePairSeq; + + struct NameDynAnyPair { + FieldName id; + DynAny value; + }; + + typedef sequence NameDynAnyPairSeq; + + local interface DynStruct : DynAny { + + FieldName current_member_name() raises(TypeMismatch, InvalidValue); + + CORBA::TCKind current_member_kind() raises(TypeMismatch, InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) + raises(TypeMismatch, InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) + raises(TypeMismatch, InvalidValue); + }; + + + local interface DynUnion : DynAny { + + DynAny get_discriminator(); + + void set_discriminator(in DynAny d) raises(TypeMismatch); + + void set_to_default_member() raises(TypeMismatch); + + void set_to_no_active_member() raises(TypeMismatch); + + boolean has_no_active_member(); + + CORBA::TCKind discriminator_kind(); + + DynAny member() raises(InvalidValue); + + FieldName member_name() raises(InvalidValue); + + CORBA::TCKind member_kind() raises(InvalidValue); + + }; + + typedef sequence AnySeq; + + typedef sequence DynAnySeq; + + local interface DynSequence : DynAny { + + unsigned long get_length(); + + void set_length(in unsigned long len) raises(InvalidValue); + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch,InvalidValue); + + }; + + local interface DynArray : DynAny { + + AnySeq get_elements(); + + void set_elements(in AnySeq value) raises(TypeMismatch, InvalidValue); + + DynAnySeq get_elements_as_dyn_any(); + + void set_elements_as_dyn_any(in DynAnySeq value) raises(TypeMismatch, InvalidValue); + + }; + + local interface DynValueCommon : DynAny { + + boolean is_null(); + + void set_to_null(); + + void set_to_value(); + + }; + + local interface DynValue : DynValueCommon { + + FieldName current_member_name()raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + CORBA::TCKind current_member_kind() raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameValuePairSeq get_members(); + + void set_members(in NameValuePairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + NameDynAnyPairSeq get_members_as_dyn_any(); + + void set_members_as_dyn_any(in NameDynAnyPairSeq value) raises(DynAny::TypeMismatch, DynAny::InvalidValue); + + }; + + local interface DynAnyFactory { + + exception InconsistentTypeCode {}; + + DynAny create_dyn_any(in any value) raises(InconsistentTypeCode); + + DynAny create_dyn_any_from_type_code(in CORBA::TypeCode type) raises(InconsistentTypeCode); + + }; + +}; // module DynamicAny + +#endif // _DYNAMIC_ANY_IDL_ + diff --git a/idl/DynamicAny/build.xml b/idl/DynamicAny/build.xml new file mode 100644 index 0000000..7753427 --- /dev/null +++ b/idl/DynamicAny/build.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/Messaging/.class/org/omg/Dynamic/ContextListHelper.class b/idl/Messaging/.class/org/omg/Dynamic/ContextListHelper.class new file mode 100644 index 0000000..8b2c37b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ContextListHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHelper.class b/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHelper.class new file mode 100644 index 0000000..d1757f0 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHolder.class b/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHolder.class new file mode 100644 index 0000000..cf269f5 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ExceptionListHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/Parameter.class b/idl/Messaging/.class/org/omg/Dynamic/Parameter.class new file mode 100644 index 0000000..ed31bb8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/Parameter.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ParameterHelper.class b/idl/Messaging/.class/org/omg/Dynamic/ParameterHelper.class new file mode 100644 index 0000000..852cd54 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ParameterHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ParameterHolder.class b/idl/Messaging/.class/org/omg/Dynamic/ParameterHolder.class new file mode 100644 index 0000000..50395af Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ParameterHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ParameterListHelper.class b/idl/Messaging/.class/org/omg/Dynamic/ParameterListHelper.class new file mode 100644 index 0000000..92f9230 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ParameterListHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/ParameterListHolder.class b/idl/Messaging/.class/org/omg/Dynamic/ParameterListHolder.class new file mode 100644 index 0000000..143c581 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/ParameterListHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Dynamic/RequestContextHelper.class b/idl/Messaging/.class/org/omg/Dynamic/RequestContextHelper.class new file mode 100644 index 0000000..977c5b6 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Dynamic/RequestContextHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/INVOCATION_POLICIES.class b/idl/Messaging/.class/org/omg/Messaging/INVOCATION_POLICIES.class new file mode 100644 index 0000000..bf37a6b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/INVOCATION_POLICIES.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MAX_HOPS_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/MAX_HOPS_POLICY_TYPE.class new file mode 100644 index 0000000..b5beb55 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MAX_HOPS_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MarshaledExceptionHelper.class b/idl/Messaging/.class/org/omg/Messaging/MarshaledExceptionHelper.class new file mode 100644 index 0000000..bbc3bd5 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MarshaledExceptionHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicy.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicy.class new file mode 100644 index 0000000..8c46f5b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHelper.class new file mode 100644 index 0000000..da612a3 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHolder.class new file mode 100644 index 0000000..b9caf6d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalBase.class new file mode 100644 index 0000000..866a08a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalTie.class new file mode 100644 index 0000000..7301afb Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyOperations.class new file mode 100644 index 0000000..9a7097e Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/MaxHopsPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/NO_REBIND.class b/idl/Messaging/.class/org/omg/Messaging/NO_REBIND.class new file mode 100644 index 0000000..6d85b85 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/NO_REBIND.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/NO_RECONNECT.class b/idl/Messaging/.class/org/omg/Messaging/NO_RECONNECT.class new file mode 100644 index 0000000..941789e Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/NO_RECONNECT.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ORDER_ANY.class b/idl/Messaging/.class/org/omg/Messaging/ORDER_ANY.class new file mode 100644 index 0000000..6de947a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ORDER_ANY.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ORDER_DEADLINE.class b/idl/Messaging/.class/org/omg/Messaging/ORDER_DEADLINE.class new file mode 100644 index 0000000..9589a29 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ORDER_DEADLINE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ORDER_PRIORITY.class b/idl/Messaging/.class/org/omg/Messaging/ORDER_PRIORITY.class new file mode 100644 index 0000000..c54736f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ORDER_PRIORITY.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ORDER_TEMPORAL.class b/idl/Messaging/.class/org/omg/Messaging/ORDER_TEMPORAL.class new file mode 100644 index 0000000..3e8b44a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ORDER_TEMPORAL.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/OrderingHelper.class b/idl/Messaging/.class/org/omg/Messaging/OrderingHelper.class new file mode 100644 index 0000000..3f17698 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/OrderingHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PolicyValue.class b/idl/Messaging/.class/org/omg/Messaging/PolicyValue.class new file mode 100644 index 0000000..68ead0c Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PolicyValue.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PolicyValueHelper.class b/idl/Messaging/.class/org/omg/Messaging/PolicyValueHelper.class new file mode 100644 index 0000000..6153361 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PolicyValueHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PolicyValueHolder.class b/idl/Messaging/.class/org/omg/Messaging/PolicyValueHolder.class new file mode 100644 index 0000000..f3e20fd Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PolicyValueHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHelper.class b/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHelper.class new file mode 100644 index 0000000..4143b4d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHolder.class b/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHolder.class new file mode 100644 index 0000000..772a6c2 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PolicyValueSeqHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PriorityHelper.class b/idl/Messaging/.class/org/omg/Messaging/PriorityHelper.class new file mode 100644 index 0000000..dda7e55 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PriorityHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PriorityRange.class b/idl/Messaging/.class/org/omg/Messaging/PriorityRange.class new file mode 100644 index 0000000..f4d14c0 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PriorityRange.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHelper.class b/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHelper.class new file mode 100644 index 0000000..90f4cbe Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHolder.class b/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHolder.class new file mode 100644 index 0000000..31ef14d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/PriorityRangeHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QUEUE_ORDER_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/QUEUE_ORDER_POLICY_TYPE.class new file mode 100644 index 0000000..f61728c Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QUEUE_ORDER_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicy.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicy.class new file mode 100644 index 0000000..47cfbe5 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHelper.class new file mode 100644 index 0000000..eb44186 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHolder.class new file mode 100644 index 0000000..e7c5b5f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalBase.class new file mode 100644 index 0000000..34bd12b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalTie.class new file mode 100644 index 0000000..320da72 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyOperations.class new file mode 100644 index 0000000..af96743 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/QueueOrderPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REBIND_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REBIND_POLICY_TYPE.class new file mode 100644 index 0000000..7686caa Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REBIND_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RELATIVE_REQ_TIMEOUT_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/RELATIVE_REQ_TIMEOUT_POLICY_TYPE.class new file mode 100644 index 0000000..6542ec8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RELATIVE_REQ_TIMEOUT_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RELATIVE_RT_TIMEOUT_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/RELATIVE_RT_TIMEOUT_POLICY_TYPE.class new file mode 100644 index 0000000..7ae3ed9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RELATIVE_RT_TIMEOUT_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REPLY_END_TIME_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REPLY_END_TIME_POLICY_TYPE.class new file mode 100644 index 0000000..194f6b3 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REPLY_END_TIME_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REPLY_PRIORITY_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REPLY_PRIORITY_POLICY_TYPE.class new file mode 100644 index 0000000..a23ef43 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REPLY_PRIORITY_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REPLY_START_TIME_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REPLY_START_TIME_POLICY_TYPE.class new file mode 100644 index 0000000..8670ac8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REPLY_START_TIME_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REQUEST_END_TIME_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REQUEST_END_TIME_POLICY_TYPE.class new file mode 100644 index 0000000..98f4f40 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REQUEST_END_TIME_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REQUEST_PRIORITY_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REQUEST_PRIORITY_POLICY_TYPE.class new file mode 100644 index 0000000..67febeb Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REQUEST_PRIORITY_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/REQUEST_START_TIME_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/REQUEST_START_TIME_POLICY_TYPE.class new file mode 100644 index 0000000..a3e7775 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/REQUEST_START_TIME_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ROUTE_FORWARD.class b/idl/Messaging/.class/org/omg/Messaging/ROUTE_FORWARD.class new file mode 100644 index 0000000..b9d5d16 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ROUTE_FORWARD.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ROUTE_NONE.class b/idl/Messaging/.class/org/omg/Messaging/ROUTE_NONE.class new file mode 100644 index 0000000..67819a7 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ROUTE_NONE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ROUTE_STORE_AND_FORWARD.class b/idl/Messaging/.class/org/omg/Messaging/ROUTE_STORE_AND_FORWARD.class new file mode 100644 index 0000000..7c399ae Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ROUTE_STORE_AND_FORWARD.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ROUTING_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/ROUTING_POLICY_TYPE.class new file mode 100644 index 0000000..558f1d8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ROUTING_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindModeHelper.class b/idl/Messaging/.class/org/omg/Messaging/RebindModeHelper.class new file mode 100644 index 0000000..d5ecf41 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindModeHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicy.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicy.class new file mode 100644 index 0000000..1816632 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHelper.class new file mode 100644 index 0000000..900f224 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHolder.class new file mode 100644 index 0000000..4464c80 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalBase.class new file mode 100644 index 0000000..6808a82 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalTie.class new file mode 100644 index 0000000..5af1b19 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RebindPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyOperations.class new file mode 100644 index 0000000..6de4710 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RebindPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicy.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicy.class new file mode 100644 index 0000000..9d0cefe Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHelper.class new file mode 100644 index 0000000..995f091 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHolder.class new file mode 100644 index 0000000..4191622 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalBase.class new file mode 100644 index 0000000..b0c9693 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalTie.class new file mode 100644 index 0000000..2df4116 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyOperations.class new file mode 100644 index 0000000..633fba5 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRequestTimeoutPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicy.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicy.class new file mode 100644 index 0000000..2ec26a1 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHelper.class new file mode 100644 index 0000000..7d15320 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHolder.class new file mode 100644 index 0000000..2366f6b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalBase.class new file mode 100644 index 0000000..4188a95 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalTie.class new file mode 100644 index 0000000..f2e7ba9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyOperations.class new file mode 100644 index 0000000..7a3e4bb Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RelativeRoundtripTimeoutPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicy.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicy.class new file mode 100644 index 0000000..b8e85ee Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHelper.class new file mode 100644 index 0000000..004fd85 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHolder.class new file mode 100644 index 0000000..bb98664 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalBase.class new file mode 100644 index 0000000..cdbf757 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalTie.class new file mode 100644 index 0000000..aa6850a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyOperations.class new file mode 100644 index 0000000..32cd481 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyEndTimePolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandler.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandler.class new file mode 100644 index 0000000..79bb453 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandler.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHelper.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHelper.class new file mode 100644 index 0000000..8b67bee Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHolder.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHolder.class new file mode 100644 index 0000000..bd63d10 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerOperations.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerOperations.class new file mode 100644 index 0000000..e370298 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOA.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOA.class new file mode 100644 index 0000000..c70e856 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOA.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOATie.class b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOATie.class new file mode 100644 index 0000000..2cf2fc9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyHandlerPOATie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicy.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicy.class new file mode 100644 index 0000000..126088b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHelper.class new file mode 100644 index 0000000..f11a11c Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHolder.class new file mode 100644 index 0000000..a7c00fa Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyOperations.class new file mode 100644 index 0000000..7a227d8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOA.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOA.class new file mode 100644 index 0000000..6c19622 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOA.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOATie.class b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOATie.class new file mode 100644 index 0000000..338c4d2 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyPriorityPolicyPOATie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicy.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicy.class new file mode 100644 index 0000000..1c82049 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHelper.class new file mode 100644 index 0000000..e1f770f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHolder.class new file mode 100644 index 0000000..f210699 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalBase.class new file mode 100644 index 0000000..2898c4f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalTie.class new file mode 100644 index 0000000..5913a8f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyOperations.class new file mode 100644 index 0000000..6212612 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/ReplyStartTimePolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicy.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicy.class new file mode 100644 index 0000000..5914df9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHelper.class new file mode 100644 index 0000000..f7a2999 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHolder.class new file mode 100644 index 0000000..81616e8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalBase.class new file mode 100644 index 0000000..2a97659 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalTie.class new file mode 100644 index 0000000..73674a0 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyOperations.class new file mode 100644 index 0000000..c76a425 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestEndTimePolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicy.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicy.class new file mode 100644 index 0000000..55f82a9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHelper.class new file mode 100644 index 0000000..ad331a0 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHolder.class new file mode 100644 index 0000000..1c6655f Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalBase.class new file mode 100644 index 0000000..1a45195 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalTie.class new file mode 100644 index 0000000..68ac84d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyOperations.class new file mode 100644 index 0000000..4d24115 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestPriorityPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicy.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicy.class new file mode 100644 index 0000000..8f6f1a1 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHelper.class new file mode 100644 index 0000000..1539a5b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHolder.class new file mode 100644 index 0000000..ce6148c Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalBase.class new file mode 100644 index 0000000..2627e2a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalTie.class new file mode 100644 index 0000000..e0f0553 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyOperations.class new file mode 100644 index 0000000..f046471 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RequestStartTimePolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicy.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicy.class new file mode 100644 index 0000000..d319d59 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHelper.class new file mode 100644 index 0000000..258a463 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHolder.class new file mode 100644 index 0000000..5ceee5d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalBase.class new file mode 100644 index 0000000..d4e0730 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalTie.class new file mode 100644 index 0000000..8831f1b Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyOperations.class new file mode 100644 index 0000000..6c959a2 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingPolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingTypeHelper.class b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeHelper.class new file mode 100644 index 0000000..91c1b2d Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRange.class b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRange.class new file mode 100644 index 0000000..6664c36 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRange.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHelper.class b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHelper.class new file mode 100644 index 0000000..1e5628e Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHolder.class b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHolder.class new file mode 100644 index 0000000..8f11523 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/RoutingTypeRangeHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SYNC_NONE.class b/idl/Messaging/.class/org/omg/Messaging/SYNC_NONE.class new file mode 100644 index 0000000..4d8f4c8 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SYNC_NONE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SYNC_SCOPE_POLICY_TYPE.class b/idl/Messaging/.class/org/omg/Messaging/SYNC_SCOPE_POLICY_TYPE.class new file mode 100644 index 0000000..ba538ae Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SYNC_SCOPE_POLICY_TYPE.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_SERVER.class b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_SERVER.class new file mode 100644 index 0000000..28ab796 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_SERVER.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TARGET.class b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TARGET.class new file mode 100644 index 0000000..9d1459a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TARGET.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TRANSPORT.class b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TRANSPORT.class new file mode 100644 index 0000000..cdf06fb Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SYNC_WITH_TRANSPORT.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopeHelper.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopeHelper.class new file mode 100644 index 0000000..b9ee410 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopeHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicy.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicy.class new file mode 100644 index 0000000..85357b9 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicy.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHelper.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHelper.class new file mode 100644 index 0000000..ba9c7bf Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHolder.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHolder.class new file mode 100644 index 0000000..1933448 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalBase.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalBase.class new file mode 100644 index 0000000..6909261 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalBase.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalTie.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalTie.class new file mode 100644 index 0000000..3902459 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyLocalTie.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyOperations.class b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyOperations.class new file mode 100644 index 0000000..cc9c9d2 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/SyncScopePolicyOperations.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/TAG_POLICIES.class b/idl/Messaging/.class/org/omg/Messaging/TAG_POLICIES.class new file mode 100644 index 0000000..3a2f781 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/TAG_POLICIES.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/TRANSPARENT.class b/idl/Messaging/.class/org/omg/Messaging/TRANSPARENT.class new file mode 100644 index 0000000..61b56a6 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/TRANSPARENT.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolder.class b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolder.class new file mode 100644 index 0000000..f61c6cc Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHelper.class b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHelper.class new file mode 100644 index 0000000..0ff8cfd Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHelper.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHolder.class b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHolder.class new file mode 100644 index 0000000..55df0d6 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/_ExceptionHolderHolder.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/_ReplyHandlerStub.class b/idl/Messaging/.class/org/omg/Messaging/_ReplyHandlerStub.class new file mode 100644 index 0000000..7c24f24 Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/_ReplyHandlerStub.class differ diff --git a/idl/Messaging/.class/org/omg/Messaging/_ReplyPriorityPolicyStub.class b/idl/Messaging/.class/org/omg/Messaging/_ReplyPriorityPolicyStub.class new file mode 100644 index 0000000..815d11a Binary files /dev/null and b/idl/Messaging/.class/org/omg/Messaging/_ReplyPriorityPolicyStub.class differ diff --git a/idl/Messaging/.cvsignore b/idl/Messaging/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/Messaging/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/Messaging/.java/org/omg/Dynamic/ContextListHelper.java b/idl/Messaging/.java/org/omg/Dynamic/ContextListHelper.java new file mode 100644 index 0000000..92e5a56 --- /dev/null +++ b/idl/Messaging/.java/org/omg/Dynamic/ContextListHelper.java @@ -0,0 +1,57 @@ +// +// ContextListHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Dynamic; + +abstract public class ContextListHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, java.lang.String[] value) { + any.insert_Streamable(new org.omg.CORBA.StringSeqHolder(value)); + }; + + public static java.lang.String[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.StringSeqHolder){ + return ((org.omg.CORBA.StringSeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.StringSeqHelper.type(); + _type = _orb().create_alias_tc(id(), "ContextList", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Dynamic/ContextList:1.0"; + }; + + public static java.lang.String[] read(org.omg.CORBA.portable.InputStream is) { + java.lang.String[] result; + result = org.omg.CORBA.StringSeqHelper.read(is); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, java.lang.String[] val) { + org.omg.CORBA.StringSeqHelper.write(os,val); + }; + +} diff --git a/idl/Messaging/.java/org/omg/Dynamic/ExceptionListHelper.java b/idl/Messaging/.java/org/omg/Dynamic/ExceptionListHelper.java new file mode 100644 index 0000000..e836d16 --- /dev/null +++ b/idl/Messaging/.java/org/omg/Dynamic/ExceptionListHelper.java @@ -0,0 +1,64 @@ +// +// ExceptionListHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.Dynamic; + +abstract public class ExceptionListHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.CORBA.TypeCode[] value) { + any.insert_Streamable(new ExceptionListHolder(value)); + }; + + public static org.omg.CORBA.TypeCode[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof ExceptionListHolder){ + return ((ExceptionListHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_TypeCode)); + _type = _orb().create_alias_tc(id(), "ExceptionList", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/Dynamic/ExceptionList:1.0"; + }; + + public static org.omg.CORBA.TypeCode[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.CORBA.TypeCode[] result; + int length0 = is.read_ulong(); + result = new org.omg.CORBA.TypeCode[length0]; + for (int i0=0; i0 + +module Dynamic { + + struct Parameter { + any argument; + CORBA::ParameterMode mode; + }; + + typedef sequence ParameterList; + typedef CORBA::StringSeq ContextList; + typedef sequence ExceptionList; + typedef CORBA::StringSeq RequestContext; + +}; // module Dynamic diff --git a/idl/Messaging/.svn/text-base/Messaging.idl.svn-base b/idl/Messaging/.svn/text-base/Messaging.idl.svn-base new file mode 100644 index 0000000..c1cde05 --- /dev/null +++ b/idl/Messaging/.svn/text-base/Messaging.idl.svn-base @@ -0,0 +1,171 @@ +#ifndef __CORBA_MESSAGING_ +#define __CORBA_MESSAGING_ + +#include +#include "IOP.idl" +#include "TimeBase.idl" +#include "Dynamic.idl" + +#pragma prefix "omg.org" + +module Messaging { + + typedef short RebindMode; + const RebindMode TRANSPARENT = 0; + const RebindMode NO_REBIND = 1; + const RebindMode NO_RECONNECT = 2; + + typedef short SyncScope; + const SyncScope SYNC_NONE = 0; + const SyncScope SYNC_WITH_TRANSPORT = 1; + const SyncScope SYNC_WITH_SERVER = 2; + const SyncScope SYNC_WITH_TARGET = 3; + + typedef short RoutingType; + const RoutingType ROUTE_NONE = 0; + const RoutingType ROUTE_FORWARD = 1; + const RoutingType ROUTE_STORE_AND_FORWARD = 2; + + + typedef short Priority; + + typedef unsigned short Ordering; + const Ordering ORDER_ANY = 0x01; + const Ordering ORDER_TEMPORAL = 0x02; + const Ordering ORDER_PRIORITY = 0x04; + const Ordering ORDER_DEADLINE = 0x08; + + // Rebind Policy (default = TRANSPARENT) + + const CORBA::PolicyType REBIND_POLICY_TYPE = 23; + + local interface RebindPolicy : CORBA::Policy { + readonly attribute RebindMode rebind_mode; + }; + + // Synchronization Policy (default = SYNC_WITH_TRANSPORT) + + const CORBA::PolicyType SYNC_SCOPE_POLICY_TYPE = 24; + local interface SyncScopePolicy : CORBA::Policy { + readonly attribute SyncScope synchronization; + }; + + // Priority Policies + + const CORBA::PolicyType REQUEST_PRIORITY_POLICY_TYPE = 25; + + struct PriorityRange { + Priority min; + Priority max; + }; + + local interface RequestPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + const CORBA::PolicyType REPLY_PRIORITY_POLICY_TYPE = 26; + + interface ReplyPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + // Timeout Policies + + const CORBA::PolicyType REQUEST_START_TIME_POLICY_TYPE = 27; + + local interface RequestStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REQUEST_END_TIME_POLICY_TYPE = 28; + + local interface RequestEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType REPLY_START_TIME_POLICY_TYPE = 29; + + local interface ReplyStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REPLY_END_TIME_POLICY_TYPE = 30; + + local interface ReplyEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType RELATIVE_REQ_TIMEOUT_POLICY_TYPE = 31; + + local interface RelativeRequestTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType RELATIVE_RT_TIMEOUT_POLICY_TYPE = 32; + + local interface RelativeRoundtripTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType ROUTING_POLICY_TYPE = 33; + + struct RoutingTypeRange { + RoutingType min; + RoutingType max; + }; + + local interface RoutingPolicy : CORBA::Policy { + readonly attribute RoutingTypeRange routing_range; + }; + + const CORBA::PolicyType MAX_HOPS_POLICY_TYPE = 34; + + local interface MaxHopsPolicy : CORBA::Policy { + readonly attribute unsigned short max_hops; + }; + + // Router Delivery-ordering Policy (default = ORDER_TEMPORAL) + + const CORBA::PolicyType QUEUE_ORDER_POLICY_TYPE = 35; + + local interface QueueOrderPolicy : CORBA::Policy { + readonly attribute Ordering allowed_orders; + }; + + + struct PolicyValue { + CORBA::PolicyType ptype; + sequence pvalue; + }; + + typedef sequence PolicyValueSeq; + + const IOP::ComponentId TAG_POLICIES = 2; + const IOP::ServiceId INVOCATION_POLICIES = 7; + + // + // Exception Delivery in the Callback Model + // + + typedef CORBA::OctetSeq MarshaledException; + native UserExceptionBase; + + valuetype ExceptionHolder { + void raise_exception() raises (UserExceptionBase); + void raise_exception_with_list(in Dynamic::ExceptionList exc_list) + raises (UserExceptionBase); + + private boolean is_system_exception; + private boolean byte_order; + private MarshaledException marshaled_exception; + }; + + + // + // Base interface for the Callback model + // + + interface ReplyHandler { }; +}; + +#endif diff --git a/idl/Messaging/.svn/text-base/build.xml.svn-base b/idl/Messaging/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..dd0f299 --- /dev/null +++ b/idl/Messaging/.svn/text-base/build.xml.svn-base @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/Messaging/Dynamic.idl b/idl/Messaging/Dynamic.idl new file mode 100644 index 0000000..0c10554 --- /dev/null +++ b/idl/Messaging/Dynamic.idl @@ -0,0 +1,19 @@ +// File: Dynamic.idl +// CORBA 3.0, Chapter 21 + +#pragma prefix "omg.org" +#include + +module Dynamic { + + struct Parameter { + any argument; + CORBA::ParameterMode mode; + }; + + typedef sequence ParameterList; + typedef CORBA::StringSeq ContextList; + typedef sequence ExceptionList; + typedef CORBA::StringSeq RequestContext; + +}; // module Dynamic diff --git a/idl/Messaging/Messaging.idl b/idl/Messaging/Messaging.idl new file mode 100644 index 0000000..c1cde05 --- /dev/null +++ b/idl/Messaging/Messaging.idl @@ -0,0 +1,171 @@ +#ifndef __CORBA_MESSAGING_ +#define __CORBA_MESSAGING_ + +#include +#include "IOP.idl" +#include "TimeBase.idl" +#include "Dynamic.idl" + +#pragma prefix "omg.org" + +module Messaging { + + typedef short RebindMode; + const RebindMode TRANSPARENT = 0; + const RebindMode NO_REBIND = 1; + const RebindMode NO_RECONNECT = 2; + + typedef short SyncScope; + const SyncScope SYNC_NONE = 0; + const SyncScope SYNC_WITH_TRANSPORT = 1; + const SyncScope SYNC_WITH_SERVER = 2; + const SyncScope SYNC_WITH_TARGET = 3; + + typedef short RoutingType; + const RoutingType ROUTE_NONE = 0; + const RoutingType ROUTE_FORWARD = 1; + const RoutingType ROUTE_STORE_AND_FORWARD = 2; + + + typedef short Priority; + + typedef unsigned short Ordering; + const Ordering ORDER_ANY = 0x01; + const Ordering ORDER_TEMPORAL = 0x02; + const Ordering ORDER_PRIORITY = 0x04; + const Ordering ORDER_DEADLINE = 0x08; + + // Rebind Policy (default = TRANSPARENT) + + const CORBA::PolicyType REBIND_POLICY_TYPE = 23; + + local interface RebindPolicy : CORBA::Policy { + readonly attribute RebindMode rebind_mode; + }; + + // Synchronization Policy (default = SYNC_WITH_TRANSPORT) + + const CORBA::PolicyType SYNC_SCOPE_POLICY_TYPE = 24; + local interface SyncScopePolicy : CORBA::Policy { + readonly attribute SyncScope synchronization; + }; + + // Priority Policies + + const CORBA::PolicyType REQUEST_PRIORITY_POLICY_TYPE = 25; + + struct PriorityRange { + Priority min; + Priority max; + }; + + local interface RequestPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + const CORBA::PolicyType REPLY_PRIORITY_POLICY_TYPE = 26; + + interface ReplyPriorityPolicy : CORBA::Policy { + readonly attribute PriorityRange priority_range; + }; + + // Timeout Policies + + const CORBA::PolicyType REQUEST_START_TIME_POLICY_TYPE = 27; + + local interface RequestStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REQUEST_END_TIME_POLICY_TYPE = 28; + + local interface RequestEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType REPLY_START_TIME_POLICY_TYPE = 29; + + local interface ReplyStartTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT start_time; + }; + + const CORBA::PolicyType REPLY_END_TIME_POLICY_TYPE = 30; + + local interface ReplyEndTimePolicy : CORBA::Policy { + readonly attribute TimeBase::UtcT end_time; + }; + + const CORBA::PolicyType RELATIVE_REQ_TIMEOUT_POLICY_TYPE = 31; + + local interface RelativeRequestTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType RELATIVE_RT_TIMEOUT_POLICY_TYPE = 32; + + local interface RelativeRoundtripTimeoutPolicy : CORBA::Policy { + readonly attribute TimeBase::TimeT relative_expiry; + }; + + const CORBA::PolicyType ROUTING_POLICY_TYPE = 33; + + struct RoutingTypeRange { + RoutingType min; + RoutingType max; + }; + + local interface RoutingPolicy : CORBA::Policy { + readonly attribute RoutingTypeRange routing_range; + }; + + const CORBA::PolicyType MAX_HOPS_POLICY_TYPE = 34; + + local interface MaxHopsPolicy : CORBA::Policy { + readonly attribute unsigned short max_hops; + }; + + // Router Delivery-ordering Policy (default = ORDER_TEMPORAL) + + const CORBA::PolicyType QUEUE_ORDER_POLICY_TYPE = 35; + + local interface QueueOrderPolicy : CORBA::Policy { + readonly attribute Ordering allowed_orders; + }; + + + struct PolicyValue { + CORBA::PolicyType ptype; + sequence pvalue; + }; + + typedef sequence PolicyValueSeq; + + const IOP::ComponentId TAG_POLICIES = 2; + const IOP::ServiceId INVOCATION_POLICIES = 7; + + // + // Exception Delivery in the Callback Model + // + + typedef CORBA::OctetSeq MarshaledException; + native UserExceptionBase; + + valuetype ExceptionHolder { + void raise_exception() raises (UserExceptionBase); + void raise_exception_with_list(in Dynamic::ExceptionList exc_list) + raises (UserExceptionBase); + + private boolean is_system_exception; + private boolean byte_order; + private MarshaledException marshaled_exception; + }; + + + // + // Base interface for the Callback model + // + + interface ReplyHandler { }; +}; + +#endif diff --git a/idl/Messaging/build.xml b/idl/Messaging/build.xml new file mode 100644 index 0000000..eaa238b --- /dev/null +++ b/idl/Messaging/build.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/Messaging/extra/.svn/all-wcprops b/idl/Messaging/extra/.svn/all-wcprops new file mode 100644 index 0000000..e88403d --- /dev/null +++ b/idl/Messaging/extra/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/Messaging/extra +END diff --git a/idl/Messaging/extra/.svn/entries b/idl/Messaging/extra/.svn/entries new file mode 100644 index 0000000..248c223 --- /dev/null +++ b/idl/Messaging/extra/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/Messaging/extra +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +org +dir + diff --git a/idl/Messaging/extra/org/.svn/all-wcprops b/idl/Messaging/extra/org/.svn/all-wcprops new file mode 100644 index 0000000..f3d0c6d --- /dev/null +++ b/idl/Messaging/extra/org/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/Messaging/extra/org +END diff --git a/idl/Messaging/extra/org/.svn/entries b/idl/Messaging/extra/org/.svn/entries new file mode 100644 index 0000000..d70b3cd --- /dev/null +++ b/idl/Messaging/extra/org/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/Messaging/extra/org +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +omg +dir + diff --git a/idl/Messaging/extra/org/omg/.svn/all-wcprops b/idl/Messaging/extra/org/omg/.svn/all-wcprops new file mode 100644 index 0000000..b3b3f07 --- /dev/null +++ b/idl/Messaging/extra/org/omg/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/Messaging/extra/org/omg +END diff --git a/idl/Messaging/extra/org/omg/.svn/entries b/idl/Messaging/extra/org/omg/.svn/entries new file mode 100644 index 0000000..08eb220 --- /dev/null +++ b/idl/Messaging/extra/org/omg/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/Messaging/extra/org/omg +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Messaging +dir + diff --git a/idl/Messaging/extra/org/omg/Messaging/.svn/all-wcprops b/idl/Messaging/extra/org/omg/Messaging/.svn/all-wcprops new file mode 100644 index 0000000..8ac5064 --- /dev/null +++ b/idl/Messaging/extra/org/omg/Messaging/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/Messaging/extra/org/omg/Messaging +END +_ExceptionHolder.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/Messaging/extra/org/omg/Messaging/_ExceptionHolder.java +END diff --git a/idl/Messaging/extra/org/omg/Messaging/.svn/entries b/idl/Messaging/extra/org/omg/Messaging/.svn/entries new file mode 100644 index 0000000..d3a0702 --- /dev/null +++ b/idl/Messaging/extra/org/omg/Messaging/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/Messaging/extra/org/omg/Messaging +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +_ExceptionHolder.java +file + + + + +2010-04-28T10:47:59.000000Z +ae521c7c476cd67c64998a08903bdb58 +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + + + + + + + + +1402 + diff --git a/idl/Messaging/extra/org/omg/Messaging/.svn/text-base/_ExceptionHolder.java.svn-base b/idl/Messaging/extra/org/omg/Messaging/.svn/text-base/_ExceptionHolder.java.svn-base new file mode 100644 index 0000000..2a5f32f --- /dev/null +++ b/idl/Messaging/extra/org/omg/Messaging/.svn/text-base/_ExceptionHolder.java.svn-base @@ -0,0 +1,49 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + + +package org.omg.Messaging; + +public abstract class _ExceptionHolder + implements org.omg.CORBA.portable.StreamableValue{ + + private static String[] _truncatable_ids = { + org.omg.Messaging._ExceptionHolderHelper.id() + }; + + public String[] _truncatable_ids(){ + return _truncatable_ids; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + this.is_system_exception = is.read_boolean(); + this.byte_order = is.read_boolean(); + this.marshaled_exception = org.omg.Messaging.MarshaledExceptionHelper.read(is); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_boolean(this.is_system_exception); + os.write_boolean(this.byte_order); + org.omg.Messaging.MarshaledExceptionHelper.write(os,this.marshaled_exception); + } + + public org.omg.CORBA.TypeCode _type(){ + return org.omg.Messaging._ExceptionHolderHelper.type(); + } + + public abstract void raise_exception() + throws org.omg.CORBA.UserException; + + public abstract void raise_exception_with_list(org.omg.CORBA.TypeCode[] exc_list) + throws org.omg.CORBA.UserException; + + protected boolean is_system_exception; + + protected boolean byte_order; + + protected byte[] marshaled_exception; + + +} diff --git a/idl/Messaging/extra/org/omg/Messaging/_ExceptionHolder.java b/idl/Messaging/extra/org/omg/Messaging/_ExceptionHolder.java new file mode 100644 index 0000000..2a5f32f --- /dev/null +++ b/idl/Messaging/extra/org/omg/Messaging/_ExceptionHolder.java @@ -0,0 +1,49 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + + +package org.omg.Messaging; + +public abstract class _ExceptionHolder + implements org.omg.CORBA.portable.StreamableValue{ + + private static String[] _truncatable_ids = { + org.omg.Messaging._ExceptionHolderHelper.id() + }; + + public String[] _truncatable_ids(){ + return _truncatable_ids; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + this.is_system_exception = is.read_boolean(); + this.byte_order = is.read_boolean(); + this.marshaled_exception = org.omg.Messaging.MarshaledExceptionHelper.read(is); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_boolean(this.is_system_exception); + os.write_boolean(this.byte_order); + org.omg.Messaging.MarshaledExceptionHelper.write(os,this.marshaled_exception); + } + + public org.omg.CORBA.TypeCode _type(){ + return org.omg.Messaging._ExceptionHolderHelper.type(); + } + + public abstract void raise_exception() + throws org.omg.CORBA.UserException; + + public abstract void raise_exception_with_list(org.omg.CORBA.TypeCode[] exc_list) + throws org.omg.CORBA.UserException; + + protected boolean is_system_exception; + + protected boolean byte_order; + + protected byte[] marshaled_exception; + + +} diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElement.class b/idl/Security/.class/org/omg/CSI/AuthorizationElement.class new file mode 100644 index 0000000..4180a10 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElement.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHelper.class b/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHelper.class new file mode 100644 index 0000000..280e76e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHolder.class b/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHolder.class new file mode 100644 index 0000000..bceb8c8 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElementContentsHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElementHelper.class b/idl/Security/.class/org/omg/CSI/AuthorizationElementHelper.class new file mode 100644 index 0000000..72778ad Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElementHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElementHolder.class b/idl/Security/.class/org/omg/CSI/AuthorizationElementHolder.class new file mode 100644 index 0000000..88728dc Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElementHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationElementTypeHelper.class b/idl/Security/.class/org/omg/CSI/AuthorizationElementTypeHelper.class new file mode 100644 index 0000000..1a29664 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationElementTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationTokenHelper.class b/idl/Security/.class/org/omg/CSI/AuthorizationTokenHelper.class new file mode 100644 index 0000000..086321e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationTokenHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/AuthorizationTokenHolder.class b/idl/Security/.class/org/omg/CSI/AuthorizationTokenHolder.class new file mode 100644 index 0000000..487b6cc Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/AuthorizationTokenHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/CompleteEstablishContext.class b/idl/Security/.class/org/omg/CSI/CompleteEstablishContext.class new file mode 100644 index 0000000..36109c1 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/CompleteEstablishContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHelper.class b/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHelper.class new file mode 100644 index 0000000..c55cc56 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHolder.class b/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHolder.class new file mode 100644 index 0000000..7d0da9d Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/CompleteEstablishContextHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/ContextError.class b/idl/Security/.class/org/omg/CSI/ContextError.class new file mode 100644 index 0000000..616fd4e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ContextError.class differ diff --git a/idl/Security/.class/org/omg/CSI/ContextErrorHelper.class b/idl/Security/.class/org/omg/CSI/ContextErrorHelper.class new file mode 100644 index 0000000..66a2496 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ContextErrorHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/ContextErrorHolder.class b/idl/Security/.class/org/omg/CSI/ContextErrorHolder.class new file mode 100644 index 0000000..ec50b72 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ContextErrorHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/ContextIdHelper.class b/idl/Security/.class/org/omg/CSI/ContextIdHelper.class new file mode 100644 index 0000000..fc6236d Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ContextIdHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/EstablishContext.class b/idl/Security/.class/org/omg/CSI/EstablishContext.class new file mode 100644 index 0000000..fdb03ac Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/EstablishContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/EstablishContextHelper.class b/idl/Security/.class/org/omg/CSI/EstablishContextHelper.class new file mode 100644 index 0000000..993b707 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/EstablishContextHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/EstablishContextHolder.class b/idl/Security/.class/org/omg/CSI/EstablishContextHolder.class new file mode 100644 index 0000000..0788e0d Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/EstablishContextHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSSTokenHelper.class b/idl/Security/.class/org/omg/CSI/GSSTokenHelper.class new file mode 100644 index 0000000..d0d8b70 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSSTokenHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSSTokenHolder.class b/idl/Security/.class/org/omg/CSI/GSSTokenHolder.class new file mode 100644 index 0000000..ad50baf Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSSTokenHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_Export_Name_OID.class b/idl/Security/.class/org/omg/CSI/GSS_NT_Export_Name_OID.class new file mode 100644 index 0000000..fb3983b Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_Export_Name_OID.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHelper.class b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHelper.class new file mode 100644 index 0000000..0685599 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHolder.class b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHolder.class new file mode 100644 index 0000000..a2e5365 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHelper.class b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHelper.class new file mode 100644 index 0000000..67551f6 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHolder.class b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHolder.class new file mode 100644 index 0000000..7a8b1d6 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_ExportedNameListHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/GSS_NT_Scoped_Username_OID.class b/idl/Security/.class/org/omg/CSI/GSS_NT_Scoped_Username_OID.class new file mode 100644 index 0000000..79a28c1 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/GSS_NT_Scoped_Username_OID.class differ diff --git a/idl/Security/.class/org/omg/CSI/ITTAbsent.class b/idl/Security/.class/org/omg/CSI/ITTAbsent.class new file mode 100644 index 0000000..c231bed Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ITTAbsent.class differ diff --git a/idl/Security/.class/org/omg/CSI/ITTAnonymous.class b/idl/Security/.class/org/omg/CSI/ITTAnonymous.class new file mode 100644 index 0000000..b0588e5 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ITTAnonymous.class differ diff --git a/idl/Security/.class/org/omg/CSI/ITTDistinguishedName.class b/idl/Security/.class/org/omg/CSI/ITTDistinguishedName.class new file mode 100644 index 0000000..cf50fe3 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ITTDistinguishedName.class differ diff --git a/idl/Security/.class/org/omg/CSI/ITTPrincipalName.class b/idl/Security/.class/org/omg/CSI/ITTPrincipalName.class new file mode 100644 index 0000000..fee7c43 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ITTPrincipalName.class differ diff --git a/idl/Security/.class/org/omg/CSI/ITTX509CertChain.class b/idl/Security/.class/org/omg/CSI/ITTX509CertChain.class new file mode 100644 index 0000000..55cdd42 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/ITTX509CertChain.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityExtensionHelper.class b/idl/Security/.class/org/omg/CSI/IdentityExtensionHelper.class new file mode 100644 index 0000000..ef7965c Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityExtensionHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityExtensionHolder.class b/idl/Security/.class/org/omg/CSI/IdentityExtensionHolder.class new file mode 100644 index 0000000..ec9006a Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityExtensionHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityToken.class b/idl/Security/.class/org/omg/CSI/IdentityToken.class new file mode 100644 index 0000000..073346a Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityToken.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityTokenHelper.class b/idl/Security/.class/org/omg/CSI/IdentityTokenHelper.class new file mode 100644 index 0000000..83f243d Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityTokenHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityTokenHolder.class b/idl/Security/.class/org/omg/CSI/IdentityTokenHolder.class new file mode 100644 index 0000000..87d0e3a Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityTokenHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/IdentityTokenTypeHelper.class b/idl/Security/.class/org/omg/CSI/IdentityTokenTypeHelper.class new file mode 100644 index 0000000..16bfc47 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/IdentityTokenTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/KRB5MechOID.class b/idl/Security/.class/org/omg/CSI/KRB5MechOID.class new file mode 100644 index 0000000..1e5cff2 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/KRB5MechOID.class differ diff --git a/idl/Security/.class/org/omg/CSI/MTCompleteEstablishContext.class b/idl/Security/.class/org/omg/CSI/MTCompleteEstablishContext.class new file mode 100644 index 0000000..c07bd34 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MTCompleteEstablishContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/MTContextError.class b/idl/Security/.class/org/omg/CSI/MTContextError.class new file mode 100644 index 0000000..3f0eeb9 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MTContextError.class differ diff --git a/idl/Security/.class/org/omg/CSI/MTEstablishContext.class b/idl/Security/.class/org/omg/CSI/MTEstablishContext.class new file mode 100644 index 0000000..ffbd26e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MTEstablishContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/MTMessageInContext.class b/idl/Security/.class/org/omg/CSI/MTMessageInContext.class new file mode 100644 index 0000000..ce28d29 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MTMessageInContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/MessageInContext.class b/idl/Security/.class/org/omg/CSI/MessageInContext.class new file mode 100644 index 0000000..7371e39 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MessageInContext.class differ diff --git a/idl/Security/.class/org/omg/CSI/MessageInContextHelper.class b/idl/Security/.class/org/omg/CSI/MessageInContextHelper.class new file mode 100644 index 0000000..5359923 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MessageInContextHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/MessageInContextHolder.class b/idl/Security/.class/org/omg/CSI/MessageInContextHolder.class new file mode 100644 index 0000000..89170b6 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MessageInContextHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/MsgTypeHelper.class b/idl/Security/.class/org/omg/CSI/MsgTypeHelper.class new file mode 100644 index 0000000..dc5314c Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/MsgTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/OIDHelper.class b/idl/Security/.class/org/omg/CSI/OIDHelper.class new file mode 100644 index 0000000..699300e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/OIDHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/OIDHolder.class b/idl/Security/.class/org/omg/CSI/OIDHolder.class new file mode 100644 index 0000000..1044e87 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/OIDHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/OIDListHelper.class b/idl/Security/.class/org/omg/CSI/OIDListHelper.class new file mode 100644 index 0000000..9afccd0 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/OIDListHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/OIDListHolder.class b/idl/Security/.class/org/omg/CSI/OIDListHolder.class new file mode 100644 index 0000000..ee63d9e Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/OIDListHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/OMGVMCID.class b/idl/Security/.class/org/omg/CSI/OMGVMCID.class new file mode 100644 index 0000000..a47de78 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/OMGVMCID.class differ diff --git a/idl/Security/.class/org/omg/CSI/SASContextBody.class b/idl/Security/.class/org/omg/CSI/SASContextBody.class new file mode 100644 index 0000000..1552fd9 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/SASContextBody.class differ diff --git a/idl/Security/.class/org/omg/CSI/SASContextBodyHelper.class b/idl/Security/.class/org/omg/CSI/SASContextBodyHelper.class new file mode 100644 index 0000000..b93df4c Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/SASContextBodyHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/SASContextBodyHolder.class b/idl/Security/.class/org/omg/CSI/SASContextBodyHolder.class new file mode 100644 index 0000000..2027ab4 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/SASContextBodyHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/StringOIDHelper.class b/idl/Security/.class/org/omg/CSI/StringOIDHelper.class new file mode 100644 index 0000000..441ef07 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/StringOIDHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/UTF8StringHelper.class b/idl/Security/.class/org/omg/CSI/UTF8StringHelper.class new file mode 100644 index 0000000..776dfb7 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/UTF8StringHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/UTF8StringHolder.class b/idl/Security/.class/org/omg/CSI/UTF8StringHolder.class new file mode 100644 index 0000000..47798d1 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/UTF8StringHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHelper.class b/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHelper.class new file mode 100644 index 0000000..eaa5647 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHolder.class b/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHolder.class new file mode 100644 index 0000000..8a479a0 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/X501DistinguishedNameHolder.class differ diff --git a/idl/Security/.class/org/omg/CSI/X509AttributeCertChain.class b/idl/Security/.class/org/omg/CSI/X509AttributeCertChain.class new file mode 100644 index 0000000..2d9add8 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/X509AttributeCertChain.class differ diff --git a/idl/Security/.class/org/omg/CSI/X509CertificateChainHelper.class b/idl/Security/.class/org/omg/CSI/X509CertificateChainHelper.class new file mode 100644 index 0000000..219b09d Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/X509CertificateChainHelper.class differ diff --git a/idl/Security/.class/org/omg/CSI/X509CertificateChainHolder.class b/idl/Security/.class/org/omg/CSI/X509CertificateChainHolder.class new file mode 100644 index 0000000..cb2b0c5 Binary files /dev/null and b/idl/Security/.class/org/omg/CSI/X509CertificateChainHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/AS_ContextSec.class b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSec.class new file mode 100644 index 0000000..e6c68d6 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSec.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHelper.class b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHelper.class new file mode 100644 index 0000000..bdb41b5 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHolder.class b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHolder.class new file mode 100644 index 0000000..e2c7a30 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/AS_ContextSecHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/AssociationOptionsHelper.class b/idl/Security/.class/org/omg/CSIIOP/AssociationOptionsHelper.class new file mode 100644 index 0000000..2b0227a Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/AssociationOptionsHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompositeDelegation.class b/idl/Security/.class/org/omg/CSIIOP/CompositeDelegation.class new file mode 100644 index 0000000..dadbc3b Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompositeDelegation.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMech.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMech.class new file mode 100644 index 0000000..27f7a03 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMech.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHelper.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHelper.class new file mode 100644 index 0000000..fe5a318 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHolder.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHolder.class new file mode 100644 index 0000000..0972028 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechList.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechList.class new file mode 100644 index 0000000..4b8244b Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechList.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHelper.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHelper.class new file mode 100644 index 0000000..338b197 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHolder.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHolder.class new file mode 100644 index 0000000..5e47d9e Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechListHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHelper.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHelper.class new file mode 100644 index 0000000..9921a70 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHolder.class b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHolder.class new file mode 100644 index 0000000..e2db183 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/CompoundSecMechanismsHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/Confidentiality.class b/idl/Security/.class/org/omg/CSIIOP/Confidentiality.class new file mode 100644 index 0000000..341b763 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/Confidentiality.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/DelegationByClient.class b/idl/Security/.class/org/omg/CSIIOP/DelegationByClient.class new file mode 100644 index 0000000..d11a35a Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/DelegationByClient.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/DetectMisordering.class b/idl/Security/.class/org/omg/CSIIOP/DetectMisordering.class new file mode 100644 index 0000000..ec6fa3d Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/DetectMisordering.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/DetectReplay.class b/idl/Security/.class/org/omg/CSIIOP/DetectReplay.class new file mode 100644 index 0000000..4f3caea Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/DetectReplay.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInClient.class b/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInClient.class new file mode 100644 index 0000000..928b969 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInClient.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInTarget.class b/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInTarget.class new file mode 100644 index 0000000..0a1ed2d Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/EstablishTrustInTarget.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/IdentityAssertion.class b/idl/Security/.class/org/omg/CSIIOP/IdentityAssertion.class new file mode 100644 index 0000000..f7a38b4 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/IdentityAssertion.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/Integrity.class b/idl/Security/.class/org/omg/CSIIOP/Integrity.class new file mode 100644 index 0000000..d089a7b Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/Integrity.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/NoDelegation.class b/idl/Security/.class/org/omg/CSIIOP/NoDelegation.class new file mode 100644 index 0000000..d4d2357 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/NoDelegation.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/NoProtection.class b/idl/Security/.class/org/omg/CSIIOP/NoProtection.class new file mode 100644 index 0000000..742a865 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/NoProtection.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSec.class b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSec.class new file mode 100644 index 0000000..be9d0f6 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSec.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHelper.class b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHelper.class new file mode 100644 index 0000000..2044408 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHolder.class b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHolder.class new file mode 100644 index 0000000..3c3218f Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SAS_ContextSecHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SCS_GSSExportedName.class b/idl/Security/.class/org/omg/CSIIOP/SCS_GSSExportedName.class new file mode 100644 index 0000000..6374a15 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SCS_GSSExportedName.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SCS_GeneralNames.class b/idl/Security/.class/org/omg/CSIIOP/SCS_GeneralNames.class new file mode 100644 index 0000000..d13e9b9 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SCS_GeneralNames.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANS.class b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANS.class new file mode 100644 index 0000000..1d5637a Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANS.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHelper.class b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHelper.class new file mode 100644 index 0000000..aeedaca Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHolder.class b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHolder.class new file mode 100644 index 0000000..8d301ae Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SECIOP_SEC_TRANSHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfiguration.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfiguration.class new file mode 100644 index 0000000..d71a276 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfiguration.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHelper.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHelper.class new file mode 100644 index 0000000..e26b08c Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHolder.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHolder.class new file mode 100644 index 0000000..8093d90 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHelper.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHelper.class new file mode 100644 index 0000000..c426690 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHolder.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHolder.class new file mode 100644 index 0000000..3fcf062 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationListHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationSyntaxHelper.class b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationSyntaxHelper.class new file mode 100644 index 0000000..6e7e55c Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceConfigurationSyntaxHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHelper.class b/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHelper.class new file mode 100644 index 0000000..5cca5eb Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHolder.class b/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHolder.class new file mode 100644 index 0000000..22a501f Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/ServiceSpecificNameHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/SimpleDelegation.class b/idl/Security/.class/org/omg/CSIIOP/SimpleDelegation.class new file mode 100644 index 0000000..4d80246 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/SimpleDelegation.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TAG_SECIOP_SEC_TRANS.class b/idl/Security/.class/org/omg/CSIIOP/TAG_SECIOP_SEC_TRANS.class new file mode 100644 index 0000000..ab32fc5 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TAG_SECIOP_SEC_TRANS.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TAG_TLS_SEC_TRANS.class b/idl/Security/.class/org/omg/CSIIOP/TAG_TLS_SEC_TRANS.class new file mode 100644 index 0000000..15d612f Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TAG_TLS_SEC_TRANS.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANS.class b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANS.class new file mode 100644 index 0000000..85c7832 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANS.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHelper.class b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHelper.class new file mode 100644 index 0000000..807fa37 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHolder.class b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHolder.class new file mode 100644 index 0000000..348cb17 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TLS_SEC_TRANSHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TransportAddress.class b/idl/Security/.class/org/omg/CSIIOP/TransportAddress.class new file mode 100644 index 0000000..b52972b Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TransportAddress.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TransportAddressHelper.class b/idl/Security/.class/org/omg/CSIIOP/TransportAddressHelper.class new file mode 100644 index 0000000..9d57ce3 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TransportAddressHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TransportAddressHolder.class b/idl/Security/.class/org/omg/CSIIOP/TransportAddressHolder.class new file mode 100644 index 0000000..fcb55b2 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TransportAddressHolder.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHelper.class b/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHelper.class new file mode 100644 index 0000000..2d530f0 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHelper.class differ diff --git a/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHolder.class b/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHolder.class new file mode 100644 index 0000000..188fc41 Binary files /dev/null and b/idl/Security/.class/org/omg/CSIIOP/TransportAddressListHolder.class differ diff --git a/idl/Security/.class/org/omg/SSLIOP/SSL.class b/idl/Security/.class/org/omg/SSLIOP/SSL.class new file mode 100644 index 0000000..ce39ea9 Binary files /dev/null and b/idl/Security/.class/org/omg/SSLIOP/SSL.class differ diff --git a/idl/Security/.class/org/omg/SSLIOP/SSLHelper.class b/idl/Security/.class/org/omg/SSLIOP/SSLHelper.class new file mode 100644 index 0000000..a35aaf9 Binary files /dev/null and b/idl/Security/.class/org/omg/SSLIOP/SSLHelper.class differ diff --git a/idl/Security/.class/org/omg/SSLIOP/SSLHolder.class b/idl/Security/.class/org/omg/SSLIOP/SSLHolder.class new file mode 100644 index 0000000..236b61a Binary files /dev/null and b/idl/Security/.class/org/omg/SSLIOP/SSLHolder.class differ diff --git a/idl/Security/.class/org/omg/SSLIOP/TAG_SSL_SEC_TRANS.class b/idl/Security/.class/org/omg/SSLIOP/TAG_SSL_SEC_TRANS.class new file mode 100644 index 0000000..d41ca57 Binary files /dev/null and b/idl/Security/.class/org/omg/SSLIOP/TAG_SSL_SEC_TRANS.class differ diff --git a/idl/Security/.class/org/omg/Security/AccessId.class b/idl/Security/.class/org/omg/Security/AccessId.class new file mode 100644 index 0000000..7f5adfa Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AccessId.class differ diff --git a/idl/Security/.class/org/omg/Security/AccountingId.class b/idl/Security/.class/org/omg/Security/AccountingId.class new file mode 100644 index 0000000..538f484 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AccountingId.class differ diff --git a/idl/Security/.class/org/omg/Security/AssociationOptionsHelper.class b/idl/Security/.class/org/omg/Security/AssociationOptionsHelper.class new file mode 100644 index 0000000..c16b47c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AssociationOptionsHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AssociationStatus.class b/idl/Security/.class/org/omg/Security/AssociationStatus.class new file mode 100644 index 0000000..8de2b84 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AssociationStatus.class differ diff --git a/idl/Security/.class/org/omg/Security/AssociationStatusHelper.class b/idl/Security/.class/org/omg/Security/AssociationStatusHelper.class new file mode 100644 index 0000000..d0a3267 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AssociationStatusHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AssociationStatusHolder.class b/idl/Security/.class/org/omg/Security/AssociationStatusHolder.class new file mode 100644 index 0000000..52c194a Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AssociationStatusHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeListHelper.class b/idl/Security/.class/org/omg/Security/AttributeListHelper.class new file mode 100644 index 0000000..295254e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeListHolder.class b/idl/Security/.class/org/omg/Security/AttributeListHolder.class new file mode 100644 index 0000000..3c199e5 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeSet.class b/idl/Security/.class/org/omg/Security/AttributeSet.class new file mode 100644 index 0000000..8bc6863 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeSet.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeType.class b/idl/Security/.class/org/omg/Security/AttributeType.class new file mode 100644 index 0000000..7cb4841 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeType.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeTypeHelper.class b/idl/Security/.class/org/omg/Security/AttributeTypeHelper.class new file mode 100644 index 0000000..566b678 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeTypeHolder.class b/idl/Security/.class/org/omg/Security/AttributeTypeHolder.class new file mode 100644 index 0000000..a286c48 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeTypeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeTypeListHelper.class b/idl/Security/.class/org/omg/Security/AttributeTypeListHelper.class new file mode 100644 index 0000000..d580dae Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeTypeListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AttributeTypeListHolder.class b/idl/Security/.class/org/omg/Security/AttributeTypeListHolder.class new file mode 100644 index 0000000..eb47e14 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AttributeTypeListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditAll.class b/idl/Security/.class/org/omg/Security/AuditAll.class new file mode 100644 index 0000000..9e5bbcf Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditAll.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditAuthorization.class b/idl/Security/.class/org/omg/Security/AuditAuthorization.class new file mode 100644 index 0000000..7bfbc57 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditAuthorization.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditChannelIdHelper.class b/idl/Security/.class/org/omg/Security/AuditChannelIdHelper.class new file mode 100644 index 0000000..6e10c7d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditChannelIdHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditCombinator.class b/idl/Security/.class/org/omg/Security/AuditCombinator.class new file mode 100644 index 0000000..571aa1e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditCombinator.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditCombinatorHelper.class b/idl/Security/.class/org/omg/Security/AuditCombinatorHelper.class new file mode 100644 index 0000000..a9cbf3f Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditCombinatorHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditCombinatorHolder.class b/idl/Security/.class/org/omg/Security/AuditCombinatorHolder.class new file mode 100644 index 0000000..e8ec45a Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditCombinatorHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditEventType.class b/idl/Security/.class/org/omg/Security/AuditEventType.class new file mode 100644 index 0000000..662ed06 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditEventType.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditEventTypeHelper.class b/idl/Security/.class/org/omg/Security/AuditEventTypeHelper.class new file mode 100644 index 0000000..f9113f7 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditEventTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditEventTypeHolder.class b/idl/Security/.class/org/omg/Security/AuditEventTypeHolder.class new file mode 100644 index 0000000..2832c7b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditEventTypeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditEventTypeListHelper.class b/idl/Security/.class/org/omg/Security/AuditEventTypeListHelper.class new file mode 100644 index 0000000..2030db4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditEventTypeListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditEventTypeListHolder.class b/idl/Security/.class/org/omg/Security/AuditEventTypeListHolder.class new file mode 100644 index 0000000..664db0e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditEventTypeListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditId.class b/idl/Security/.class/org/omg/Security/AuditId.class new file mode 100644 index 0000000..131ba9d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditId.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditInvocation.class b/idl/Security/.class/org/omg/Security/AuditInvocation.class new file mode 100644 index 0000000..a4db92d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditInvocation.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditNonRepudiation.class b/idl/Security/.class/org/omg/Security/AuditNonRepudiation.class new file mode 100644 index 0000000..d0d7999 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditNonRepudiation.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditObjectCreation.class b/idl/Security/.class/org/omg/Security/AuditObjectCreation.class new file mode 100644 index 0000000..64cf1f9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditObjectCreation.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditObjectDestruction.class b/idl/Security/.class/org/omg/Security/AuditObjectDestruction.class new file mode 100644 index 0000000..254145a Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditObjectDestruction.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditPolicyChange.class b/idl/Security/.class/org/omg/Security/AuditPolicyChange.class new file mode 100644 index 0000000..0125477 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditPolicyChange.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditPrincipalAuth.class b/idl/Security/.class/org/omg/Security/AuditPrincipalAuth.class new file mode 100644 index 0000000..3bf3c68 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditPrincipalAuth.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditSecEnvChange.class b/idl/Security/.class/org/omg/Security/AuditSecEnvChange.class new file mode 100644 index 0000000..01ac385 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditSecEnvChange.class differ diff --git a/idl/Security/.class/org/omg/Security/AuditSessionAuth.class b/idl/Security/.class/org/omg/Security/AuditSessionAuth.class new file mode 100644 index 0000000..9c27d77 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuditSessionAuth.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationMethodHelper.class b/idl/Security/.class/org/omg/Security/AuthenticationMethodHelper.class new file mode 100644 index 0000000..bbaa8f4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationMethodHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationMethodListHelper.class b/idl/Security/.class/org/omg/Security/AuthenticationMethodListHelper.class new file mode 100644 index 0000000..4a6d8e9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationMethodListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationMethodListHolder.class b/idl/Security/.class/org/omg/Security/AuthenticationMethodListHolder.class new file mode 100644 index 0000000..1532a8b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationMethodListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationStatus.class b/idl/Security/.class/org/omg/Security/AuthenticationStatus.class new file mode 100644 index 0000000..87c9e98 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationStatus.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationStatusHelper.class b/idl/Security/.class/org/omg/Security/AuthenticationStatusHelper.class new file mode 100644 index 0000000..af1af86 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationStatusHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/AuthenticationStatusHolder.class b/idl/Security/.class/org/omg/Security/AuthenticationStatusHolder.class new file mode 100644 index 0000000..b598c80 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/AuthenticationStatusHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/Capability.class b/idl/Security/.class/org/omg/Security/Capability.class new file mode 100644 index 0000000..ab10cd2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Capability.class differ diff --git a/idl/Security/.class/org/omg/Security/ChannelBindings.class b/idl/Security/.class/org/omg/Security/ChannelBindings.class new file mode 100644 index 0000000..030beed Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ChannelBindings.class differ diff --git a/idl/Security/.class/org/omg/Security/ChannelBindingsHelper.class b/idl/Security/.class/org/omg/Security/ChannelBindingsHelper.class new file mode 100644 index 0000000..96cb696 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ChannelBindingsHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/ChannelBindingsHolder.class b/idl/Security/.class/org/omg/Security/ChannelBindingsHolder.class new file mode 100644 index 0000000..e3a8097 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ChannelBindingsHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/Clearance.class b/idl/Security/.class/org/omg/Security/Clearance.class new file mode 100644 index 0000000..3b1d0c0 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Clearance.class differ diff --git a/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel0.class b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel0.class new file mode 100644 index 0000000..024d268 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel0.class differ diff --git a/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel1.class b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel1.class new file mode 100644 index 0000000..4b700c6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel1.class differ diff --git a/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel2.class b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel2.class new file mode 100644 index 0000000..975d523 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommonInteroperabilityLevel2.class differ diff --git a/idl/Security/.class/org/omg/Security/CommunicationDirection.class b/idl/Security/.class/org/omg/Security/CommunicationDirection.class new file mode 100644 index 0000000..68b889c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommunicationDirection.class differ diff --git a/idl/Security/.class/org/omg/Security/CommunicationDirectionHelper.class b/idl/Security/.class/org/omg/Security/CommunicationDirectionHelper.class new file mode 100644 index 0000000..dc5d410 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommunicationDirectionHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/CommunicationDirectionHolder.class b/idl/Security/.class/org/omg/Security/CommunicationDirectionHolder.class new file mode 100644 index 0000000..a8bd5de Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CommunicationDirectionHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/CompositeDelegation.class b/idl/Security/.class/org/omg/Security/CompositeDelegation.class new file mode 100644 index 0000000..22ca7d4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/CompositeDelegation.class differ diff --git a/idl/Security/.class/org/omg/Security/Confidentiality.class b/idl/Security/.class/org/omg/Security/Confidentiality.class new file mode 100644 index 0000000..9c27031 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Confidentiality.class differ diff --git a/idl/Security/.class/org/omg/Security/DCESecureInteroperability.class b/idl/Security/.class/org/omg/Security/DCESecureInteroperability.class new file mode 100644 index 0000000..380ce9d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DCESecureInteroperability.class differ diff --git a/idl/Security/.class/org/omg/Security/DayOfTheWeek.class b/idl/Security/.class/org/omg/Security/DayOfTheWeek.class new file mode 100644 index 0000000..763510c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DayOfTheWeek.class differ diff --git a/idl/Security/.class/org/omg/Security/DayOfTheWeekHelper.class b/idl/Security/.class/org/omg/Security/DayOfTheWeekHelper.class new file mode 100644 index 0000000..d354bb6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DayOfTheWeekHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/DayOfTheWeekHolder.class b/idl/Security/.class/org/omg/Security/DayOfTheWeekHolder.class new file mode 100644 index 0000000..23015dc Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DayOfTheWeekHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/DayOfWeek.class b/idl/Security/.class/org/omg/Security/DayOfWeek.class new file mode 100644 index 0000000..894e9a6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DayOfWeek.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationDirective.class b/idl/Security/.class/org/omg/Security/DelegationDirective.class new file mode 100644 index 0000000..6edfb10 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationDirective.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationDirectiveHelper.class b/idl/Security/.class/org/omg/Security/DelegationDirectiveHelper.class new file mode 100644 index 0000000..4d79b55 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationDirectiveHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationDirectiveHolder.class b/idl/Security/.class/org/omg/Security/DelegationDirectiveHolder.class new file mode 100644 index 0000000..015b1a4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationDirectiveHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationMode.class b/idl/Security/.class/org/omg/Security/DelegationMode.class new file mode 100644 index 0000000..0c682a0 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationMode.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationModeHelper.class b/idl/Security/.class/org/omg/Security/DelegationModeHelper.class new file mode 100644 index 0000000..b15faaa Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationModeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationModeHolder.class b/idl/Security/.class/org/omg/Security/DelegationModeHolder.class new file mode 100644 index 0000000..f9bf515 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationModeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationState.class b/idl/Security/.class/org/omg/Security/DelegationState.class new file mode 100644 index 0000000..929a5b3 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationState.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationStateHelper.class b/idl/Security/.class/org/omg/Security/DelegationStateHelper.class new file mode 100644 index 0000000..a80dafc Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationStateHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/DelegationStateHolder.class b/idl/Security/.class/org/omg/Security/DelegationStateHolder.class new file mode 100644 index 0000000..69720d5 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DelegationStateHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/DetectMisordering.class b/idl/Security/.class/org/omg/Security/DetectMisordering.class new file mode 100644 index 0000000..c41e090 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DetectMisordering.class differ diff --git a/idl/Security/.class/org/omg/Security/DetectReplay.class b/idl/Security/.class/org/omg/Security/DetectReplay.class new file mode 100644 index 0000000..02c48d9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/DetectReplay.class differ diff --git a/idl/Security/.class/org/omg/Security/EstablishTrust.class b/idl/Security/.class/org/omg/Security/EstablishTrust.class new file mode 100644 index 0000000..a7defdd Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EstablishTrust.class differ diff --git a/idl/Security/.class/org/omg/Security/EstablishTrustHelper.class b/idl/Security/.class/org/omg/Security/EstablishTrustHelper.class new file mode 100644 index 0000000..c1ab538 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EstablishTrustHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/EstablishTrustHolder.class b/idl/Security/.class/org/omg/Security/EstablishTrustHolder.class new file mode 100644 index 0000000..8801737 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EstablishTrustHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/EstablishTrustInClient.class b/idl/Security/.class/org/omg/Security/EstablishTrustInClient.class new file mode 100644 index 0000000..5091663 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EstablishTrustInClient.class differ diff --git a/idl/Security/.class/org/omg/Security/EstablishTrustInTarget.class b/idl/Security/.class/org/omg/Security/EstablishTrustInTarget.class new file mode 100644 index 0000000..a5bf0a2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EstablishTrustInTarget.class differ diff --git a/idl/Security/.class/org/omg/Security/EventTypeHelper.class b/idl/Security/.class/org/omg/Security/EventTypeHelper.class new file mode 100644 index 0000000..868f52f Binary files /dev/null and b/idl/Security/.class/org/omg/Security/EventTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/ExtensibleFamily.class b/idl/Security/.class/org/omg/Security/ExtensibleFamily.class new file mode 100644 index 0000000..35ad7f8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ExtensibleFamily.class differ diff --git a/idl/Security/.class/org/omg/Security/ExtensibleFamilyHelper.class b/idl/Security/.class/org/omg/Security/ExtensibleFamilyHelper.class new file mode 100644 index 0000000..25af160 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ExtensibleFamilyHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/ExtensibleFamilyHolder.class b/idl/Security/.class/org/omg/Security/ExtensibleFamilyHolder.class new file mode 100644 index 0000000..fc5cd5a Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ExtensibleFamilyHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/GroupId.class b/idl/Security/.class/org/omg/Security/GroupId.class new file mode 100644 index 0000000..db68e3e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/GroupId.class differ diff --git a/idl/Security/.class/org/omg/Security/Initiator.class b/idl/Security/.class/org/omg/Security/Initiator.class new file mode 100644 index 0000000..ab82a86 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Initiator.class differ diff --git a/idl/Security/.class/org/omg/Security/Integrity.class b/idl/Security/.class/org/omg/Security/Integrity.class new file mode 100644 index 0000000..b606072 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Integrity.class differ diff --git a/idl/Security/.class/org/omg/Security/InterfaceName.class b/idl/Security/.class/org/omg/Security/InterfaceName.class new file mode 100644 index 0000000..8077bac Binary files /dev/null and b/idl/Security/.class/org/omg/Security/InterfaceName.class differ diff --git a/idl/Security/.class/org/omg/Security/IntervalTHelper.class b/idl/Security/.class/org/omg/Security/IntervalTHelper.class new file mode 100644 index 0000000..9d4961d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/IntervalTHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/InvocationCredentialsType.class b/idl/Security/.class/org/omg/Security/InvocationCredentialsType.class new file mode 100644 index 0000000..0989d06 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/InvocationCredentialsType.class differ diff --git a/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHelper.class b/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHelper.class new file mode 100644 index 0000000..8a39c8c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHolder.class b/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHolder.class new file mode 100644 index 0000000..39c40ce Binary files /dev/null and b/idl/Security/.class/org/omg/Security/InvocationCredentialsTypeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/MechandOptions.class b/idl/Security/.class/org/omg/Security/MechandOptions.class new file mode 100644 index 0000000..67de007 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechandOptions.class differ diff --git a/idl/Security/.class/org/omg/Security/MechandOptionsHelper.class b/idl/Security/.class/org/omg/Security/MechandOptionsHelper.class new file mode 100644 index 0000000..aadac9e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechandOptionsHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/MechandOptionsHolder.class b/idl/Security/.class/org/omg/Security/MechandOptionsHolder.class new file mode 100644 index 0000000..f8788d4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechandOptionsHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/MechandOptionsListHelper.class b/idl/Security/.class/org/omg/Security/MechandOptionsListHelper.class new file mode 100644 index 0000000..6db4098 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechandOptionsListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/MechandOptionsListHolder.class b/idl/Security/.class/org/omg/Security/MechandOptionsListHolder.class new file mode 100644 index 0000000..42498f2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechandOptionsListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/MechanismTypeHelper.class b/idl/Security/.class/org/omg/Security/MechanismTypeHelper.class new file mode 100644 index 0000000..1a496ab Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechanismTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/MechanismTypeListHelper.class b/idl/Security/.class/org/omg/Security/MechanismTypeListHelper.class new file mode 100644 index 0000000..3662a49 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechanismTypeListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/MechanismTypeListHolder.class b/idl/Security/.class/org/omg/Security/MechanismTypeListHolder.class new file mode 100644 index 0000000..d067a32 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/MechanismTypeListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/NoDelegation.class b/idl/Security/.class/org/omg/Security/NoDelegation.class new file mode 100644 index 0000000..07aab48 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/NoDelegation.class differ diff --git a/idl/Security/.class/org/omg/Security/NoProtection.class b/idl/Security/.class/org/omg/Security/NoProtection.class new file mode 100644 index 0000000..c20b45c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/NoProtection.class differ diff --git a/idl/Security/.class/org/omg/Security/NonRepudiation.class b/idl/Security/.class/org/omg/Security/NonRepudiation.class new file mode 100644 index 0000000..a26c14b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/NonRepudiation.class differ diff --git a/idl/Security/.class/org/omg/Security/NonRepudiationId.class b/idl/Security/.class/org/omg/Security/NonRepudiationId.class new file mode 100644 index 0000000..8978a13 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/NonRepudiationId.class differ diff --git a/idl/Security/.class/org/omg/Security/OIDHelper.class b/idl/Security/.class/org/omg/Security/OIDHelper.class new file mode 100644 index 0000000..3b1a4f4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OIDHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OIDHolder.class b/idl/Security/.class/org/omg/Security/OIDHolder.class new file mode 100644 index 0000000..3dd9f17 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OIDHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/OIDListHelper.class b/idl/Security/.class/org/omg/Security/OIDListHelper.class new file mode 100644 index 0000000..4b6baf3 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OIDListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OIDListHolder.class b/idl/Security/.class/org/omg/Security/OIDListHolder.class new file mode 100644 index 0000000..95567e6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OIDListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/ObjectRef.class b/idl/Security/.class/org/omg/Security/ObjectRef.class new file mode 100644 index 0000000..0c0b835 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ObjectRef.class differ diff --git a/idl/Security/.class/org/omg/Security/OpaqueBuffer.class b/idl/Security/.class/org/omg/Security/OpaqueBuffer.class new file mode 100644 index 0000000..1f97002 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OpaqueBuffer.class differ diff --git a/idl/Security/.class/org/omg/Security/OpaqueBufferHelper.class b/idl/Security/.class/org/omg/Security/OpaqueBufferHelper.class new file mode 100644 index 0000000..fd818ea Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OpaqueBufferHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OpaqueBufferHolder.class b/idl/Security/.class/org/omg/Security/OpaqueBufferHolder.class new file mode 100644 index 0000000..2c664e7 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OpaqueBufferHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/OpaqueHelper.class b/idl/Security/.class/org/omg/Security/OpaqueHelper.class new file mode 100644 index 0000000..25e6ef6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OpaqueHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OpaqueHolder.class b/idl/Security/.class/org/omg/Security/OpaqueHolder.class new file mode 100644 index 0000000..c1e96f2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OpaqueHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/Operation.class b/idl/Security/.class/org/omg/Security/Operation.class new file mode 100644 index 0000000..19b6807 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Operation.class differ diff --git a/idl/Security/.class/org/omg/Security/OptionsDirectionPair.class b/idl/Security/.class/org/omg/Security/OptionsDirectionPair.class new file mode 100644 index 0000000..727336e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OptionsDirectionPair.class differ diff --git a/idl/Security/.class/org/omg/Security/OptionsDirectionPairHelper.class b/idl/Security/.class/org/omg/Security/OptionsDirectionPairHelper.class new file mode 100644 index 0000000..3739f30 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OptionsDirectionPairHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OptionsDirectionPairHolder.class b/idl/Security/.class/org/omg/Security/OptionsDirectionPairHolder.class new file mode 100644 index 0000000..78d564b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OptionsDirectionPairHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHelper.class b/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHelper.class new file mode 100644 index 0000000..3480793 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHolder.class b/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHolder.class new file mode 100644 index 0000000..8c466bb Binary files /dev/null and b/idl/Security/.class/org/omg/Security/OptionsDirectionPairListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/PrimaryGroupId.class b/idl/Security/.class/org/omg/Security/PrimaryGroupId.class new file mode 100644 index 0000000..57a9560 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/PrimaryGroupId.class differ diff --git a/idl/Security/.class/org/omg/Security/QOP.class b/idl/Security/.class/org/omg/Security/QOP.class new file mode 100644 index 0000000..83a49a2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/QOP.class differ diff --git a/idl/Security/.class/org/omg/Security/QOPHelper.class b/idl/Security/.class/org/omg/Security/QOPHelper.class new file mode 100644 index 0000000..7844ef8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/QOPHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/QOPHolder.class b/idl/Security/.class/org/omg/Security/QOPHolder.class new file mode 100644 index 0000000..1bb01c0 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/QOPHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/ReplaceORBServices.class b/idl/Security/.class/org/omg/Security/ReplaceORBServices.class new file mode 100644 index 0000000..590f366 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ReplaceORBServices.class differ diff --git a/idl/Security/.class/org/omg/Security/ReplaceSecurityServices.class b/idl/Security/.class/org/omg/Security/ReplaceSecurityServices.class new file mode 100644 index 0000000..8ec4681 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/ReplaceSecurityServices.class differ diff --git a/idl/Security/.class/org/omg/Security/RequiresSupports.class b/idl/Security/.class/org/omg/Security/RequiresSupports.class new file mode 100644 index 0000000..0cb5d49 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RequiresSupports.class differ diff --git a/idl/Security/.class/org/omg/Security/RequiresSupportsHelper.class b/idl/Security/.class/org/omg/Security/RequiresSupportsHelper.class new file mode 100644 index 0000000..613d4f8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RequiresSupportsHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/RequiresSupportsHolder.class b/idl/Security/.class/org/omg/Security/RequiresSupportsHolder.class new file mode 100644 index 0000000..edc1b20 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RequiresSupportsHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/Right.class b/idl/Security/.class/org/omg/Security/Right.class new file mode 100644 index 0000000..24f6665 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Right.class differ diff --git a/idl/Security/.class/org/omg/Security/RightHelper.class b/idl/Security/.class/org/omg/Security/RightHelper.class new file mode 100644 index 0000000..4e08895 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/RightHolder.class b/idl/Security/.class/org/omg/Security/RightHolder.class new file mode 100644 index 0000000..eaecc09 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/RightsCombinator.class b/idl/Security/.class/org/omg/Security/RightsCombinator.class new file mode 100644 index 0000000..6f418b4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightsCombinator.class differ diff --git a/idl/Security/.class/org/omg/Security/RightsCombinatorHelper.class b/idl/Security/.class/org/omg/Security/RightsCombinatorHelper.class new file mode 100644 index 0000000..de53b5d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightsCombinatorHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/RightsCombinatorHolder.class b/idl/Security/.class/org/omg/Security/RightsCombinatorHolder.class new file mode 100644 index 0000000..c45fac3 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightsCombinatorHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/RightsListHelper.class b/idl/Security/.class/org/omg/Security/RightsListHelper.class new file mode 100644 index 0000000..16b946b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightsListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/RightsListHolder.class b/idl/Security/.class/org/omg/Security/RightsListHolder.class new file mode 100644 index 0000000..99df7f4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/RightsListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/Role.class b/idl/Security/.class/org/omg/Security/Role.class new file mode 100644 index 0000000..3a2fbc8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Role.class differ diff --git a/idl/Security/.class/org/omg/Security/SecApplicationAccess.class b/idl/Security/.class/org/omg/Security/SecApplicationAccess.class new file mode 100644 index 0000000..376b5f9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecApplicationAccess.class differ diff --git a/idl/Security/.class/org/omg/Security/SecApplicationAudit.class b/idl/Security/.class/org/omg/Security/SecApplicationAudit.class new file mode 100644 index 0000000..379c65d Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecApplicationAudit.class differ diff --git a/idl/Security/.class/org/omg/Security/SecAttribute.class b/idl/Security/.class/org/omg/Security/SecAttribute.class new file mode 100644 index 0000000..3f35db9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecAttribute.class differ diff --git a/idl/Security/.class/org/omg/Security/SecAttributeHelper.class b/idl/Security/.class/org/omg/Security/SecAttributeHelper.class new file mode 100644 index 0000000..7716f3f Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecAttributeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecAttributeHolder.class b/idl/Security/.class/org/omg/Security/SecAttributeHolder.class new file mode 100644 index 0000000..8ccc1ea Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecAttributeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SecClientInvocationAccess.class b/idl/Security/.class/org/omg/Security/SecClientInvocationAccess.class new file mode 100644 index 0000000..99cf6e7 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecClientInvocationAccess.class differ diff --git a/idl/Security/.class/org/omg/Security/SecClientInvocationAudit.class b/idl/Security/.class/org/omg/Security/SecClientInvocationAudit.class new file mode 100644 index 0000000..a7e20bf Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecClientInvocationAudit.class differ diff --git a/idl/Security/.class/org/omg/Security/SecClientSecureInvocation.class b/idl/Security/.class/org/omg/Security/SecClientSecureInvocation.class new file mode 100644 index 0000000..cbe611a Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecClientSecureInvocation.class differ diff --git a/idl/Security/.class/org/omg/Security/SecDelegation.class b/idl/Security/.class/org/omg/Security/SecDelegation.class new file mode 100644 index 0000000..c97bfff Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecDelegation.class differ diff --git a/idl/Security/.class/org/omg/Security/SecDelegationDirectivePolicy.class b/idl/Security/.class/org/omg/Security/SecDelegationDirectivePolicy.class new file mode 100644 index 0000000..e318d0b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecDelegationDirectivePolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecEstablishTrustPolicy.class b/idl/Security/.class/org/omg/Security/SecEstablishTrustPolicy.class new file mode 100644 index 0000000..a159fb5 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecEstablishTrustPolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecFeaturePolicy.class b/idl/Security/.class/org/omg/Security/SecFeaturePolicy.class new file mode 100644 index 0000000..3db1859 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecFeaturePolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecInvocationCredentialsPolicy.class b/idl/Security/.class/org/omg/Security/SecInvocationCredentialsPolicy.class new file mode 100644 index 0000000..20cd234 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecInvocationCredentialsPolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecMechanismsPolicy.class b/idl/Security/.class/org/omg/Security/SecMechanismsPolicy.class new file mode 100644 index 0000000..cb04649 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecMechanismsPolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecNonRepudiation.class b/idl/Security/.class/org/omg/Security/SecNonRepudiation.class new file mode 100644 index 0000000..97da309 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecNonRepudiation.class differ diff --git a/idl/Security/.class/org/omg/Security/SecQOPPolicy.class b/idl/Security/.class/org/omg/Security/SecQOPPolicy.class new file mode 100644 index 0000000..63631b6 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecQOPPolicy.class differ diff --git a/idl/Security/.class/org/omg/Security/SecTargetInvocationAccess.class b/idl/Security/.class/org/omg/Security/SecTargetInvocationAccess.class new file mode 100644 index 0000000..a0c8ea4 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecTargetInvocationAccess.class differ diff --git a/idl/Security/.class/org/omg/Security/SecTargetInvocationAudit.class b/idl/Security/.class/org/omg/Security/SecTargetInvocationAudit.class new file mode 100644 index 0000000..2bf86e8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecTargetInvocationAudit.class differ diff --git a/idl/Security/.class/org/omg/Security/SecTargetSecureInvocation.class b/idl/Security/.class/org/omg/Security/SecTargetSecureInvocation.class new file mode 100644 index 0000000..a174381 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecTargetSecureInvocation.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityAttribute.class b/idl/Security/.class/org/omg/Security/SecurityAttribute.class new file mode 100644 index 0000000..45c58b3 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityAttribute.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityAttributeTypeHelper.class b/idl/Security/.class/org/omg/Security/SecurityAttributeTypeHelper.class new file mode 100644 index 0000000..1167aa5 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityAttributeTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextState.class b/idl/Security/.class/org/omg/Security/SecurityContextState.class new file mode 100644 index 0000000..e000807 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextState.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextStateHelper.class b/idl/Security/.class/org/omg/Security/SecurityContextStateHelper.class new file mode 100644 index 0000000..ef5110c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextStateHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextStateHolder.class b/idl/Security/.class/org/omg/Security/SecurityContextStateHolder.class new file mode 100644 index 0000000..770e21c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextStateHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextType.class b/idl/Security/.class/org/omg/Security/SecurityContextType.class new file mode 100644 index 0000000..d340997 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextType.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextTypeHelper.class b/idl/Security/.class/org/omg/Security/SecurityContextTypeHelper.class new file mode 100644 index 0000000..3e69900 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityContextTypeHolder.class b/idl/Security/.class/org/omg/Security/SecurityContextTypeHolder.class new file mode 100644 index 0000000..62258f5 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityContextTypeHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityFeature.class b/idl/Security/.class/org/omg/Security/SecurityFeature.class new file mode 100644 index 0000000..3ca2f3e Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityFeature.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityFeatureHelper.class b/idl/Security/.class/org/omg/Security/SecurityFeatureHelper.class new file mode 100644 index 0000000..c6fcd90 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityFeatureHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityFeatureHolder.class b/idl/Security/.class/org/omg/Security/SecurityFeatureHolder.class new file mode 100644 index 0000000..2351be2 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityFeatureHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityLevel1.class b/idl/Security/.class/org/omg/Security/SecurityLevel1.class new file mode 100644 index 0000000..71e5097 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityLevel1.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityLevel2.class b/idl/Security/.class/org/omg/Security/SecurityLevel2.class new file mode 100644 index 0000000..8173c00 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityLevel2.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityMechanismType.class b/idl/Security/.class/org/omg/Security/SecurityMechanismType.class new file mode 100644 index 0000000..bc9e6b8 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityMechanismType.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityNameHelper.class b/idl/Security/.class/org/omg/Security/SecurityNameHelper.class new file mode 100644 index 0000000..f106d17 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityNameHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityORBServiceReady.class b/idl/Security/.class/org/omg/Security/SecurityORBServiceReady.class new file mode 100644 index 0000000..6db968f Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityORBServiceReady.class differ diff --git a/idl/Security/.class/org/omg/Security/SecurityServiceReady.class b/idl/Security/.class/org/omg/Security/SecurityServiceReady.class new file mode 100644 index 0000000..6904803 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SecurityServiceReady.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorTypeHelper.class b/idl/Security/.class/org/omg/Security/SelectorTypeHelper.class new file mode 100644 index 0000000..889d062 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorTypeHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorValue.class b/idl/Security/.class/org/omg/Security/SelectorValue.class new file mode 100644 index 0000000..ec44cac Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorValue.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorValueHelper.class b/idl/Security/.class/org/omg/Security/SelectorValueHelper.class new file mode 100644 index 0000000..8c5fd12 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorValueHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorValueHolder.class b/idl/Security/.class/org/omg/Security/SelectorValueHolder.class new file mode 100644 index 0000000..77bcaf3 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorValueHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorValueListHelper.class b/idl/Security/.class/org/omg/Security/SelectorValueListHelper.class new file mode 100644 index 0000000..b9c1689 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorValueListHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/SelectorValueListHolder.class b/idl/Security/.class/org/omg/Security/SelectorValueListHolder.class new file mode 100644 index 0000000..31bcafe Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SelectorValueListHolder.class differ diff --git a/idl/Security/.class/org/omg/Security/SimpleDelegation.class b/idl/Security/.class/org/omg/Security/SimpleDelegation.class new file mode 100644 index 0000000..1ea3510 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SimpleDelegation.class differ diff --git a/idl/Security/.class/org/omg/Security/StandardSecureInteroperability.class b/idl/Security/.class/org/omg/Security/StandardSecureInteroperability.class new file mode 100644 index 0000000..fa4eb53 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/StandardSecureInteroperability.class differ diff --git a/idl/Security/.class/org/omg/Security/SuccessFailure.class b/idl/Security/.class/org/omg/Security/SuccessFailure.class new file mode 100644 index 0000000..832b4cd Binary files /dev/null and b/idl/Security/.class/org/omg/Security/SuccessFailure.class differ diff --git a/idl/Security/.class/org/omg/Security/Time.class b/idl/Security/.class/org/omg/Security/Time.class new file mode 100644 index 0000000..85aff1b Binary files /dev/null and b/idl/Security/.class/org/omg/Security/Time.class differ diff --git a/idl/Security/.class/org/omg/Security/TimeTHelper.class b/idl/Security/.class/org/omg/Security/TimeTHelper.class new file mode 100644 index 0000000..ddc2bdc Binary files /dev/null and b/idl/Security/.class/org/omg/Security/TimeTHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/UtcTHelper.class b/idl/Security/.class/org/omg/Security/UtcTHelper.class new file mode 100644 index 0000000..660a97c Binary files /dev/null and b/idl/Security/.class/org/omg/Security/UtcTHelper.class differ diff --git a/idl/Security/.class/org/omg/Security/_Public.class b/idl/Security/.class/org/omg/Security/_Public.class new file mode 100644 index 0000000..6909bc9 Binary files /dev/null and b/idl/Security/.class/org/omg/Security/_Public.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/Current.class b/idl/Security/.class/org/omg/SecurityLevel1/Current.class new file mode 100644 index 0000000..ab64d90 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/Current.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/CurrentHelper.class b/idl/Security/.class/org/omg/SecurityLevel1/CurrentHelper.class new file mode 100644 index 0000000..f28e3c3 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/CurrentHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/CurrentHolder.class b/idl/Security/.class/org/omg/SecurityLevel1/CurrentHolder.class new file mode 100644 index 0000000..13ca2ae Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/CurrentHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalBase.class new file mode 100644 index 0000000..158ee5e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalTie.class new file mode 100644 index 0000000..f7bf8e3 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/CurrentLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel1/CurrentOperations.class b/idl/Security/.class/org/omg/SecurityLevel1/CurrentOperations.class new file mode 100644 index 0000000..5c8eb5c Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel1/CurrentOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecision.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecision.class new file mode 100644 index 0000000..deaf834 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecision.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHelper.class new file mode 100644 index 0000000..6e252bb Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHolder.class new file mode 100644 index 0000000..df6a43d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalBase.class new file mode 100644 index 0000000..6ecf4ee Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalTie.class new file mode 100644 index 0000000..5bcee4d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionOperations.class new file mode 100644 index 0000000..55fd1ee Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AccessDecisionOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannel.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannel.class new file mode 100644 index 0000000..d2fdba1 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannel.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHelper.class new file mode 100644 index 0000000..76f8d11 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHolder.class new file mode 100644 index 0000000..ac93b57 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalBase.class new file mode 100644 index 0000000..bad6475 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalTie.class new file mode 100644 index 0000000..335aa52 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelOperations.class new file mode 100644 index 0000000..6ee59b1 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditChannelOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecision.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecision.class new file mode 100644 index 0000000..685894b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecision.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHelper.class new file mode 100644 index 0000000..adbb5f4 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHolder.class new file mode 100644 index 0000000..ee0e4ab Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalBase.class new file mode 100644 index 0000000..35fedd3 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalTie.class new file mode 100644 index 0000000..d0e2093 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionOperations.class new file mode 100644 index 0000000..1853334 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/AuditDecisionOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/Credentials.class b/idl/Security/.class/org/omg/SecurityLevel2/Credentials.class new file mode 100644 index 0000000..2ef818d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/Credentials.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHelper.class new file mode 100644 index 0000000..c263736 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHolder.class new file mode 100644 index 0000000..9105b08 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHelper.class new file mode 100644 index 0000000..bb07add Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHolder.class new file mode 100644 index 0000000..bf7b619 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsListHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalBase.class new file mode 100644 index 0000000..672c561 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalTie.class new file mode 100644 index 0000000..f01390f Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CredentialsOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsOperations.class new file mode 100644 index 0000000..6135dfc Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CredentialsOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/Current.class b/idl/Security/.class/org/omg/SecurityLevel2/Current.class new file mode 100644 index 0000000..82ed16a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/Current.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CurrentHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/CurrentHelper.class new file mode 100644 index 0000000..acd154b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CurrentHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CurrentHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/CurrentHolder.class new file mode 100644 index 0000000..4064d01 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CurrentHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalBase.class new file mode 100644 index 0000000..31f8672 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalTie.class new file mode 100644 index 0000000..f7c852a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CurrentLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/CurrentOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/CurrentOperations.class new file mode 100644 index 0000000..bc045d3 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/CurrentOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicy.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicy.class new file mode 100644 index 0000000..69887ed Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicy.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHelper.class new file mode 100644 index 0000000..45f2071 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHolder.class new file mode 100644 index 0000000..b9c4a33 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalBase.class new file mode 100644 index 0000000..17822f0 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalTie.class new file mode 100644 index 0000000..067fb76 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyOperations.class new file mode 100644 index 0000000..0a4541a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/DelegationDirectivePolicyOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicy.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicy.class new file mode 100644 index 0000000..2b75759 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicy.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHelper.class new file mode 100644 index 0000000..b97ed4b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHolder.class new file mode 100644 index 0000000..af6a2ea Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalBase.class new file mode 100644 index 0000000..54a3858 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalTie.class new file mode 100644 index 0000000..b0d153f Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyOperations.class new file mode 100644 index 0000000..7cd3f21 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/EstablishTrustPolicyOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicy.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicy.class new file mode 100644 index 0000000..210adf3 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicy.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHelper.class new file mode 100644 index 0000000..aa17259 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHolder.class new file mode 100644 index 0000000..9dd759d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalBase.class new file mode 100644 index 0000000..e87fc85 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalTie.class new file mode 100644 index 0000000..cccaa03 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyOperations.class new file mode 100644 index 0000000..b7907f0 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/InvocationCredentialsPolicyOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicy.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicy.class new file mode 100644 index 0000000..3b7975e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicy.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHelper.class new file mode 100644 index 0000000..68d863e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHolder.class new file mode 100644 index 0000000..1489943 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalBase.class new file mode 100644 index 0000000..9a9fab8 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalTie.class new file mode 100644 index 0000000..0f3338d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyOperations.class new file mode 100644 index 0000000..b811685 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/MechanismPolicyOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticator.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticator.class new file mode 100644 index 0000000..c16c9d4 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticator.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHelper.class new file mode 100644 index 0000000..18d0b0c Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHolder.class new file mode 100644 index 0000000..767097d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalBase.class new file mode 100644 index 0000000..bf4c10b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalTie.class new file mode 100644 index 0000000..5cb324a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorOperations.class new file mode 100644 index 0000000..c3e6290 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/PrincipalAuthenticatorOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicy.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicy.class new file mode 100644 index 0000000..d14c20e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicy.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHelper.class new file mode 100644 index 0000000..ef0d39c Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHolder.class new file mode 100644 index 0000000..b4a8f86 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalBase.class new file mode 100644 index 0000000..51323f5 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalTie.class new file mode 100644 index 0000000..f3d6c19 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyOperations.class new file mode 100644 index 0000000..4d5e62c Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/QOPPolicyOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentials.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentials.class new file mode 100644 index 0000000..a657fa5 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentials.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHelper.class new file mode 100644 index 0000000..b126c4e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHolder.class new file mode 100644 index 0000000..a58d306 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalBase.class new file mode 100644 index 0000000..63efee9 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalTie.class new file mode 100644 index 0000000..b0da65b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsOperations.class new file mode 100644 index 0000000..de1b309 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/ReceivedCredentialsOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRights.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRights.class new file mode 100644 index 0000000..3f82abe Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRights.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHelper.class new file mode 100644 index 0000000..b53b47e Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHolder.class new file mode 100644 index 0000000..f15271a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsOperations.class new file mode 100644 index 0000000..c078e17 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOA.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOA.class new file mode 100644 index 0000000..0e3688d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOA.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOATie.class b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOATie.class new file mode 100644 index 0000000..b5bf354 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/RequiredRightsPOATie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManager.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManager.class new file mode 100644 index 0000000..4bb54de Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManager.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHelper.class new file mode 100644 index 0000000..b124419 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHolder.class new file mode 100644 index 0000000..cabfb03 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalBase.class new file mode 100644 index 0000000..1b9d172 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalTie.class new file mode 100644 index 0000000..bc1a60d Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerOperations.class new file mode 100644 index 0000000..d65f333 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/SecurityManagerOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentials.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentials.class new file mode 100644 index 0000000..79579a2 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentials.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHelper.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHelper.class new file mode 100644 index 0000000..7e1b184 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHelper.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHolder.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHolder.class new file mode 100644 index 0000000..4270a0a Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsHolder.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalBase.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalBase.class new file mode 100644 index 0000000..276956b Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalBase.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalTie.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalTie.class new file mode 100644 index 0000000..60c94e8 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsLocalTie.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsOperations.class b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsOperations.class new file mode 100644 index 0000000..7fc4123 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/TargetCredentialsOperations.class differ diff --git a/idl/Security/.class/org/omg/SecurityLevel2/_RequiredRightsStub.class b/idl/Security/.class/org/omg/SecurityLevel2/_RequiredRightsStub.class new file mode 100644 index 0000000..e5ac833 Binary files /dev/null and b/idl/Security/.class/org/omg/SecurityLevel2/_RequiredRightsStub.class differ diff --git a/idl/Security/.java/org/omg/CSI/AuthorizationElement.java b/idl/Security/.java/org/omg/CSI/AuthorizationElement.java new file mode 100644 index 0000000..6274202 --- /dev/null +++ b/idl/Security/.java/org/omg/CSI/AuthorizationElement.java @@ -0,0 +1,24 @@ +// +// AuthorizationElement.java (struct) +// +// File generated: Thu May 19 07:31:44 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CSI; + +public class AuthorizationElement + implements org.omg.CORBA.portable.IDLEntity { + + public int the_type; + public byte[] the_element; + + public AuthorizationElement() { + } + + public AuthorizationElement(int the_type, byte[] the_element) { + this.the_type = the_type; + this.the_element = the_element; + } + +} diff --git a/idl/Security/.java/org/omg/CSI/AuthorizationElementContentsHelper.java b/idl/Security/.java/org/omg/CSI/AuthorizationElementContentsHelper.java new file mode 100644 index 0000000..c680536 --- /dev/null +++ b/idl/Security/.java/org/omg/CSI/AuthorizationElementContentsHelper.java @@ -0,0 +1,64 @@ +// +// AuthorizationElementContentsHelper.java (helper) +// +// File generated: Thu May 19 07:31:44 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CSI; + +abstract public class AuthorizationElementContentsHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, byte[] value) { + any.insert_Streamable(new AuthorizationElementContentsHolder(value)); + }; + + public static byte[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof AuthorizationElementContentsHolder){ + return ((AuthorizationElementContentsHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet)); + _type = _orb().create_alias_tc(id(), "AuthorizationElementContents", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CSI/AuthorizationElementContents:1.0"; + }; + + public static byte[] read(org.omg.CORBA.portable.InputStream is) { + byte[] result; + int length0 = is.read_ulong(); + result = new byte[length0]; + for (int i0=0; i0 X509CertificateChain; + + // an X.501 type name or Distinguished Name encapsulated in a sequence of + // octets containing the ASN.1 encoding. + typedef sequence X501DistinguishedName; + + // UTF-8 Encoding of String + typedef sequence UTF8String; + + // ASN.1 Encoding of an OBJECT IDENTIFIER + typedef sequence OID; + typedef sequence OIDList; + + // A sequence of octets containing a GSStoken. Initial context tokens are + // ASN.1 encoded as defined in [IETF RFC 2743] 3.1, + // "Mechanism-Independent token Format", pp. 81-82. Initial context tokens + // contain an ASN.1 tag followed by a token length, a mechanism identifier, + // and a mechanism-specific token (i.e. a GSSUP::InitialContextToken). The + // encoding of all other GSS tokens (e.g. error tokens and final context + // tokens) is mechanism dependent. + typedef sequence GSSToken; + + // An encoding of a GSS Mechanism-Independent Exported Name Object as + // defined in [IETF RFC 2743] 3.2, "GSS Mechanism-Independent + // Exported Name Object Format," p. 84. + typedef sequence GSS_NT_ExportedName; + typedef sequence GSS_NT_ExportedNameList; + + // The MsgType enumeration defines the complete set of service context + // message types used by the CSI context management protocols, including + // those message types pertaining only to the stateful application of the + // protocols (to insure proper alignment of the identifiers between + // stateless and stateful implementations). Specifically, the + // MTMessageInContext is not sent by stateless clients (although it may + // be received by stateless targets). + typedef short MsgType; + const MsgType MTEstablishContext = 0; + const MsgType MTCompleteEstablishContext = 1; + const MsgType MTContextError = 4; + const MsgType MTMessageInContext = 5; + + // The ContextId type is used carry session identifiers. A stateless + // application of the service context protocol is indicated by a session + // identifier value of 0. + typedef unsigned long long ContextId; + + // The AuthorizationElementType defines the contents and encoding of + // the_element field of the AuthorizationElement. + // The high order 20-bits of each AuthorizationElementType constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the element type. The low order 12 bits + // shall contain the organization-scoped element type identifier. The + // high-order 20 bits of all element types defined by the OMG shall + // contain the VMCID allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long AuthorizationElementType; + + // An AuthorizationElementType of X509AttributeCertChain indicates that + // the_element field of the AuthorizationElement contains an ASN.1 BER + // SEQUENCE composed of an (X.509) AttributeCertificate followed by a + // SEQUENCE OF (X.509) Certificate. The two-part SEQUENCE is encapsulated + // in an octet stream. // The chain of identity certificates is provided + // shall directly certify the one preceding it. The first certificate + // in the chain shall certify the attribute certificate. The ASN.1 + // representation of (X.509) Certificate is as defined in [IETF RFC 2459]. + // The ASN.1 representation of (X.509) AtributeCertificate is as defined + // in [IETF ID PKIXAC]. + const AuthorizationElementType X509AttributeCertChain = OMGVMCID | 1; + typedef sequence AuthorizationElementContents; + + // The AuthorizationElement contains one element of an authorization token. + // Each element of an authorization token is logically a PAC. + struct AuthorizationElement { + AuthorizationElementType the_type; + AuthorizationElementContents the_element; + }; + + // The AuthorizationToken is made up of a sequence of + // AuthorizationElements + typedef sequence AuthorizationToken; + typedef unsigned long IdentityTokenType; + + // Additional standard identity token types shall only be defined by the + // OMG. All IdentityTokenType constants shall be a power of 2. + const IdentityTokenType ITTAbsent = 0; + const IdentityTokenType ITTAnonymous = 1; + const IdentityTokenType ITTPrincipalName = 2; + const IdentityTokenType ITTX509CertChain = 4; + const IdentityTokenType ITTDistinguishedName = 8; + + typedef sequence IdentityExtension; + + union IdentityToken switch ( IdentityTokenType ) { + case ITTAbsent: boolean absent; + case ITTAnonymous: boolean anonymous; + case ITTPrincipalName: GSS_NT_ExportedName principal_name; + case ITTX509CertChain: X509CertificateChain certificate_chain; + case ITTDistinguishedName: X501DistinguishedName dn; + default: IdentityExtension id; + }; + + struct EstablishContext { + ContextId client_context_id; + AuthorizationToken authorization_token; + IdentityToken identity_token; + GSSToken client_authentication_token; + }; + + struct CompleteEstablishContext { + ContextId client_context_id; + boolean context_stateful; + GSSToken final_context_token; + }; + + struct ContextError { + ContextId client_context_id; + long major_status; + long minor_status; + GSSToken error_token; + }; + + // Not sent by stateless clients. If received by a stateless server, a + // ContextError message should be returned, indicating the session does + // not exist. + struct MessageInContext { + ContextId client_context_id; + boolean discard_context; + }; + + union SASContextBody switch ( MsgType ) { + case MTEstablishContext: EstablishContext establish_msg; + case MTCompleteEstablishContext: CompleteEstablishContext complete_msg; + case MTContextError: ContextError error_msg; + case MTMessageInContext: MessageInContext in_context_msg; + }; + + // The following type represents the string representation of an ASN.1 + // OBJECT IDENTIFIER (OID). OIDs are represented by the string "oid:" + // followed by the integer base 10 representation of the OID separated + // by dots. For example, the OID corresponding to the OMG is represented + // as: "oid:2.23.130" + typedef string StringOID; + + // The GSS Object Identifier for the KRB5 mechanism is: + // { iso(1) member-body(2) United States(840) mit(113554) infosys(1) + // gssapi(2) krb5(2) } + const StringOID KRB5MechOID = "oid:1.2.840.113554.1.2.2"; + + // The GSS Object Identifier for name objects of the Mechanism-independent + // Exported Name Object type is: + // { iso(1) org(3) dod(6) internet(1) security(5) nametypes(6) + // gss-api-exported-name(4) } + const StringOID GSS_NT_Export_Name_OID = "oid:1.3.6.1.5.6.4"; + + // The GSS Object Identifier for the scoped-username name form is: + // { iso-itu-t (2) international-organization (23) omg (130) security (1) + // naming (2) scoped-username(1) } + const StringOID GSS_NT_Scoped_Username_OID = "oid:2.23.130.1.2.1"; + +}; // CSI + +#endif + + diff --git a/idl/Security/.svn/text-base/CSIIOP.idl.svn-base b/idl/Security/.svn/text-base/CSIIOP.idl.svn-base new file mode 100644 index 0000000..07128a5 --- /dev/null +++ b/idl/Security/.svn/text-base/CSIIOP.idl.svn-base @@ -0,0 +1,116 @@ +#ifndef _CSIIOP_IDL_ +#define _CSIIOP_IDL_ + +#include +#include "CSI.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module CSIIOP { + + //typeprefix CIIOP "omg.org"; + + // Association options + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + const AssociationOptions IdentityAssertion = 1024; + const AssociationOptions DelegationByClient = 2048; + + // The high order 20-bits of each ServiceConfigurationSyntax constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the syntax. The low order 12 bits shall + // contain the organization-scoped syntax identifier. The high-order 20 + // bits of all syntaxes defined by the OMG shall contain the VMCID + // allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long ServiceConfigurationSyntax; + const ServiceConfigurationSyntax SCS_GeneralNames = CSI::OMGVMCID | 0; + const ServiceConfigurationSyntax SCS_GSSExportedName = CSI::OMGVMCID | 1; + typedef sequence ServiceSpecificName; + + // The name field of the ServiceConfiguration structure identifies a + // privilege authority in the format identified in the syntax field. If the + // syntax is SCS_GeneralNames, the name field contains an ASN.1 (BER) + // SEQUENCE [1..MAX] OF GeneralName, as defined by the type GeneralNames in + // [IETF RFC 2459]. If the syntax is SCS_GSSExportedName, the name field + // contains a GSS exported name encoded according to the rules in + // [IETF RFC 2743] 3.2, "Mechanism-Independent Exported Name + // Object Format," p. 84. + struct ServiceConfiguration { + ServiceConfigurationSyntax syntax; + ServiceSpecificName name; + }; + typedef sequence ServiceConfigurationList; + + // The body of the TAG_NULL_TAG component is a sequence of octets of + // length 0. + // type used to define AS layer functionality within a compound mechanism + // definition + struct AS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID client_authentication_mech; + CSI::GSS_NT_ExportedName target_name; + }; + + // type used to define SAS layer functionality within a compound mechanism + // definition + struct SAS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + ServiceConfigurationList privilege_authorities; + CSI::OIDList supported_naming_mechanisms; + CSI::IdentityTokenType supported_identity_types; + }; + + // type used in the body of a TAG_CSI_SEC_MECH_LIST component to + // describe a compound mechanism + struct CompoundSecMech { + AssociationOptions target_requires; + IOP::TaggedComponent transport_mech; + AS_ContextSec as_context_mech; + SAS_ContextSec sas_context_mech; + }; + typedef sequence CompoundSecMechanisms; + + // type corresponding to the body of a TAG_CSI_SEC_MECH_LIST + // component + struct CompoundSecMechList { + boolean stateful; + CompoundSecMechanisms mechanism_list; + }; + struct TransportAddress { + string host_name; + unsigned short port; + }; + typedef sequence TransportAddressList; + + // Tagged component for configuring SECIOP as a CSIv2 transport mechanism + const IOP::ComponentId TAG_SECIOP_SEC_TRANS = 35; + + struct SECIOP_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID mech_oid; + CSI::GSS_NT_ExportedName target_name; + TransportAddressList addresses; + }; + // tagged component for configuring TLS/SSL as a CSIv2 transport mechanism + const IOP::ComponentId TAG_TLS_SEC_TRANS = 36; + struct TLS_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + TransportAddressList addresses; + }; + +}; //CSIIOP +#endif diff --git a/idl/Security/.svn/text-base/SSLIOP.idl.svn-base b/idl/Security/.svn/text-base/SSLIOP.idl.svn-base new file mode 100644 index 0000000..d985dd0 --- /dev/null +++ b/idl/Security/.svn/text-base/SSLIOP.idl.svn-base @@ -0,0 +1,20 @@ +#if !defined(_SSLIOP_IDL) +#define _SSLIOP_IDL + +#pragma prefix "omg.org" + +#include +#include + +module SSLIOP { + // Security mechanism SSL + const IOP::ComponentId TAG_SSL_SEC_TRANS = 20; + + struct SSL { + Security::AssociationOptions target_supports; + Security::AssociationOptions target_requires; + unsigned short port; + }; + +}; +#endif /* _SSLIOP_IDL */ diff --git a/idl/Security/.svn/text-base/Security.idl.svn-base b/idl/Security/.svn/text-base/Security.idl.svn-base new file mode 100644 index 0000000..b78dabd --- /dev/null +++ b/idl/Security/.svn/text-base/Security.idl.svn-base @@ -0,0 +1,329 @@ +//Security Service, v1.8 - OMG IDL Summary File +//Object Management Group, Inc. +// +//Copyright 1995, AT&T Global Information Solutions Company +//Copyright 1995, Digital Equipment Corporation +//Copyright 1995, Expersoft Corporation +//Copyright 1995, Groupe Bull +//Copyright 1995, Hewlett-Packard Company +//Copyright 1995, IBM (in collaboration with Taligent, Inc.) +//Copyright 1995, International Computers Limited +//Copyright 2000, Object Management Group, Inc. +//Copyright 1995, Netscape Communications Corporation +//Copyright 1997, Northern Telecom Limited +//Copyright 1995, Novell, Inc. +//Copyright 1995, Siemens Nixdorf Informationssysteme AG +//Copyright 1995, 1997, SunSoft, Inc. +//Copyright 1995, Tandem Computer, Inc. (in collaboration with Odyssey Research Assoc, Inc.) +//Copyright 1995, Tivoli Systems, Inc. +//Copyright 1997, Visigenic Software, Inc. +// +//The companies listed above have granted to the Object Management Group, Inc. +//(OMG) a nonexclusive, royalty-free, paid up, worldwide license to copy and +//distribute this document and to modify this document and distribute copies of +//the modified version. Each of the copyright holders listed above has agreed +//that no person shall be deemed to have infringed the copyright in the included +//material of any such copyright holder by reason of having used the +//specification set forth herein or having conformed any computer software to +//the specification. +// +//This file contains OMG IDL from the Security Service, v1.8 specification. +//OMG regularly publishes a summary file that contains all the "code" parts of +//an OMG formal document. Every formal document line that is IDL, PIDL, or +//language code is included in the summary file. The reason for such a listing +//is to give readers an electronic version of the "code" so that they can +//extract pieces of it. Readers might want to test an example, include it in +//their own code, or use it for documentation purposes. Having the code lines +//available electronically means there is less likelihood of a transcription +//error. +// +//This subsection defines the OMG IDL for security data types common to the //other security modules, which is the module Security. The Security module //depends on the TimeBase module and the CORBA module. + + +#if !defined(_SECURITY_IDL_) +#define _SECURITY_IDL_ + +#include +#include + +#pragma prefix "omg.org" + +module Security { + //# pragma version Security 1.8 + typedef string SecurityName; + typedef sequence Opaque; + // Constant declarations for Security Service Options + const CORBA::ServiceOption SecurityLevel1 = 1; + const CORBA::ServiceOption SecurityLevel2 = 2; + const CORBA::ServiceOption NonRepudiation = 3; + const CORBA::ServiceOption SecurityORBServiceReady = 4; + const CORBA::ServiceOption SecurityServiceReady = 5; + const CORBA::ServiceOption ReplaceORBServices = 6; + const CORBA::ServiceOption ReplaceSecurityServices = 7; + const CORBA::ServiceOption StandardSecureInteroperability = 8; + const CORBA::ServiceOption DCESecureInteroperability = 9; + // Service options for Common Secure Interoperability + const CORBA::ServiceOption CommonInteroperabilityLevel0 = 10; + const CORBA::ServiceOption CommonInteroperabilityLevel1 = 11; + const CORBA::ServiceOption CommonInteroperabilityLevel2 = 12; + // Security mech types supported for secure association + const CORBA::ServiceDetailType SecurityMechanismType = 1; + // privilege types supported in standard access policy + const CORBA::ServiceDetailType SecurityAttribute = 2; + // extensible families for standard data types + struct ExtensibleFamily { + unsigned short family_definer; + unsigned short family; + }; + typedef sequence OID; + typedef sequence OIDList; + // security attributes + typedef unsigned long SecurityAttributeType; + // other attributes; family = 0 + const SecurityAttributeType AuditId = 1; + const SecurityAttributeType AccountingId = 2; + const SecurityAttributeType NonRepudiationId = 3; + // privilege attributes; family = 1 + const SecurityAttributeType _Public = 1; + const SecurityAttributeType AccessId = 2; + const SecurityAttributeType PrimaryGroupId = 3; + const SecurityAttributeType GroupId = 4; + const SecurityAttributeType Role = 5; + const SecurityAttributeType AttributeSet = 6; + const SecurityAttributeType Clearance = 7; + const SecurityAttributeType Capability = 8; + struct AttributeType { + ExtensibleFamily attribute_family; + SecurityAttributeType attribute_type; + }; + typedef sequence AttributeTypeList; + struct SecAttribute { + AttributeType attribute_type; + OID defining_authority; + Opaque value; + // the value of this attribute can be + // decoded only with knowledge of defining_authority + }; + typedef sequence AttributeList; + // Authentication return status + enum AuthenticationStatus { + SecAuthSuccess, + SecAuthFailure, + SecAuthContinue, + SecAuthExpired + }; + // Association return status + enum AssociationStatus { + SecAssocSuccess, + SecAssocFailure, + SecAssocContinue + }; + // Authentication method + typedef unsigned long AuthenticationMethod; + typedef sequence AuthenticationMethodList; + // Credential types + enum InvocationCredentialsType { + SecOwnCredentials, + SecReceivedCredentials, + SecTargetCredentials + }; + // Declarations related to Rights + struct Right { + ExtensibleFamily rights_family; + string the_right; + }; + typedef sequence RightsList; + enum RightsCombinator { + SecAllRights , + SecAnyRight + }; + // Delegation related + enum DelegationState { + SecInitiator, + SecDelegate + }; + enum DelegationDirective { + Delegate, + NoDelegate + }; + // pick up from TimeBase + typedef TimeBase::UtcT UtcT; + typedef TimeBase::IntervalT IntervalT; + typedef TimeBase::TimeT TimeT; + // Security features available on credentials. + enum SecurityFeature { + SecNoDelegation, + SecSimpleDelegation, + SecCompositeDelegation, + SecNoProtection, + SecIntegrity, + SecConfidentiality, + SecIntegrityAndConfidentiality, + SecDetectReplay, + SecDetectMisordering, + SecEstablishTrustInTarget, + SecEstablishTrustInClient + }; + // Quality of protection which can be specified + // for an object reference and used to protect messages + enum QOP { + SecQOPNoProtection, + SecQOPIntegrity, + SecQOPConfidentiality, + SecQOPIntegrityAndConfidentiality + }; + // Type of SecurityContext + enum SecurityContextType { + SecClientSecurityContext, + SecServerSecurityContext + }; + // Operational State of a Security Context + enum SecurityContextState { + SecContextInitialized, + SecContextContinued, + SecContextClientEstablished, + SecContextEstablished, + SecContextEstablishExpired, + SecContextExpired, + SecContextInvalid + }; + struct ChannelBindings { + unsigned long initiator_addrtype; + sequence initiator_address; + unsigned long acceptor_addrtype; + sequence acceptor_address; + sequence application_data; + }; + // For use with SecurityReplaceable + struct OpaqueBuffer { + Opaque buffer; + unsigned long startpos; + unsigned long endpos; + // startpos <= endpos + // OpaqueBuffer is said to be empty if startpos == endpos + }; + + // Association options which can be administered + // on secure invocation policy and used to + // initialize security context + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + + // Flag to indicate whether association options being + // administered are the "required" or "supported" set + enum RequiresSupports { + SecRequires, + SecSupports + }; + // Direction of communication for which + // secure invocation policy applies + enum CommunicationDirection { + SecDirectionBoth, + SecDirectionRequest, + SecDirectionReply + }; + // security association mechanism type + typedef string MechanismType; + typedef sequence MechanismTypeList; + // AssociationOptions-Direction pair + struct OptionsDirectionPair { + AssociationOptions options; + CommunicationDirection direction; + }; + typedef sequence OptionsDirectionPairList; + // Delegation mode which can be administered + enum DelegationMode { + SecDelModeNoDelegation, // i.e. use own credentials + SecDelModeSimpleDelegation, // delegate received credentials + SecDelModeCompositeDelegation // delegate both; + }; + // Association options supported by a given mech type + struct MechandOptions { + MechanismType mechanism_type; + AssociationOptions options_supported; + }; + typedef sequence MechandOptionsList; + // Attribute of the SecurityLevel2::EstablishTrustPolicy + struct EstablishTrust { + boolean trust_in_client; + boolean trust_in_target; + }; + // Audit + typedef unsigned long AuditChannelId; + typedef unsigned short EventType; + const EventType AuditAll = 0; + const EventType AuditPrincipalAuth = 1; + const EventType AuditSessionAuth = 2; + const EventType AuditAuthorization = 3; + const EventType AuditInvocation = 4; + const EventType AuditSecEnvChange = 5; + const EventType AuditPolicyChange = 6; + const EventType AuditObjectCreation = 7; + const EventType AuditObjectDestruction =8; + const EventType AuditNonRepudiation = 9; + enum DayOfTheWeek { + Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; + enum AuditCombinator { + SecAllSelectors, + SecAnySelector + }; + struct AuditEventType { + ExtensibleFamily event_family; + EventType event_type; + }; + typedef sequence AuditEventTypeList; + typedef unsigned long SelectorType; + const SelectorType InterfaceName = 1; + const SelectorType ObjectRef = 2; + const SelectorType Operation = 3; + const SelectorType Initiator = 4; + const SelectorType SuccessFailure = 5; + const SelectorType Time = 6; + const SelectorType DayOfWeek = 7; + + // values defined for audit_needed and audit_write are: + // InterfaceName: CORBA::RepositoryId + // ObjectRef: object reference + // Operation: op_name + // Initiator: Credentials + // SuccessFailure: boolean + // Time: utc time on audit_write; time picked up from + // environment in audit_needed if required + // DayOfWeek: DayOfTheWeek + struct SelectorValue { + SelectorType selector; + any value; + }; + typedef sequence SelectorValueList; + + // Constant declaration for valid Security Policy Types + // General administrative policies + const CORBA::PolicyType SecClientInvocationAccess = 1; + const CORBA::PolicyType SecTargetInvocationAccess = 2; + const CORBA::PolicyType SecApplicationAccess = 3; + const CORBA::PolicyType SecClientInvocationAudit = 4; + const CORBA::PolicyType SecTargetInvocationAudit = 5; + const CORBA::PolicyType SecApplicationAudit = 6; + const CORBA::PolicyType SecDelegation = 7; + const CORBA::PolicyType SecClientSecureInvocation = 8; + const CORBA::PolicyType SecTargetSecureInvocation = 9; + const CORBA::PolicyType SecNonRepudiation = 10; + // Policies used to control attributes of a binding to a target + const CORBA::PolicyType SecMechanismsPolicy = 12; + const CORBA::PolicyType SecInvocationCredentialsPolicy = 13; + const CORBA::PolicyType SecFeaturePolicy = 14; // obsolete + const CORBA::PolicyType SecQOPPolicy = 15; + const CORBA::PolicyType SecDelegationDirectivePolicy = 38; + const CORBA::PolicyType SecEstablishTrustPolicy = 39; +}; +#endif /* _SECURITY_IDL_ */ + diff --git a/idl/Security/.svn/text-base/SecurityLevel1.idl.svn-base b/idl/Security/.svn/text-base/SecurityLevel1.idl.svn-base new file mode 100644 index 0000000..ee46e4b --- /dev/null +++ b/idl/Security/.svn/text-base/SecurityLevel1.idl.svn-base @@ -0,0 +1,18 @@ +#if !defined(_SECURITY_LEVEL_1_IDL_) +#define _SECURITY_LEVEL_1_IDL_ + +#include +#pragma prefix "omg.org" + +module SecurityLevel1 { + //# pragma version SecurityLevel1 1.8 + local interface Current : CORBA::Current { + //# pragma version Current 1.8 + // thread specific operations + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + }; +}; +#endif /* _SECURITY_LEVEL_1_IDL_ */ + diff --git a/idl/Security/.svn/text-base/SecurityLevel2.idl.svn-base b/idl/Security/.svn/text-base/SecurityLevel2.idl.svn-base new file mode 100644 index 0000000..dd3e11a --- /dev/null +++ b/idl/Security/.svn/text-base/SecurityLevel2.idl.svn-base @@ -0,0 +1,196 @@ +#if !defined(_SECURITY_LEVEL_2_IDL_) +#define _SECURITY_LEVEL_2_IDL_ + +#include + +#pragma prefix "omg.org" + +module SecurityLevel2 { + //# pragma version SecurityLevel2 1.8 + // Forward declaration of interfaces + local interface PrincipalAuthenticator; + local interface Credentials; + local interface Current; + +// Interface PrincipalAuthenticator + local interface PrincipalAuthenticator { + //# pragma version PrincipalAuthenticator 1.8 + Security::AuthenticationMethodList + get_supported_authen_methods( + in Security::MechanismType mechanism + ); + Security::AuthenticationStatus authenticate ( + in Security::AuthenticationMethod method, + in Security::MechanismType mechanism, + in Security::SecurityName security_name, + in any auth_data, + in Security::AttributeList privileges, + out Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + Security::AuthenticationStatus continue_authentication ( + in any response_data, + in Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + }; + + // Interface Credentials + local interface Credentials { + //# pragma version Credentials 1.8 + Credentials copy (); + void destroy(); + readonly attribute Security::InvocationCredentialsType credentials_type; + readonly attribute Security::AuthenticationStatus authentication_state; + readonly attribute Security::MechanismType mechanism; + attribute Security::AssociationOptions accepting_options_supported; + attribute Security::AssociationOptions accepting_options_required; + attribute Security::AssociationOptions invocation_options_supported; + attribute Security::AssociationOptions invocation_options_required; + boolean get_security_feature( + in Security::CommunicationDirection direction, + in Security::SecurityFeature feature + ); + boolean set_attributes ( + in Security::AttributeList requested_attributes, + out Security::AttributeList actual_attributes + ); + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + boolean is_valid ( + out Security::UtcT expiry_time + ); + boolean refresh( + in any refresh_data + ); + }; + + typedef sequence CredentialsList; + + local interface ReceivedCredentials : Credentials { + //# pragma version ReceivedCredentials 1.8 + readonly attribute Credentials accepting_credentials; + readonly attribute Security::AssociationOptions association_options_used; + readonly attribute Security::DelegationState delegation_state; + readonly attribute Security::DelegationMode delegation_mode; + }; + + local interface TargetCredentials : Credentials { + //# pragma version TargetCredentials 1.8 + readonly attribute Credentials initiating_credentials; + readonly attribute Security::AssociationOptions association_options_used; + }; + + // RequiredRights Interface + interface RequiredRights{ + void get_required_rights( + in Object obj, + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + out Security::RightsList rights, + out Security::RightsCombinator rights_combinator + ); + void set_required_rights( + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + in Security::RightsList rights, + in Security::RightsCombinator rights_combinator + ); + }; + + // interface audit channel + local interface AuditChannel { + //# pragma version AuditChannel 1.8 + void audit_write ( + in Security::AuditEventType event_type, + in CredentialsList creds, + in Security::UtcT time, + in Security::SelectorValueList descriptors, + in any event_specific_data + ); + readonly attribute Security::AuditChannelId audit_channel_id; + }; + + // interface for Audit Decision + local interface AuditDecision { + // #pragma version AuditDecision 1.8 + boolean audit_needed ( + in Security::AuditEventType event_type, + in Security::SelectorValueList value_list + ); + readonly attribute AuditChannel audit_channel; + }; + + local interface AccessDecision { + // #pragma version AccessDecision 1.8 + boolean access_allowed ( + in SecurityLevel2::CredentialsList cred_list, + in Object target, + in CORBA::Identifier operation_name, + in CORBA::Identifier target_interface_name + ); + }; + + // Policy interfaces to control bindings + local interface QOPPolicy : CORBA::Policy { + // #pragma version QOPPolicy 1.8 + readonly attribute Security::QOP qop; + }; + + local interface MechanismPolicy : CORBA::Policy { + // #pragma version MechanismPolicy 1.8 + readonly attribute Security::MechanismTypeList mechanisms; + }; + + local interface InvocationCredentialsPolicy : CORBA::Policy { + // #pragma version InvocationCredentialsPolicy 1.8 + readonly attribute CredentialsList creds; + }; + + local interface EstablishTrustPolicy : CORBA::Policy { + // #pragma version EstablishTrustPolicy 1.8 + readonly attribute Security::EstablishTrust trust; + }; + + local interface DelegationDirectivePolicy : CORBA::Policy { + // #pragma version DelegationDirectivePolicy 1.8 + readonly attribute Security::DelegationDirective delegation_directive; + }; + + local interface SecurityManager { + // #pragma version SecurityManager 1.8 + // Process/Capsule/ORB Instance specific operations + readonly attribute Security::MechandOptionsList supported_mechanisms; + readonly attribute CredentialsList own_credentials; + readonly attribute RequiredRights required_rights_object; + readonly attribute PrincipalAuthenticator principal_authenticator; + readonly attribute AccessDecision access_decision; + readonly attribute AuditDecision audit_decision; + TargetCredentials get_target_credentials ( + in Object obj_ref + ); + void remove_own_credentials( + in Credentials creds + ); + CORBA::Policy get_security_policy ( + in CORBA::PolicyType policy_type + ); + }; + + // Interface Current derived from SecurityLevel1::Current providing + // additional operations on Current at this security level. + // This is implemented by the ORB + local interface Current : SecurityLevel1::Current { + //# pragma version Current 1.8 + // Thread specific + readonly attribute ReceivedCredentials received_credentials; + }; +}; + +#endif /* _SECURITY_LEVEL_2_IDL_ */ + + + diff --git a/idl/Security/.svn/text-base/SecurityLevel3.idl.svn-base b/idl/Security/.svn/text-base/SecurityLevel3.idl.svn-base new file mode 100644 index 0000000..e3251eb --- /dev/null +++ b/idl/Security/.svn/text-base/SecurityLevel3.idl.svn-base @@ -0,0 +1,2041 @@ +//*********************************************************************** +// ORBAsec SL3 +// ---------------------------------------------------------------------- +// Copyright (C) 2001 Adiron, LLC. +// All rights reserved. +// ---------------------------------------------------------------------- +//*********************************************************************** + +//*********************************************************************** +/** + * @note Some interfaces in this IDL module have been altered from the + * original Adiron sources. + */ +//*********************************************************************** + + +#ifndef _SecurityLevel3_ +#define _SecurityLevel3_ + +#include +#include "TimeBase.idl" + +#pragma prefix "adiron.com" + +/** + * The Security Level 3 module contains the data definitions and + * the Application Programmers Interface for dealing with the + * ORBAsec SL3 Security, and the new CSIv2 Security Protocol, which has + * been adopted by the OMG. + *

+ * The SecurityLevel3 interfaces and its security data structures + * are based on the Principal Calculus. This is a mathematical + * model of representing principals for the use of access control + * and auditing. + *

+ * The SecurityLevel3 Security Service is represented by two objects + * that are returned by the ORB's resolve_initial_reference call. + * Those two objects are the SecurityManager and the SecurityCurrent. + * Other objects associated with the security service emanate from + * these two objects. + *

+ * The SecurityLevel3 Security Service has a Credentials model. This + * model, which is heavily based on the Principal Calculus, yields + * an API for accessing principal information. The credentials + * represent a principal's credentials, as well as the establishment + * of security contexts between client and servers. + *

+ * The SecurityLevel3 Security Service is currently CSIv2 Level 2 + * compliant: + *

+ *

+ * The Security Level 3 ORB Security Service does supports retention + * of CSI state. Client Authentication information and Identity + * assertion information is transmitted on each request. + *

+ * The Security Level 3 ORB Security Service does not automatically + * support endorsement at this time (CSIv2 Level 2 compliance), but + * does give you facility to do so. + */ +module SecurityLevel3 { + + /** + * The Adiron VMCID, which is used in Minor Error Codes, + * Policy Tags, etc. + */ + const unsigned long ADIRON_VMCID = 0xA11C000; + + //------------------------------------------------------------- + // Security Level 3 Data Representations + // + //------------------------------------------------------------- + + // + // A Principal Name + // A principal name always has a type, and a path of + // name components. They are ordered from least significant + // to most significant. For example, if a principal is represented + // by a single X.509 certificate, the first element in the path + // is the SubjectDN, and the second is the IssuerDN. + // + /** + * A NameType is used for typing a PrincipalName data structure. + * A NameType is a string that represents an ASN.1 + * OBJECT IDENTIFIER. Its representation usually of the form + * "oid:1.2.3.4". Other forms may be possible. It is used + * for encoding name type identifiers, which are ASN.1 DER encoded + * OBJECT IDENTIFIERs, in the CSI protocol. + * @see NameComponent + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef string NameType; + + /** + * A NameComponent is an ordered component of a NamePath. The + * least significant component is always the first component. + * It is the type of a wstring to handle international character + * values. + * @see NameType + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef wstring NameComponent; + + /** + * A NamePath is an ordered collection of NameComponents, ordered + * from the least significant to most significant. For example, + * an identity that is defined by a certificate that has a + * SubjectDN of "C=US,CN=Joe,O=Adiron" and an IssuerDN of + * "C=US,CN=AdironCA,O=Adiron" will have the following + * name components: + *

+     *  NameComponent[0] = "C=US,CN=Joe,O=Adiron"
+     *  NameComponent[1] = "C=US,CN=AdironCA,O=Adiron"
+     * 
+ * @see NameType + * @see NameComponent + * @see NameValue + * @see PrincipalName + */ + typedef sequence NamePath; + + /** + * A NameValue is the value component of a PrincipalName, + * which is a "type-value" pair. It is defined as a NamePath. + * @see NameType + * @see NameComponent + * @see NamePath + * @see PrincipalName + */ + typedef NamePath NameValue; + + /** + * A PrincipalName is a "type-value" structure. The type directs + * what the encoding and format of the components in the the + * value component are. For example, a type of "X509DirectoryPath" + * means that the value contains the DNs of the subject and + * subsequent issuers. + * @see NameType + * @see NameComponent + * @see NamePath + * @see NameValue + */ + struct PrincipalName { + NameType the_type; + NameValue the_name; + }; + + /** + * A list of PrincipalNames. + * @see PrincipalName + */ + typedef sequence PrincipalNameList; + + + // + // Attributes for privileges and other things. They are type value pairs. + // + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + *

+ * The type of a PrinAttribute is represented by a string. + *

+ * Privilege Attribute Types, that might come from X.509 certificates + * might be represented by OIDs. OIDs are represented as: + *

+     *   oid:n1.n2.n3.n4.n5.n6....
+     *             for an OID where ni are non-negative integers.
+     * 
+ * These OIDs are meant to be used to direct the "type-value" encoding + * of a GSS-API ExportName, which uses an OID as a type that directs + * the encoding of the value. + *

+ * Example Environmental Attribute Types + *

+     *   SL3:ChannelIdentifier
+     *   SL3:LocalAddress
+     *   SL3:LocalPort
+     *   SL3:TransportMechanism
+     *   SL3:TLSCipherSuite
+     * 
+ * @see PrinAttribute + */ + typedef string PrinAttributeType; + + /** + * A PrinAttributeValue is a wide character string that encodes + * or decodes the value of an attribute. An attempt is always + * meant to represent an attribute's value in a human readable + * string form. If the value cannot be decoded this way, and its + * native form is binary, then it is represented in a Hex encoding + * of the binary form. + * @see PrinAttribute + */ + typedef wstring PrinAttributeValue; + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + * @see PrinAttribute + */ + struct PrinAttribute { + PrinAttributeType the_type; + PrinAttributeValue the_value; + }; + + /** + * A list of PrinAttributes. + * @see PrinAttribute + */ + typedef sequence PrinAttributeList; + + + /** + * This is just a sequence of strings that make + * up the components of a ResourceName. + * @see ResourceName + */ + typedef sequence ResourceNameComponents; + + /** + * A ResourceName is the constructed name of a "resource". A + * ResourceName is closely modeled after CORBAmed's Resource + * Access Decision (RAD) facility's "Resource". It contains + * a sequence of strings. + */ + struct ResourceName { + ResourceNameComponents components; + }; + + /** + * A List of Resource Names. + * @See ResourceName + */ + typedef sequence ResourceNameList; + + + // + // NameTypes used in SL3 + // + + /** + * An NT_KerberosName is a NameType that signifies that the + * value of a PrincipalName is a Kerberos formated name. + * A KerberosName is a single string encoded in the + * familiar "name@REALM" format. + *

+ * From GSS-Kerboeros RFC 1964: + *

+ * 2.1.1. Kerberos Principal Name Form + *

+ * This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5_name(1)}. + */ + const NameType NT_KerberosName = "oid:1.2.840.113554.1.2.2.1"; + + /** + * An NT_X509DirectoryNamePath is a NameType that signifies that + * the value of a PrincipalName is constructed from a chain + * of certificates, such that the end entity is the least + * significant position, with the subsequent issuers following + * in order of signature. + *

+ * The coding of the names is the string encoding of + * complete X.500 DN's, such as "C=US, CN=Joe, O=Adiron". + * There is no indication whether the last DN in the path is a + * "root", i.e. it's issuer is the same. + */ + const NameType NT_X509DirectoryNamePath = "SL3:X509DirectoryPathName"; + + /** + * The NT_Anonymous is a name type that specifies that the + * PrincipalName is representing the "anonymous" principal. + * Its value always as a single name component of "anonymous" + */ + const NameType NT_Anonymous = "SL3:anonymous"; + + /** + * The NT_StringName is a NameType that specifies that the + * PrincipalName is represented by a single NameComponent + * of name in a "scoped" name space. The name and scope + * are separated by a single "@" character. The escape character + * is "\". This string name as we call it is the same form + * used for the GSSUP (GSS-UserPassword NameType). This + * oid is the OID defined by the OMG CSIv2 specification. It + * is the value defined by the CSI::GSS_NT_Scoped_Username_OID + * constant. + */ + const NameType NT_StringName = "oid:2.23.130.1.2.1"; + + // + // Privileges + // + + /** + * A ScopedPrivileges structure represents privileges that + * belong to a scope defined by a principal. This structure + * is used to represent a principal that is a privilege authority + * that issues privileges. Privileges are represented as + * PrinAttributes. + */ + struct ScopedPrivileges { + PrincipalName privilege_authority; + PrinAttributeList privileges; + }; + + /** + * A list of ScopedPrivileges + * @see ScopedPrivileges + */ + typedef sequence ScopedPrivilegesList; + + // + // Principals + // + + /** + * A Principal comes in three forms, which correspond to the + * Principal Calculus. The forms are "Simple", "Quoting", and + * "Proxy". Simple is a principal that represents a single + * entity, usually "speaking for" itself. A "Quoting" principal + * is a "compound" principal that says that one principal is + * speaking on behalf of another, usually denoted by "(A|B)", i.e. + * "A is quoting B", which means that "A is speaking on behalf of B". + * A "Proxy" principal is almost the same as a "Quoting" principal. + * However, the security service has determined that enough evidence + * exists that proves that Principal A is authorized to speak in + * B's behalf. This principal is denoted in the calculus as "(A for B)" + * in contrast to the quoting principal "(A|B)". + */ + typedef unsigned long PrincipalType; + + /** + * The Simple Principal Type (A) + * @see PrincipalType + */ + const PrincipalType PT_Simple = 0; // A, valuetype SimplePrincipal + /** + * The Quoting Principal Type (A|B) + * @see PrincipalType + */ + const PrincipalType PT_Quoting = 1; // B | A, valuetype QuotingPrincipal + /** + * The Proxy Principal Type (A for B) + * @see PrincipalType + */ + const PrincipalType PT_Proxy = 2; // B for A, valuetype ProxyPrincipal + + /** + * A Principal is represented by a base value type, which is extended + * for the various principals, Simple, Quoting, and Proxy. This base + * type of a Principal may be sufficient for access control in + * most systems. + * @param the_type contains the corresponding identifier + * @param the_name contains the logical name of the most derived + * Principal. Such as if the Principal is a nested + * ProxyPrincipal (i.e. C for B for A) the name here + * is A. + * @param environmental_attributes + * The attributes name certain things that do are + * environmental, such as IP addresses. + * @param with_privileges + * These are the privileges associated with Principal A + * restricted_resources. + * This attribute contains a collection of resources on which + * the principal is authorized to perform actions. + */ + valuetype Principal { + /** This field contains the type of the Principal. */ + public PrincipalType the_type; + /** This field contains the name of the Principal */ + public PrincipalName the_name; + /** + * This field contains the attributes of the principal + * that are considered environmental, such as authentication + * mechanism, authentication channel identifier, etc. + */ + public PrinAttributeList environmental_attributes; + /** + * This field contains the list of scoped privileges the + * security service has determined belong to the particular + * principal. + */ + public ScopedPrivilegesList with_privileges; + }; + + /** + * A list of Principals. + * @see Principal + */ + typedef sequence PrincipalList; + + /** + * A Simple Principal represents a single entity. It is usually + * derived by credentials acquisition, authentication, trust rules concerning quoting, + * or trust rules and certificates concerning Proxying. + * It has one extra field over the base Principal, which is + * "alternate_names". + */ + valuetype SimplePrincipal : /* truncatable */ Principal { + /** + * This field indicates whether the principal was derived or is + * going to be derived from an authentication mechanism. + *

+ * If the SimplePrincipal is directly or indirectly + * (as part of a composite Principal) in the + * ClientCredentials.client_principal or + * TargetCredentials.target_principal field, + * the authenticated field indicates the authentication + * status of the SimplePrincipal in the client or target + * principal, respectively. + *

+ * If the SimplePricipal is directly or indirectly in + * the ClientCredentials.target_principal + * (or TargetCredentials.client_principal) field, + * the authenticated field indicates the target's + * (or client's belief) about its authentication status to the other + * party. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of the initiator or acceptor + * of OwnCredentials, the authenticated + * field indicates the expectation of being authenticated to the other + * side of the communication when the initiator or acceptor is used. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of a + * PrincipalIdentityStatement, + * the authenticated field indicates only the + * "best effort" of knowing whether the principal has been possibly + * authenticated or not. In other word, if this field is + * TRUE, it is for sure that the principal has been + * authenticated (or is expecting to be authenticated). + * If this field is FALSE, the principal may or may not + * have been authenticated. The reason for this ambiguity is that + * a PrincipalIdentityStatement may be created before + * the authentication of the principal being performed. In general, + * the authenticated field of a + * SimplePrincipal inside the the_principal + * field of a PrincipalIdentityStatement should not be + * taken as a definite answer for the authentication status of the + * SimplePrincipal. + * + * @see ClientCredentials.client_authentication + * @see ClientCredentials.target_authentication + * @see TargetCredentials.client_authentication + * @see TargetCredentials.target_authentication + */ + // For example, if a client uses the User/Password mechanism to + // communicate with a target, the client's OwnCredentials, created + // using a PasswordGenerator, will have the authenticated + // field in the principal in the initiator being true, + // although the client may not have been authenticated to the target. + // + public boolean authenticated; + /** + * This field contains the other name types, such as + * that appear in the X.509 alternate name fields. + */ + public PrincipalNameList alternate_names; + + }; + + /** + * A ProxyPrincipal represents a principal that speaks for another. + * The principal is proved that it is authorized to speak for another. + * The system believes this, either by trust rules of its own, + * or by delivered endorsement from the principal such as + * Principal (B for A) where the endorsement takes the form + * in the Principal Calculus as (T says B serves A) + * where T is some entity trusted by the security service + * to make those statements. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * speaks_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype ProxyPrincipal : /* truncatable */ Principal { + + /** + * In a Proxy Principal of (A for B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Proxy Principal of (A for B) the speaks_for field + * represents the principal B. + */ + public Principal speaks_for; + + }; + + /** + * A QuotingPrincipal represents a principal that speaks for another. + * The principal is not proved that it is authorized to speak for another. + * The system derives principals like this based on statements in the + * Pricipal Calculus, such as "A says B says r", which results in the + * quoting principal (A|B) says r, where "r" is a statement, such as + * a CORBA request. The security service derives principals like + * this from the CSI Identity Assertion mechanism. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * quotes_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype QuotingPrincipal : /* truncatable */ Principal { + + /** + * In a Quoting Principal of (A|B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Quoting Principal of (A|B) the quotes_for field + * represents the principal B. + */ + public Principal quotes_for; + + }; + + // + // Statements + // + + /** + * A Statement is a value type that has extensions which + * represent the different relevant data directed by its StatementType. + * There are two basic Statement Types, an IdentityStatement and + * an EndorsementStatement. An identity statement is a statement that + * asserts an identity. It may represent a the components of + * an X.509 certificate during an authentication. An EndorsementStatement + * may represent the contents of an X.509 AttributeCertificate or + * some other notion of an endorsement, such as a certificate in + * BizTalk XML. + *

+ * Statements are contained in the Credentials Objects. They + * represent pieces of evidence collected from which the security + * service deduces the Principal of the Credentials Objects. + */ + typedef unsigned long StatementType; + + /** + * The Identity Statement Type. + *

+ * A statement of this type at least extends to the + * IdentityStatement valuetype, if not truncated + * @see IdentityStatement + */ + const StatementType ST_IdentityStatement = 1; //valuetype IdentityStatement + + /** + * The Endorsement Statement Type. + *

+ * A statement of this type at least extends to the + * EndorsementStatement valuetype, if not truncated + * @see EndorsementStatement + */ + const StatementType ST_EndorsementStatement = 2; //valuetype EndorsementStatement + + /** + * An encoding is a sequence of bytes. + */ + typedef sequence Encoding; + + /** + * Statement encoding type. + *

+ * Statements carry their original encoding information, if + * they came from an encoding, such as list of X.509 identity + * certificates (i.e. a chain). The encoding type may be derivable + * from the encoding itself. For example, it's easy to tell the + * difference between a PEM encoded certificate, and a DER encoded + * certificate. Therefore, the encoding type may default to "Unknown". + * Other types may exist than the ones provided as constants in + * this module. + */ + typedef string EncodingType; + + /** + * The ET_NoEncoding type signifies that the statement + * has been generated solely by the security service + * and has no encoding. + */ + const EncodingType ET_NoEncoding = "NoEncoding"; + + /** + * The ET_Unknown encoding type may always be used if the encoding + * type can only be figured out from encoding itself. + */ + const EncodingType ET_Unknown = "Unknown"; + + /** + * User Exception for a bad encoding. + */ + exception BadEncoding {}; + + /** + * User Exception for a bad or unsupported encoding type. + */ + exception BadEncodingType {}; + + /** + * The Statement Layer is the layer of the protocol or security + * service from which the statement emanated, derived, or was collected. + */ + typedef unsigned long StatementLayer; + + /** + * Default type for a Statement Layer + */ + const StatementLayer SL_Unknown = 0; + /** + * The SL_Transport statement type signifies that the associated + * statement is derived from the transport layer, such as + * an X.509 Certificate from a TLS handshake. + */ + const StatementLayer SL_Transport = 1; + /** + * The SL_CSIAuthorization statement type signifies that the associated + * statement is derived from the CSI Authorization Layer in the CSIv2 + * protocol. + */ + const StatementLayer SL_CSIAuthorization = 2; + /** + * The SL_CSIClientAuth statement type signifies that the associated + * statement is derived from the CSI Client Authentication Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIClientAuth = 3; + /** + * The SL_CSIIdentity statement type signifies that the associated + * statement is derived from the CSI Identity Assertion Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIIdentity = 4; + + /** + * The SL_UserDefined statement layer signifies that the associate + * statement is derived or created by a user or some other + * entity than the security service. + */ + const StatementLayer SL_UserDefined = 5; + + /** + * The Statement base type contains the information common + * to all statements. A statement has an "external" encoding, such + * as an X509 Certificate. Some statements may not have an encoding, + * but its extension may carry the pertinent marshable information, + * such as a PrincipalIdentityStatement for anonymous, which is + * generated by the security service. + */ + valuetype Statement { + /** + * This field contains an identifier of the + * service layer that generated the statement. + * The layer that generated or delivered + * the statement, i.e. Transport, CSIv2 Authentication, + * CSIv2 Authorization, or CSIv2 Identity Assertion. + */ + public StatementLayer the_layer; + /** + * The type of statement, which indicates its extension + * such as an Identity Statement or an Endorsement + * Statement. + */ + public StatementType the_type; + /** + * This field indicates the type of encoding. + * The encoding may be contrived, at the encoding + * may not exist, however, the extension of the + * statement type may contain data that can + * be marshaled across the wire. See the Principal + * Identity Statement. + */ + private EncodingType encoding_type; + /** + * The bytes of the encoding, if it exists. + */ + private Encoding the_encoding; + + /** + * Returns the encoding type + */ + EncodingType get_encoding_type(); + + /** + * Returns an encoding of this statement. Some implementations + * may be able to convert. Using and encoding_type of + * ET_Unknown, will always yield the default encoding, + * if it exists. If the encoding does not exist, + * a successful return containing an empty + * sequence will result. + */ + Encoding get_encoding( + in EncodingType encoding_type + ) raises ( + BadEncodingType + ); + + /** + * This factory method allows users to create their + * own Statements from an encoding. The statements created + * by this factory method may have a type which is a further + * extension of the valuetype Statement. + */ + factory create( + in EncodingType encoding_type, + in Encoding the_encoding + ); + }; + typedef sequence StatementList; + + /** + * The Identity Statement further classifies the encoding + * as a statement that if verified asserts an identity. + */ + valuetype IdentityStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + /** + * The Principal Identity Statement is the minimal version of an + * Identity statement that asserts a single identity that the + * security service can translate into a principal. + *

+ * An example of an identity statement is an X.509 certificate in + * which its attributes are exposed into the principal, such as + * privileges. This valuetype may also be further extended by the + * security service depending on its encoding and the capabilities + * of the security service. + */ + valuetype PrincipalIdentityStatement : IdentityStatement { + public Principal the_principal; + }; + + /** + * The Endorsement Statement is a statement that is used for + * authorization. An Endorsement statement endorses a + * principal with certain characteristics, such as privileges + * or the authority to act on behalf of another principal, sometimes + * called "delegation". + *

+ * According to our research, an endorsement statement may be a + * complex entity containing matching rules for the endorsement. + * An endorsement may have the following general form: + *

+     *     I says Principal A matching [(P1 with [p1,...,pn]) or ....]
+     *        speaks_for
+     *          Principal B matching [(T1 with [t1,...,tn]) or ... ]
+     *        has [s1,...,sm]
+     *        on Resources matching [R1, .... Rn]
+     * 
+ * Actual semantic reduction of principals is directed by the + * the matching rules, and may depend on other statements as well, + * such as local trust rules in the security service configuration. + * Also, much of the capability of an endorsement statement is + * dependent on its encoding. + *

+ * This approach to authorization is a largely unexplored research + * topic. There are not many or well known encodings of endorsement + * statements. Therefore, we are reluctant to produce interfaces + * just yet, that go beyond the encoding. However, we do expose the + * Endorsement statement type, which may further direct the interpretation + * of it's encoding. + */ + valuetype EndorsementStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + + + // + // TODO: The following contruction is not supported by TIDIdlc + // + /** + * An X509IdentityStatement is one that extends the Principal Identity + * Statement. If one does get an X509 IdentityStatement, it is + * currently supported with IAIK in both DER and PEM formats. + */ + valuetype X509IdentityStatement : PrincipalIdentityStatement { +// Already defined in Statement +// /** +// * This factory method allows users to create their +// * own X509Identity statements from an encoding. +// */ +// factory create( +// in EncodingType encoding_type, +// in Encoding the_encoding +// ); + }; + typedef sequence X509IdentityStatementList; + + //------------------------------------------------------------- + // Security Level 3 Application Users Interface + // + //------------------------------------------------------------- + + // + // The Security Level 3 Credentials Model + // + + /** + * Credentials come in three types. OwnCredentials, ClientCredentials, + * and TargetCredentials. OwnCredentials represent the ORB instance's + * credentials. Each Credentials has initiating and accepting capability. + * ClientCredentials represent an established security context with + * a client. TargetCredentials represent an established security context + * with a Target's Server. + */ + typedef unsigned long CredentialsType; + + /** + * The CT_OwnCredentials CredentialsType signifies that the + * Credentials can be extended to the OwnCredentials Type. + */ + const CredentialsType CT_OwnCredentials = 0; + /** + * The CT_ClientCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_ClientCredentials = 1; + /** + * The CT_TargetCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_TargetCredentials = 2; + + /** + * A Credentials object has a validity state. Some credentials + * may be time or use dependent. + */ + typedef long CredentialsState; + + /** + * The Credentials with a CredentialsState of CS_Invalid cannot be + * used in any the initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Invalid = -3; + + /** + * Credentials with a CredentialsState of CS_Expired can no longer + * be used for initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Expired = -2; + /** + * Credentials with a CredentialsState of CS_PendingRelease can no longer + * be used for initiating or accepting establishment of any + * security contexts. It means that "release_credentials" has been + * called on the credentials. + */ + const CredentialsState CS_PendingRelease = -1; + /** + * Credentials with a CredentialsState of CS_Initialized cannot + * be used for initiating or accepting establishment of any + * security contexts. It means that credentials are in an initial + * state. This value is for internal use, and there is no + * reason a SecurityLevel3 user should see credentials in this state. + */ + const CredentialsState CS_Initialized = 0; + /** + * Credentials with a CredentialsState of CS_Valid can + * be used for initiating or accepting establishment of + * security contexts. + */ + const CredentialsState CS_Valid = 1; + + /** + * Credentials have system generated identifiers + * to which they can be referred and retrieved. + */ + typedef string CredentialsId; + typedef sequence CredentialsIdList; + + /** + * A Context Id is a system generated unique identifier for identifying + * a security context to the application. + * Security Contexts may be long lived and not established on + * every request. Therefore, an identifier is assigned. + *

+ * Note that this Context Id is not directly related to the context + * defined in the CSIv2 specification. + */ + typedef string ContextId; + + /** + * Credentials Usage + *

+ * Credentials Usage refers to the concept that Credentials may + * be used to initiate security context, accept security contexts, + * or do both. its values are used in the acquisition + * of credentials for the purpose of designating the abilities + * of the credentials acquired. + */ + typedef unsigned long CredentialsUsage; + /** + * The CU_Indefinite CredentialsUsage type is a value that + * signifies the default. Depending on some other acquisition + * arguments, the credentials usage may be able to be implicitly + * determined. + */ + const CredentialsUsage CU_Indefinite = 1; + /** + * The CU_None CredentialsUsage type is a value that states the + * credentials cannot be used to make or accept security + * contexts. ClientCredentials and TargetCredentials have + * this credentials usage. + */ + const CredentialsUsage CU_None = 2; + /** + * The CU_AcceptOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to accept the establishment + * of security contexts. + */ + const CredentialsUsage CU_AcceptOnly = 3; + /** + * The CU_InitiateOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to initiate the establishment + * of security contexts. + */ + const CredentialsUsage CU_InitiateOnly = 4; + /** + * The CU_InitiateAndAccept CredentialsUsage type is a value that + * signifies that the credentials can be used to both initiate + * and accept the establishment of security contexts. + */ + const CredentialsUsage CU_InitiateAndAccept = 5; + + /** + * A CredsDirective is a directive on a invocation as to the + * effects of the initiated security context will have on the + * the accepting side. Please see ContextEstablishmentPolicy + * for is use in context with establishing security contexts. + * @see ContextEstablishmentPolicy + */ + typedef unsigned long CredsDirective; + /** + * The CD_Default CredsDirective is a value that signifies to + * use the capabilities of the selected credentials. + */ + const CredsDirective CD_Default = 0; + /** + * The CD_InvokeTarget CredsDirective is a value that signifies that + * the selected credentials should only be used in a simple + * invocation fashion. They shall not attempt to endorse or embody + * the target to act on its behalf. + */ + const CredsDirective CD_InvokeTarget = 1; + /** + * The CD_EndorseTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to endorse + * the target. In other words, it gives the accepting side the ability + * to act on behalf of the initiating side. + */ + const CredsDirective CD_EndorseTarget = 2; + /** + * The CD_EmbodyTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to embody + * the target. In other words, it gives the accepting side the ability + * to impersonate the initiating side. + */ + const CredsDirective CD_EmbodyTarget = 3; + + /** + * A Feature Directive is a general directive used in policy that + * stipulates the of a particular feature. Such examples include, + * confidentiality, integrity, client authentication, etc. + */ + typedef long FeatureDirective; + + /** + * The FD_DoNotUse FeatureDirective means definitely not to use + * the feature. + */ + const FeatureDirective FD_DoNotUse = -2; + /** + * The FD_DoNotUseIfPossible FeatureDirective means not to use + * the feature if it is possible. Note, some mechanisms may always + * use confidentiality. + */ + const FeatureDirective FD_DoNotUseIfPossible = -1; + /** + * The FD_UseDefault FeatureDirective means to use or not to use + * the feature depending on defaults. + */ + const FeatureDirective FD_UseDefault = 0; + /** + * The FD_UseIfPossible FeatureDirective means to use the feature + * if it is possible. + */ + const FeatureDirective FD_UseIfPossible = 1; + /** + * The FD_Use FeatureDirective means definitely to use the feature. + */ + const FeatureDirective FD_Use = 2; + + + /** + * The Initiator Type of the Initiator Side of the Credentials states + * the kind of Initiator it is. There are three types that mirror + * the type of Principal, Simple, Quoting, and Proxy, that the + * initiator intends to represent to a server while trying to + * establish a security context with the server. + */ + typedef unsigned long InitiatorType; + /** + * The IT_None InitiatorType is a value that is defined for + * completeness, and has no real use. + */ + const InitiatorType IT_None = 0; + /** + * The IT_Simple InitiatorType is a value that states that the + * initiator is a "Simple" Principal. + */ + const InitiatorType IT_Simple = 1; + /** + * The IT_Quoting InitiatorType is a value that states that the + * initiator will quote another principal to the server. This + * principal is denoted in the Principal Calculus as (A|B), i.e. + * A quoting B. + */ + const InitiatorType IT_Quoting = 2; + /** + * The IT_Proxy InitiatorType is a value that states that the + * initiator will quote another principal to the server along with + * getting or providing proof to the server that it can act on + * behalf of the quoted principals. This + * principal is denoted in the Principal Calculus as (A for B). + */ + const InitiatorType IT_Proxy = 3; + + /** + * The CredsInitiator object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "initiator" side of the credentials. + */ + local interface CredsInitiator { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * client principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute Principal the_principal; + /** + * The supporting statements attribute contains a list of statements + * supporting the principal associated with this initiator. + */ + readonly attribute StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The initiator_type attribute signifies the intent of the + * initiator as to the principal it presents for the + * security context establishment. It should correspond + * to the type of the Principal. However, it might be slightly + * different, because using CSIv2 Client Authentication + * technically creates a "QuotingPrincipal" however, the + * initiator type will still be simple as no CSIv2 Identity + * Assertion will be used in establishing the security + * context. + */ + readonly attribute InitiatorType initiator_type; + /** + * The supports_embodiment attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to give the + * the accepting end of a context establishment the ability + * to impersonate this initiator principal. + */ + readonly attribute boolean supports_embodiment; + /** + * The supports_endorsement attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to endorse + * the accepting end of a context establishment to act + * on behalf of this initiator principal. + */ + readonly attribute boolean supports_endorsement; + /** + * The supports_quoting attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to simply + * quote another principal on top of these credentials. + */ + readonly attribute boolean supports_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + }; + + /** + * The CredsAcceptor object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "acceptor" side of the credentials. + */ + local interface CredsAcceptor { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * target principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute SecurityLevel3::Principal the_principal; + /** + * The supporting_statements attribute contains a list of statements + * supporting the principal associated with this acceptor. + */ + readonly attribute SecurityLevel3::StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The accepts_endorsement attribute is TRUE if these credentials + * supports and accepts CSIv2 endorsement information. + */ + readonly attribute boolean accepts_endorsement; + /** + * The accepts_quoting attribute is TRUE if these credentials + * supports and accepts CSIv2 Identity Assertion information. + */ + readonly attribute boolean accepts_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + }; + + /** + * This type is used to identify listeners for removal. + * A Listener identity will be assigned to a listener when + * it is assigned to a particular object. + */ + typedef string ListenerId; + + /** + * This local interface is used to notify the user when the credentials + * have been relinquished. When credentials are "released" they may + * stay around until their work is finished. At that point they + * will be relinquished. Also, if the underlying transport credentials + * are released, then the SecurityLevel3 Credentials get released + * as well. This listener will get informed of this event. + */ + local interface RelinquishedCredentialsListener { + void relinquished_notify( + in CredentialsId creds_id + ); + }; + + /** + * The Credentials base interface contains the common items for + * the different types of credentials. + * @see OwnCredentials + * @see ClientCredentials + * @see TargetCredentials + */ + local interface Credentials { + + /** + * The creds_id attribute contains a system generated + * identifier with which can uniquely reference the credentials + * object. + */ + readonly attribute CredentialsId creds_id; + + /** + * The creds_type stipulates the type of credentials, i.e. + * to which type of credentials it may be narrowed, e.g., + * Own, Client, or Target. + */ + readonly attribute CredentialsType creds_type; + + /** + * The creds_usage attribute stipulates the intended usage of the + * credentials. For OwnCredentials, it will be one of + * CU_AcceptOnly, CU_Initiate, CU_InitiateAndAccept. + * For ClientCredentials and TargetCredentials it will be + * CU_None. + */ + readonly attribute CredentialsUsage creds_usage; + + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + /** + * The creds_state attribute contains the + * validity state of the credentials. + */ + readonly attribute CredentialsState creds_state; + + /** + * Add a listener that will get notified when the + * OwnCredentials are finally done with any pending + * work and are relinquished by the security service. + */ + ListenerId add_relinquished_listener( + in RelinquishedCredentialsListener listener + ); + + /** + * Removes a listener. This function raises a BAD_PARAM + * exception if the listener is not registered. + */ + void remove_relinquished_listener( + in ListenerId id + ); + }; + /** + * A list of credentials. + */ + typedef sequence CredentialsList; + + /** + * OwnCredentials are created as a result of Credentials acquisition + * from the CredentialsCurator's CredentialsAcquirers. + * The Credentials have an initiator and an acceptor based + * upon its intended usage and capability. Some OwnCredentials + * that were acquired solely for initiating contexts (i.e. client side) + * will not have an acceptor, and visa versa. + */ + local interface OwnCredentials : Credentials { + + /** + * The creds_initiator attribute contains a reference to the + * local credentials initiator associated with these credentials. + * It is null if the creds_usage is AcceptOnly. + */ + readonly attribute CredsInitiator creds_initiator; + + /** + * The creds_acceptor attribute contains a reference to the + * local credentials acceptor associated with these credentials. + * It is null if the creds_usage is InitiateOnly. + */ + readonly attribute CredsAcceptor creds_acceptor; + + /** + * The release_credentials operation disables the credentials + * from further initiating and/or accepting contexts. + * Formal destruction of the Credentials object is delayed until + * its pending work is done, at which time it becomes Invalid. + */ + void release_credentials (); + }; + + /** + * A list of OwnCredentials + */ + typedef sequence OwnCredentialsList; + + /** + * An object of this interface represents the security context for + * a CSIv2 based remote client. It is created as the result of accepting + * a security context for the remote client. + * This object is only available during the servicing of a CORBA request. + * It can be retrieved from the + * SecurityLevel3::SecurityCurrent object, + * as it is thread based. + *

+ * This object contains only the information used from the + * OwnCredentials that was pertinent in establishing the + * context. There is a pointer back to that OwnCredentials + * object. Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface ClientCredentials : Credentials { + + /** + * The context_id attribute contains a system generated unique identifier + * for the context, + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service can deduce is the client from the + * information and mechanisms used. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the statements that + * delivered from CSIv2 protocol along with any from the associated + * OwnCredentials that are used to deduce the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains the names of the + * resources that the security service deduces from the CSIv2 + * information and information from the associated OwnCredentials. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service believes is representative of the + * clients version of the target's principal. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements that + * support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of resources + * on which the target is restricted. This information may come + * from the OwnCredentials. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * This attribute refers to the OwnCredentials that were used in + * establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * This attribute is TRUE if the target has + * authenticated the client, either over the transport, or at + * the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * This attribute is TRUE if the target believes that + * the client has authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * This attribute is TRUE if the context is providing + * confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * This attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + }; + + /** + * The TargetCredentials object is created as the result of accepting a + * security context for a target. It represents that context. + * It contains only the information used from the OwnCredentials + * that was pertinent in establishing the context. + * There is a pointer back to that OwnCredentials object. + * Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface TargetCredentials : Credentials { + + /** + * The context_id attribute contains a system generated + * unique identifier for the context. + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service believe is the target's + * ClientCredentials client_principal attribute. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the + * statements that support the deduction of the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains names of + * resources on which the client believes the client is restricted. + * This information may be derived from newly acquired endorsement + * information. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service deduces to be the target. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements + * that support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of + * resources on which the target is restricted. This information + * may not be available. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * The parent_credentials attribute refers to the OwnCredentials + * that were used in establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * The client_authentication attribute is TRUE if the client + * believes that the target has authenticated the client, either + * over the transport, or at the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * The target_authentication attribute is TRUE if the client has + * authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * The confidentiality attribute is TRUE if the context is + * providing confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * The integrity attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + + /** + * The target_embodied attribute is TRUE if the security service + * believes that the target is embodied to impersonate the client + * side principal. + */ + readonly attribute boolean target_embodied; + + /** + * The target_endorsed attribute is TRUE if the security service + * believes that the target is endorsed to act on behalf of the + * client side principal. + */ + readonly attribute boolean target_endorsed; + + /** + * The release operation indicates to the CSIv2 protocol, that if + * state is being retained for these credentials, they + * will be discarded with the pending next request that + * may have not yet gone out. + *

+ * Any objects references that are binded to these + * credentials after you release them will become unusable. + * + * This operation is experimental. + */ + void release(); + }; + + + //-------------------------------------------------------------------- + // Security Invocation Policy + // + //-------------------------------------------------------------------- + + /** + * The ContextEstablishmentPolicy policy object directs the + * establishment of security contexts with a target. + *

+ * The CredsDirective usage is the following: + *

+ *
+ * CD_Default + *
+ * This directive means to use the default set + * up by the thread, the ORB, the ORB configuration, + * available credentials, or other policies. + *
+ * CD_InvokeTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. Do not endorse or embody the target. + * Credentials may be IT_Simple, IT_Quoting, or IT_Proxy. + *
+ * CD_EndorseTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. + * The credentials must be + * IT_Simple, IT_Quoting, or IT_Proxy own credentials + * that supports endorsement. + * Note, a Initiator Credentials that is a IT_Proxy + * may have an endorsement statement that not only + * endorses this immediate client, but may very well + * apply to the next target. + *
+ * CD_EmbodyTarget + *
+ * If possible give the target the ability to + * impersonate the client, is performed using + * transports that can forward their credentials + * in the transport that give the ability to the + * target to work in their own behalf. Alternatively, + * the authenticator may be able to be passed on. + * IT_Simple credentials must have or have the + * ability to forward credentials. This is analogous + * to flipping the DELEGATE bit on GSS-Kerberos Forwardable + * credentials. IT_Quoting principals means + * that you can forward the transport credentials, + * authenticator plus the Quoting statement. + * IT_Proxy principals means that you can forward + * the transport credentials, authenticator, + * and associated proxy statements. + *
+ *

+ * On using Own Credentials. The creds_ids name Own Credentials. + * Also, they restrict the invocation to use only certain credentials. + * If the cred_ids list is empty, then the own credentials for the + * invocation are selected from a default, which may be + * set on the thread or the ORB instance. + */ + local interface ContextEstablishmentPolicy : CORBA::Policy { + + readonly attribute CredsDirective creds_directive; + readonly attribute OwnCredentialsList creds_list; + readonly attribute FeatureDirective use_client_auth; + readonly attribute FeatureDirective use_target_auth; + readonly attribute FeatureDirective use_confidentiality; + readonly attribute FeatureDirective use_integrity; + }; + + /** + * Type to be passed to ContextEstablishmentPolicy PolicyFactory + * through an Any. + */ + struct ContextEstablishmentPolicyArgument + { + CredsDirective creds_directive; + OwnCredentialsList creds_list; + FeatureDirective use_client_auth; + FeatureDirective use_target_auth; + FeatureDirective use_confidentiality; + FeatureDirective use_integrity; + }; + + /** + * The ContextEstablishmentPolicyType constant is + * holds value used to denote the ContextEstablishmentPolicy. + */ + const CORBA::PolicyType ContextEstablishmentPolicyType = ADIRON_VMCID | 1001; + + + /** + * The ObjectCredentialsPolicy object is placed on the policy list + * of a POA to indicate the own credentials + * that govern the accepting contexts for objects underneath + * that POA. The credentials listed here, only if they have Accepting + * capability, are used to created security components in the + * IOR of the object's reference when created. + */ + local interface ObjectCredentialsPolicy : CORBA::Policy { + readonly attribute OwnCredentialsList creds_list; + }; + + /** + * Type to be passed to ObjectCredentialsPolicy PolicyFactory + * through an Any. + */ + typedef OwnCredentialsList ObjectCredentialsPolicyArgument; + + /** + * The ObjectCredentialsPolicyType constant is + * holds value used to denote the ObjectCredentialsPolicy. + */ + const CORBA::PolicyType ObjectCredentialsPolicyType = ADIRON_VMCID | 1002; + + + //-------------------------------------------------------------------- + // Security Level 3 Credentials Acquisition Mechanism + // + //-------------------------------------------------------------------- + + /** + * Credentials are acquired by a Credentials Acquirer by some + * acquisition mechanism specified in the Credentials Curator. + * Acquisition methods are available on the curator. The + * specifics of arguments needed and the acquisition process + * are defined by the method itself. + */ + typedef string AcquisitionMethod; + typedef sequence AcquisitionMethodList; + + /** + * An acquisition of credentials may quite possibly fail as well + * as be a multistep process. A status defines the current + * state of an acquisition. + */ + typedef long AcquisitionStatus; + /** Acquisition has failed. */ + const AcquisitionStatus AQST_Failed = -2; + /** Acquisition has expired. */ + const AcquisitionStatus AQST_Expired = -1; + /** Acquisition is initialized. */ + const AcquisitionStatus AQST_Initialized = 0; + /** Acquisition needs more processing. */ + const AcquisitionStatus AQST_Continued = 1; + /** Acquisition has succeeded. */ + const AcquisitionStatus AQST_Succeeded = 2; + + /** + * The CredentialsAcquirer object is created by the Credentials + * Curator based on the selected method and initial acquisition + * arguments. When this acquisition is complete and successful, + * the created credentials can be retrieved using the get_credentials + * operation. Once get_credentials is called, this object is destroyed. + */ + local interface CredentialsAcquirer { + + /** + * This attribute contains the acquisition method + * identifier naming the method by which these credentials + * are being acquired. + */ + readonly attribute AcquisitionMethod acquisition_method; + + /** + * This attribute contains the current acquisition + * status of the acquisition process. + */ + readonly attribute AcquisitionStatus current_status; + + /** + * If the acquisition process is a multistep process through calls + * to this acquirer, then this attribute contains the current + * iteration. + */ + readonly attribute unsigned long nth_iteration; + + /** + * If the current_status attribute contains + * the AQST_Continued value, + * this operation returns, if necessary and supported + * by the acquisition method, any data that may direct the + * acquisition. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Continued value, + * a BAD_INV_ORDER exception will be raised. + */ + any get_continuation_data(); + + /** + * This operation continues the acquisition. The argument + * data is dependent on the acquisition method. + */ + AcquisitionStatus continue_acquisition( + in any acquisition_arguments + ); + + /** + * Once the current_status attribute has the + * AQST_Succeeded value, a call to this operation + * is used to retrieve the acquired OwnCredentials + * and, optionally, place the credentials on the curator's default own + * credentials list (for use with default ContextEstablishmentPolicy + * and ObjectCredentialsPolicy). + *

+ * The CredentialsAcquirer object is destroyed after + * this call. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Succeeded value, + * a BAD_INV_ORDER exception will be raised. + * + * @param on_list TRUE if these credentials go on the + * default own credentials list of the + * CredentialsCurator. + */ + OwnCredentials get_credentials( + in boolean on_list + ); + + /** + * This operation is used to destroy the + * CredentialsAcquirer object before + * get_credentials is called. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + */ + void destroy(); + }; + + /** + * The CredentialsCurator object is a single object per an ORB + * instance's Security Service. It has the ability to create + * CredentialsAcquirers and keeps a list of active default + * credentials. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     * 
+ * Or it may be retrieved from the SecurityManager's + * credentials_curator attribute. + *

+ * The following pseudo code describes the process of credentials + * acquisition using CredentialsCurator. + *

+     * // Resolve the Credentials Curator
+     * CredentialsCurator curator = ....
+     *     resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     *
+     * // Build up an acquisition argument (e.g., using SL3CSI::CSIArgBuilder)
+     * Any arg = ...
+     *
+     * // Acquire credentials and get a Credentials Acquirer
+     * CredentialsAcquirer acquirer =
+     *     curator.acquire_credentials("SL3CSIAQArgs",arg);
+     *
+     * // Get credentials and destroy the Credentials Acquirer
+     * OwnCredentials own = acquirer.get_credentials(false);
+     * 
+ */ + local interface CredentialsCurator { + + /** + * This attribute contains a list of + * acquisition methods that are supported. Method identifiers + * are defined in modules that signify their support. + * + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + readonly attribute SecurityLevel3::AcquisitionMethodList + supported_methods; + + /** + * This operation starts the process of credentials acquisition and + * create a CredentialsAcquirer for a particular + * acquisition method. It takes an initial set of arguments for + * the acquisition. The content of the arguments are based on the + * acquisiton method. Depending on the method, it is possible that + * the credentials may be immediately available from a call to + * get_credentials on the returned + * CredentialsAcquirer. + *

+ * If the process of credentials acquisition is not completed upon + * the return of the acquire_credentials operation, + * the returned CredentialsAcquirer object shall have + * its current_status at AQST_Continued. + * In this case, the get_continuation_data and + * continue_acquisition operations shall be used to + * complete the credentials acquisition process. + *

+ * If the process of credentials acquisition fails, it is up to the + * implementation to either throw a system exception or return a + * CredentialsAcquirer with the AQST_Failed + * status. + *

+ * The acquisition_arguments parameter is a CORBA + * any that is constructed according to the acquisition + * method used. The ArgumentFactory from the + * SL3AQArgs module is a local object that helps + * immensely with the construction of this complex argument. + * Extensions of that object are defined in their own separate + * modules that pertain to the particular acquisition mechanism, + * such as the SL3CSI, SL3TLS, SL3TCPIP, SL3KRB5 modules. + * + * @param acquisition_method + * The identifier of the desired acquisition method. + * A CORBA BAD_PARAM exception will be raised + * if the named method is not supported. + * @param acquisition_arguments + * The argument of the desired acquisition method. + * This CORBA any type is constructed according + * to the particular acquisition method. + * + * @see "SL3AQArgs" + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + CredentialsAcquirer acquire_credentials( + in SecurityLevel3::AcquisitionMethod acquisition_method, + in any acquisition_arguments + ); + + /** + * The Curator's Default Own Credentials list. + */ + readonly attribute OwnCredentialsList default_creds_list; + + /** + * The Curator's ids of the credentials on the default list. + */ + readonly attribute CredentialsIdList default_creds_ids; + + /** + * This operation retrieves Own Credentials by identifier. + * It is not required that the identifier name a credentials + * on the default_credentials_list. The Curator keeps track + * of all OwnCredentials it creates, until they are explicitly + * released. + */ + OwnCredentials get_own_credentials( + in CredentialsId credentials_id + ); + + /** + * This operation releases credentials from the default_creds_list, + * if there, and also disables the credentials from further use, + * provided that all their pending work is done. + */ + void release_own_credentials ( + in CredentialsId credentials_id + ); + + }; + + //-------------------------------------------------------------------- + // Security Service ORB Objects + // Retrieved from the ORB by "resolve_initial_references". + // + //-------------------------------------------------------------------- + + /** + * The SecurityManager object represents the Security Level 3 + * Security Service. There is one object of this type per ORB + * instance. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityManager");
+     * 
+ */ + local interface SecurityManager { + + /** + * The credentials_curator attribute contains the reference + * to the SecurityLevel3 Credentials Curator. There is only + * one instance per ORB. + */ + readonly attribute CredentialsCurator credentials_curator; + + /** + * The get_target_credentials operation retrieves the + * TargetCredentials that represents a CSIv2 security association + * with a Target. This operation causes communication with + * the target in order to establish a security context. + */ + TargetCredentials get_target_credentials( + in Object the_object + ); + + /** + * The create_context_estab_policy operation is a policy factory + * operation that creates the Security Level 3 + * ContextEstablishmentPolicy object. This policy is placed on + * the policy override lists of object references to direct + * the security characteristics when communicating through + * that object reference. + *

+ * If this policy is not put on an object reference, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the object references policy list, + * then the default credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ContextEstablishmentPolicy create_context_estab_policy( + in CredsDirective creds_directive, + in OwnCredentialsList creds_list, + in FeatureDirective use_client_auth, + in FeatureDirective use_target_auth, + in FeatureDirective use_confidentiality, + in FeatureDirective use_integrity + ); + + /** + * The create_object_creds_policy is a policy factory operation + * that creates the ObjectCredentialsPolicy object. This policy + * is solely for use with policies place on POAs with "POA.create_POA". + * It restricts the POAs use of credentials. If this policy is + * not put on a POA, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the POA policy list, then the default + * credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ObjectCredentialsPolicy create_object_creds_policy( + in OwnCredentialsList creds_list + ); + }; + + /** + * The SecurityCurrent object references thread specific + * data pertaining to the security service. It is used to retrieve + * the client's credentials during an invocation on the server side. + *

+ * There is only one instance of this object per ORB instance. + * It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityCurrent");
+     * 
+ */ + local interface SecurityCurrent { + + /** + * From inside the execution of a target object implementation, + * this attribute contains the representation of the remote client's + * credentials. This attribute is null if the client is not CSIv2 + * based, or the client is from a collocated call. + *

+ * The value of this attribute, if not null, represents the + * security context with a remote CSIv2 client. + * If the request_is_local attribute is FALSE, + * the current thread of execution is directly servicing a remote + * request for the target object within the target's implemenation. + * If the request_is_local attribute is TRUE, + * the current thread of execution is servicing an ORB mediated call + * on a collocated object. + *

+ * If the client is not CSIv2 based, there are no CSIv2 Client + * Credentials, and this attribute is null. In this case, + * the user should try the + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/Security/CSI.idl b/idl/Security/CSI.idl new file mode 100644 index 0000000..dd035e1 --- /dev/null +++ b/idl/Security/CSI.idl @@ -0,0 +1,180 @@ +#ifndef _CSI_IDL_ +#define _CSI_IDL_ + +#pragma prefix "omg.org" + +module CSI { + + //typeprefix CSI "omg.org"; + + // The OMG VMCID; same value as CORBA::OMGVMCID. Do not change ever. + const unsigned long OMGVMCID = 0x4F4D0; + + // An X509CertificateChain contains an ASN.1 BER encoded SEQUENCE + // [1..MAX] OF X.509 certificates encapsulated in a sequence of octets. The + // subject's certificate shall come first in the list. Each following + // certificate shall directly certify the one preceding it. The ASN.1 + // representation of Certificate is as defined in [IETF RFC 2459]. + typedef sequence X509CertificateChain; + + // an X.501 type name or Distinguished Name encapsulated in a sequence of + // octets containing the ASN.1 encoding. + typedef sequence X501DistinguishedName; + + // UTF-8 Encoding of String + typedef sequence UTF8String; + + // ASN.1 Encoding of an OBJECT IDENTIFIER + typedef sequence OID; + typedef sequence OIDList; + + // A sequence of octets containing a GSStoken. Initial context tokens are + // ASN.1 encoded as defined in [IETF RFC 2743] 3.1, + // "Mechanism-Independent token Format", pp. 81-82. Initial context tokens + // contain an ASN.1 tag followed by a token length, a mechanism identifier, + // and a mechanism-specific token (i.e. a GSSUP::InitialContextToken). The + // encoding of all other GSS tokens (e.g. error tokens and final context + // tokens) is mechanism dependent. + typedef sequence GSSToken; + + // An encoding of a GSS Mechanism-Independent Exported Name Object as + // defined in [IETF RFC 2743] 3.2, "GSS Mechanism-Independent + // Exported Name Object Format," p. 84. + typedef sequence GSS_NT_ExportedName; + typedef sequence GSS_NT_ExportedNameList; + + // The MsgType enumeration defines the complete set of service context + // message types used by the CSI context management protocols, including + // those message types pertaining only to the stateful application of the + // protocols (to insure proper alignment of the identifiers between + // stateless and stateful implementations). Specifically, the + // MTMessageInContext is not sent by stateless clients (although it may + // be received by stateless targets). + typedef short MsgType; + const MsgType MTEstablishContext = 0; + const MsgType MTCompleteEstablishContext = 1; + const MsgType MTContextError = 4; + const MsgType MTMessageInContext = 5; + + // The ContextId type is used carry session identifiers. A stateless + // application of the service context protocol is indicated by a session + // identifier value of 0. + typedef unsigned long long ContextId; + + // The AuthorizationElementType defines the contents and encoding of + // the_element field of the AuthorizationElement. + // The high order 20-bits of each AuthorizationElementType constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the element type. The low order 12 bits + // shall contain the organization-scoped element type identifier. The + // high-order 20 bits of all element types defined by the OMG shall + // contain the VMCID allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long AuthorizationElementType; + + // An AuthorizationElementType of X509AttributeCertChain indicates that + // the_element field of the AuthorizationElement contains an ASN.1 BER + // SEQUENCE composed of an (X.509) AttributeCertificate followed by a + // SEQUENCE OF (X.509) Certificate. The two-part SEQUENCE is encapsulated + // in an octet stream. // The chain of identity certificates is provided + // shall directly certify the one preceding it. The first certificate + // in the chain shall certify the attribute certificate. The ASN.1 + // representation of (X.509) Certificate is as defined in [IETF RFC 2459]. + // The ASN.1 representation of (X.509) AtributeCertificate is as defined + // in [IETF ID PKIXAC]. + const AuthorizationElementType X509AttributeCertChain = OMGVMCID | 1; + typedef sequence AuthorizationElementContents; + + // The AuthorizationElement contains one element of an authorization token. + // Each element of an authorization token is logically a PAC. + struct AuthorizationElement { + AuthorizationElementType the_type; + AuthorizationElementContents the_element; + }; + + // The AuthorizationToken is made up of a sequence of + // AuthorizationElements + typedef sequence AuthorizationToken; + typedef unsigned long IdentityTokenType; + + // Additional standard identity token types shall only be defined by the + // OMG. All IdentityTokenType constants shall be a power of 2. + const IdentityTokenType ITTAbsent = 0; + const IdentityTokenType ITTAnonymous = 1; + const IdentityTokenType ITTPrincipalName = 2; + const IdentityTokenType ITTX509CertChain = 4; + const IdentityTokenType ITTDistinguishedName = 8; + + typedef sequence IdentityExtension; + + union IdentityToken switch ( IdentityTokenType ) { + case ITTAbsent: boolean absent; + case ITTAnonymous: boolean anonymous; + case ITTPrincipalName: GSS_NT_ExportedName principal_name; + case ITTX509CertChain: X509CertificateChain certificate_chain; + case ITTDistinguishedName: X501DistinguishedName dn; + default: IdentityExtension id; + }; + + struct EstablishContext { + ContextId client_context_id; + AuthorizationToken authorization_token; + IdentityToken identity_token; + GSSToken client_authentication_token; + }; + + struct CompleteEstablishContext { + ContextId client_context_id; + boolean context_stateful; + GSSToken final_context_token; + }; + + struct ContextError { + ContextId client_context_id; + long major_status; + long minor_status; + GSSToken error_token; + }; + + // Not sent by stateless clients. If received by a stateless server, a + // ContextError message should be returned, indicating the session does + // not exist. + struct MessageInContext { + ContextId client_context_id; + boolean discard_context; + }; + + union SASContextBody switch ( MsgType ) { + case MTEstablishContext: EstablishContext establish_msg; + case MTCompleteEstablishContext: CompleteEstablishContext complete_msg; + case MTContextError: ContextError error_msg; + case MTMessageInContext: MessageInContext in_context_msg; + }; + + // The following type represents the string representation of an ASN.1 + // OBJECT IDENTIFIER (OID). OIDs are represented by the string "oid:" + // followed by the integer base 10 representation of the OID separated + // by dots. For example, the OID corresponding to the OMG is represented + // as: "oid:2.23.130" + typedef string StringOID; + + // The GSS Object Identifier for the KRB5 mechanism is: + // { iso(1) member-body(2) United States(840) mit(113554) infosys(1) + // gssapi(2) krb5(2) } + const StringOID KRB5MechOID = "oid:1.2.840.113554.1.2.2"; + + // The GSS Object Identifier for name objects of the Mechanism-independent + // Exported Name Object type is: + // { iso(1) org(3) dod(6) internet(1) security(5) nametypes(6) + // gss-api-exported-name(4) } + const StringOID GSS_NT_Export_Name_OID = "oid:1.3.6.1.5.6.4"; + + // The GSS Object Identifier for the scoped-username name form is: + // { iso-itu-t (2) international-organization (23) omg (130) security (1) + // naming (2) scoped-username(1) } + const StringOID GSS_NT_Scoped_Username_OID = "oid:2.23.130.1.2.1"; + +}; // CSI + +#endif + + diff --git a/idl/Security/CSIIOP.idl b/idl/Security/CSIIOP.idl new file mode 100644 index 0000000..07128a5 --- /dev/null +++ b/idl/Security/CSIIOP.idl @@ -0,0 +1,116 @@ +#ifndef _CSIIOP_IDL_ +#define _CSIIOP_IDL_ + +#include +#include "CSI.idl" +#include "IOP.idl" + +#pragma prefix "omg.org" + +module CSIIOP { + + //typeprefix CIIOP "omg.org"; + + // Association options + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + const AssociationOptions IdentityAssertion = 1024; + const AssociationOptions DelegationByClient = 2048; + + // The high order 20-bits of each ServiceConfigurationSyntax constant + // shall contain the Vendor Minor Codeset ID (VMCID) of the + // organization that defined the syntax. The low order 12 bits shall + // contain the organization-scoped syntax identifier. The high-order 20 + // bits of all syntaxes defined by the OMG shall contain the VMCID + // allocated to the OMG (that is, 0x4F4D0). + typedef unsigned long ServiceConfigurationSyntax; + const ServiceConfigurationSyntax SCS_GeneralNames = CSI::OMGVMCID | 0; + const ServiceConfigurationSyntax SCS_GSSExportedName = CSI::OMGVMCID | 1; + typedef sequence ServiceSpecificName; + + // The name field of the ServiceConfiguration structure identifies a + // privilege authority in the format identified in the syntax field. If the + // syntax is SCS_GeneralNames, the name field contains an ASN.1 (BER) + // SEQUENCE [1..MAX] OF GeneralName, as defined by the type GeneralNames in + // [IETF RFC 2459]. If the syntax is SCS_GSSExportedName, the name field + // contains a GSS exported name encoded according to the rules in + // [IETF RFC 2743] 3.2, "Mechanism-Independent Exported Name + // Object Format," p. 84. + struct ServiceConfiguration { + ServiceConfigurationSyntax syntax; + ServiceSpecificName name; + }; + typedef sequence ServiceConfigurationList; + + // The body of the TAG_NULL_TAG component is a sequence of octets of + // length 0. + // type used to define AS layer functionality within a compound mechanism + // definition + struct AS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID client_authentication_mech; + CSI::GSS_NT_ExportedName target_name; + }; + + // type used to define SAS layer functionality within a compound mechanism + // definition + struct SAS_ContextSec { + AssociationOptions target_supports; + AssociationOptions target_requires; + ServiceConfigurationList privilege_authorities; + CSI::OIDList supported_naming_mechanisms; + CSI::IdentityTokenType supported_identity_types; + }; + + // type used in the body of a TAG_CSI_SEC_MECH_LIST component to + // describe a compound mechanism + struct CompoundSecMech { + AssociationOptions target_requires; + IOP::TaggedComponent transport_mech; + AS_ContextSec as_context_mech; + SAS_ContextSec sas_context_mech; + }; + typedef sequence CompoundSecMechanisms; + + // type corresponding to the body of a TAG_CSI_SEC_MECH_LIST + // component + struct CompoundSecMechList { + boolean stateful; + CompoundSecMechanisms mechanism_list; + }; + struct TransportAddress { + string host_name; + unsigned short port; + }; + typedef sequence TransportAddressList; + + // Tagged component for configuring SECIOP as a CSIv2 transport mechanism + const IOP::ComponentId TAG_SECIOP_SEC_TRANS = 35; + + struct SECIOP_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + CSI::OID mech_oid; + CSI::GSS_NT_ExportedName target_name; + TransportAddressList addresses; + }; + // tagged component for configuring TLS/SSL as a CSIv2 transport mechanism + const IOP::ComponentId TAG_TLS_SEC_TRANS = 36; + struct TLS_SEC_TRANS { + AssociationOptions target_supports; + AssociationOptions target_requires; + TransportAddressList addresses; + }; + +}; //CSIIOP +#endif diff --git a/idl/Security/SSLIOP.idl b/idl/Security/SSLIOP.idl new file mode 100644 index 0000000..d985dd0 --- /dev/null +++ b/idl/Security/SSLIOP.idl @@ -0,0 +1,20 @@ +#if !defined(_SSLIOP_IDL) +#define _SSLIOP_IDL + +#pragma prefix "omg.org" + +#include +#include + +module SSLIOP { + // Security mechanism SSL + const IOP::ComponentId TAG_SSL_SEC_TRANS = 20; + + struct SSL { + Security::AssociationOptions target_supports; + Security::AssociationOptions target_requires; + unsigned short port; + }; + +}; +#endif /* _SSLIOP_IDL */ diff --git a/idl/Security/Security.idl b/idl/Security/Security.idl new file mode 100644 index 0000000..b78dabd --- /dev/null +++ b/idl/Security/Security.idl @@ -0,0 +1,329 @@ +//Security Service, v1.8 - OMG IDL Summary File +//Object Management Group, Inc. +// +//Copyright 1995, AT&T Global Information Solutions Company +//Copyright 1995, Digital Equipment Corporation +//Copyright 1995, Expersoft Corporation +//Copyright 1995, Groupe Bull +//Copyright 1995, Hewlett-Packard Company +//Copyright 1995, IBM (in collaboration with Taligent, Inc.) +//Copyright 1995, International Computers Limited +//Copyright 2000, Object Management Group, Inc. +//Copyright 1995, Netscape Communications Corporation +//Copyright 1997, Northern Telecom Limited +//Copyright 1995, Novell, Inc. +//Copyright 1995, Siemens Nixdorf Informationssysteme AG +//Copyright 1995, 1997, SunSoft, Inc. +//Copyright 1995, Tandem Computer, Inc. (in collaboration with Odyssey Research Assoc, Inc.) +//Copyright 1995, Tivoli Systems, Inc. +//Copyright 1997, Visigenic Software, Inc. +// +//The companies listed above have granted to the Object Management Group, Inc. +//(OMG) a nonexclusive, royalty-free, paid up, worldwide license to copy and +//distribute this document and to modify this document and distribute copies of +//the modified version. Each of the copyright holders listed above has agreed +//that no person shall be deemed to have infringed the copyright in the included +//material of any such copyright holder by reason of having used the +//specification set forth herein or having conformed any computer software to +//the specification. +// +//This file contains OMG IDL from the Security Service, v1.8 specification. +//OMG regularly publishes a summary file that contains all the "code" parts of +//an OMG formal document. Every formal document line that is IDL, PIDL, or +//language code is included in the summary file. The reason for such a listing +//is to give readers an electronic version of the "code" so that they can +//extract pieces of it. Readers might want to test an example, include it in +//their own code, or use it for documentation purposes. Having the code lines +//available electronically means there is less likelihood of a transcription +//error. +// +//This subsection defines the OMG IDL for security data types common to the //other security modules, which is the module Security. The Security module //depends on the TimeBase module and the CORBA module. + + +#if !defined(_SECURITY_IDL_) +#define _SECURITY_IDL_ + +#include +#include + +#pragma prefix "omg.org" + +module Security { + //# pragma version Security 1.8 + typedef string SecurityName; + typedef sequence Opaque; + // Constant declarations for Security Service Options + const CORBA::ServiceOption SecurityLevel1 = 1; + const CORBA::ServiceOption SecurityLevel2 = 2; + const CORBA::ServiceOption NonRepudiation = 3; + const CORBA::ServiceOption SecurityORBServiceReady = 4; + const CORBA::ServiceOption SecurityServiceReady = 5; + const CORBA::ServiceOption ReplaceORBServices = 6; + const CORBA::ServiceOption ReplaceSecurityServices = 7; + const CORBA::ServiceOption StandardSecureInteroperability = 8; + const CORBA::ServiceOption DCESecureInteroperability = 9; + // Service options for Common Secure Interoperability + const CORBA::ServiceOption CommonInteroperabilityLevel0 = 10; + const CORBA::ServiceOption CommonInteroperabilityLevel1 = 11; + const CORBA::ServiceOption CommonInteroperabilityLevel2 = 12; + // Security mech types supported for secure association + const CORBA::ServiceDetailType SecurityMechanismType = 1; + // privilege types supported in standard access policy + const CORBA::ServiceDetailType SecurityAttribute = 2; + // extensible families for standard data types + struct ExtensibleFamily { + unsigned short family_definer; + unsigned short family; + }; + typedef sequence OID; + typedef sequence OIDList; + // security attributes + typedef unsigned long SecurityAttributeType; + // other attributes; family = 0 + const SecurityAttributeType AuditId = 1; + const SecurityAttributeType AccountingId = 2; + const SecurityAttributeType NonRepudiationId = 3; + // privilege attributes; family = 1 + const SecurityAttributeType _Public = 1; + const SecurityAttributeType AccessId = 2; + const SecurityAttributeType PrimaryGroupId = 3; + const SecurityAttributeType GroupId = 4; + const SecurityAttributeType Role = 5; + const SecurityAttributeType AttributeSet = 6; + const SecurityAttributeType Clearance = 7; + const SecurityAttributeType Capability = 8; + struct AttributeType { + ExtensibleFamily attribute_family; + SecurityAttributeType attribute_type; + }; + typedef sequence AttributeTypeList; + struct SecAttribute { + AttributeType attribute_type; + OID defining_authority; + Opaque value; + // the value of this attribute can be + // decoded only with knowledge of defining_authority + }; + typedef sequence AttributeList; + // Authentication return status + enum AuthenticationStatus { + SecAuthSuccess, + SecAuthFailure, + SecAuthContinue, + SecAuthExpired + }; + // Association return status + enum AssociationStatus { + SecAssocSuccess, + SecAssocFailure, + SecAssocContinue + }; + // Authentication method + typedef unsigned long AuthenticationMethod; + typedef sequence AuthenticationMethodList; + // Credential types + enum InvocationCredentialsType { + SecOwnCredentials, + SecReceivedCredentials, + SecTargetCredentials + }; + // Declarations related to Rights + struct Right { + ExtensibleFamily rights_family; + string the_right; + }; + typedef sequence RightsList; + enum RightsCombinator { + SecAllRights , + SecAnyRight + }; + // Delegation related + enum DelegationState { + SecInitiator, + SecDelegate + }; + enum DelegationDirective { + Delegate, + NoDelegate + }; + // pick up from TimeBase + typedef TimeBase::UtcT UtcT; + typedef TimeBase::IntervalT IntervalT; + typedef TimeBase::TimeT TimeT; + // Security features available on credentials. + enum SecurityFeature { + SecNoDelegation, + SecSimpleDelegation, + SecCompositeDelegation, + SecNoProtection, + SecIntegrity, + SecConfidentiality, + SecIntegrityAndConfidentiality, + SecDetectReplay, + SecDetectMisordering, + SecEstablishTrustInTarget, + SecEstablishTrustInClient + }; + // Quality of protection which can be specified + // for an object reference and used to protect messages + enum QOP { + SecQOPNoProtection, + SecQOPIntegrity, + SecQOPConfidentiality, + SecQOPIntegrityAndConfidentiality + }; + // Type of SecurityContext + enum SecurityContextType { + SecClientSecurityContext, + SecServerSecurityContext + }; + // Operational State of a Security Context + enum SecurityContextState { + SecContextInitialized, + SecContextContinued, + SecContextClientEstablished, + SecContextEstablished, + SecContextEstablishExpired, + SecContextExpired, + SecContextInvalid + }; + struct ChannelBindings { + unsigned long initiator_addrtype; + sequence initiator_address; + unsigned long acceptor_addrtype; + sequence acceptor_address; + sequence application_data; + }; + // For use with SecurityReplaceable + struct OpaqueBuffer { + Opaque buffer; + unsigned long startpos; + unsigned long endpos; + // startpos <= endpos + // OpaqueBuffer is said to be empty if startpos == endpos + }; + + // Association options which can be administered + // on secure invocation policy and used to + // initialize security context + typedef unsigned short AssociationOptions; + const AssociationOptions NoProtection = 1; + const AssociationOptions Integrity = 2; + const AssociationOptions Confidentiality = 4; + const AssociationOptions DetectReplay = 8; + const AssociationOptions DetectMisordering = 16; + const AssociationOptions EstablishTrustInTarget = 32; + const AssociationOptions EstablishTrustInClient = 64; + const AssociationOptions NoDelegation = 128; + const AssociationOptions SimpleDelegation = 256; + const AssociationOptions CompositeDelegation = 512; + + // Flag to indicate whether association options being + // administered are the "required" or "supported" set + enum RequiresSupports { + SecRequires, + SecSupports + }; + // Direction of communication for which + // secure invocation policy applies + enum CommunicationDirection { + SecDirectionBoth, + SecDirectionRequest, + SecDirectionReply + }; + // security association mechanism type + typedef string MechanismType; + typedef sequence MechanismTypeList; + // AssociationOptions-Direction pair + struct OptionsDirectionPair { + AssociationOptions options; + CommunicationDirection direction; + }; + typedef sequence OptionsDirectionPairList; + // Delegation mode which can be administered + enum DelegationMode { + SecDelModeNoDelegation, // i.e. use own credentials + SecDelModeSimpleDelegation, // delegate received credentials + SecDelModeCompositeDelegation // delegate both; + }; + // Association options supported by a given mech type + struct MechandOptions { + MechanismType mechanism_type; + AssociationOptions options_supported; + }; + typedef sequence MechandOptionsList; + // Attribute of the SecurityLevel2::EstablishTrustPolicy + struct EstablishTrust { + boolean trust_in_client; + boolean trust_in_target; + }; + // Audit + typedef unsigned long AuditChannelId; + typedef unsigned short EventType; + const EventType AuditAll = 0; + const EventType AuditPrincipalAuth = 1; + const EventType AuditSessionAuth = 2; + const EventType AuditAuthorization = 3; + const EventType AuditInvocation = 4; + const EventType AuditSecEnvChange = 5; + const EventType AuditPolicyChange = 6; + const EventType AuditObjectCreation = 7; + const EventType AuditObjectDestruction =8; + const EventType AuditNonRepudiation = 9; + enum DayOfTheWeek { + Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday}; + enum AuditCombinator { + SecAllSelectors, + SecAnySelector + }; + struct AuditEventType { + ExtensibleFamily event_family; + EventType event_type; + }; + typedef sequence AuditEventTypeList; + typedef unsigned long SelectorType; + const SelectorType InterfaceName = 1; + const SelectorType ObjectRef = 2; + const SelectorType Operation = 3; + const SelectorType Initiator = 4; + const SelectorType SuccessFailure = 5; + const SelectorType Time = 6; + const SelectorType DayOfWeek = 7; + + // values defined for audit_needed and audit_write are: + // InterfaceName: CORBA::RepositoryId + // ObjectRef: object reference + // Operation: op_name + // Initiator: Credentials + // SuccessFailure: boolean + // Time: utc time on audit_write; time picked up from + // environment in audit_needed if required + // DayOfWeek: DayOfTheWeek + struct SelectorValue { + SelectorType selector; + any value; + }; + typedef sequence SelectorValueList; + + // Constant declaration for valid Security Policy Types + // General administrative policies + const CORBA::PolicyType SecClientInvocationAccess = 1; + const CORBA::PolicyType SecTargetInvocationAccess = 2; + const CORBA::PolicyType SecApplicationAccess = 3; + const CORBA::PolicyType SecClientInvocationAudit = 4; + const CORBA::PolicyType SecTargetInvocationAudit = 5; + const CORBA::PolicyType SecApplicationAudit = 6; + const CORBA::PolicyType SecDelegation = 7; + const CORBA::PolicyType SecClientSecureInvocation = 8; + const CORBA::PolicyType SecTargetSecureInvocation = 9; + const CORBA::PolicyType SecNonRepudiation = 10; + // Policies used to control attributes of a binding to a target + const CORBA::PolicyType SecMechanismsPolicy = 12; + const CORBA::PolicyType SecInvocationCredentialsPolicy = 13; + const CORBA::PolicyType SecFeaturePolicy = 14; // obsolete + const CORBA::PolicyType SecQOPPolicy = 15; + const CORBA::PolicyType SecDelegationDirectivePolicy = 38; + const CORBA::PolicyType SecEstablishTrustPolicy = 39; +}; +#endif /* _SECURITY_IDL_ */ + diff --git a/idl/Security/SecurityLevel1.idl b/idl/Security/SecurityLevel1.idl new file mode 100644 index 0000000..ee46e4b --- /dev/null +++ b/idl/Security/SecurityLevel1.idl @@ -0,0 +1,18 @@ +#if !defined(_SECURITY_LEVEL_1_IDL_) +#define _SECURITY_LEVEL_1_IDL_ + +#include +#pragma prefix "omg.org" + +module SecurityLevel1 { + //# pragma version SecurityLevel1 1.8 + local interface Current : CORBA::Current { + //# pragma version Current 1.8 + // thread specific operations + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + }; +}; +#endif /* _SECURITY_LEVEL_1_IDL_ */ + diff --git a/idl/Security/SecurityLevel2.idl b/idl/Security/SecurityLevel2.idl new file mode 100644 index 0000000..dd3e11a --- /dev/null +++ b/idl/Security/SecurityLevel2.idl @@ -0,0 +1,196 @@ +#if !defined(_SECURITY_LEVEL_2_IDL_) +#define _SECURITY_LEVEL_2_IDL_ + +#include + +#pragma prefix "omg.org" + +module SecurityLevel2 { + //# pragma version SecurityLevel2 1.8 + // Forward declaration of interfaces + local interface PrincipalAuthenticator; + local interface Credentials; + local interface Current; + +// Interface PrincipalAuthenticator + local interface PrincipalAuthenticator { + //# pragma version PrincipalAuthenticator 1.8 + Security::AuthenticationMethodList + get_supported_authen_methods( + in Security::MechanismType mechanism + ); + Security::AuthenticationStatus authenticate ( + in Security::AuthenticationMethod method, + in Security::MechanismType mechanism, + in Security::SecurityName security_name, + in any auth_data, + in Security::AttributeList privileges, + out Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + Security::AuthenticationStatus continue_authentication ( + in any response_data, + in Credentials creds, + out any continuation_data, + out any auth_specific_data + ); + }; + + // Interface Credentials + local interface Credentials { + //# pragma version Credentials 1.8 + Credentials copy (); + void destroy(); + readonly attribute Security::InvocationCredentialsType credentials_type; + readonly attribute Security::AuthenticationStatus authentication_state; + readonly attribute Security::MechanismType mechanism; + attribute Security::AssociationOptions accepting_options_supported; + attribute Security::AssociationOptions accepting_options_required; + attribute Security::AssociationOptions invocation_options_supported; + attribute Security::AssociationOptions invocation_options_required; + boolean get_security_feature( + in Security::CommunicationDirection direction, + in Security::SecurityFeature feature + ); + boolean set_attributes ( + in Security::AttributeList requested_attributes, + out Security::AttributeList actual_attributes + ); + Security::AttributeList get_attributes ( + in Security::AttributeTypeList attributes + ); + boolean is_valid ( + out Security::UtcT expiry_time + ); + boolean refresh( + in any refresh_data + ); + }; + + typedef sequence CredentialsList; + + local interface ReceivedCredentials : Credentials { + //# pragma version ReceivedCredentials 1.8 + readonly attribute Credentials accepting_credentials; + readonly attribute Security::AssociationOptions association_options_used; + readonly attribute Security::DelegationState delegation_state; + readonly attribute Security::DelegationMode delegation_mode; + }; + + local interface TargetCredentials : Credentials { + //# pragma version TargetCredentials 1.8 + readonly attribute Credentials initiating_credentials; + readonly attribute Security::AssociationOptions association_options_used; + }; + + // RequiredRights Interface + interface RequiredRights{ + void get_required_rights( + in Object obj, + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + out Security::RightsList rights, + out Security::RightsCombinator rights_combinator + ); + void set_required_rights( + in CORBA::Identifier operation_name, + in CORBA::RepositoryId interface_name, + in Security::RightsList rights, + in Security::RightsCombinator rights_combinator + ); + }; + + // interface audit channel + local interface AuditChannel { + //# pragma version AuditChannel 1.8 + void audit_write ( + in Security::AuditEventType event_type, + in CredentialsList creds, + in Security::UtcT time, + in Security::SelectorValueList descriptors, + in any event_specific_data + ); + readonly attribute Security::AuditChannelId audit_channel_id; + }; + + // interface for Audit Decision + local interface AuditDecision { + // #pragma version AuditDecision 1.8 + boolean audit_needed ( + in Security::AuditEventType event_type, + in Security::SelectorValueList value_list + ); + readonly attribute AuditChannel audit_channel; + }; + + local interface AccessDecision { + // #pragma version AccessDecision 1.8 + boolean access_allowed ( + in SecurityLevel2::CredentialsList cred_list, + in Object target, + in CORBA::Identifier operation_name, + in CORBA::Identifier target_interface_name + ); + }; + + // Policy interfaces to control bindings + local interface QOPPolicy : CORBA::Policy { + // #pragma version QOPPolicy 1.8 + readonly attribute Security::QOP qop; + }; + + local interface MechanismPolicy : CORBA::Policy { + // #pragma version MechanismPolicy 1.8 + readonly attribute Security::MechanismTypeList mechanisms; + }; + + local interface InvocationCredentialsPolicy : CORBA::Policy { + // #pragma version InvocationCredentialsPolicy 1.8 + readonly attribute CredentialsList creds; + }; + + local interface EstablishTrustPolicy : CORBA::Policy { + // #pragma version EstablishTrustPolicy 1.8 + readonly attribute Security::EstablishTrust trust; + }; + + local interface DelegationDirectivePolicy : CORBA::Policy { + // #pragma version DelegationDirectivePolicy 1.8 + readonly attribute Security::DelegationDirective delegation_directive; + }; + + local interface SecurityManager { + // #pragma version SecurityManager 1.8 + // Process/Capsule/ORB Instance specific operations + readonly attribute Security::MechandOptionsList supported_mechanisms; + readonly attribute CredentialsList own_credentials; + readonly attribute RequiredRights required_rights_object; + readonly attribute PrincipalAuthenticator principal_authenticator; + readonly attribute AccessDecision access_decision; + readonly attribute AuditDecision audit_decision; + TargetCredentials get_target_credentials ( + in Object obj_ref + ); + void remove_own_credentials( + in Credentials creds + ); + CORBA::Policy get_security_policy ( + in CORBA::PolicyType policy_type + ); + }; + + // Interface Current derived from SecurityLevel1::Current providing + // additional operations on Current at this security level. + // This is implemented by the ORB + local interface Current : SecurityLevel1::Current { + //# pragma version Current 1.8 + // Thread specific + readonly attribute ReceivedCredentials received_credentials; + }; +}; + +#endif /* _SECURITY_LEVEL_2_IDL_ */ + + + diff --git a/idl/Security/SecurityLevel3.idl b/idl/Security/SecurityLevel3.idl new file mode 100644 index 0000000..e3251eb --- /dev/null +++ b/idl/Security/SecurityLevel3.idl @@ -0,0 +1,2041 @@ +//*********************************************************************** +// ORBAsec SL3 +// ---------------------------------------------------------------------- +// Copyright (C) 2001 Adiron, LLC. +// All rights reserved. +// ---------------------------------------------------------------------- +//*********************************************************************** + +//*********************************************************************** +/** + * @note Some interfaces in this IDL module have been altered from the + * original Adiron sources. + */ +//*********************************************************************** + + +#ifndef _SecurityLevel3_ +#define _SecurityLevel3_ + +#include +#include "TimeBase.idl" + +#pragma prefix "adiron.com" + +/** + * The Security Level 3 module contains the data definitions and + * the Application Programmers Interface for dealing with the + * ORBAsec SL3 Security, and the new CSIv2 Security Protocol, which has + * been adopted by the OMG. + *

+ * The SecurityLevel3 interfaces and its security data structures + * are based on the Principal Calculus. This is a mathematical + * model of representing principals for the use of access control + * and auditing. + *

+ * The SecurityLevel3 Security Service is represented by two objects + * that are returned by the ORB's resolve_initial_reference call. + * Those two objects are the SecurityManager and the SecurityCurrent. + * Other objects associated with the security service emanate from + * these two objects. + *

+ * The SecurityLevel3 Security Service has a Credentials model. This + * model, which is heavily based on the Principal Calculus, yields + * an API for accessing principal information. The credentials + * represent a principal's credentials, as well as the establishment + * of security contexts between client and servers. + *

+ * The SecurityLevel3 Security Service is currently CSIv2 Level 2 + * compliant: + *

+ *

+ * The Security Level 3 ORB Security Service does supports retention + * of CSI state. Client Authentication information and Identity + * assertion information is transmitted on each request. + *

+ * The Security Level 3 ORB Security Service does not automatically + * support endorsement at this time (CSIv2 Level 2 compliance), but + * does give you facility to do so. + */ +module SecurityLevel3 { + + /** + * The Adiron VMCID, which is used in Minor Error Codes, + * Policy Tags, etc. + */ + const unsigned long ADIRON_VMCID = 0xA11C000; + + //------------------------------------------------------------- + // Security Level 3 Data Representations + // + //------------------------------------------------------------- + + // + // A Principal Name + // A principal name always has a type, and a path of + // name components. They are ordered from least significant + // to most significant. For example, if a principal is represented + // by a single X.509 certificate, the first element in the path + // is the SubjectDN, and the second is the IssuerDN. + // + /** + * A NameType is used for typing a PrincipalName data structure. + * A NameType is a string that represents an ASN.1 + * OBJECT IDENTIFIER. Its representation usually of the form + * "oid:1.2.3.4". Other forms may be possible. It is used + * for encoding name type identifiers, which are ASN.1 DER encoded + * OBJECT IDENTIFIERs, in the CSI protocol. + * @see NameComponent + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef string NameType; + + /** + * A NameComponent is an ordered component of a NamePath. The + * least significant component is always the first component. + * It is the type of a wstring to handle international character + * values. + * @see NameType + * @see NamePath + * @see NameValue + * @see PrincipalName + */ + typedef wstring NameComponent; + + /** + * A NamePath is an ordered collection of NameComponents, ordered + * from the least significant to most significant. For example, + * an identity that is defined by a certificate that has a + * SubjectDN of "C=US,CN=Joe,O=Adiron" and an IssuerDN of + * "C=US,CN=AdironCA,O=Adiron" will have the following + * name components: + *

+     *  NameComponent[0] = "C=US,CN=Joe,O=Adiron"
+     *  NameComponent[1] = "C=US,CN=AdironCA,O=Adiron"
+     * 
+ * @see NameType + * @see NameComponent + * @see NameValue + * @see PrincipalName + */ + typedef sequence NamePath; + + /** + * A NameValue is the value component of a PrincipalName, + * which is a "type-value" pair. It is defined as a NamePath. + * @see NameType + * @see NameComponent + * @see NamePath + * @see PrincipalName + */ + typedef NamePath NameValue; + + /** + * A PrincipalName is a "type-value" structure. The type directs + * what the encoding and format of the components in the the + * value component are. For example, a type of "X509DirectoryPath" + * means that the value contains the DNs of the subject and + * subsequent issuers. + * @see NameType + * @see NameComponent + * @see NamePath + * @see NameValue + */ + struct PrincipalName { + NameType the_type; + NameValue the_name; + }; + + /** + * A list of PrincipalNames. + * @see PrincipalName + */ + typedef sequence PrincipalNameList; + + + // + // Attributes for privileges and other things. They are type value pairs. + // + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + *

+ * The type of a PrinAttribute is represented by a string. + *

+ * Privilege Attribute Types, that might come from X.509 certificates + * might be represented by OIDs. OIDs are represented as: + *

+     *   oid:n1.n2.n3.n4.n5.n6....
+     *             for an OID where ni are non-negative integers.
+     * 
+ * These OIDs are meant to be used to direct the "type-value" encoding + * of a GSS-API ExportName, which uses an OID as a type that directs + * the encoding of the value. + *

+ * Example Environmental Attribute Types + *

+     *   SL3:ChannelIdentifier
+     *   SL3:LocalAddress
+     *   SL3:LocalPort
+     *   SL3:TransportMechanism
+     *   SL3:TLSCipherSuite
+     * 
+ * @see PrinAttribute + */ + typedef string PrinAttributeType; + + /** + * A PrinAttributeValue is a wide character string that encodes + * or decodes the value of an attribute. An attempt is always + * meant to represent an attribute's value in a human readable + * string form. If the value cannot be decoded this way, and its + * native form is binary, then it is represented in a Hex encoding + * of the binary form. + * @see PrinAttribute + */ + typedef wstring PrinAttributeValue; + + /** + * A PrinAttribute is a "type-value" pair, usually attributed to + * a Principal by some means, such as values stored in its certificate + * or environmental concerns, such as the channel the principal was + * authenticated over. + * @see PrinAttribute + */ + struct PrinAttribute { + PrinAttributeType the_type; + PrinAttributeValue the_value; + }; + + /** + * A list of PrinAttributes. + * @see PrinAttribute + */ + typedef sequence PrinAttributeList; + + + /** + * This is just a sequence of strings that make + * up the components of a ResourceName. + * @see ResourceName + */ + typedef sequence ResourceNameComponents; + + /** + * A ResourceName is the constructed name of a "resource". A + * ResourceName is closely modeled after CORBAmed's Resource + * Access Decision (RAD) facility's "Resource". It contains + * a sequence of strings. + */ + struct ResourceName { + ResourceNameComponents components; + }; + + /** + * A List of Resource Names. + * @See ResourceName + */ + typedef sequence ResourceNameList; + + + // + // NameTypes used in SL3 + // + + /** + * An NT_KerberosName is a NameType that signifies that the + * value of a PrincipalName is a Kerberos formated name. + * A KerberosName is a single string encoded in the + * familiar "name@REALM" format. + *

+ * From GSS-Kerboeros RFC 1964: + *

+ * 2.1.1. Kerberos Principal Name Form + *

+ * This name form shall be represented by the Object Identifier {iso(1) + * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2) + * krb5(2) krb5_name(1)}. + */ + const NameType NT_KerberosName = "oid:1.2.840.113554.1.2.2.1"; + + /** + * An NT_X509DirectoryNamePath is a NameType that signifies that + * the value of a PrincipalName is constructed from a chain + * of certificates, such that the end entity is the least + * significant position, with the subsequent issuers following + * in order of signature. + *

+ * The coding of the names is the string encoding of + * complete X.500 DN's, such as "C=US, CN=Joe, O=Adiron". + * There is no indication whether the last DN in the path is a + * "root", i.e. it's issuer is the same. + */ + const NameType NT_X509DirectoryNamePath = "SL3:X509DirectoryPathName"; + + /** + * The NT_Anonymous is a name type that specifies that the + * PrincipalName is representing the "anonymous" principal. + * Its value always as a single name component of "anonymous" + */ + const NameType NT_Anonymous = "SL3:anonymous"; + + /** + * The NT_StringName is a NameType that specifies that the + * PrincipalName is represented by a single NameComponent + * of name in a "scoped" name space. The name and scope + * are separated by a single "@" character. The escape character + * is "\". This string name as we call it is the same form + * used for the GSSUP (GSS-UserPassword NameType). This + * oid is the OID defined by the OMG CSIv2 specification. It + * is the value defined by the CSI::GSS_NT_Scoped_Username_OID + * constant. + */ + const NameType NT_StringName = "oid:2.23.130.1.2.1"; + + // + // Privileges + // + + /** + * A ScopedPrivileges structure represents privileges that + * belong to a scope defined by a principal. This structure + * is used to represent a principal that is a privilege authority + * that issues privileges. Privileges are represented as + * PrinAttributes. + */ + struct ScopedPrivileges { + PrincipalName privilege_authority; + PrinAttributeList privileges; + }; + + /** + * A list of ScopedPrivileges + * @see ScopedPrivileges + */ + typedef sequence ScopedPrivilegesList; + + // + // Principals + // + + /** + * A Principal comes in three forms, which correspond to the + * Principal Calculus. The forms are "Simple", "Quoting", and + * "Proxy". Simple is a principal that represents a single + * entity, usually "speaking for" itself. A "Quoting" principal + * is a "compound" principal that says that one principal is + * speaking on behalf of another, usually denoted by "(A|B)", i.e. + * "A is quoting B", which means that "A is speaking on behalf of B". + * A "Proxy" principal is almost the same as a "Quoting" principal. + * However, the security service has determined that enough evidence + * exists that proves that Principal A is authorized to speak in + * B's behalf. This principal is denoted in the calculus as "(A for B)" + * in contrast to the quoting principal "(A|B)". + */ + typedef unsigned long PrincipalType; + + /** + * The Simple Principal Type (A) + * @see PrincipalType + */ + const PrincipalType PT_Simple = 0; // A, valuetype SimplePrincipal + /** + * The Quoting Principal Type (A|B) + * @see PrincipalType + */ + const PrincipalType PT_Quoting = 1; // B | A, valuetype QuotingPrincipal + /** + * The Proxy Principal Type (A for B) + * @see PrincipalType + */ + const PrincipalType PT_Proxy = 2; // B for A, valuetype ProxyPrincipal + + /** + * A Principal is represented by a base value type, which is extended + * for the various principals, Simple, Quoting, and Proxy. This base + * type of a Principal may be sufficient for access control in + * most systems. + * @param the_type contains the corresponding identifier + * @param the_name contains the logical name of the most derived + * Principal. Such as if the Principal is a nested + * ProxyPrincipal (i.e. C for B for A) the name here + * is A. + * @param environmental_attributes + * The attributes name certain things that do are + * environmental, such as IP addresses. + * @param with_privileges + * These are the privileges associated with Principal A + * restricted_resources. + * This attribute contains a collection of resources on which + * the principal is authorized to perform actions. + */ + valuetype Principal { + /** This field contains the type of the Principal. */ + public PrincipalType the_type; + /** This field contains the name of the Principal */ + public PrincipalName the_name; + /** + * This field contains the attributes of the principal + * that are considered environmental, such as authentication + * mechanism, authentication channel identifier, etc. + */ + public PrinAttributeList environmental_attributes; + /** + * This field contains the list of scoped privileges the + * security service has determined belong to the particular + * principal. + */ + public ScopedPrivilegesList with_privileges; + }; + + /** + * A list of Principals. + * @see Principal + */ + typedef sequence PrincipalList; + + /** + * A Simple Principal represents a single entity. It is usually + * derived by credentials acquisition, authentication, trust rules concerning quoting, + * or trust rules and certificates concerning Proxying. + * It has one extra field over the base Principal, which is + * "alternate_names". + */ + valuetype SimplePrincipal : /* truncatable */ Principal { + /** + * This field indicates whether the principal was derived or is + * going to be derived from an authentication mechanism. + *

+ * If the SimplePrincipal is directly or indirectly + * (as part of a composite Principal) in the + * ClientCredentials.client_principal or + * TargetCredentials.target_principal field, + * the authenticated field indicates the authentication + * status of the SimplePrincipal in the client or target + * principal, respectively. + *

+ * If the SimplePricipal is directly or indirectly in + * the ClientCredentials.target_principal + * (or TargetCredentials.client_principal) field, + * the authenticated field indicates the target's + * (or client's belief) about its authentication status to the other + * party. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of the initiator or acceptor + * of OwnCredentials, the authenticated + * field indicates the expectation of being authenticated to the other + * side of the communication when the initiator or acceptor is used. + *

+ * If the SimplePrincipal is directly or indirectly in + * the the_principal field of a + * PrincipalIdentityStatement, + * the authenticated field indicates only the + * "best effort" of knowing whether the principal has been possibly + * authenticated or not. In other word, if this field is + * TRUE, it is for sure that the principal has been + * authenticated (or is expecting to be authenticated). + * If this field is FALSE, the principal may or may not + * have been authenticated. The reason for this ambiguity is that + * a PrincipalIdentityStatement may be created before + * the authentication of the principal being performed. In general, + * the authenticated field of a + * SimplePrincipal inside the the_principal + * field of a PrincipalIdentityStatement should not be + * taken as a definite answer for the authentication status of the + * SimplePrincipal. + * + * @see ClientCredentials.client_authentication + * @see ClientCredentials.target_authentication + * @see TargetCredentials.client_authentication + * @see TargetCredentials.target_authentication + */ + // For example, if a client uses the User/Password mechanism to + // communicate with a target, the client's OwnCredentials, created + // using a PasswordGenerator, will have the authenticated + // field in the principal in the initiator being true, + // although the client may not have been authenticated to the target. + // + public boolean authenticated; + /** + * This field contains the other name types, such as + * that appear in the X.509 alternate name fields. + */ + public PrincipalNameList alternate_names; + + }; + + /** + * A ProxyPrincipal represents a principal that speaks for another. + * The principal is proved that it is authorized to speak for another. + * The system believes this, either by trust rules of its own, + * or by delivered endorsement from the principal such as + * Principal (B for A) where the endorsement takes the form + * in the Principal Calculus as (T says B serves A) + * where T is some entity trusted by the security service + * to make those statements. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * speaks_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype ProxyPrincipal : /* truncatable */ Principal { + + /** + * In a Proxy Principal of (A for B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Proxy Principal of (A for B) the speaks_for field + * represents the principal B. + */ + public Principal speaks_for; + + }; + + /** + * A QuotingPrincipal represents a principal that speaks for another. + * The principal is not proved that it is authorized to speak for another. + * The system derives principals like this based on statements in the + * Pricipal Calculus, such as "A says B says r", which results in the + * quoting principal (A|B) says r, where "r" is a statement, such as + * a CORBA request. The security service derives principals like + * this from the CSI Identity Assertion mechanism. + *

+ * Important: This valuetype extends the Principal value type. The + * the_name filed of this object will contain the name of the + * quotes_for principal, as that is the name most access control + * systems would care about. Therefore, this value type can be + * truncated by access control systems that do not want to + * examine the principal in detail. + */ + valuetype QuotingPrincipal : /* truncatable */ Principal { + + /** + * In a Quoting Principal of (A|B) the speaking field + * represents the principal A. + */ + public Principal speaking; + + /** + * In a Quoting Principal of (A|B) the quotes_for field + * represents the principal B. + */ + public Principal quotes_for; + + }; + + // + // Statements + // + + /** + * A Statement is a value type that has extensions which + * represent the different relevant data directed by its StatementType. + * There are two basic Statement Types, an IdentityStatement and + * an EndorsementStatement. An identity statement is a statement that + * asserts an identity. It may represent a the components of + * an X.509 certificate during an authentication. An EndorsementStatement + * may represent the contents of an X.509 AttributeCertificate or + * some other notion of an endorsement, such as a certificate in + * BizTalk XML. + *

+ * Statements are contained in the Credentials Objects. They + * represent pieces of evidence collected from which the security + * service deduces the Principal of the Credentials Objects. + */ + typedef unsigned long StatementType; + + /** + * The Identity Statement Type. + *

+ * A statement of this type at least extends to the + * IdentityStatement valuetype, if not truncated + * @see IdentityStatement + */ + const StatementType ST_IdentityStatement = 1; //valuetype IdentityStatement + + /** + * The Endorsement Statement Type. + *

+ * A statement of this type at least extends to the + * EndorsementStatement valuetype, if not truncated + * @see EndorsementStatement + */ + const StatementType ST_EndorsementStatement = 2; //valuetype EndorsementStatement + + /** + * An encoding is a sequence of bytes. + */ + typedef sequence Encoding; + + /** + * Statement encoding type. + *

+ * Statements carry their original encoding information, if + * they came from an encoding, such as list of X.509 identity + * certificates (i.e. a chain). The encoding type may be derivable + * from the encoding itself. For example, it's easy to tell the + * difference between a PEM encoded certificate, and a DER encoded + * certificate. Therefore, the encoding type may default to "Unknown". + * Other types may exist than the ones provided as constants in + * this module. + */ + typedef string EncodingType; + + /** + * The ET_NoEncoding type signifies that the statement + * has been generated solely by the security service + * and has no encoding. + */ + const EncodingType ET_NoEncoding = "NoEncoding"; + + /** + * The ET_Unknown encoding type may always be used if the encoding + * type can only be figured out from encoding itself. + */ + const EncodingType ET_Unknown = "Unknown"; + + /** + * User Exception for a bad encoding. + */ + exception BadEncoding {}; + + /** + * User Exception for a bad or unsupported encoding type. + */ + exception BadEncodingType {}; + + /** + * The Statement Layer is the layer of the protocol or security + * service from which the statement emanated, derived, or was collected. + */ + typedef unsigned long StatementLayer; + + /** + * Default type for a Statement Layer + */ + const StatementLayer SL_Unknown = 0; + /** + * The SL_Transport statement type signifies that the associated + * statement is derived from the transport layer, such as + * an X.509 Certificate from a TLS handshake. + */ + const StatementLayer SL_Transport = 1; + /** + * The SL_CSIAuthorization statement type signifies that the associated + * statement is derived from the CSI Authorization Layer in the CSIv2 + * protocol. + */ + const StatementLayer SL_CSIAuthorization = 2; + /** + * The SL_CSIClientAuth statement type signifies that the associated + * statement is derived from the CSI Client Authentication Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIClientAuth = 3; + /** + * The SL_CSIIdentity statement type signifies that the associated + * statement is derived from the CSI Identity Assertion Layer + * in the CSIv2 protocol. + */ + const StatementLayer SL_CSIIdentity = 4; + + /** + * The SL_UserDefined statement layer signifies that the associate + * statement is derived or created by a user or some other + * entity than the security service. + */ + const StatementLayer SL_UserDefined = 5; + + /** + * The Statement base type contains the information common + * to all statements. A statement has an "external" encoding, such + * as an X509 Certificate. Some statements may not have an encoding, + * but its extension may carry the pertinent marshable information, + * such as a PrincipalIdentityStatement for anonymous, which is + * generated by the security service. + */ + valuetype Statement { + /** + * This field contains an identifier of the + * service layer that generated the statement. + * The layer that generated or delivered + * the statement, i.e. Transport, CSIv2 Authentication, + * CSIv2 Authorization, or CSIv2 Identity Assertion. + */ + public StatementLayer the_layer; + /** + * The type of statement, which indicates its extension + * such as an Identity Statement or an Endorsement + * Statement. + */ + public StatementType the_type; + /** + * This field indicates the type of encoding. + * The encoding may be contrived, at the encoding + * may not exist, however, the extension of the + * statement type may contain data that can + * be marshaled across the wire. See the Principal + * Identity Statement. + */ + private EncodingType encoding_type; + /** + * The bytes of the encoding, if it exists. + */ + private Encoding the_encoding; + + /** + * Returns the encoding type + */ + EncodingType get_encoding_type(); + + /** + * Returns an encoding of this statement. Some implementations + * may be able to convert. Using and encoding_type of + * ET_Unknown, will always yield the default encoding, + * if it exists. If the encoding does not exist, + * a successful return containing an empty + * sequence will result. + */ + Encoding get_encoding( + in EncodingType encoding_type + ) raises ( + BadEncodingType + ); + + /** + * This factory method allows users to create their + * own Statements from an encoding. The statements created + * by this factory method may have a type which is a further + * extension of the valuetype Statement. + */ + factory create( + in EncodingType encoding_type, + in Encoding the_encoding + ); + }; + typedef sequence StatementList; + + /** + * The Identity Statement further classifies the encoding + * as a statement that if verified asserts an identity. + */ + valuetype IdentityStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + /** + * The Principal Identity Statement is the minimal version of an + * Identity statement that asserts a single identity that the + * security service can translate into a principal. + *

+ * An example of an identity statement is an X.509 certificate in + * which its attributes are exposed into the principal, such as + * privileges. This valuetype may also be further extended by the + * security service depending on its encoding and the capabilities + * of the security service. + */ + valuetype PrincipalIdentityStatement : IdentityStatement { + public Principal the_principal; + }; + + /** + * The Endorsement Statement is a statement that is used for + * authorization. An Endorsement statement endorses a + * principal with certain characteristics, such as privileges + * or the authority to act on behalf of another principal, sometimes + * called "delegation". + *

+ * According to our research, an endorsement statement may be a + * complex entity containing matching rules for the endorsement. + * An endorsement may have the following general form: + *

+     *     I says Principal A matching [(P1 with [p1,...,pn]) or ....]
+     *        speaks_for
+     *          Principal B matching [(T1 with [t1,...,tn]) or ... ]
+     *        has [s1,...,sm]
+     *        on Resources matching [R1, .... Rn]
+     * 
+ * Actual semantic reduction of principals is directed by the + * the matching rules, and may depend on other statements as well, + * such as local trust rules in the security service configuration. + * Also, much of the capability of an endorsement statement is + * dependent on its encoding. + *

+ * This approach to authorization is a largely unexplored research + * topic. There are not many or well known encodings of endorsement + * statements. Therefore, we are reluctant to produce interfaces + * just yet, that go beyond the encoding. However, we do expose the + * Endorsement statement type, which may further direct the interpretation + * of it's encoding. + */ + valuetype EndorsementStatement : Statement { + /** + * This field contains a possibly well known identifier that + * may aid in the interpretation of the identity statement's + * encoding. It may be an empty string, which signifies that + * there is no known interpretation aid for the encoding, or + * that there is no encoding. + */ + public string interpretation_aid; + }; + + + + // + // TODO: The following contruction is not supported by TIDIdlc + // + /** + * An X509IdentityStatement is one that extends the Principal Identity + * Statement. If one does get an X509 IdentityStatement, it is + * currently supported with IAIK in both DER and PEM formats. + */ + valuetype X509IdentityStatement : PrincipalIdentityStatement { +// Already defined in Statement +// /** +// * This factory method allows users to create their +// * own X509Identity statements from an encoding. +// */ +// factory create( +// in EncodingType encoding_type, +// in Encoding the_encoding +// ); + }; + typedef sequence X509IdentityStatementList; + + //------------------------------------------------------------- + // Security Level 3 Application Users Interface + // + //------------------------------------------------------------- + + // + // The Security Level 3 Credentials Model + // + + /** + * Credentials come in three types. OwnCredentials, ClientCredentials, + * and TargetCredentials. OwnCredentials represent the ORB instance's + * credentials. Each Credentials has initiating and accepting capability. + * ClientCredentials represent an established security context with + * a client. TargetCredentials represent an established security context + * with a Target's Server. + */ + typedef unsigned long CredentialsType; + + /** + * The CT_OwnCredentials CredentialsType signifies that the + * Credentials can be extended to the OwnCredentials Type. + */ + const CredentialsType CT_OwnCredentials = 0; + /** + * The CT_ClientCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_ClientCredentials = 1; + /** + * The CT_TargetCredentials CredentialsType signifies that the + * Credentials can be extended to the ClientCredentials Type. + */ + const CredentialsType CT_TargetCredentials = 2; + + /** + * A Credentials object has a validity state. Some credentials + * may be time or use dependent. + */ + typedef long CredentialsState; + + /** + * The Credentials with a CredentialsState of CS_Invalid cannot be + * used in any the initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Invalid = -3; + + /** + * Credentials with a CredentialsState of CS_Expired can no longer + * be used for initiating or accepting establishment of any + * security contexts. + */ + const CredentialsState CS_Expired = -2; + /** + * Credentials with a CredentialsState of CS_PendingRelease can no longer + * be used for initiating or accepting establishment of any + * security contexts. It means that "release_credentials" has been + * called on the credentials. + */ + const CredentialsState CS_PendingRelease = -1; + /** + * Credentials with a CredentialsState of CS_Initialized cannot + * be used for initiating or accepting establishment of any + * security contexts. It means that credentials are in an initial + * state. This value is for internal use, and there is no + * reason a SecurityLevel3 user should see credentials in this state. + */ + const CredentialsState CS_Initialized = 0; + /** + * Credentials with a CredentialsState of CS_Valid can + * be used for initiating or accepting establishment of + * security contexts. + */ + const CredentialsState CS_Valid = 1; + + /** + * Credentials have system generated identifiers + * to which they can be referred and retrieved. + */ + typedef string CredentialsId; + typedef sequence CredentialsIdList; + + /** + * A Context Id is a system generated unique identifier for identifying + * a security context to the application. + * Security Contexts may be long lived and not established on + * every request. Therefore, an identifier is assigned. + *

+ * Note that this Context Id is not directly related to the context + * defined in the CSIv2 specification. + */ + typedef string ContextId; + + /** + * Credentials Usage + *

+ * Credentials Usage refers to the concept that Credentials may + * be used to initiate security context, accept security contexts, + * or do both. its values are used in the acquisition + * of credentials for the purpose of designating the abilities + * of the credentials acquired. + */ + typedef unsigned long CredentialsUsage; + /** + * The CU_Indefinite CredentialsUsage type is a value that + * signifies the default. Depending on some other acquisition + * arguments, the credentials usage may be able to be implicitly + * determined. + */ + const CredentialsUsage CU_Indefinite = 1; + /** + * The CU_None CredentialsUsage type is a value that states the + * credentials cannot be used to make or accept security + * contexts. ClientCredentials and TargetCredentials have + * this credentials usage. + */ + const CredentialsUsage CU_None = 2; + /** + * The CU_AcceptOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to accept the establishment + * of security contexts. + */ + const CredentialsUsage CU_AcceptOnly = 3; + /** + * The CU_InitiateOnly CredentialsUsage type is a value that signifies + * that the credentials can only be used to initiate the establishment + * of security contexts. + */ + const CredentialsUsage CU_InitiateOnly = 4; + /** + * The CU_InitiateAndAccept CredentialsUsage type is a value that + * signifies that the credentials can be used to both initiate + * and accept the establishment of security contexts. + */ + const CredentialsUsage CU_InitiateAndAccept = 5; + + /** + * A CredsDirective is a directive on a invocation as to the + * effects of the initiated security context will have on the + * the accepting side. Please see ContextEstablishmentPolicy + * for is use in context with establishing security contexts. + * @see ContextEstablishmentPolicy + */ + typedef unsigned long CredsDirective; + /** + * The CD_Default CredsDirective is a value that signifies to + * use the capabilities of the selected credentials. + */ + const CredsDirective CD_Default = 0; + /** + * The CD_InvokeTarget CredsDirective is a value that signifies that + * the selected credentials should only be used in a simple + * invocation fashion. They shall not attempt to endorse or embody + * the target to act on its behalf. + */ + const CredsDirective CD_InvokeTarget = 1; + /** + * The CD_EndorseTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to endorse + * the target. In other words, it gives the accepting side the ability + * to act on behalf of the initiating side. + */ + const CredsDirective CD_EndorseTarget = 2; + /** + * The CD_EmbodyTarget CredsDirective is a value that signifies that + * the selected credentials, if capable, should attempt to embody + * the target. In other words, it gives the accepting side the ability + * to impersonate the initiating side. + */ + const CredsDirective CD_EmbodyTarget = 3; + + /** + * A Feature Directive is a general directive used in policy that + * stipulates the of a particular feature. Such examples include, + * confidentiality, integrity, client authentication, etc. + */ + typedef long FeatureDirective; + + /** + * The FD_DoNotUse FeatureDirective means definitely not to use + * the feature. + */ + const FeatureDirective FD_DoNotUse = -2; + /** + * The FD_DoNotUseIfPossible FeatureDirective means not to use + * the feature if it is possible. Note, some mechanisms may always + * use confidentiality. + */ + const FeatureDirective FD_DoNotUseIfPossible = -1; + /** + * The FD_UseDefault FeatureDirective means to use or not to use + * the feature depending on defaults. + */ + const FeatureDirective FD_UseDefault = 0; + /** + * The FD_UseIfPossible FeatureDirective means to use the feature + * if it is possible. + */ + const FeatureDirective FD_UseIfPossible = 1; + /** + * The FD_Use FeatureDirective means definitely to use the feature. + */ + const FeatureDirective FD_Use = 2; + + + /** + * The Initiator Type of the Initiator Side of the Credentials states + * the kind of Initiator it is. There are three types that mirror + * the type of Principal, Simple, Quoting, and Proxy, that the + * initiator intends to represent to a server while trying to + * establish a security context with the server. + */ + typedef unsigned long InitiatorType; + /** + * The IT_None InitiatorType is a value that is defined for + * completeness, and has no real use. + */ + const InitiatorType IT_None = 0; + /** + * The IT_Simple InitiatorType is a value that states that the + * initiator is a "Simple" Principal. + */ + const InitiatorType IT_Simple = 1; + /** + * The IT_Quoting InitiatorType is a value that states that the + * initiator will quote another principal to the server. This + * principal is denoted in the Principal Calculus as (A|B), i.e. + * A quoting B. + */ + const InitiatorType IT_Quoting = 2; + /** + * The IT_Proxy InitiatorType is a value that states that the + * initiator will quote another principal to the server along with + * getting or providing proof to the server that it can act on + * behalf of the quoted principals. This + * principal is denoted in the Principal Calculus as (A for B). + */ + const InitiatorType IT_Proxy = 3; + + /** + * The CredsInitiator object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "initiator" side of the credentials. + */ + local interface CredsInitiator { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * client principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute Principal the_principal; + /** + * The supporting statements attribute contains a list of statements + * supporting the principal associated with this initiator. + */ + readonly attribute StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The initiator_type attribute signifies the intent of the + * initiator as to the principal it presents for the + * security context establishment. It should correspond + * to the type of the Principal. However, it might be slightly + * different, because using CSIv2 Client Authentication + * technically creates a "QuotingPrincipal" however, the + * initiator type will still be simple as no CSIv2 Identity + * Assertion will be used in establishing the security + * context. + */ + readonly attribute InitiatorType initiator_type; + /** + * The supports_embodiment attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to give the + * the accepting end of a context establishment the ability + * to impersonate this initiator principal. + */ + readonly attribute boolean supports_embodiment; + /** + * The supports_endorsement attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to endorse + * the accepting end of a context establishment to act + * on behalf of this initiator principal. + */ + readonly attribute boolean supports_endorsement; + /** + * The supports_quoting attribute is TRUE if these credentials + * can be directed by use of the CredsDirective, to simply + * quote another principal on top of these credentials. + */ + readonly attribute boolean supports_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + }; + + /** + * The CredsAcceptor object is an object that is directly a + * member of a particular OwnCredentials object. It represents + * the "acceptor" side of the credentials. + */ + local interface CredsAcceptor { + + /** + * The principal attribute contains a local view of the + * Principal that the Credentials intend to represent. + * Note that during context establishment, the actual establish + * target principal may be represented differently, especially + * with respect to environmental attributes. Some environmental + * attributes are a direct result of context establishment. + */ + readonly attribute SecurityLevel3::Principal the_principal; + /** + * The supporting_statements attribute contains a list of statements + * supporting the principal associated with this acceptor. + */ + readonly attribute SecurityLevel3::StatementList supporting_statements; + /** + * The restricted_resources attribute contains a list of + * resource names, by which the credentials initiator + * believes his authorizations apply. + */ + readonly attribute ResourceNameList restricted_resources; + /** + * The accepts_endorsement attribute is TRUE if these credentials + * supports and accepts CSIv2 endorsement information. + */ + readonly attribute boolean accepts_endorsement; + /** + * The accepts_quoting attribute is TRUE if these credentials + * supports and accepts CSIv2 Identity Assertion information. + */ + readonly attribute boolean accepts_quoting; + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + }; + + /** + * This type is used to identify listeners for removal. + * A Listener identity will be assigned to a listener when + * it is assigned to a particular object. + */ + typedef string ListenerId; + + /** + * This local interface is used to notify the user when the credentials + * have been relinquished. When credentials are "released" they may + * stay around until their work is finished. At that point they + * will be relinquished. Also, if the underlying transport credentials + * are released, then the SecurityLevel3 Credentials get released + * as well. This listener will get informed of this event. + */ + local interface RelinquishedCredentialsListener { + void relinquished_notify( + in CredentialsId creds_id + ); + }; + + /** + * The Credentials base interface contains the common items for + * the different types of credentials. + * @see OwnCredentials + * @see ClientCredentials + * @see TargetCredentials + */ + local interface Credentials { + + /** + * The creds_id attribute contains a system generated + * identifier with which can uniquely reference the credentials + * object. + */ + readonly attribute CredentialsId creds_id; + + /** + * The creds_type stipulates the type of credentials, i.e. + * to which type of credentials it may be narrowed, e.g., + * Own, Client, or Target. + */ + readonly attribute CredentialsType creds_type; + + /** + * The creds_usage attribute stipulates the intended usage of the + * credentials. For OwnCredentials, it will be one of + * CU_AcceptOnly, CU_Initiate, CU_InitiateAndAccept. + * For ClientCredentials and TargetCredentials it will be + * CU_None. + */ + readonly attribute CredentialsUsage creds_usage; + + /** + * The expiry_time attribute denotes the time that these + * credentials expire. + */ + readonly attribute TimeBase::UtcT expiry_time; + + /** + * The creds_state attribute contains the + * validity state of the credentials. + */ + readonly attribute CredentialsState creds_state; + + /** + * Add a listener that will get notified when the + * OwnCredentials are finally done with any pending + * work and are relinquished by the security service. + */ + ListenerId add_relinquished_listener( + in RelinquishedCredentialsListener listener + ); + + /** + * Removes a listener. This function raises a BAD_PARAM + * exception if the listener is not registered. + */ + void remove_relinquished_listener( + in ListenerId id + ); + }; + /** + * A list of credentials. + */ + typedef sequence CredentialsList; + + /** + * OwnCredentials are created as a result of Credentials acquisition + * from the CredentialsCurator's CredentialsAcquirers. + * The Credentials have an initiator and an acceptor based + * upon its intended usage and capability. Some OwnCredentials + * that were acquired solely for initiating contexts (i.e. client side) + * will not have an acceptor, and visa versa. + */ + local interface OwnCredentials : Credentials { + + /** + * The creds_initiator attribute contains a reference to the + * local credentials initiator associated with these credentials. + * It is null if the creds_usage is AcceptOnly. + */ + readonly attribute CredsInitiator creds_initiator; + + /** + * The creds_acceptor attribute contains a reference to the + * local credentials acceptor associated with these credentials. + * It is null if the creds_usage is InitiateOnly. + */ + readonly attribute CredsAcceptor creds_acceptor; + + /** + * The release_credentials operation disables the credentials + * from further initiating and/or accepting contexts. + * Formal destruction of the Credentials object is delayed until + * its pending work is done, at which time it becomes Invalid. + */ + void release_credentials (); + }; + + /** + * A list of OwnCredentials + */ + typedef sequence OwnCredentialsList; + + /** + * An object of this interface represents the security context for + * a CSIv2 based remote client. It is created as the result of accepting + * a security context for the remote client. + * This object is only available during the servicing of a CORBA request. + * It can be retrieved from the + * SecurityLevel3::SecurityCurrent object, + * as it is thread based. + *

+ * This object contains only the information used from the + * OwnCredentials that was pertinent in establishing the + * context. There is a pointer back to that OwnCredentials + * object. Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface ClientCredentials : Credentials { + + /** + * The context_id attribute contains a system generated unique identifier + * for the context, + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service can deduce is the client from the + * information and mechanisms used. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the statements that + * delivered from CSIv2 protocol along with any from the associated + * OwnCredentials that are used to deduce the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains the names of the + * resources that the security service deduces from the CSIv2 + * information and information from the associated OwnCredentials. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service believes is representative of the + * clients version of the target's principal. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements that + * support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of resources + * on which the target is restricted. This information may come + * from the OwnCredentials. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * This attribute refers to the OwnCredentials that were used in + * establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * This attribute is TRUE if the target has + * authenticated the client, either over the transport, or at + * the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * This attribute is TRUE if the target believes that + * the client has authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * This attribute is TRUE if the context is providing + * confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * This attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + }; + + /** + * The TargetCredentials object is created as the result of accepting a + * security context for a target. It represents that context. + * It contains only the information used from the OwnCredentials + * that was pertinent in establishing the context. + * There is a pointer back to that OwnCredentials object. + * Once this context is created, its attributes are guaranteed + * not to change. + */ + local interface TargetCredentials : Credentials { + + /** + * The context_id attribute contains a system generated + * unique identifier for the context. + */ + readonly attribute ContextId context_id; + + /** + * The client_principal attribute contains the principal that + * the security service believe is the target's + * ClientCredentials client_principal attribute. + */ + readonly attribute Principal client_principal; + + /** + * The client_supporting_statements attribute contains the + * statements that support the deduction of the client principal. + */ + readonly attribute StatementList client_supporting_statements; + + /** + * The client_restricted_resources attribute contains names of + * resources on which the client believes the client is restricted. + * This information may be derived from newly acquired endorsement + * information. + */ + readonly attribute ResourceNameList client_restricted_resources; + + /** + * The target_principal attribute contains the exact principal that + * the security service deduces to be the target. + */ + readonly attribute Principal target_principal; + + /** + * The target_supporting_statements attribute contains the statements + * that support the deduction of the target principal. + */ + readonly attribute StatementList target_supporting_statements; + + /** + * The target_restricted_resources attribute contains names of + * resources on which the target is restricted. This information + * may not be available. + */ + readonly attribute ResourceNameList target_restricted_resources; + + /** + * The parent_credentials attribute refers to the OwnCredentials + * that were used in establishing the security context. + */ + readonly attribute OwnCredentials parent_credentials; + + /** + * The client_authentication attribute is TRUE if the client + * believes that the target has authenticated the client, either + * over the transport, or at the CSIv2 Client Authentication layer. + */ + readonly attribute boolean client_authentication; + + /** + * The target_authentication attribute is TRUE if the client has + * authenticated the target over the transport. + */ + readonly attribute boolean target_authentication; + + /** + * The confidentiality attribute is TRUE if the context is + * providing confidentiality protection. + */ + readonly attribute boolean confidentiality; + + /** + * The integrity attribute is TRUE if the context is providing + * integrity protection. + */ + readonly attribute boolean integrity; + + /** + * The target_embodied attribute is TRUE if the security service + * believes that the target is embodied to impersonate the client + * side principal. + */ + readonly attribute boolean target_embodied; + + /** + * The target_endorsed attribute is TRUE if the security service + * believes that the target is endorsed to act on behalf of the + * client side principal. + */ + readonly attribute boolean target_endorsed; + + /** + * The release operation indicates to the CSIv2 protocol, that if + * state is being retained for these credentials, they + * will be discarded with the pending next request that + * may have not yet gone out. + *

+ * Any objects references that are binded to these + * credentials after you release them will become unusable. + * + * This operation is experimental. + */ + void release(); + }; + + + //-------------------------------------------------------------------- + // Security Invocation Policy + // + //-------------------------------------------------------------------- + + /** + * The ContextEstablishmentPolicy policy object directs the + * establishment of security contexts with a target. + *

+ * The CredsDirective usage is the following: + *

+ *
+ * CD_Default + *
+ * This directive means to use the default set + * up by the thread, the ORB, the ORB configuration, + * available credentials, or other policies. + *
+ * CD_InvokeTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. Do not endorse or embody the target. + * Credentials may be IT_Simple, IT_Quoting, or IT_Proxy. + *
+ * CD_EndorseTarget + *
+ * This directive means to use the + * the specified OwnCredentials to create a + * secure association with the target + * before invocation. + * The credentials must be + * IT_Simple, IT_Quoting, or IT_Proxy own credentials + * that supports endorsement. + * Note, a Initiator Credentials that is a IT_Proxy + * may have an endorsement statement that not only + * endorses this immediate client, but may very well + * apply to the next target. + *
+ * CD_EmbodyTarget + *
+ * If possible give the target the ability to + * impersonate the client, is performed using + * transports that can forward their credentials + * in the transport that give the ability to the + * target to work in their own behalf. Alternatively, + * the authenticator may be able to be passed on. + * IT_Simple credentials must have or have the + * ability to forward credentials. This is analogous + * to flipping the DELEGATE bit on GSS-Kerberos Forwardable + * credentials. IT_Quoting principals means + * that you can forward the transport credentials, + * authenticator plus the Quoting statement. + * IT_Proxy principals means that you can forward + * the transport credentials, authenticator, + * and associated proxy statements. + *
+ *

+ * On using Own Credentials. The creds_ids name Own Credentials. + * Also, they restrict the invocation to use only certain credentials. + * If the cred_ids list is empty, then the own credentials for the + * invocation are selected from a default, which may be + * set on the thread or the ORB instance. + */ + local interface ContextEstablishmentPolicy : CORBA::Policy { + + readonly attribute CredsDirective creds_directive; + readonly attribute OwnCredentialsList creds_list; + readonly attribute FeatureDirective use_client_auth; + readonly attribute FeatureDirective use_target_auth; + readonly attribute FeatureDirective use_confidentiality; + readonly attribute FeatureDirective use_integrity; + }; + + /** + * Type to be passed to ContextEstablishmentPolicy PolicyFactory + * through an Any. + */ + struct ContextEstablishmentPolicyArgument + { + CredsDirective creds_directive; + OwnCredentialsList creds_list; + FeatureDirective use_client_auth; + FeatureDirective use_target_auth; + FeatureDirective use_confidentiality; + FeatureDirective use_integrity; + }; + + /** + * The ContextEstablishmentPolicyType constant is + * holds value used to denote the ContextEstablishmentPolicy. + */ + const CORBA::PolicyType ContextEstablishmentPolicyType = ADIRON_VMCID | 1001; + + + /** + * The ObjectCredentialsPolicy object is placed on the policy list + * of a POA to indicate the own credentials + * that govern the accepting contexts for objects underneath + * that POA. The credentials listed here, only if they have Accepting + * capability, are used to created security components in the + * IOR of the object's reference when created. + */ + local interface ObjectCredentialsPolicy : CORBA::Policy { + readonly attribute OwnCredentialsList creds_list; + }; + + /** + * Type to be passed to ObjectCredentialsPolicy PolicyFactory + * through an Any. + */ + typedef OwnCredentialsList ObjectCredentialsPolicyArgument; + + /** + * The ObjectCredentialsPolicyType constant is + * holds value used to denote the ObjectCredentialsPolicy. + */ + const CORBA::PolicyType ObjectCredentialsPolicyType = ADIRON_VMCID | 1002; + + + //-------------------------------------------------------------------- + // Security Level 3 Credentials Acquisition Mechanism + // + //-------------------------------------------------------------------- + + /** + * Credentials are acquired by a Credentials Acquirer by some + * acquisition mechanism specified in the Credentials Curator. + * Acquisition methods are available on the curator. The + * specifics of arguments needed and the acquisition process + * are defined by the method itself. + */ + typedef string AcquisitionMethod; + typedef sequence AcquisitionMethodList; + + /** + * An acquisition of credentials may quite possibly fail as well + * as be a multistep process. A status defines the current + * state of an acquisition. + */ + typedef long AcquisitionStatus; + /** Acquisition has failed. */ + const AcquisitionStatus AQST_Failed = -2; + /** Acquisition has expired. */ + const AcquisitionStatus AQST_Expired = -1; + /** Acquisition is initialized. */ + const AcquisitionStatus AQST_Initialized = 0; + /** Acquisition needs more processing. */ + const AcquisitionStatus AQST_Continued = 1; + /** Acquisition has succeeded. */ + const AcquisitionStatus AQST_Succeeded = 2; + + /** + * The CredentialsAcquirer object is created by the Credentials + * Curator based on the selected method and initial acquisition + * arguments. When this acquisition is complete and successful, + * the created credentials can be retrieved using the get_credentials + * operation. Once get_credentials is called, this object is destroyed. + */ + local interface CredentialsAcquirer { + + /** + * This attribute contains the acquisition method + * identifier naming the method by which these credentials + * are being acquired. + */ + readonly attribute AcquisitionMethod acquisition_method; + + /** + * This attribute contains the current acquisition + * status of the acquisition process. + */ + readonly attribute AcquisitionStatus current_status; + + /** + * If the acquisition process is a multistep process through calls + * to this acquirer, then this attribute contains the current + * iteration. + */ + readonly attribute unsigned long nth_iteration; + + /** + * If the current_status attribute contains + * the AQST_Continued value, + * this operation returns, if necessary and supported + * by the acquisition method, any data that may direct the + * acquisition. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Continued value, + * a BAD_INV_ORDER exception will be raised. + */ + any get_continuation_data(); + + /** + * This operation continues the acquisition. The argument + * data is dependent on the acquisition method. + */ + AcquisitionStatus continue_acquisition( + in any acquisition_arguments + ); + + /** + * Once the current_status attribute has the + * AQST_Succeeded value, a call to this operation + * is used to retrieve the acquired OwnCredentials + * and, optionally, place the credentials on the curator's default own + * credentials list (for use with default ContextEstablishmentPolicy + * and ObjectCredentialsPolicy). + *

+ * The CredentialsAcquirer object is destroyed after + * this call. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + *

+ * If this operation in invoked when the current_status + * attribute does not have the AQST_Succeeded value, + * a BAD_INV_ORDER exception will be raised. + * + * @param on_list TRUE if these credentials go on the + * default own credentials list of the + * CredentialsCurator. + */ + OwnCredentials get_credentials( + in boolean on_list + ); + + /** + * This operation is used to destroy the + * CredentialsAcquirer object before + * get_credentials is called. + * Any operation called on a destroyed CredentialsAcquirer + * raises a BAD_INV_ORDER exception. + */ + void destroy(); + }; + + /** + * The CredentialsCurator object is a single object per an ORB + * instance's Security Service. It has the ability to create + * CredentialsAcquirers and keeps a list of active default + * credentials. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     * 
+ * Or it may be retrieved from the SecurityManager's + * credentials_curator attribute. + *

+ * The following pseudo code describes the process of credentials + * acquisition using CredentialsCurator. + *

+     * // Resolve the Credentials Curator
+     * CredentialsCurator curator = ....
+     *     resolve_initial_references("SecurityLevel3:CredentialsCurator");
+     *
+     * // Build up an acquisition argument (e.g., using SL3CSI::CSIArgBuilder)
+     * Any arg = ...
+     *
+     * // Acquire credentials and get a Credentials Acquirer
+     * CredentialsAcquirer acquirer =
+     *     curator.acquire_credentials("SL3CSIAQArgs",arg);
+     *
+     * // Get credentials and destroy the Credentials Acquirer
+     * OwnCredentials own = acquirer.get_credentials(false);
+     * 
+ */ + local interface CredentialsCurator { + + /** + * This attribute contains a list of + * acquisition methods that are supported. Method identifiers + * are defined in modules that signify their support. + * + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + readonly attribute SecurityLevel3::AcquisitionMethodList + supported_methods; + + /** + * This operation starts the process of credentials acquisition and + * create a CredentialsAcquirer for a particular + * acquisition method. It takes an initial set of arguments for + * the acquisition. The content of the arguments are based on the + * acquisiton method. Depending on the method, it is possible that + * the credentials may be immediately available from a call to + * get_credentials on the returned + * CredentialsAcquirer. + *

+ * If the process of credentials acquisition is not completed upon + * the return of the acquire_credentials operation, + * the returned CredentialsAcquirer object shall have + * its current_status at AQST_Continued. + * In this case, the get_continuation_data and + * continue_acquisition operations shall be used to + * complete the credentials acquisition process. + *

+ * If the process of credentials acquisition fails, it is up to the + * implementation to either throw a system exception or return a + * CredentialsAcquirer with the AQST_Failed + * status. + *

+ * The acquisition_arguments parameter is a CORBA + * any that is constructed according to the acquisition + * method used. The ArgumentFactory from the + * SL3AQArgs module is a local object that helps + * immensely with the construction of this complex argument. + * Extensions of that object are defined in their own separate + * modules that pertain to the particular acquisition mechanism, + * such as the SL3CSI, SL3TLS, SL3TCPIP, SL3KRB5 modules. + * + * @param acquisition_method + * The identifier of the desired acquisition method. + * A CORBA BAD_PARAM exception will be raised + * if the named method is not supported. + * @param acquisition_arguments + * The argument of the desired acquisition method. + * This CORBA any type is constructed according + * to the particular acquisition method. + * + * @see "SL3AQArgs" + * @see "SL3CSI" + * @see "SL3TLS" + * @see "SL3TCPIP" + * @see "SL3KRB5" + */ + CredentialsAcquirer acquire_credentials( + in SecurityLevel3::AcquisitionMethod acquisition_method, + in any acquisition_arguments + ); + + /** + * The Curator's Default Own Credentials list. + */ + readonly attribute OwnCredentialsList default_creds_list; + + /** + * The Curator's ids of the credentials on the default list. + */ + readonly attribute CredentialsIdList default_creds_ids; + + /** + * This operation retrieves Own Credentials by identifier. + * It is not required that the identifier name a credentials + * on the default_credentials_list. The Curator keeps track + * of all OwnCredentials it creates, until they are explicitly + * released. + */ + OwnCredentials get_own_credentials( + in CredentialsId credentials_id + ); + + /** + * This operation releases credentials from the default_creds_list, + * if there, and also disables the credentials from further use, + * provided that all their pending work is done. + */ + void release_own_credentials ( + in CredentialsId credentials_id + ); + + }; + + //-------------------------------------------------------------------- + // Security Service ORB Objects + // Retrieved from the ORB by "resolve_initial_references". + // + //-------------------------------------------------------------------- + + /** + * The SecurityManager object represents the Security Level 3 + * Security Service. There is one object of this type per ORB + * instance. It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityManager");
+     * 
+ */ + local interface SecurityManager { + + /** + * The credentials_curator attribute contains the reference + * to the SecurityLevel3 Credentials Curator. There is only + * one instance per ORB. + */ + readonly attribute CredentialsCurator credentials_curator; + + /** + * The get_target_credentials operation retrieves the + * TargetCredentials that represents a CSIv2 security association + * with a Target. This operation causes communication with + * the target in order to establish a security context. + */ + TargetCredentials get_target_credentials( + in Object the_object + ); + + /** + * The create_context_estab_policy operation is a policy factory + * operation that creates the Security Level 3 + * ContextEstablishmentPolicy object. This policy is placed on + * the policy override lists of object references to direct + * the security characteristics when communicating through + * that object reference. + *

+ * If this policy is not put on an object reference, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the object references policy list, + * then the default credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ContextEstablishmentPolicy create_context_estab_policy( + in CredsDirective creds_directive, + in OwnCredentialsList creds_list, + in FeatureDirective use_client_auth, + in FeatureDirective use_target_auth, + in FeatureDirective use_confidentiality, + in FeatureDirective use_integrity + ); + + /** + * The create_object_creds_policy is a policy factory operation + * that creates the ObjectCredentialsPolicy object. This policy + * is solely for use with policies place on POAs with "POA.create_POA". + * It restricts the POAs use of credentials. If this policy is + * not put on a POA, and the + * + * TransportSecurity::ObjectCredentialsPolicy + * is also not on the POA policy list, then the default + * credentials lists from the + * + * SecurityLevel3::CredentialsCurator + * and + * + * TransportSecurity::CredentialsCurator + * are used. + */ + ObjectCredentialsPolicy create_object_creds_policy( + in OwnCredentialsList creds_list + ); + }; + + /** + * The SecurityCurrent object references thread specific + * data pertaining to the security service. It is used to retrieve + * the client's credentials during an invocation on the server side. + *

+ * There is only one instance of this object per ORB instance. + * It is resolved by a call to + *

+     *   ORB.resolve_initial_references("SecurityLevel3:SecurityCurrent");
+     * 
+ */ + local interface SecurityCurrent { + + /** + * From inside the execution of a target object implementation, + * this attribute contains the representation of the remote client's + * credentials. This attribute is null if the client is not CSIv2 + * based, or the client is from a collocated call. + *

+ * The value of this attribute, if not null, represents the + * security context with a remote CSIv2 client. + * If the request_is_local attribute is FALSE, + * the current thread of execution is directly servicing a remote + * request for the target object within the target's implemenation. + * If the request_is_local attribute is TRUE, + * the current thread of execution is servicing an ORB mediated call + * on a collocated object. + *

+ * If the client is not CSIv2 based, there are no CSIv2 Client + * Credentials, and this attribute is null. In this case, + * the user should try the + * + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBase.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBase.class new file mode 100644 index 0000000..8f0dde5 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBase.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHelper.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHelper.class new file mode 100644 index 0000000..c983b79 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHelper.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHolder.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHolder.class new file mode 100644 index 0000000..d04dacf Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseHolder.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseOperations.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseOperations.class new file mode 100644 index 0000000..8b7d4fe Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBaseOperations.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOA.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOA.class new file mode 100644 index 0000000..31dff50 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOA.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOATie.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOATie.class new file mode 100644 index 0000000..263a09d Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePOATie.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLHelper.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLHelper.class new file mode 100644 index 0000000..6ec82e9 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLHelper.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.class new file mode 100644 index 0000000..2a7ac5f Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHolder.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHolder.class new file mode 100644 index 0000000..55f11a1 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/URLSeqHolder.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.class new file mode 100644 index 0000000..43a63f4 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHelper.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHolder.class b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHolder.class new file mode 100644 index 0000000..e25983e Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/CodeBasePackage/ValueDescSeqHolder.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTime.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTime.class new file mode 100644 index 0000000..fad9943 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTime.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHelper.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHelper.class new file mode 100644 index 0000000..70e6125 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHelper.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHolder.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHolder.class new file mode 100644 index 0000000..da426ee Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeHolder.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTimeOperations.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeOperations.class new file mode 100644 index 0000000..a395a4d Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTimeOperations.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOA.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOA.class new file mode 100644 index 0000000..902216d Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOA.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOATie.class b/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOATie.class new file mode 100644 index 0000000..f55da55 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/RunTimePOATie.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/_CodeBaseStub.class b/idl/SendingContext/.class/org/omg/SendingContext/_CodeBaseStub.class new file mode 100644 index 0000000..8a5b185 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/_CodeBaseStub.class differ diff --git a/idl/SendingContext/.class/org/omg/SendingContext/_RunTimeStub.class b/idl/SendingContext/.class/org/omg/SendingContext/_RunTimeStub.class new file mode 100644 index 0000000..76caf32 Binary files /dev/null and b/idl/SendingContext/.class/org/omg/SendingContext/_RunTimeStub.class differ diff --git a/idl/SendingContext/.cvsignore b/idl/SendingContext/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/SendingContext/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBase.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBase.java new file mode 100644 index 0000000..8c6f6b8 --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBase.java @@ -0,0 +1,16 @@ +// +// CodeBase.java (interface) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +public interface CodeBase + extends CodeBaseOperations, + org.omg.SendingContext.RunTime, + org.omg.CORBA.Object, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHelper.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHelper.java new file mode 100644 index 0000000..12090c2 --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHelper.java @@ -0,0 +1,76 @@ +// +// CodeBaseHelper.java (helper) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +abstract public class CodeBaseHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "CodeBase"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/SendingContext/CodeBase:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, CodeBase value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static CodeBase extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + CodeBase value = narrow(obj); + return value; + }; + + public static CodeBase read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, CodeBase val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static CodeBase narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static CodeBase unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static CodeBase narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof CodeBase) { + return (CodeBase)obj; + } + if (is_a || obj._is_a(id())) { + _CodeBaseStub result = (_CodeBaseStub)new _CodeBaseStub(); + ((org.omg.CORBA.portable.ObjectImpl) result)._set_delegate + (((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate()); + return (CodeBase)result; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHolder.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHolder.java new file mode 100644 index 0000000..48e0aed --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseHolder.java @@ -0,0 +1,33 @@ +// +// CodeBaseHolder.java (holder) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +final public class CodeBaseHolder + implements org.omg.CORBA.portable.Streamable { + + public CodeBase value; + public CodeBaseHolder() { + } + + public CodeBaseHolder(CodeBase initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.SendingContext.CodeBaseHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.SendingContext.CodeBaseHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.SendingContext.CodeBaseHelper.type(); + }; + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseOperations.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseOperations.java new file mode 100644 index 0000000..0ecdafc --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBaseOperations.java @@ -0,0 +1,26 @@ +// +// CodeBase.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +public interface CodeBaseOperations + extends org.omg.SendingContext.RunTimeOperations { + + org.omg.CORBA.Repository get_ir(); + + java.lang.String implementation(java.lang.String x); + + java.lang.String[] implementations(java.lang.String[] x); + + org.omg.CORBA.ValueDefPackage.FullValueDescription meta(java.lang.String x); + + org.omg.CORBA.ValueDefPackage.FullValueDescription[] metas(java.lang.String[] x); + + java.lang.String[] bases(java.lang.String x); + + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOA.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOA.java new file mode 100644 index 0000000..03aece7 --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOA.java @@ -0,0 +1,129 @@ +// +// CodeBasePOA.java (skeleton) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +abstract public class CodeBasePOA + extends org.omg.PortableServer.DynamicImplementation + implements CodeBaseOperations { + + public CodeBase _this() { + return CodeBaseHelper.narrow(super._this_object()); + }; + + public CodeBase _this(org.omg.CORBA.ORB orb) { + return CodeBaseHelper.narrow(super._this_object(orb)); + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/SendingContext/CodeBase:1.0", + "IDL:omg.org/SendingContext/RunTime:1.0" + }; + + private static java.util.Dictionary _methods = new java.util.Hashtable(); + static { + _methods.put("get_ir", new Integer(0)); + _methods.put("implementation", new Integer(1)); + _methods.put("implementations", new Integer(2)); + _methods.put("meta", new Integer(3)); + _methods.put("metas", new Integer(4)); + _methods.put("bases", new Integer(5)); + } + + public void invoke(org.omg.CORBA.ServerRequest _request) { + java.lang.Object _method = _methods.get(_request.operation()); + if (_method == null) { + throw new org.omg.CORBA.BAD_OPERATION(_request.operation()); + } + int _method_id = ((java.lang.Integer)_method).intValue(); + switch(_method_id) { + case 0: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.Repository _result = this.get_ir(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.RepositoryHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 1: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $x = _orb().create_any(); + $x.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("x", $x, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String x; + x = $x.extract_string(); + java.lang.String _result = this.implementation(x); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_string(_result); + _request.set_result(_resultAny); + return; + } + case 2: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $x = _orb().create_any(); + $x.type(org.omg.CORBA.RepositoryIdSeqHelper.type()); + _params.add_value("x", $x, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String[] x; + x = org.omg.CORBA.RepositoryIdSeqHelper.extract($x); + java.lang.String[] _result = this.implementations(x); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.SendingContext.CodeBasePackage.URLSeqHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 3: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $x = _orb().create_any(); + $x.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("x", $x, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String x; + x = $x.extract_string(); + org.omg.CORBA.ValueDefPackage.FullValueDescription _result = this.meta(x); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.ValueDefPackage.FullValueDescriptionHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 4: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $x = _orb().create_any(); + $x.type(org.omg.CORBA.RepositoryIdSeqHelper.type()); + _params.add_value("x", $x, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String[] x; + x = org.omg.CORBA.RepositoryIdSeqHelper.extract($x); + org.omg.CORBA.ValueDefPackage.FullValueDescription[] _result = this.metas(x); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.SendingContext.CodeBasePackage.ValueDescSeqHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 5: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $x = _orb().create_any(); + $x.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("x", $x, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String x; + x = $x.extract_string(); + java.lang.String[] _result = this.bases(x); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.RepositoryIdSeqHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + } + } +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOATie.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOATie.java new file mode 100644 index 0000000..617ad5b --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePOATie.java @@ -0,0 +1,68 @@ +// +// CodeBasePOATie.java (tie) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext; + +public class CodeBasePOATie + extends CodeBasePOA + implements CodeBaseOperations { + + private CodeBaseOperations _delegate; + public CodeBasePOATie(CodeBaseOperations delegate) { + this._delegate = delegate; + }; + + public CodeBaseOperations _delegate() { + return this._delegate; + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/SendingContext/CodeBase:1.0", + "IDL:omg.org/SendingContext/RunTime:1.0" }; + + public org.omg.CORBA.Repository get_ir() { + return this._delegate.get_ir( + ); + }; + + public java.lang.String implementation(java.lang.String x) { + return this._delegate.implementation( + x + ); + }; + + public java.lang.String[] implementations(java.lang.String[] x) { + return this._delegate.implementations( + x + ); + }; + + public org.omg.CORBA.ValueDefPackage.FullValueDescription meta(java.lang.String x) { + return this._delegate.meta( + x + ); + }; + + public org.omg.CORBA.ValueDefPackage.FullValueDescription[] metas(java.lang.String[] x) { + return this._delegate.metas( + x + ); + }; + + public java.lang.String[] bases(java.lang.String x) { + return this._delegate.bases( + x + ); + }; + + + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLHelper.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLHelper.java new file mode 100644 index 0000000..ae2e91a --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLHelper.java @@ -0,0 +1,57 @@ +// +// URLHelper.java (helper) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext.CodeBasePackage; + +abstract public class URLHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, java.lang.String value) { + any.insert_Streamable(new org.omg.CORBA.StringHolder(value)); + }; + + public static java.lang.String extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.StringHolder){ + return ((org.omg.CORBA.StringHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string); + _type = _orb().create_alias_tc(id(), "URL", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/SendingContext/CodeBase/URL:1.0"; + }; + + public static java.lang.String read(org.omg.CORBA.portable.InputStream is) { + java.lang.String result; + result = is.read_string(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, java.lang.String val) { + os.write_string(val); + }; + +} diff --git a/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java new file mode 100644 index 0000000..8c5709a --- /dev/null +++ b/idl/SendingContext/.java/org/omg/SendingContext/CodeBasePackage/URLSeqHelper.java @@ -0,0 +1,64 @@ +// +// URLSeqHelper.java (helper) +// +// File generated: Thu May 19 07:31:40 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.SendingContext.CodeBasePackage; + +abstract public class URLSeqHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, java.lang.String[] value) { + any.insert_Streamable(new URLSeqHolder(value)); + }; + + public static java.lang.String[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof URLSeqHolder){ + return ((URLSeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.SendingContext.CodeBasePackage.URLHelper.type()); + _type = _orb().create_alias_tc(id(), "URLSeq", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/SendingContext/CodeBase/URLSeq:1.0"; + }; + + public static java.lang.String[] read(org.omg.CORBA.portable.InputStream is) { + java.lang.String[] result; + int length0 = is.read_ulong(); + result = new java.lang.String[length0]; + for (int i0=0; i0 + +#pragma prefix "omg.org" + +module SendingContext { + + interface RunTime {}; + + interface CodeBase: RunTime { + + typedef string URL; // blank-separated list of one or more URLs + typedef sequence URLSeq; + typedef sequence < CORBA::ValueDef::FullValueDescription > ValueDescSeq; + + // Operation to obtain the IR from the sending context + CORBA::Repository get_ir(); + + // Operations to obtain a location of the implementation code + URL implementation(in CORBA::RepositoryId x); + + URLSeq implementations(in CORBA::RepositoryIdSeq x); + + // Operations to obtain complete meta information about a Value + // This is just a performance optimization the IR can provide + // the same information + CORBA::ValueDef::FullValueDescription meta(in CORBA::RepositoryId x); + + ValueDescSeq metas(in CORBA::RepositoryIdSeq x); + + // To obtain a type graph for a value type + // same comment as before the IR can provide similar + // information + CORBA::RepositoryIdSeq bases(in CORBA::RepositoryId x); + }; +}; \ No newline at end of file diff --git a/idl/SendingContext/.svn/text-base/build.xml.svn-base b/idl/SendingContext/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..1230a4c --- /dev/null +++ b/idl/SendingContext/.svn/text-base/build.xml.svn-base @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/SendingContext/SendingContext.idl b/idl/SendingContext/SendingContext.idl new file mode 100644 index 0000000..a3d9170 --- /dev/null +++ b/idl/SendingContext/SendingContext.idl @@ -0,0 +1,35 @@ +#include + +#pragma prefix "omg.org" + +module SendingContext { + + interface RunTime {}; + + interface CodeBase: RunTime { + + typedef string URL; // blank-separated list of one or more URLs + typedef sequence URLSeq; + typedef sequence < CORBA::ValueDef::FullValueDescription > ValueDescSeq; + + // Operation to obtain the IR from the sending context + CORBA::Repository get_ir(); + + // Operations to obtain a location of the implementation code + URL implementation(in CORBA::RepositoryId x); + + URLSeq implementations(in CORBA::RepositoryIdSeq x); + + // Operations to obtain complete meta information about a Value + // This is just a performance optimization the IR can provide + // the same information + CORBA::ValueDef::FullValueDescription meta(in CORBA::RepositoryId x); + + ValueDescSeq metas(in CORBA::RepositoryIdSeq x); + + // To obtain a type graph for a value type + // same comment as before the IR can provide similar + // information + CORBA::RepositoryIdSeq bases(in CORBA::RepositoryId x); + }; +}; \ No newline at end of file diff --git a/idl/SendingContext/build.xml b/idl/SendingContext/build.xml new file mode 100644 index 0000000..5d8ee69 --- /dev/null +++ b/idl/SendingContext/build.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/TimeBase/.class/org/omg/TimeBase/InaccuracyTHelper.class b/idl/TimeBase/.class/org/omg/TimeBase/InaccuracyTHelper.class new file mode 100644 index 0000000..c6887bc Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/InaccuracyTHelper.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/IntervalT.class b/idl/TimeBase/.class/org/omg/TimeBase/IntervalT.class new file mode 100644 index 0000000..8097fe1 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/IntervalT.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHelper.class b/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHelper.class new file mode 100644 index 0000000..aa5650e Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHelper.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHolder.class b/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHolder.class new file mode 100644 index 0000000..b929e16 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/IntervalTHolder.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/TdfTHelper.class b/idl/TimeBase/.class/org/omg/TimeBase/TdfTHelper.class new file mode 100644 index 0000000..7a99e7e Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/TdfTHelper.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/TimeTHelper.class b/idl/TimeBase/.class/org/omg/TimeBase/TimeTHelper.class new file mode 100644 index 0000000..9d279e7 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/TimeTHelper.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/UtcT.class b/idl/TimeBase/.class/org/omg/TimeBase/UtcT.class new file mode 100644 index 0000000..b19add3 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/UtcT.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/UtcTHelper.class b/idl/TimeBase/.class/org/omg/TimeBase/UtcTHelper.class new file mode 100644 index 0000000..9f8cf00 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/UtcTHelper.class differ diff --git a/idl/TimeBase/.class/org/omg/TimeBase/UtcTHolder.class b/idl/TimeBase/.class/org/omg/TimeBase/UtcTHolder.class new file mode 100644 index 0000000..4910c88 Binary files /dev/null and b/idl/TimeBase/.class/org/omg/TimeBase/UtcTHolder.class differ diff --git a/idl/TimeBase/.cvsignore b/idl/TimeBase/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/TimeBase/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/TimeBase/.java/org/omg/TimeBase/InaccuracyTHelper.java b/idl/TimeBase/.java/org/omg/TimeBase/InaccuracyTHelper.java new file mode 100644 index 0000000..2fe8582 --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/InaccuracyTHelper.java @@ -0,0 +1,57 @@ +// +// InaccuracyTHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +abstract public class InaccuracyTHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, long value) { + any.insert_Streamable(new org.omg.CORBA.LongHolder(value)); + }; + + public static long extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.LongHolder){ + return ((org.omg.CORBA.LongHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong); + _type = _orb().create_alias_tc(id(), "InaccuracyT", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/TimeBase/InaccuracyT:1.0"; + }; + + public static long read(org.omg.CORBA.portable.InputStream is) { + long result; + result = is.read_ulonglong(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, long val) { + os.write_ulonglong(val); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/IntervalT.java b/idl/TimeBase/.java/org/omg/TimeBase/IntervalT.java new file mode 100644 index 0000000..e3ab174 --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/IntervalT.java @@ -0,0 +1,24 @@ +// +// IntervalT.java (struct) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +public class IntervalT + implements org.omg.CORBA.portable.IDLEntity { + + public long lower_bound; + public long upper_bound; + + public IntervalT() { + } + + public IntervalT(long lower_bound, long upper_bound) { + this.lower_bound = lower_bound; + this.upper_bound = upper_bound; + } + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHelper.java b/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHelper.java new file mode 100644 index 0000000..d53061b --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHelper.java @@ -0,0 +1,61 @@ +// +// IntervalTHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +abstract public class IntervalTHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, IntervalT value) { + any.insert_Streamable(new IntervalTHolder(value)); + }; + + public static IntervalT extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof IntervalTHolder){ + return ((IntervalTHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; + members[0] = new org.omg.CORBA.StructMember("lower_bound", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong), null); + members[1] = new org.omg.CORBA.StructMember("upper_bound", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong), null); + _type = _orb().create_struct_tc(id(), "IntervalT", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/TimeBase/IntervalT:1.0"; + }; + + public static IntervalT read(org.omg.CORBA.portable.InputStream is) { + IntervalT result = new IntervalT(); + result.lower_bound = is.read_ulonglong(); + result.upper_bound = is.read_ulonglong(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, IntervalT val) { + os.write_ulonglong(val.lower_bound); + os.write_ulonglong(val.upper_bound); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHolder.java b/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHolder.java new file mode 100644 index 0000000..3c95aec --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/IntervalTHolder.java @@ -0,0 +1,33 @@ +// +// IntervalTHolder.java (holder) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +final public class IntervalTHolder + implements org.omg.CORBA.portable.Streamable { + + public IntervalT value; + public IntervalTHolder() { + } + + public IntervalTHolder(IntervalT initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.TimeBase.IntervalTHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.TimeBase.IntervalTHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.TimeBase.IntervalTHelper.type(); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/TdfTHelper.java b/idl/TimeBase/.java/org/omg/TimeBase/TdfTHelper.java new file mode 100644 index 0000000..3ac3ce0 --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/TdfTHelper.java @@ -0,0 +1,57 @@ +// +// TdfTHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +abstract public class TdfTHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, short value) { + any.insert_Streamable(new org.omg.CORBA.ShortHolder(value)); + }; + + public static short extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.ShortHolder){ + return ((org.omg.CORBA.ShortHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_short); + _type = _orb().create_alias_tc(id(), "TdfT", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/TimeBase/TdfT:1.0"; + }; + + public static short read(org.omg.CORBA.portable.InputStream is) { + short result; + result = is.read_short(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, short val) { + os.write_short(val); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/TimeTHelper.java b/idl/TimeBase/.java/org/omg/TimeBase/TimeTHelper.java new file mode 100644 index 0000000..062129d --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/TimeTHelper.java @@ -0,0 +1,57 @@ +// +// TimeTHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +abstract public class TimeTHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, long value) { + any.insert_Streamable(new org.omg.CORBA.LongHolder(value)); + }; + + public static long extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof org.omg.CORBA.LongHolder){ + return ((org.omg.CORBA.LongHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong); + _type = _orb().create_alias_tc(id(), "TimeT", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/TimeBase/TimeT:1.0"; + }; + + public static long read(org.omg.CORBA.portable.InputStream is) { + long result; + result = is.read_ulonglong(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, long val) { + os.write_ulonglong(val); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/UtcT.java b/idl/TimeBase/.java/org/omg/TimeBase/UtcT.java new file mode 100644 index 0000000..680f26e --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/UtcT.java @@ -0,0 +1,28 @@ +// +// UtcT.java (struct) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +public class UtcT + implements org.omg.CORBA.portable.IDLEntity { + + public long time; + public int inacclo; + public short inacchi; + public short tdf; + + public UtcT() { + } + + public UtcT(long time, int inacclo, short inacchi, short tdf) { + this.time = time; + this.inacclo = inacclo; + this.inacchi = inacchi; + this.tdf = tdf; + } + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/UtcTHelper.java b/idl/TimeBase/.java/org/omg/TimeBase/UtcTHelper.java new file mode 100644 index 0000000..a272d63 --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/UtcTHelper.java @@ -0,0 +1,67 @@ +// +// UtcTHelper.java (helper) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +abstract public class UtcTHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, UtcT value) { + any.insert_Streamable(new UtcTHolder(value)); + }; + + public static UtcT extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof UtcTHolder){ + return ((UtcTHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[4]; + members[0] = new org.omg.CORBA.StructMember("time", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulonglong), null); + members[1] = new org.omg.CORBA.StructMember("inacclo", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong), null); + members[2] = new org.omg.CORBA.StructMember("inacchi", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort), null); + members[3] = new org.omg.CORBA.StructMember("tdf", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_short), null); + _type = _orb().create_struct_tc(id(), "UtcT", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/TimeBase/UtcT:1.0"; + }; + + public static UtcT read(org.omg.CORBA.portable.InputStream is) { + UtcT result = new UtcT(); + result.time = is.read_ulonglong(); + result.inacclo = is.read_ulong(); + result.inacchi = is.read_ushort(); + result.tdf = is.read_short(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, UtcT val) { + os.write_ulonglong(val.time); + os.write_ulong(val.inacclo); + os.write_ushort(val.inacchi); + os.write_short(val.tdf); + }; + +} diff --git a/idl/TimeBase/.java/org/omg/TimeBase/UtcTHolder.java b/idl/TimeBase/.java/org/omg/TimeBase/UtcTHolder.java new file mode 100644 index 0000000..49779bb --- /dev/null +++ b/idl/TimeBase/.java/org/omg/TimeBase/UtcTHolder.java @@ -0,0 +1,33 @@ +// +// UtcTHolder.java (holder) +// +// File generated: Thu May 19 07:31:42 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.TimeBase; + +final public class UtcTHolder + implements org.omg.CORBA.portable.Streamable { + + public UtcT value; + public UtcTHolder() { + } + + public UtcTHolder(UtcT initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.TimeBase.UtcTHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.TimeBase.UtcTHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.TimeBase.UtcTHelper.type(); + }; + +} diff --git a/idl/TimeBase/.svn/all-wcprops b/idl/TimeBase/.svn/all-wcprops new file mode 100644 index 0000000..0a71dfc --- /dev/null +++ b/idl/TimeBase/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/TimeBase +END +TimeBase.idl +K 25 +svn:wc:ra_dav:version-url +V 73 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/TimeBase/TimeBase.idl +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 71 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/TimeBase/.cvsignore +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 70 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/TimeBase/build.xml +END diff --git a/idl/TimeBase/.svn/dir-prop-base b/idl/TimeBase/.svn/dir-prop-base new file mode 100644 index 0000000..7208e29 --- /dev/null +++ b/idl/TimeBase/.svn/dir-prop-base @@ -0,0 +1,6 @@ +K 10 +svn:ignore +V 12 +.class +.java +END diff --git a/idl/TimeBase/.svn/entries b/idl/TimeBase/.svn/entries new file mode 100644 index 0000000..037e2a7 --- /dev/null +++ b/idl/TimeBase/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/TimeBase +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TimeBase.idl +file + + + + +2009-02-16T09:48:55.000000Z +c48e1b4849544d429fac34629def8cf7 +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +911 + +.cvsignore +file + + + + +2009-02-16T09:48:55.000000Z +a81562d70b7d74bef8f9f4c7fce04811 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +13 + +build.xml +file + + + + +2009-02-16T09:48:55.000000Z +193aae71fcf06c5fbdd5d05748040472 +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2639 + diff --git a/idl/TimeBase/.svn/prop-base/.cvsignore.svn-base b/idl/TimeBase/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/TimeBase/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/TimeBase/.svn/prop-base/TimeBase.idl.svn-base b/idl/TimeBase/.svn/prop-base/TimeBase.idl.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/TimeBase/.svn/prop-base/TimeBase.idl.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/TimeBase/.svn/prop-base/build.xml.svn-base b/idl/TimeBase/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/TimeBase/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/TimeBase/.svn/text-base/.cvsignore.svn-base b/idl/TimeBase/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/TimeBase/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/TimeBase/.svn/text-base/TimeBase.idl.svn-base b/idl/TimeBase/.svn/text-base/TimeBase.idl.svn-base new file mode 100644 index 0000000..3574c0a --- /dev/null +++ b/idl/TimeBase/.svn/text-base/TimeBase.idl.svn-base @@ -0,0 +1,42 @@ +//File: TimeBase.idl +//Part of the Time Service +// Note: if your IDL compiler does not yet support the +// "long long" data type, compile this module with the +// preprocessor definition "NOLONGLONG". With many +// compilers this would be done with a qualifier on +// the command line, something like -DNOLONGLONG + +#ifndef _TIME_BASE_IDL_ +#define _TIME_BASE_IDL_ + +#pragma prefix "omg.org" + +module TimeBase { + +#ifdef NOLONGLONG + struct ulonglong{ + unsigned long low; + unsigned long high; + }; + typedef ulonglong TimeT; +#else + typedef unsigned long long TimeT; +#endif + + typedef TimeT InaccuracyT; + typedef short TdfT; + struct UtcT { + TimeT time; // 8 octets + unsigned long inacclo; // 4 octets + unsigned short inacchi; // 2 octets + TdfT tdf; // 2 octets + // total 16 octets. + }; + + struct IntervalT { + TimeT lower_bound; + TimeT upper_bound; + }; +}; +#endif /* ifndef _TIME_BASE_IDL_ */ + diff --git a/idl/TimeBase/.svn/text-base/build.xml.svn-base b/idl/TimeBase/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..abb6b26 --- /dev/null +++ b/idl/TimeBase/.svn/text-base/build.xml.svn-base @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/TimeBase/TimeBase.idl b/idl/TimeBase/TimeBase.idl new file mode 100644 index 0000000..3574c0a --- /dev/null +++ b/idl/TimeBase/TimeBase.idl @@ -0,0 +1,42 @@ +//File: TimeBase.idl +//Part of the Time Service +// Note: if your IDL compiler does not yet support the +// "long long" data type, compile this module with the +// preprocessor definition "NOLONGLONG". With many +// compilers this would be done with a qualifier on +// the command line, something like -DNOLONGLONG + +#ifndef _TIME_BASE_IDL_ +#define _TIME_BASE_IDL_ + +#pragma prefix "omg.org" + +module TimeBase { + +#ifdef NOLONGLONG + struct ulonglong{ + unsigned long low; + unsigned long high; + }; + typedef ulonglong TimeT; +#else + typedef unsigned long long TimeT; +#endif + + typedef TimeT InaccuracyT; + typedef short TdfT; + struct UtcT { + TimeT time; // 8 octets + unsigned long inacclo; // 4 octets + unsigned short inacchi; // 2 octets + TdfT tdf; // 2 octets + // total 16 octets. + }; + + struct IntervalT { + TimeT lower_bound; + TimeT upper_bound; + }; +}; +#endif /* ifndef _TIME_BASE_IDL_ */ + diff --git a/idl/TimeBase/build.xml b/idl/TimeBase/build.xml new file mode 100644 index 0000000..4b1e810 --- /dev/null +++ b/idl/TimeBase/build.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/build.xml b/idl/build.xml new file mode 100644 index 0000000..2eafdb3 --- /dev/null +++ b/idl/build.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContext.class b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContext.class new file mode 100644 index 0000000..57b9374 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContext.class differ diff --git a/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHelper.class b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHelper.class new file mode 100644 index 0000000..44a6d65 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHelper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHolder.class b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHolder.class new file mode 100644 index 0000000..3a32a91 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/BiDirIIOPServiceContextHolder.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ListenPoint.class b/idl/comm/.class/org/omg/IIOP/ListenPoint.class new file mode 100644 index 0000000..bb39e3c Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ListenPoint.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ListenPointHelper.class b/idl/comm/.class/org/omg/IIOP/ListenPointHelper.class new file mode 100644 index 0000000..5ab47aa Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ListenPointHelper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ListenPointHolder.class b/idl/comm/.class/org/omg/IIOP/ListenPointHolder.class new file mode 100644 index 0000000..874a54d Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ListenPointHolder.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ListenPointListHelper.class b/idl/comm/.class/org/omg/IIOP/ListenPointListHelper.class new file mode 100644 index 0000000..02ff56c Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ListenPointListHelper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ListenPointListHolder.class b/idl/comm/.class/org/omg/IIOP/ListenPointListHolder.class new file mode 100644 index 0000000..5816319 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ListenPointListHolder.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0.class new file mode 100644 index 0000000..d76d0aa Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Helper.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Helper.class new file mode 100644 index 0000000..09d88f6 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Helper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Holder.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Holder.class new file mode 100644 index 0000000..22274d3 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_0Holder.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1.class new file mode 100644 index 0000000..2531521 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Helper.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Helper.class new file mode 100644 index 0000000..37d0156 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Helper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Holder.class b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Holder.class new file mode 100644 index 0000000..7737612 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/ProfileBody_1_1Holder.class differ diff --git a/idl/comm/.class/org/omg/IIOP/Version.class b/idl/comm/.class/org/omg/IIOP/Version.class new file mode 100644 index 0000000..bf88513 Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/Version.class differ diff --git a/idl/comm/.class/org/omg/IIOP/VersionHelper.class b/idl/comm/.class/org/omg/IIOP/VersionHelper.class new file mode 100644 index 0000000..71958cf Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/VersionHelper.class differ diff --git a/idl/comm/.class/org/omg/IIOP/VersionHolder.class b/idl/comm/.class/org/omg/IIOP/VersionHolder.class new file mode 100644 index 0000000..9350a2f Binary files /dev/null and b/idl/comm/.class/org/omg/IIOP/VersionHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/BI_DIR_IIOP.class b/idl/comm/.class/org/omg/IOP/BI_DIR_IIOP.class new file mode 100644 index 0000000..d09e10b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/BI_DIR_IIOP.class differ diff --git a/idl/comm/.class/org/omg/IOP/ChainBypassCheck.class b/idl/comm/.class/org/omg/IOP/ChainBypassCheck.class new file mode 100644 index 0000000..1629170 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ChainBypassCheck.class differ diff --git a/idl/comm/.class/org/omg/IOP/ChainBypassInfo.class b/idl/comm/.class/org/omg/IOP/ChainBypassInfo.class new file mode 100644 index 0000000..c6decc4 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ChainBypassInfo.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodeSets.class b/idl/comm/.class/org/omg/IOP/CodeSets.class new file mode 100644 index 0000000..0f9170e Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodeSets.class differ diff --git a/idl/comm/.class/org/omg/IOP/Codec.class b/idl/comm/.class/org/omg/IOP/Codec.class new file mode 100644 index 0000000..113a772 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/Codec.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactory.class b/idl/comm/.class/org/omg/IOP/CodecFactory.class new file mode 100644 index 0000000..ab8322b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactory.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryHelper.class b/idl/comm/.class/org/omg/IOP/CodecFactoryHelper.class new file mode 100644 index 0000000..632c3cb Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryHolder.class b/idl/comm/.class/org/omg/IOP/CodecFactoryHolder.class new file mode 100644 index 0000000..d8533df Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryLocalBase.class b/idl/comm/.class/org/omg/IOP/CodecFactoryLocalBase.class new file mode 100644 index 0000000..b790653 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryLocalBase.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryLocalTie.class b/idl/comm/.class/org/omg/IOP/CodecFactoryLocalTie.class new file mode 100644 index 0000000..95201ff Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryLocalTie.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryOperations.class b/idl/comm/.class/org/omg/IOP/CodecFactoryOperations.class new file mode 100644 index 0000000..a0397fb Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryOperations.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class new file mode 100644 index 0000000..8c87080 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncoding.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class new file mode 100644 index 0000000..d5a359b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.class b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.class new file mode 100644 index 0000000..23bc086 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecFactoryPackage/UnknownEncodingHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecHelper.class b/idl/comm/.class/org/omg/IOP/CodecHelper.class new file mode 100644 index 0000000..cc25114 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecHolder.class b/idl/comm/.class/org/omg/IOP/CodecHolder.class new file mode 100644 index 0000000..784dfd5 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecLocalBase.class b/idl/comm/.class/org/omg/IOP/CodecLocalBase.class new file mode 100644 index 0000000..753b0b5 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecLocalBase.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecLocalTie.class b/idl/comm/.class/org/omg/IOP/CodecLocalTie.class new file mode 100644 index 0000000..94e677a Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecLocalTie.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecOperations.class b/idl/comm/.class/org/omg/IOP/CodecOperations.class new file mode 100644 index 0000000..abf932c Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecOperations.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatch.class b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatch.class new file mode 100644 index 0000000..071a249 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatch.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHelper.class b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHelper.class new file mode 100644 index 0000000..76ac34b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHolder.class b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHolder.class new file mode 100644 index 0000000..f0650cf Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/FormatMismatchHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class new file mode 100644 index 0000000..5d1ba5b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncoding.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class new file mode 100644 index 0000000..2bc9fad Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.class b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.class new file mode 100644 index 0000000..b35580e Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/InvalidTypeForEncodingHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatch.class b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatch.class new file mode 100644 index 0000000..3b75527 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatch.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHelper.class b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHelper.class new file mode 100644 index 0000000..5abb587 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHolder.class b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHolder.class new file mode 100644 index 0000000..5bda8fc Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/CodecPackage/TypeMismatchHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/ComponentIdHelper.class b/idl/comm/.class/org/omg/IOP/ComponentIdHelper.class new file mode 100644 index 0000000..61b859b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ComponentIdHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/ENCODING_CDR_ENCAPS.class b/idl/comm/.class/org/omg/IOP/ENCODING_CDR_ENCAPS.class new file mode 100644 index 0000000..476169e Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ENCODING_CDR_ENCAPS.class differ diff --git a/idl/comm/.class/org/omg/IOP/Encoding.class b/idl/comm/.class/org/omg/IOP/Encoding.class new file mode 100644 index 0000000..abc3c0b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/Encoding.class differ diff --git a/idl/comm/.class/org/omg/IOP/EncodingFormatHelper.class b/idl/comm/.class/org/omg/IOP/EncodingFormatHelper.class new file mode 100644 index 0000000..c03d567 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/EncodingFormatHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/EncodingHelper.class b/idl/comm/.class/org/omg/IOP/EncodingHelper.class new file mode 100644 index 0000000..d0cf2d9 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/EncodingHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/EncodingHolder.class b/idl/comm/.class/org/omg/IOP/EncodingHolder.class new file mode 100644 index 0000000..07e498e Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/EncodingHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/ExceptionDetailMessage.class b/idl/comm/.class/org/omg/IOP/ExceptionDetailMessage.class new file mode 100644 index 0000000..386f56d Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ExceptionDetailMessage.class differ diff --git a/idl/comm/.class/org/omg/IOP/FORWARDED_IDENTITY.class b/idl/comm/.class/org/omg/IOP/FORWARDED_IDENTITY.class new file mode 100644 index 0000000..672fc68 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/FORWARDED_IDENTITY.class differ diff --git a/idl/comm/.class/org/omg/IOP/INVOCATION_POLICIES.class b/idl/comm/.class/org/omg/IOP/INVOCATION_POLICIES.class new file mode 100644 index 0000000..fd6c1be Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/INVOCATION_POLICIES.class differ diff --git a/idl/comm/.class/org/omg/IOP/IOR.class b/idl/comm/.class/org/omg/IOP/IOR.class new file mode 100644 index 0000000..868dd46 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/IOR.class differ diff --git a/idl/comm/.class/org/omg/IOP/IORHelper.class b/idl/comm/.class/org/omg/IOP/IORHelper.class new file mode 100644 index 0000000..25d6cfe Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/IORHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/IORHolder.class b/idl/comm/.class/org/omg/IOP/IORHolder.class new file mode 100644 index 0000000..05b2f73 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/IORHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/LogicalThreadId.class b/idl/comm/.class/org/omg/IOP/LogicalThreadId.class new file mode 100644 index 0000000..a66ae1a Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/LogicalThreadId.class differ diff --git a/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHelper.class b/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHelper.class new file mode 100644 index 0000000..0e2f990 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHolder.class b/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHolder.class new file mode 100644 index 0000000..966f503 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/MultipleComponentProfileHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/ProfileIdHelper.class b/idl/comm/.class/org/omg/IOP/ProfileIdHelper.class new file mode 100644 index 0000000..62c1542 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ProfileIdHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/RTCorbaPriority.class b/idl/comm/.class/org/omg/IOP/RTCorbaPriority.class new file mode 100644 index 0000000..7753f83 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/RTCorbaPriority.class differ diff --git a/idl/comm/.class/org/omg/IOP/RTCorbaPriorityRange.class b/idl/comm/.class/org/omg/IOP/RTCorbaPriorityRange.class new file mode 100644 index 0000000..04c63bd Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/RTCorbaPriorityRange.class differ diff --git a/idl/comm/.class/org/omg/IOP/SecurityAttributeService.class b/idl/comm/.class/org/omg/IOP/SecurityAttributeService.class new file mode 100644 index 0000000..62f01ed Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/SecurityAttributeService.class differ diff --git a/idl/comm/.class/org/omg/IOP/SendingContextRunTime.class b/idl/comm/.class/org/omg/IOP/SendingContextRunTime.class new file mode 100644 index 0000000..2e9b907 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/SendingContextRunTime.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceContext.class b/idl/comm/.class/org/omg/IOP/ServiceContext.class new file mode 100644 index 0000000..bb0c20a Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceContext.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceContextHelper.class b/idl/comm/.class/org/omg/IOP/ServiceContextHelper.class new file mode 100644 index 0000000..bf6b655 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceContextHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceContextHolder.class b/idl/comm/.class/org/omg/IOP/ServiceContextHolder.class new file mode 100644 index 0000000..f7b8f44 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceContextHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceContextListHelper.class b/idl/comm/.class/org/omg/IOP/ServiceContextListHelper.class new file mode 100644 index 0000000..04a409e Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceContextListHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceContextListHolder.class b/idl/comm/.class/org/omg/IOP/ServiceContextListHolder.class new file mode 100644 index 0000000..061a688 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceContextListHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/ServiceIdHelper.class b/idl/comm/.class/org/omg/IOP/ServiceIdHelper.class new file mode 100644 index 0000000..b51c9cc Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/ServiceIdHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class b/idl/comm/.class/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class new file mode 100644 index 0000000..bc0c93d Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_ALTERNATE_IIOP_ADDRESS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_ASSOCIATION_OPTIONS.class b/idl/comm/.class/org/omg/IOP/TAG_ASSOCIATION_OPTIONS.class new file mode 100644 index 0000000..36febbd Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_ASSOCIATION_OPTIONS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_CODE_SETS.class b/idl/comm/.class/org/omg/IOP/TAG_CODE_SETS.class new file mode 100644 index 0000000..693723f Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_CODE_SETS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_COMPLETE_OBJECT_KEY.class b/idl/comm/.class/org/omg/IOP/TAG_COMPLETE_OBJECT_KEY.class new file mode 100644 index 0000000..20b426a Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_COMPLETE_OBJECT_KEY.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Hybrid_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Hybrid_SEC_MECH.class new file mode 100644 index 0000000..f4d91d8 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Hybrid_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Public_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Public_SEC_MECH.class new file mode 100644 index 0000000..e9a7f21 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Public_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Secret_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Secret_SEC_MECH.class new file mode 100644 index 0000000..80d7dde Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_CSI_ECMA_Secret_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_CSI_SEC_MECH_LIST.class b/idl/comm/.class/org/omg/IOP/TAG_CSI_SEC_MECH_LIST.class new file mode 100644 index 0000000..1b0bf50 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_CSI_SEC_MECH_LIST.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_DCE_BINDING_NAME.class b/idl/comm/.class/org/omg/IOP/TAG_DCE_BINDING_NAME.class new file mode 100644 index 0000000..e43d5b9 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_DCE_BINDING_NAME.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_DCE_NO_PIPES.class b/idl/comm/.class/org/omg/IOP/TAG_DCE_NO_PIPES.class new file mode 100644 index 0000000..561ddd7 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_DCE_NO_PIPES.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_DCE_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_DCE_SEC_MECH.class new file mode 100644 index 0000000..b26b448 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_DCE_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_DCE_STRING_BINDING.class b/idl/comm/.class/org/omg/IOP/TAG_DCE_STRING_BINDING.class new file mode 100644 index 0000000..8285cb1 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_DCE_STRING_BINDING.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_ENDPOINT_ID_POSITION.class b/idl/comm/.class/org/omg/IOP/TAG_ENDPOINT_ID_POSITION.class new file mode 100644 index 0000000..27eecb1 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_ENDPOINT_ID_POSITION.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_FIREWALL_TRANS.class b/idl/comm/.class/org/omg/IOP/TAG_FIREWALL_TRANS.class new file mode 100644 index 0000000..847bca6 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_FIREWALL_TRANS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_GENERIC_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_GENERIC_SEC_MECH.class new file mode 100644 index 0000000..1e34d83 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_GENERIC_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_INET_SEC_TRANS.class b/idl/comm/.class/org/omg/IOP/TAG_INET_SEC_TRANS.class new file mode 100644 index 0000000..0b84b25 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_INET_SEC_TRANS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_INTERNET_IOP.class b/idl/comm/.class/org/omg/IOP/TAG_INTERNET_IOP.class new file mode 100644 index 0000000..4dc3d89 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_INTERNET_IOP.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_INV_POLICY.class b/idl/comm/.class/org/omg/IOP/TAG_INV_POLICY.class new file mode 100644 index 0000000..cfd2ed5 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_INV_POLICY.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_JAVA_CODEBASE.class b/idl/comm/.class/org/omg/IOP/TAG_JAVA_CODEBASE.class new file mode 100644 index 0000000..0995f89 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_JAVA_CODEBASE.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_KerberosV5_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_KerberosV5_SEC_MECH.class new file mode 100644 index 0000000..9f33403 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_KerberosV5_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_LOCATION_POLICY.class b/idl/comm/.class/org/omg/IOP/TAG_LOCATION_POLICY.class new file mode 100644 index 0000000..94f16e6 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_LOCATION_POLICY.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_MESSAGE_ROUTERS.class b/idl/comm/.class/org/omg/IOP/TAG_MESSAGE_ROUTERS.class new file mode 100644 index 0000000..cc1a22d Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_MESSAGE_ROUTERS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class b/idl/comm/.class/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class new file mode 100644 index 0000000..741b55d Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_MULTIPLE_COMPONENTS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_NULL_TAG.class b/idl/comm/.class/org/omg/IOP/TAG_NULL_TAG.class new file mode 100644 index 0000000..ea8872b Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_NULL_TAG.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_ORB_TYPE.class b/idl/comm/.class/org/omg/IOP/TAG_ORB_TYPE.class new file mode 100644 index 0000000..817fe00 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_ORB_TYPE.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_OTS_POLICY.class b/idl/comm/.class/org/omg/IOP/TAG_OTS_POLICY.class new file mode 100644 index 0000000..232b3a6 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_OTS_POLICY.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_POLICIES.class b/idl/comm/.class/org/omg/IOP/TAG_POLICIES.class new file mode 100644 index 0000000..02f5c1d Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_POLICIES.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_SCCP_CONTACT_INFO.class b/idl/comm/.class/org/omg/IOP/TAG_SCCP_CONTACT_INFO.class new file mode 100644 index 0000000..f41f98a Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_SCCP_CONTACT_INFO.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_SEC_NAME.class b/idl/comm/.class/org/omg/IOP/TAG_SEC_NAME.class new file mode 100644 index 0000000..08d83b9 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_SEC_NAME.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_SPKM_1_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_SPKM_1_SEC_MECH.class new file mode 100644 index 0000000..6dae507 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_SPKM_1_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_SPKM_2_SEC_MECH.class b/idl/comm/.class/org/omg/IOP/TAG_SPKM_2_SEC_MECH.class new file mode 100644 index 0000000..ca38dd3 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_SPKM_2_SEC_MECH.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_SSL_SEC_TRANS.class b/idl/comm/.class/org/omg/IOP/TAG_SSL_SEC_TRANS.class new file mode 100644 index 0000000..3c646d9 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_SSL_SEC_TRANS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_TLS_SEC_TRANS.class b/idl/comm/.class/org/omg/IOP/TAG_TLS_SEC_TRANS.class new file mode 100644 index 0000000..6e214de Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_TLS_SEC_TRANS.class differ diff --git a/idl/comm/.class/org/omg/IOP/TAG_TRANSACTION_POLICY.class b/idl/comm/.class/org/omg/IOP/TAG_TRANSACTION_POLICY.class new file mode 100644 index 0000000..8621496 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TAG_TRANSACTION_POLICY.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedComponent.class b/idl/comm/.class/org/omg/IOP/TaggedComponent.class new file mode 100644 index 0000000..39c3155 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedComponent.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedComponentHelper.class b/idl/comm/.class/org/omg/IOP/TaggedComponentHelper.class new file mode 100644 index 0000000..df8aa53 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedComponentHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedComponentHolder.class b/idl/comm/.class/org/omg/IOP/TaggedComponentHolder.class new file mode 100644 index 0000000..409e6ff Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedComponentHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHelper.class b/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHelper.class new file mode 100644 index 0000000..a519d46 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHolder.class b/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHolder.class new file mode 100644 index 0000000..bbfa989 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedComponentSeqHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedProfile.class b/idl/comm/.class/org/omg/IOP/TaggedProfile.class new file mode 100644 index 0000000..6d88e63 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedProfile.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedProfileHelper.class b/idl/comm/.class/org/omg/IOP/TaggedProfileHelper.class new file mode 100644 index 0000000..287c29f Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedProfileHelper.class differ diff --git a/idl/comm/.class/org/omg/IOP/TaggedProfileHolder.class b/idl/comm/.class/org/omg/IOP/TaggedProfileHolder.class new file mode 100644 index 0000000..dd58405 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TaggedProfileHolder.class differ diff --git a/idl/comm/.class/org/omg/IOP/TransactionService.class b/idl/comm/.class/org/omg/IOP/TransactionService.class new file mode 100644 index 0000000..bd610e1 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/TransactionService.class differ diff --git a/idl/comm/.class/org/omg/IOP/UnknownExceptionInfo.class b/idl/comm/.class/org/omg/IOP/UnknownExceptionInfo.class new file mode 100644 index 0000000..e40c113 Binary files /dev/null and b/idl/comm/.class/org/omg/IOP/UnknownExceptionInfo.class differ diff --git a/idl/comm/.cvsignore b/idl/comm/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/comm/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContext.java b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContext.java new file mode 100644 index 0000000..f7dcce3 --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContext.java @@ -0,0 +1,22 @@ +// +// BiDirIIOPServiceContext.java (struct) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +public class BiDirIIOPServiceContext + implements org.omg.CORBA.portable.IDLEntity { + + public org.omg.IIOP.ListenPoint[] listen_points; + + public BiDirIIOPServiceContext() { + } + + public BiDirIIOPServiceContext(org.omg.IIOP.ListenPoint[] listen_points) { + this.listen_points = listen_points; + } + +} diff --git a/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHelper.java b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHelper.java new file mode 100644 index 0000000..46b4a07 --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHelper.java @@ -0,0 +1,58 @@ +// +// BiDirIIOPServiceContextHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +abstract public class BiDirIIOPServiceContextHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, BiDirIIOPServiceContext value) { + any.insert_Streamable(new BiDirIIOPServiceContextHolder(value)); + }; + + public static BiDirIIOPServiceContext extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof BiDirIIOPServiceContextHolder){ + return ((BiDirIIOPServiceContextHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; + members[0] = new org.omg.CORBA.StructMember("listen_points", org.omg.IIOP.ListenPointListHelper.type(), null); + _type = _orb().create_struct_tc(id(), "BiDirIIOPServiceContext", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/IIOP/BiDirIIOPServiceContext:1.0"; + }; + + public static BiDirIIOPServiceContext read(org.omg.CORBA.portable.InputStream is) { + BiDirIIOPServiceContext result = new BiDirIIOPServiceContext(); + result.listen_points = org.omg.IIOP.ListenPointListHelper.read(is); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, BiDirIIOPServiceContext val) { + org.omg.IIOP.ListenPointListHelper.write(os,val.listen_points); + }; + +} diff --git a/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHolder.java b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHolder.java new file mode 100644 index 0000000..d10bdef --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/BiDirIIOPServiceContextHolder.java @@ -0,0 +1,33 @@ +// +// BiDirIIOPServiceContextHolder.java (holder) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +final public class BiDirIIOPServiceContextHolder + implements org.omg.CORBA.portable.Streamable { + + public BiDirIIOPServiceContext value; + public BiDirIIOPServiceContextHolder() { + } + + public BiDirIIOPServiceContextHolder(BiDirIIOPServiceContext initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.IIOP.BiDirIIOPServiceContextHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.IIOP.BiDirIIOPServiceContextHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.IIOP.BiDirIIOPServiceContextHelper.type(); + }; + +} diff --git a/idl/comm/.java/org/omg/IIOP/ListenPoint.java b/idl/comm/.java/org/omg/IIOP/ListenPoint.java new file mode 100644 index 0000000..5e36a02 --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/ListenPoint.java @@ -0,0 +1,25 @@ +// +// ListenPoint.java (struct) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +public class ListenPoint + implements org.omg.CORBA.portable.IDLEntity { + + public java.lang.String host; + public short port; + + public ListenPoint() { + host = ""; + } + + public ListenPoint(java.lang.String host, short port) { + this.host = host; + this.port = port; + } + +} diff --git a/idl/comm/.java/org/omg/IIOP/ListenPointHelper.java b/idl/comm/.java/org/omg/IIOP/ListenPointHelper.java new file mode 100644 index 0000000..0c238e8 --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/ListenPointHelper.java @@ -0,0 +1,61 @@ +// +// ListenPointHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +abstract public class ListenPointHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, ListenPoint value) { + any.insert_Streamable(new ListenPointHolder(value)); + }; + + public static ListenPoint extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof ListenPointHolder){ + return ((ListenPointHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; + members[0] = new org.omg.CORBA.StructMember("host", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string), null); + members[1] = new org.omg.CORBA.StructMember("port", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ushort), null); + _type = _orb().create_struct_tc(id(), "ListenPoint", members); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/IIOP/ListenPoint:1.0"; + }; + + public static ListenPoint read(org.omg.CORBA.portable.InputStream is) { + ListenPoint result = new ListenPoint(); + result.host = is.read_string(); + result.port = is.read_ushort(); + return result; + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, ListenPoint val) { + os.write_string(val.host); + os.write_ushort(val.port); + }; + +} diff --git a/idl/comm/.java/org/omg/IIOP/ListenPointHolder.java b/idl/comm/.java/org/omg/IIOP/ListenPointHolder.java new file mode 100644 index 0000000..09f5f9f --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/ListenPointHolder.java @@ -0,0 +1,33 @@ +// +// ListenPointHolder.java (holder) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +final public class ListenPointHolder + implements org.omg.CORBA.portable.Streamable { + + public ListenPoint value; + public ListenPointHolder() { + } + + public ListenPointHolder(ListenPoint initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.IIOP.ListenPointHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.IIOP.ListenPointHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.IIOP.ListenPointHelper.type(); + }; + +} diff --git a/idl/comm/.java/org/omg/IIOP/ListenPointListHelper.java b/idl/comm/.java/org/omg/IIOP/ListenPointListHelper.java new file mode 100644 index 0000000..d57fe95 --- /dev/null +++ b/idl/comm/.java/org/omg/IIOP/ListenPointListHelper.java @@ -0,0 +1,64 @@ +// +// ListenPointListHelper.java (helper) +// +// File generated: Thu May 19 07:31:39 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.IIOP; + +abstract public class ListenPointListHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.IIOP.ListenPoint[] value) { + any.insert_Streamable(new ListenPointListHolder(value)); + }; + + public static org.omg.IIOP.ListenPoint[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof ListenPointListHolder){ + return ((ListenPointListHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.IIOP.ListenPointHelper.type()); + _type = _orb().create_alias_tc(id(), "ListenPointList", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/IIOP/ListenPointList:1.0"; + }; + + public static org.omg.IIOP.ListenPoint[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.IIOP.ListenPoint[] result; + int length0 = is.read_ulong(); + result = new org.omg.IIOP.ListenPoint[length0]; + for (int i0=0; i0 object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.1 + struct RequestHeader_1_1 { + IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + octet reserved[3]; // Added in GIOP 1.1 + sequence object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.2 + typedef short AddressingDisposition; + const short KeyAddr = 0; + const short ProfileAddr = 1; + const short ReferenceAddr = 2; + + struct IORAddressingInfo { + unsigned long selected_profile_index; + IOP::IOR ior; + }; + + union TargetAddress switch (AddressingDisposition) { + case KeyAddr: sequence object_key; + case ProfileAddr: IOP::TaggedProfile profile; + case ReferenceAddr: IORAddressingInfo ior; + }; + + struct RequestHeader_1_2 { + unsigned long request_id; + octet response_flags; + octet reserved[3]; + TargetAddress target; + string operation; + // requesting_principal not in GIOP 1.2 + IOP::ServiceContextList service_context; // 1.2 change + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum ReplyStatusType_1_0 {// Renamed from ReplyStatusType + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD + }; + + // GIOP 1.0 + struct ReplyHeader_1_0 {// Renamed from ReplyHeader + IOP::ServiceContextList service_context; + unsigned long request_id; + ReplyStatusType_1_0 reply_status; + }; + + // GIOP 1.1 + typedef ReplyHeader_1_0 ReplyHeader_1_1; + + // Same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum ReplyStatusType_1_2 { + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD, + LOCATION_FORWARD_PERM, // new value for 1.2 + NEEDS_ADDRESSING_MODE // new value for 1.2 + }; + struct ReplyHeader_1_2 { + unsigned long request_id; + ReplyStatusType_1_2 reply_status; + IOP:ServiceContextList service_context; // 1.2 change + }; + #endif // GIOP_1_2 + + struct SystemExceptionReplyBody { + string exception_id; + unsigned long minor_code_value; + unsigned long completion_status; + }; + + struct CancelRequestHeader { + unsigned long request_id; + }; + + // GIOP 1.0 + struct LocateRequestHeader_1_0 { + // Renamed LocationRequestHeader + unsigned long request_id; + sequence object_key; + }; + // GIOP 1.1 + typedef LocateRequestHeader_1_0 LocateRequestHeader_1_1; + // Same Header contents for 1.0 and 1.1 + + // GIOP 1.2 + struct LocateRequestHeader_1_2 { + unsigned long request_id; + TargetAddress target; + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum LocateStatusType_1_0 {// Renamed from LocateStatusType + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD + }; + + // GIOP 1.0 + struct LocateReplyHeader_1_0 { + // Renamed from LocateReplyHeader + unsigned long request_id; + LocateStatusType_1_0 locate_status; + }; + + // GIOP 1.1 + typedef LocateReplyHeader_1_0 LocateReplyHeader_1_1; + // same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum LocateStatusType_1_2 { + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD, + OBJECT_FORWARD_PERM, // new value for GIOP 1.2 + LOC_SYSTEM_EXCEPTION, // new value for GIOP 1.2 + LOC_NEEDS_ADDRESSING_MODE // new value for GIOP 1.2 + }; + struct LocateReplyHeader_1_2 { + unsigned long request_id; + LocateStatusType_1_2 locate_status; + }; + #endif // GIOP_1_2 + + // GIOP 1.2 + struct FragmentHeader_1_2 { + unsigned long request_id; + }; +}; \ No newline at end of file diff --git a/idl/comm/.svn/text-base/IIOP.idl.svn-base b/idl/comm/.svn/text-base/IIOP.idl.svn-base new file mode 100644 index 0000000..cefadf1 --- /dev/null +++ b/idl/comm/.svn/text-base/IIOP.idl.svn-base @@ -0,0 +1,37 @@ +#include "IOP.idl" + +#pragma prefix "omg.org" + +module IIOP { // IDL extended for version 1.1 and 1.2 + struct Version { + octet major; + octet minor; + }; + + struct ProfileBody_1_0 {// renamed from ProfileBody + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + }; + + struct ProfileBody_1_1 {// also used for 1.2 + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + // Added in 1.1 unchanged for 1.2 + sequence components; + }; + + struct ListenPoint { + string host; + unsigned short port; + }; + + typedef sequence ListenPointList; + + struct BiDirIIOPServiceContext {// BI_DIR_IIOP Service Context + ListenPointList listen_points; + }; +}; \ No newline at end of file diff --git a/idl/comm/.svn/text-base/IOP.idl.svn-base b/idl/comm/.svn/text-base/IOP.idl.svn-base new file mode 100644 index 0000000..e73d551 --- /dev/null +++ b/idl/comm/.svn/text-base/IOP.idl.svn-base @@ -0,0 +1,134 @@ + +#include + +#pragma prefix "omg.org" + +module IOP { + + // Standard Protocol Profile tag values + + typedef unsigned long ProfileId; + + const ProfileId TAG_INTERNET_IOP = 0; + + const ProfileId TAG_MULTIPLE_COMPONENTS = 1; + + struct TaggedProfile { + ProfileId tag; + sequence profile_data; + }; + + // an Interoperable Object Reference is a sequence of + // object-specific protocol profiles, plus a type ID. + struct IOR { + string type_id; + sequence profiles; + }; + + // Standard way of representing multicomponent profiles. + + // This would be encapsulated in a TaggedProfile. + + typedef unsigned long ComponentId; + + struct TaggedComponent { + ComponentId tag; + sequence component_data; + }; + + + typedef sequence MultipleComponentProfile; + + typedef sequence TaggedComponentSeq; + + // CORBA 2.4 + const ComponentId TAG_ORB_TYPE = 0; + const ComponentId TAG_CODE_SETS = 1; + const ComponentId TAG_POLICIES = 2; + const ComponentId TAG_ALTERNATE_IIOP_ADDRESS = 3; + const ComponentId TAG_ASSOCIATION_OPTIONS = 13; + const ComponentId TAG_SEC_NAME = 14; + const ComponentId TAG_SPKM_1_SEC_MECH = 15; + const ComponentId TAG_SPKM_2_SEC_MECH = 16; + const ComponentId TAG_KerberosV5_SEC_MECH = 17; + const ComponentId TAG_CSI_ECMA_Secret_SEC_MECH = 18; + const ComponentId TAG_CSI_ECMA_Hybrid_SEC_MECH = 19; + const ComponentId TAG_SSL_SEC_TRANS = 20; + const ComponentId TAG_CSI_ECMA_Public_SEC_MECH = 21; + const ComponentId TAG_GENERIC_SEC_MECH = 22; + const ComponentId TAG_FIREWALL_TRANS = 23; + const ComponentId TAG_SCCP_CONTACT_INFO = 24; + const ComponentId TAG_JAVA_CODEBASE = 25; + const ComponentId TAG_TRANSACTION_POLICY = 26; + const ComponentId TAG_MESSAGE_ROUTERS = 30; + const ComponentId TAG_OTS_POLICY = 31; + const ComponentId TAG_INV_POLICY = 32; + const ComponentId TAG_CSI_SEC_MECH_LIST = 33; + const ComponentId TAG_NULL_TAG = 34; + const ComponentId TAG_TLS_SEC_TRANS = 36; + const ComponentId TAG_INET_SEC_TRANS = 123; + const ComponentId TAG_COMPLETE_OBJECT_KEY = 5; + const ComponentId TAG_ENDPOINT_ID_POSITION = 6; + const ComponentId TAG_LOCATION_POLICY = 12; + const ComponentId TAG_DCE_STRING_BINDING = 100; + const ComponentId TAG_DCE_BINDING_NAME = 101; + const ComponentId TAG_DCE_NO_PIPES = 102; + const ComponentId TAG_DCE_SEC_MECH = 103; // Security Service + + typedef unsigned long ServiceId; + + struct ServiceContext { + ServiceId context_id; + sequence context_data; + }; + + typedef sequence ServiceContextList; + + const ServiceId TransactionService = 0; + const ServiceId CodeSets = 1; + const ServiceId ChainBypassCheck = 2; + const ServiceId ChainBypassInfo = 3; + const ServiceId LogicalThreadId = 4; + const ServiceId BI_DIR_IIOP = 5; + const ServiceId SendingContextRunTime = 6; + const ServiceId INVOCATION_POLICIES = 7; + const ServiceId FORWARDED_IDENTITY = 8; + const ServiceId UnknownExceptionInfo = 9; + const ServiceId RTCorbaPriority = 10; + const ServiceId RTCorbaPriorityRange = 11; + const ServiceId ExceptionDetailMessage = 14; + const ServiceId SecurityAttributeService = 15; + + local interface Codec { + + exception InvalidTypeForEncoding {}; + exception FormatMismatch {}; + exception TypeMismatch {}; + + CORBA::OctetSeq encode (in any data) raises (InvalidTypeForEncoding); + + any decode (in CORBA::OctetSeq data) raises (FormatMismatch); + + CORBA::OctetSeq encode_value (in any data) raises (InvalidTypeForEncoding); + + any decode_value (in CORBA::OctetSeq data, in CORBA::TypeCode tc) + raises (FormatMismatch, TypeMismatch); + }; + + + typedef short EncodingFormat; + + const EncodingFormat ENCODING_CDR_ENCAPS = 0; + + struct Encoding { + EncodingFormat format; + octet major_version; + octet minor_version; + }; + + local interface CodecFactory { + exception UnknownEncoding {}; + + Codec create_codec (in Encoding enc) raises (UnknownEncoding); + }; +}; diff --git a/idl/comm/.svn/text-base/build.xml.svn-base b/idl/comm/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..7a2bbae --- /dev/null +++ b/idl/comm/.svn/text-base/build.xml.svn-base @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/comm/GIOP.idl b/idl/comm/GIOP.idl new file mode 100644 index 0000000..263497f --- /dev/null +++ b/idl/comm/GIOP.idl @@ -0,0 +1,200 @@ + +#include "IOP.idl" + +#pragma prefix "omg.org" + +module GIOP { // IDL extended for version 1.1 and 1.2 + + struct Version { + octet major; + octet minor; + }; + + #ifndef GIOP_1_1 + // GIOP 1.0 + enum MsgType_1_0{ // rename from MsgType + Request, Reply, CancelRequest, + LocateRequest, LocateReply, + CloseConnection, MessageError + }; + #else + // GIOP 1.1 + enum MsgType_1_1{ + Request, Reply, CancelRequest, + LocateRequest, LocateReply, + CloseConnection, MessageError, + Fragment // GIOP 1.1 addition + }; + #endif + + // GIOP 1.0 + struct MessageHeader_1_0 {// Renamed from MessageHeader + char magic [4]; + Version GIOP_version; + boolean byte_order; + octet message_type; + unsigned long message_size; + }; + + // GIOP 1.1 + struct MessageHeader_1_1 { + char magic [4]; + Version GIOP_version; + octet flags; // GIOP 1.1 change + octet message_type; + unsigned long message_size; + }; + + // GIOP 1.2 + typedef MessageHeader_1_1 MessageHeader_1_2; + + // GIOP 1.0 + struct RequestHeader _1_0 { + IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + sequence object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.1 + struct RequestHeader_1_1 { + IOP::ServiceContextList service_context; + unsigned long request_id; + boolean response_expected; + octet reserved[3]; // Added in GIOP 1.1 + sequence object_key; + string operation; + CORBA::OctetSeq requesting_principal; + }; + + // GIOP 1.2 + typedef short AddressingDisposition; + const short KeyAddr = 0; + const short ProfileAddr = 1; + const short ReferenceAddr = 2; + + struct IORAddressingInfo { + unsigned long selected_profile_index; + IOP::IOR ior; + }; + + union TargetAddress switch (AddressingDisposition) { + case KeyAddr: sequence object_key; + case ProfileAddr: IOP::TaggedProfile profile; + case ReferenceAddr: IORAddressingInfo ior; + }; + + struct RequestHeader_1_2 { + unsigned long request_id; + octet response_flags; + octet reserved[3]; + TargetAddress target; + string operation; + // requesting_principal not in GIOP 1.2 + IOP::ServiceContextList service_context; // 1.2 change + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum ReplyStatusType_1_0 {// Renamed from ReplyStatusType + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD + }; + + // GIOP 1.0 + struct ReplyHeader_1_0 {// Renamed from ReplyHeader + IOP::ServiceContextList service_context; + unsigned long request_id; + ReplyStatusType_1_0 reply_status; + }; + + // GIOP 1.1 + typedef ReplyHeader_1_0 ReplyHeader_1_1; + + // Same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum ReplyStatusType_1_2 { + NO_EXCEPTION, + USER_EXCEPTION, + SYSTEM_EXCEPTION, + LOCATION_FORWARD, + LOCATION_FORWARD_PERM, // new value for 1.2 + NEEDS_ADDRESSING_MODE // new value for 1.2 + }; + struct ReplyHeader_1_2 { + unsigned long request_id; + ReplyStatusType_1_2 reply_status; + IOP:ServiceContextList service_context; // 1.2 change + }; + #endif // GIOP_1_2 + + struct SystemExceptionReplyBody { + string exception_id; + unsigned long minor_code_value; + unsigned long completion_status; + }; + + struct CancelRequestHeader { + unsigned long request_id; + }; + + // GIOP 1.0 + struct LocateRequestHeader_1_0 { + // Renamed LocationRequestHeader + unsigned long request_id; + sequence object_key; + }; + // GIOP 1.1 + typedef LocateRequestHeader_1_0 LocateRequestHeader_1_1; + // Same Header contents for 1.0 and 1.1 + + // GIOP 1.2 + struct LocateRequestHeader_1_2 { + unsigned long request_id; + TargetAddress target; + }; + + #ifndef GIOP_1_2 + // GIOP 1.0 and 1.1 + enum LocateStatusType_1_0 {// Renamed from LocateStatusType + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD + }; + + // GIOP 1.0 + struct LocateReplyHeader_1_0 { + // Renamed from LocateReplyHeader + unsigned long request_id; + LocateStatusType_1_0 locate_status; + }; + + // GIOP 1.1 + typedef LocateReplyHeader_1_0 LocateReplyHeader_1_1; + // same Header contents for 1.0 and 1.1 + #else + // GIOP 1.2 + enum LocateStatusType_1_2 { + UNKNOWN_OBJECT, + OBJECT_HERE, + OBJECT_FORWARD, + OBJECT_FORWARD_PERM, // new value for GIOP 1.2 + LOC_SYSTEM_EXCEPTION, // new value for GIOP 1.2 + LOC_NEEDS_ADDRESSING_MODE // new value for GIOP 1.2 + }; + struct LocateReplyHeader_1_2 { + unsigned long request_id; + LocateStatusType_1_2 locate_status; + }; + #endif // GIOP_1_2 + + // GIOP 1.2 + struct FragmentHeader_1_2 { + unsigned long request_id; + }; +}; \ No newline at end of file diff --git a/idl/comm/IIOP.idl b/idl/comm/IIOP.idl new file mode 100644 index 0000000..cefadf1 --- /dev/null +++ b/idl/comm/IIOP.idl @@ -0,0 +1,37 @@ +#include "IOP.idl" + +#pragma prefix "omg.org" + +module IIOP { // IDL extended for version 1.1 and 1.2 + struct Version { + octet major; + octet minor; + }; + + struct ProfileBody_1_0 {// renamed from ProfileBody + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + }; + + struct ProfileBody_1_1 {// also used for 1.2 + Version iiop_version; + string host; + unsigned short port; + sequence object_key; + // Added in 1.1 unchanged for 1.2 + sequence components; + }; + + struct ListenPoint { + string host; + unsigned short port; + }; + + typedef sequence ListenPointList; + + struct BiDirIIOPServiceContext {// BI_DIR_IIOP Service Context + ListenPointList listen_points; + }; +}; \ No newline at end of file diff --git a/idl/comm/IOP.idl b/idl/comm/IOP.idl new file mode 100644 index 0000000..e73d551 --- /dev/null +++ b/idl/comm/IOP.idl @@ -0,0 +1,134 @@ + +#include + +#pragma prefix "omg.org" + +module IOP { + + // Standard Protocol Profile tag values + + typedef unsigned long ProfileId; + + const ProfileId TAG_INTERNET_IOP = 0; + + const ProfileId TAG_MULTIPLE_COMPONENTS = 1; + + struct TaggedProfile { + ProfileId tag; + sequence profile_data; + }; + + // an Interoperable Object Reference is a sequence of + // object-specific protocol profiles, plus a type ID. + struct IOR { + string type_id; + sequence profiles; + }; + + // Standard way of representing multicomponent profiles. + + // This would be encapsulated in a TaggedProfile. + + typedef unsigned long ComponentId; + + struct TaggedComponent { + ComponentId tag; + sequence component_data; + }; + + + typedef sequence MultipleComponentProfile; + + typedef sequence TaggedComponentSeq; + + // CORBA 2.4 + const ComponentId TAG_ORB_TYPE = 0; + const ComponentId TAG_CODE_SETS = 1; + const ComponentId TAG_POLICIES = 2; + const ComponentId TAG_ALTERNATE_IIOP_ADDRESS = 3; + const ComponentId TAG_ASSOCIATION_OPTIONS = 13; + const ComponentId TAG_SEC_NAME = 14; + const ComponentId TAG_SPKM_1_SEC_MECH = 15; + const ComponentId TAG_SPKM_2_SEC_MECH = 16; + const ComponentId TAG_KerberosV5_SEC_MECH = 17; + const ComponentId TAG_CSI_ECMA_Secret_SEC_MECH = 18; + const ComponentId TAG_CSI_ECMA_Hybrid_SEC_MECH = 19; + const ComponentId TAG_SSL_SEC_TRANS = 20; + const ComponentId TAG_CSI_ECMA_Public_SEC_MECH = 21; + const ComponentId TAG_GENERIC_SEC_MECH = 22; + const ComponentId TAG_FIREWALL_TRANS = 23; + const ComponentId TAG_SCCP_CONTACT_INFO = 24; + const ComponentId TAG_JAVA_CODEBASE = 25; + const ComponentId TAG_TRANSACTION_POLICY = 26; + const ComponentId TAG_MESSAGE_ROUTERS = 30; + const ComponentId TAG_OTS_POLICY = 31; + const ComponentId TAG_INV_POLICY = 32; + const ComponentId TAG_CSI_SEC_MECH_LIST = 33; + const ComponentId TAG_NULL_TAG = 34; + const ComponentId TAG_TLS_SEC_TRANS = 36; + const ComponentId TAG_INET_SEC_TRANS = 123; + const ComponentId TAG_COMPLETE_OBJECT_KEY = 5; + const ComponentId TAG_ENDPOINT_ID_POSITION = 6; + const ComponentId TAG_LOCATION_POLICY = 12; + const ComponentId TAG_DCE_STRING_BINDING = 100; + const ComponentId TAG_DCE_BINDING_NAME = 101; + const ComponentId TAG_DCE_NO_PIPES = 102; + const ComponentId TAG_DCE_SEC_MECH = 103; // Security Service + + typedef unsigned long ServiceId; + + struct ServiceContext { + ServiceId context_id; + sequence context_data; + }; + + typedef sequence ServiceContextList; + + const ServiceId TransactionService = 0; + const ServiceId CodeSets = 1; + const ServiceId ChainBypassCheck = 2; + const ServiceId ChainBypassInfo = 3; + const ServiceId LogicalThreadId = 4; + const ServiceId BI_DIR_IIOP = 5; + const ServiceId SendingContextRunTime = 6; + const ServiceId INVOCATION_POLICIES = 7; + const ServiceId FORWARDED_IDENTITY = 8; + const ServiceId UnknownExceptionInfo = 9; + const ServiceId RTCorbaPriority = 10; + const ServiceId RTCorbaPriorityRange = 11; + const ServiceId ExceptionDetailMessage = 14; + const ServiceId SecurityAttributeService = 15; + + local interface Codec { + + exception InvalidTypeForEncoding {}; + exception FormatMismatch {}; + exception TypeMismatch {}; + + CORBA::OctetSeq encode (in any data) raises (InvalidTypeForEncoding); + + any decode (in CORBA::OctetSeq data) raises (FormatMismatch); + + CORBA::OctetSeq encode_value (in any data) raises (InvalidTypeForEncoding); + + any decode_value (in CORBA::OctetSeq data, in CORBA::TypeCode tc) + raises (FormatMismatch, TypeMismatch); + }; + + + typedef short EncodingFormat; + + const EncodingFormat ENCODING_CDR_ENCAPS = 0; + + struct Encoding { + EncodingFormat format; + octet major_version; + octet minor_version; + }; + + local interface CodecFactory { + exception UnknownEncoding {}; + + Codec create_codec (in Encoding enc) raises (UnknownEncoding); + }; +}; diff --git a/idl/comm/build.xml b/idl/comm/build.xml new file mode 100644 index 0000000..6f92f83 --- /dev/null +++ b/idl/comm/build.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/orb/.class/es/tid/CORBA/Any.class b/idl/orb/.class/es/tid/CORBA/Any.class new file mode 100644 index 0000000..c657395 Binary files /dev/null and b/idl/orb/.class/es/tid/CORBA/Any.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ARG_IN.class b/idl/orb/.class/org/omg/CORBA/ARG_IN.class new file mode 100644 index 0000000..a997733 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ARG_IN.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ARG_INOUT.class b/idl/orb/.class/org/omg/CORBA/ARG_INOUT.class new file mode 100644 index 0000000..c6706c5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ARG_INOUT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ARG_OUT.class b/idl/orb/.class/org/omg/CORBA/ARG_OUT.class new file mode 100644 index 0000000..e3ada5f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ARG_OUT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDef.class b/idl/orb/.class/org/omg/CORBA/AliasDef.class new file mode 100644 index 0000000..273c560 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDefHelper.class b/idl/orb/.class/org/omg/CORBA/AliasDefHelper.class new file mode 100644 index 0000000..890acdd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDefHolder.class b/idl/orb/.class/org/omg/CORBA/AliasDefHolder.class new file mode 100644 index 0000000..3a06f65 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDefOperations.class b/idl/orb/.class/org/omg/CORBA/AliasDefOperations.class new file mode 100644 index 0000000..85e2b03 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDefPOA.class b/idl/orb/.class/org/omg/CORBA/AliasDefPOA.class new file mode 100644 index 0000000..8b096fa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AliasDefPOATie.class b/idl/orb/.class/org/omg/CORBA/AliasDefPOATie.class new file mode 100644 index 0000000..df0299a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AliasDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Any.class b/idl/orb/.class/org/omg/CORBA/Any.class new file mode 100644 index 0000000..5a1095e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Any.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AnyHolder.class b/idl/orb/.class/org/omg/CORBA/AnyHolder.class new file mode 100644 index 0000000..ebcb813 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AnyHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AnySeqHelper.class b/idl/orb/.class/org/omg/CORBA/AnySeqHelper.class new file mode 100644 index 0000000..f6d7581 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AnySeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AnySeqHolder.class b/idl/orb/.class/org/omg/CORBA/AnySeqHolder.class new file mode 100644 index 0000000..bf7eb9c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AnySeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDef.class b/idl/orb/.class/org/omg/CORBA/ArrayDef.class new file mode 100644 index 0000000..a6f2454 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDefHelper.class b/idl/orb/.class/org/omg/CORBA/ArrayDefHelper.class new file mode 100644 index 0000000..e8959c8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDefHolder.class b/idl/orb/.class/org/omg/CORBA/ArrayDefHolder.class new file mode 100644 index 0000000..ecdcf10 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDefOperations.class b/idl/orb/.class/org/omg/CORBA/ArrayDefOperations.class new file mode 100644 index 0000000..ead1484 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDefPOA.class b/idl/orb/.class/org/omg/CORBA/ArrayDefPOA.class new file mode 100644 index 0000000..a0dea8d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ArrayDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ArrayDefPOATie.class new file mode 100644 index 0000000..4e40efb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ArrayDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHelper.class b/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHelper.class new file mode 100644 index 0000000..003c24c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHolder.class b/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHolder.class new file mode 100644 index 0000000..cd2934f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttrDescriptionSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDef.class b/idl/orb/.class/org/omg/CORBA/AttributeDef.class new file mode 100644 index 0000000..8b271d4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDefHelper.class b/idl/orb/.class/org/omg/CORBA/AttributeDefHelper.class new file mode 100644 index 0000000..bef505c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDefHolder.class b/idl/orb/.class/org/omg/CORBA/AttributeDefHolder.class new file mode 100644 index 0000000..df65a48 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDefOperations.class b/idl/orb/.class/org/omg/CORBA/AttributeDefOperations.class new file mode 100644 index 0000000..e083504 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDefPOA.class b/idl/orb/.class/org/omg/CORBA/AttributeDefPOA.class new file mode 100644 index 0000000..c495b83 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDefPOATie.class b/idl/orb/.class/org/omg/CORBA/AttributeDefPOATie.class new file mode 100644 index 0000000..9990e07 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDescription.class b/idl/orb/.class/org/omg/CORBA/AttributeDescription.class new file mode 100644 index 0000000..8387626 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHelper.class new file mode 100644 index 0000000..58e6c0a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHolder.class new file mode 100644 index 0000000..2adf7a5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeMode.class b/idl/orb/.class/org/omg/CORBA/AttributeMode.class new file mode 100644 index 0000000..5eb0cec Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeMode.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeModeHelper.class b/idl/orb/.class/org/omg/CORBA/AttributeModeHelper.class new file mode 100644 index 0000000..90e7e5e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeModeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/AttributeModeHolder.class b/idl/orb/.class/org/omg/CORBA/AttributeModeHolder.class new file mode 100644 index 0000000..38230d2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/AttributeModeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_CONTEXT.class b/idl/orb/.class/org/omg/CORBA/BAD_CONTEXT.class new file mode 100644 index 0000000..9664700 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_CONTEXT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_INV_ORDER.class b/idl/orb/.class/org/omg/CORBA/BAD_INV_ORDER.class new file mode 100644 index 0000000..287caee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_INV_ORDER.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_OPERATION.class b/idl/orb/.class/org/omg/CORBA/BAD_OPERATION.class new file mode 100644 index 0000000..f69c172 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_OPERATION.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_PARAM.class b/idl/orb/.class/org/omg/CORBA/BAD_PARAM.class new file mode 100644 index 0000000..e50383e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_PARAM.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_POLICY.class b/idl/orb/.class/org/omg/CORBA/BAD_POLICY.class new file mode 100644 index 0000000..ef77cee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_POLICY.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_POLICY_TYPE.class b/idl/orb/.class/org/omg/CORBA/BAD_POLICY_TYPE.class new file mode 100644 index 0000000..fe0d2fa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_POLICY_TYPE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_POLICY_VALUE.class b/idl/orb/.class/org/omg/CORBA/BAD_POLICY_VALUE.class new file mode 100644 index 0000000..ade7ca4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_POLICY_VALUE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BAD_TYPECODE.class b/idl/orb/.class/org/omg/CORBA/BAD_TYPECODE.class new file mode 100644 index 0000000..40dd764 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BAD_TYPECODE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BadFixedValue.class b/idl/orb/.class/org/omg/CORBA/BadFixedValue.class new file mode 100644 index 0000000..1650342 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BadFixedValue.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BadFixedValueHelper.class b/idl/orb/.class/org/omg/CORBA/BadFixedValueHelper.class new file mode 100644 index 0000000..b367506 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BadFixedValueHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BadFixedValueHolder.class b/idl/orb/.class/org/omg/CORBA/BadFixedValueHolder.class new file mode 100644 index 0000000..b796e06 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BadFixedValueHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BooleanHolder.class b/idl/orb/.class/org/omg/CORBA/BooleanHolder.class new file mode 100644 index 0000000..c944de6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BooleanHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BooleanSeqHelper.class b/idl/orb/.class/org/omg/CORBA/BooleanSeqHelper.class new file mode 100644 index 0000000..1ef046d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BooleanSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/BooleanSeqHolder.class b/idl/orb/.class/org/omg/CORBA/BooleanSeqHolder.class new file mode 100644 index 0000000..e9183f6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/BooleanSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Bounds.class b/idl/orb/.class/org/omg/CORBA/Bounds.class new file mode 100644 index 0000000..0d42d4f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Bounds.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ByteHolder.class b/idl/orb/.class/org/omg/CORBA/ByteHolder.class new file mode 100644 index 0000000..81d1a5f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ByteHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CODESET_INCOMPATIBLE.class b/idl/orb/.class/org/omg/CORBA/CODESET_INCOMPATIBLE.class new file mode 100644 index 0000000..12aa6ed Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CODESET_INCOMPATIBLE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/COMM_FAILURE.class b/idl/orb/.class/org/omg/CORBA/COMM_FAILURE.class new file mode 100644 index 0000000..eb2dc3e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/COMM_FAILURE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CTX_RESTRICT_SCOPE.class b/idl/orb/.class/org/omg/CORBA/CTX_RESTRICT_SCOPE.class new file mode 100644 index 0000000..3ea94d0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CTX_RESTRICT_SCOPE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CharHolder.class b/idl/orb/.class/org/omg/CORBA/CharHolder.class new file mode 100644 index 0000000..18a31dd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CharHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CharSeqHelper.class b/idl/orb/.class/org/omg/CORBA/CharSeqHelper.class new file mode 100644 index 0000000..456d370 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CharSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CharSeqHolder.class b/idl/orb/.class/org/omg/CORBA/CharSeqHolder.class new file mode 100644 index 0000000..818e6c8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CharSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CompletionStatus.class b/idl/orb/.class/org/omg/CORBA/CompletionStatus.class new file mode 100644 index 0000000..686b5d8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CompletionStatus.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDef.class b/idl/orb/.class/org/omg/CORBA/ConstantDef.class new file mode 100644 index 0000000..b55b665 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDefHelper.class b/idl/orb/.class/org/omg/CORBA/ConstantDefHelper.class new file mode 100644 index 0000000..5df0363 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDefHolder.class b/idl/orb/.class/org/omg/CORBA/ConstantDefHolder.class new file mode 100644 index 0000000..e3aa283 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDefOperations.class b/idl/orb/.class/org/omg/CORBA/ConstantDefOperations.class new file mode 100644 index 0000000..136c6f9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDefPOA.class b/idl/orb/.class/org/omg/CORBA/ConstantDefPOA.class new file mode 100644 index 0000000..a6de8f4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ConstantDefPOATie.class new file mode 100644 index 0000000..d7578cb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDescription.class b/idl/orb/.class/org/omg/CORBA/ConstantDescription.class new file mode 100644 index 0000000..af24ec1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHelper.class new file mode 100644 index 0000000..22d8e33 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHolder.class new file mode 100644 index 0000000..18354a6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstantDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicy.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicy.class new file mode 100644 index 0000000..370177a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicy.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHelper.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHelper.class new file mode 100644 index 0000000..1ac4b12 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHolder.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHolder.class new file mode 100644 index 0000000..90fcc6e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicyOperations.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyOperations.class new file mode 100644 index 0000000..7e4efb7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOA.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOA.class new file mode 100644 index 0000000..499516d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOATie.class b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOATie.class new file mode 100644 index 0000000..302f8be Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ConstructionPolicyPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Contained.class b/idl/orb/.class/org/omg/CORBA/Contained.class new file mode 100644 index 0000000..1fcb3e7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Contained.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedHelper.class b/idl/orb/.class/org/omg/CORBA/ContainedHelper.class new file mode 100644 index 0000000..190f900 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedHolder.class b/idl/orb/.class/org/omg/CORBA/ContainedHolder.class new file mode 100644 index 0000000..c283cfd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedOperations.class b/idl/orb/.class/org/omg/CORBA/ContainedOperations.class new file mode 100644 index 0000000..a2f398b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedPOA.class b/idl/orb/.class/org/omg/CORBA/ContainedPOA.class new file mode 100644 index 0000000..1a74c69 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedPOATie.class b/idl/orb/.class/org/omg/CORBA/ContainedPOATie.class new file mode 100644 index 0000000..e4d0da8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedPackage/Description.class b/idl/orb/.class/org/omg/CORBA/ContainedPackage/Description.class new file mode 100644 index 0000000..b9ddb0f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedPackage/Description.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHelper.class new file mode 100644 index 0000000..a31cc2c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHolder.class new file mode 100644 index 0000000..a1224a0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedPackage/DescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ContainedSeqHelper.class new file mode 100644 index 0000000..6224921 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainedSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ContainedSeqHolder.class new file mode 100644 index 0000000..402a563 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainedSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Container.class b/idl/orb/.class/org/omg/CORBA/Container.class new file mode 100644 index 0000000..3aea5d8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Container.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerHelper.class b/idl/orb/.class/org/omg/CORBA/ContainerHelper.class new file mode 100644 index 0000000..e8796ba Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerHolder.class b/idl/orb/.class/org/omg/CORBA/ContainerHolder.class new file mode 100644 index 0000000..8ca04f6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerOperations.class b/idl/orb/.class/org/omg/CORBA/ContainerOperations.class new file mode 100644 index 0000000..a5f248c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPOA.class b/idl/orb/.class/org/omg/CORBA/ContainerPOA.class new file mode 100644 index 0000000..e836387 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPOATie.class b/idl/orb/.class/org/omg/CORBA/ContainerPOATie.class new file mode 100644 index 0000000..9cf8f5a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPackage/Description.class b/idl/orb/.class/org/omg/CORBA/ContainerPackage/Description.class new file mode 100644 index 0000000..c5a0d75 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPackage/Description.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHelper.class new file mode 100644 index 0000000..7b452c4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHolder.class new file mode 100644 index 0000000..b15663f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHelper.class new file mode 100644 index 0000000..11b9011 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHolder.class new file mode 100644 index 0000000..a7af92b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContainerPackage/DescriptionSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Context.class b/idl/orb/.class/org/omg/CORBA/Context.class new file mode 100644 index 0000000..ca5d04a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Context.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContextIdSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ContextIdSeqHelper.class new file mode 100644 index 0000000..7d0208d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContextIdSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContextIdSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ContextIdSeqHolder.class new file mode 100644 index 0000000..bdbe08f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContextIdSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContextIdentifierHelper.class b/idl/orb/.class/org/omg/CORBA/ContextIdentifierHelper.class new file mode 100644 index 0000000..241b5af Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContextIdentifierHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ContextList.class b/idl/orb/.class/org/omg/CORBA/ContextList.class new file mode 100644 index 0000000..dbd7408 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ContextList.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Current.class b/idl/orb/.class/org/omg/CORBA/Current.class new file mode 100644 index 0000000..4d34b9e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Current.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CurrentHelper.class b/idl/orb/.class/org/omg/CORBA/CurrentHelper.class new file mode 100644 index 0000000..2c0e3ee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CurrentHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CurrentHolder.class b/idl/orb/.class/org/omg/CORBA/CurrentHolder.class new file mode 100644 index 0000000..bfd532a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CurrentHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CurrentOperations.class b/idl/orb/.class/org/omg/CORBA/CurrentOperations.class new file mode 100644 index 0000000..bd08354 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CurrentOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CurrentPOA.class b/idl/orb/.class/org/omg/CORBA/CurrentPOA.class new file mode 100644 index 0000000..7b15ab6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CurrentPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CurrentPOATie.class b/idl/orb/.class/org/omg/CORBA/CurrentPOATie.class new file mode 100644 index 0000000..228fe70 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CurrentPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CustomMarshal.class b/idl/orb/.class/org/omg/CORBA/CustomMarshal.class new file mode 100644 index 0000000..361aa76 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CustomMarshal.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CustomMarshalHelper.class b/idl/orb/.class/org/omg/CORBA/CustomMarshalHelper.class new file mode 100644 index 0000000..b093c65 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CustomMarshalHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/CustomMarshalHolder.class b/idl/orb/.class/org/omg/CORBA/CustomMarshalHolder.class new file mode 100644 index 0000000..ca63b6c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/CustomMarshalHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DATA_CONVERSION.class b/idl/orb/.class/org/omg/CORBA/DATA_CONVERSION.class new file mode 100644 index 0000000..af7d9f6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DATA_CONVERSION.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataInputStream.class b/idl/orb/.class/org/omg/CORBA/DataInputStream.class new file mode 100644 index 0000000..6ac430c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataInputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataInputStreamHelper.class b/idl/orb/.class/org/omg/CORBA/DataInputStreamHelper.class new file mode 100644 index 0000000..3422ee6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataInputStreamHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataInputStreamHolder.class b/idl/orb/.class/org/omg/CORBA/DataInputStreamHolder.class new file mode 100644 index 0000000..607bceb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataInputStreamHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataOutputStream.class b/idl/orb/.class/org/omg/CORBA/DataOutputStream.class new file mode 100644 index 0000000..9e580f6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataOutputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataOutputStreamHelper.class b/idl/orb/.class/org/omg/CORBA/DataOutputStreamHelper.class new file mode 100644 index 0000000..4551628 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataOutputStreamHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DataOutputStreamHolder.class b/idl/orb/.class/org/omg/CORBA/DataOutputStreamHolder.class new file mode 100644 index 0000000..997c333 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DataOutputStreamHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DefinitionKind.class b/idl/orb/.class/org/omg/CORBA/DefinitionKind.class new file mode 100644 index 0000000..504a3eb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DefinitionKind.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DefinitionKindHelper.class b/idl/orb/.class/org/omg/CORBA/DefinitionKindHelper.class new file mode 100644 index 0000000..8f74a77 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DefinitionKindHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DefinitionKindHolder.class b/idl/orb/.class/org/omg/CORBA/DefinitionKindHolder.class new file mode 100644 index 0000000..373f8a9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DefinitionKindHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManager.class b/idl/orb/.class/org/omg/CORBA/DomainManager.class new file mode 100644 index 0000000..cbc78a0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManager.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerHelper.class b/idl/orb/.class/org/omg/CORBA/DomainManagerHelper.class new file mode 100644 index 0000000..9539090 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerHolder.class b/idl/orb/.class/org/omg/CORBA/DomainManagerHolder.class new file mode 100644 index 0000000..145c62a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerListHelper.class b/idl/orb/.class/org/omg/CORBA/DomainManagerListHelper.class new file mode 100644 index 0000000..36c259d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerListHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerListHolder.class b/idl/orb/.class/org/omg/CORBA/DomainManagerListHolder.class new file mode 100644 index 0000000..cbd144c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerListHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerOperations.class b/idl/orb/.class/org/omg/CORBA/DomainManagerOperations.class new file mode 100644 index 0000000..0b5de71 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerPOA.class b/idl/orb/.class/org/omg/CORBA/DomainManagerPOA.class new file mode 100644 index 0000000..4c46d3a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DomainManagerPOATie.class b/idl/orb/.class/org/omg/CORBA/DomainManagerPOATie.class new file mode 100644 index 0000000..9f18e97 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DomainManagerPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DoubleHolder.class b/idl/orb/.class/org/omg/CORBA/DoubleHolder.class new file mode 100644 index 0000000..65089e6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DoubleHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DoubleSeqHelper.class b/idl/orb/.class/org/omg/CORBA/DoubleSeqHelper.class new file mode 100644 index 0000000..fa4e3a5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DoubleSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DoubleSeqHolder.class b/idl/orb/.class/org/omg/CORBA/DoubleSeqHolder.class new file mode 100644 index 0000000..673a98f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DoubleSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/DynamicImplementation.class b/idl/orb/.class/org/omg/CORBA/DynamicImplementation.class new file mode 100644 index 0000000..65af293 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/DynamicImplementation.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDef.class b/idl/orb/.class/org/omg/CORBA/EnumDef.class new file mode 100644 index 0000000..99c3c77 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDefHelper.class b/idl/orb/.class/org/omg/CORBA/EnumDefHelper.class new file mode 100644 index 0000000..e3db15b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDefHolder.class b/idl/orb/.class/org/omg/CORBA/EnumDefHolder.class new file mode 100644 index 0000000..ce3a9ad Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDefOperations.class b/idl/orb/.class/org/omg/CORBA/EnumDefOperations.class new file mode 100644 index 0000000..03e119d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDefPOA.class b/idl/orb/.class/org/omg/CORBA/EnumDefPOA.class new file mode 100644 index 0000000..8f19599 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumDefPOATie.class b/idl/orb/.class/org/omg/CORBA/EnumDefPOATie.class new file mode 100644 index 0000000..7e271e5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHelper.class b/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHelper.class new file mode 100644 index 0000000..454729f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHolder.class b/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHolder.class new file mode 100644 index 0000000..898aaba Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/EnumMemberSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Environment.class b/idl/orb/.class/org/omg/CORBA/Environment.class new file mode 100644 index 0000000..69b2e34 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Environment.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHelper.class new file mode 100644 index 0000000..12efa0c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHolder.class new file mode 100644 index 0000000..768aff9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExcDescriptionSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDef.class b/idl/orb/.class/org/omg/CORBA/ExceptionDef.class new file mode 100644 index 0000000..fa1ac64 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefHelper.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefHelper.class new file mode 100644 index 0000000..18b6284 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefHolder.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefHolder.class new file mode 100644 index 0000000..9b47f9c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefOperations.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefOperations.class new file mode 100644 index 0000000..93c1ead Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefPOA.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefPOA.class new file mode 100644 index 0000000..c1ceb1f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefPOATie.class new file mode 100644 index 0000000..6a71011 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHelper.class new file mode 100644 index 0000000..af73e7e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHolder.class new file mode 100644 index 0000000..0eefe7f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDefSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDescription.class b/idl/orb/.class/org/omg/CORBA/ExceptionDescription.class new file mode 100644 index 0000000..5ff6aab Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHelper.class new file mode 100644 index 0000000..0c2bc1d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHolder.class new file mode 100644 index 0000000..b340ed4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ExceptionList.class b/idl/orb/.class/org/omg/CORBA/ExceptionList.class new file mode 100644 index 0000000..3f4ccb1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ExceptionList.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FREE_MEM.class b/idl/orb/.class/org/omg/CORBA/FREE_MEM.class new file mode 100644 index 0000000..26f0b5a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FREE_MEM.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDef.class b/idl/orb/.class/org/omg/CORBA/FixedDef.class new file mode 100644 index 0000000..6d46278 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDefHelper.class b/idl/orb/.class/org/omg/CORBA/FixedDefHelper.class new file mode 100644 index 0000000..8185229 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDefHolder.class b/idl/orb/.class/org/omg/CORBA/FixedDefHolder.class new file mode 100644 index 0000000..e463232 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDefOperations.class b/idl/orb/.class/org/omg/CORBA/FixedDefOperations.class new file mode 100644 index 0000000..d141a6d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDefPOA.class b/idl/orb/.class/org/omg/CORBA/FixedDefPOA.class new file mode 100644 index 0000000..19b1ecb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FixedDefPOATie.class b/idl/orb/.class/org/omg/CORBA/FixedDefPOATie.class new file mode 100644 index 0000000..1f21629 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FixedDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FlagsHelper.class b/idl/orb/.class/org/omg/CORBA/FlagsHelper.class new file mode 100644 index 0000000..a3a0948 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FlagsHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FloatHolder.class b/idl/orb/.class/org/omg/CORBA/FloatHolder.class new file mode 100644 index 0000000..76273d1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FloatHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FloatSeqHelper.class b/idl/orb/.class/org/omg/CORBA/FloatSeqHelper.class new file mode 100644 index 0000000..315ed6a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FloatSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/FloatSeqHolder.class b/idl/orb/.class/org/omg/CORBA/FloatSeqHolder.class new file mode 100644 index 0000000..b0560e2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/FloatSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLType.class b/idl/orb/.class/org/omg/CORBA/IDLType.class new file mode 100644 index 0000000..8205a6a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLType.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLTypeHelper.class b/idl/orb/.class/org/omg/CORBA/IDLTypeHelper.class new file mode 100644 index 0000000..5e96dbc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLTypeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLTypeHolder.class b/idl/orb/.class/org/omg/CORBA/IDLTypeHolder.class new file mode 100644 index 0000000..8913026 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLTypeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLTypeOperations.class b/idl/orb/.class/org/omg/CORBA/IDLTypeOperations.class new file mode 100644 index 0000000..33b03a0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLTypeOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLTypePOA.class b/idl/orb/.class/org/omg/CORBA/IDLTypePOA.class new file mode 100644 index 0000000..7f33ada Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLTypePOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IDLTypePOATie.class b/idl/orb/.class/org/omg/CORBA/IDLTypePOATie.class new file mode 100644 index 0000000..31ddc08 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IDLTypePOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IMP_LIMIT.class b/idl/orb/.class/org/omg/CORBA/IMP_LIMIT.class new file mode 100644 index 0000000..4f7f58a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IMP_LIMIT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INITIALIZE.class b/idl/orb/.class/org/omg/CORBA/INITIALIZE.class new file mode 100644 index 0000000..b84746c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INITIALIZE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INTERNAL.class b/idl/orb/.class/org/omg/CORBA/INTERNAL.class new file mode 100644 index 0000000..dc60ebf Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INTERNAL.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INTF_REPOS.class b/idl/orb/.class/org/omg/CORBA/INTF_REPOS.class new file mode 100644 index 0000000..bedb27b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INTF_REPOS.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INVALID_TRANSACTION.class b/idl/orb/.class/org/omg/CORBA/INVALID_TRANSACTION.class new file mode 100644 index 0000000..8ae998b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INVALID_TRANSACTION.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INV_FLAG.class b/idl/orb/.class/org/omg/CORBA/INV_FLAG.class new file mode 100644 index 0000000..059c7f9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INV_FLAG.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INV_IDENT.class b/idl/orb/.class/org/omg/CORBA/INV_IDENT.class new file mode 100644 index 0000000..22dffec Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INV_IDENT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INV_OBJREF.class b/idl/orb/.class/org/omg/CORBA/INV_OBJREF.class new file mode 100644 index 0000000..86d5c7f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INV_OBJREF.class differ diff --git a/idl/orb/.class/org/omg/CORBA/INV_POLICY.class b/idl/orb/.class/org/omg/CORBA/INV_POLICY.class new file mode 100644 index 0000000..0397cd8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/INV_POLICY.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObject.class b/idl/orb/.class/org/omg/CORBA/IRObject.class new file mode 100644 index 0000000..d18795e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObject.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObjectHelper.class b/idl/orb/.class/org/omg/CORBA/IRObjectHelper.class new file mode 100644 index 0000000..6566d28 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObjectHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObjectHolder.class b/idl/orb/.class/org/omg/CORBA/IRObjectHolder.class new file mode 100644 index 0000000..1e8a12e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObjectHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObjectOperations.class b/idl/orb/.class/org/omg/CORBA/IRObjectOperations.class new file mode 100644 index 0000000..1459386 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObjectOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObjectPOA.class b/idl/orb/.class/org/omg/CORBA/IRObjectPOA.class new file mode 100644 index 0000000..da9d28c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObjectPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IRObjectPOATie.class b/idl/orb/.class/org/omg/CORBA/IRObjectPOATie.class new file mode 100644 index 0000000..01ce854 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IRObjectPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IdentifierHelper.class b/idl/orb/.class/org/omg/CORBA/IdentifierHelper.class new file mode 100644 index 0000000..68d7176 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IdentifierHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Initializer.class b/idl/orb/.class/org/omg/CORBA/Initializer.class new file mode 100644 index 0000000..fb4bbfc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Initializer.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InitializerHelper.class b/idl/orb/.class/org/omg/CORBA/InitializerHelper.class new file mode 100644 index 0000000..a7abbd5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InitializerHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InitializerHolder.class b/idl/orb/.class/org/omg/CORBA/InitializerHolder.class new file mode 100644 index 0000000..afd7320 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InitializerHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InitializerSeqHelper.class b/idl/orb/.class/org/omg/CORBA/InitializerSeqHelper.class new file mode 100644 index 0000000..a93a79b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InitializerSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InitializerSeqHolder.class b/idl/orb/.class/org/omg/CORBA/InitializerSeqHolder.class new file mode 100644 index 0000000..d8351da Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InitializerSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/IntHolder.class b/idl/orb/.class/org/omg/CORBA/IntHolder.class new file mode 100644 index 0000000..cf4d33f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/IntHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDef.class b/idl/orb/.class/org/omg/CORBA/InterfaceDef.class new file mode 100644 index 0000000..5f0d2cb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefHelper.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefHelper.class new file mode 100644 index 0000000..c113753 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefHolder.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefHolder.class new file mode 100644 index 0000000..2c70ec0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefOperations.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefOperations.class new file mode 100644 index 0000000..4f29a9e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefPOA.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefPOA.class new file mode 100644 index 0000000..a7d9c34 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefPOATie.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefPOATie.class new file mode 100644 index 0000000..8656427 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescription.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescription.class new file mode 100644 index 0000000..bcab45e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHelper.class new file mode 100644 index 0000000..a09b275 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHolder.class new file mode 100644 index 0000000..f4c88c4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefPackage/FullInterfaceDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHelper.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHelper.class new file mode 100644 index 0000000..7ba03e2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHolder.class b/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHolder.class new file mode 100644 index 0000000..80f0ca5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDefSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDescription.class b/idl/orb/.class/org/omg/CORBA/InterfaceDescription.class new file mode 100644 index 0000000..89e28e6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHelper.class new file mode 100644 index 0000000..429505a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHolder.class new file mode 100644 index 0000000..4420608 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InterfaceDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InvalidPolicies.class b/idl/orb/.class/org/omg/CORBA/InvalidPolicies.class new file mode 100644 index 0000000..1fe6ce6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InvalidPolicies.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHelper.class b/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHelper.class new file mode 100644 index 0000000..f4d2ec4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHolder.class b/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHolder.class new file mode 100644 index 0000000..14fb459 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/InvalidPoliciesHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LocalInterface.class b/idl/orb/.class/org/omg/CORBA/LocalInterface.class new file mode 100644 index 0000000..697299e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LocalInterface.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LocalObject.class b/idl/orb/.class/org/omg/CORBA/LocalObject.class new file mode 100644 index 0000000..ca21256 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LocalObject.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LongHolder.class b/idl/orb/.class/org/omg/CORBA/LongHolder.class new file mode 100644 index 0000000..5fc84da Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LongHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LongLongSeqHelper.class b/idl/orb/.class/org/omg/CORBA/LongLongSeqHelper.class new file mode 100644 index 0000000..85baba5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LongLongSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LongLongSeqHolder.class b/idl/orb/.class/org/omg/CORBA/LongLongSeqHolder.class new file mode 100644 index 0000000..80958b3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LongLongSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LongSeqHelper.class b/idl/orb/.class/org/omg/CORBA/LongSeqHelper.class new file mode 100644 index 0000000..8cce9a9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LongSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/LongSeqHolder.class b/idl/orb/.class/org/omg/CORBA/LongSeqHolder.class new file mode 100644 index 0000000..32ef700 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/LongSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/MARSHAL.class b/idl/orb/.class/org/omg/CORBA/MARSHAL.class new file mode 100644 index 0000000..28247ef Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/MARSHAL.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDef.class b/idl/orb/.class/org/omg/CORBA/ModuleDef.class new file mode 100644 index 0000000..7ae13ef Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDefHelper.class b/idl/orb/.class/org/omg/CORBA/ModuleDefHelper.class new file mode 100644 index 0000000..4c466d2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDefHolder.class b/idl/orb/.class/org/omg/CORBA/ModuleDefHolder.class new file mode 100644 index 0000000..4957c88 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDefOperations.class b/idl/orb/.class/org/omg/CORBA/ModuleDefOperations.class new file mode 100644 index 0000000..a4b8215 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDefPOA.class b/idl/orb/.class/org/omg/CORBA/ModuleDefPOA.class new file mode 100644 index 0000000..f0a13c9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ModuleDefPOATie.class new file mode 100644 index 0000000..bfa3278 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDescription.class b/idl/orb/.class/org/omg/CORBA/ModuleDescription.class new file mode 100644 index 0000000..c144a4c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHelper.class new file mode 100644 index 0000000..e2f2b2c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHolder.class new file mode 100644 index 0000000..4580017 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ModuleDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NO_IMPLEMENT.class b/idl/orb/.class/org/omg/CORBA/NO_IMPLEMENT.class new file mode 100644 index 0000000..9cd0b92 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NO_IMPLEMENT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NO_MEMORY.class b/idl/orb/.class/org/omg/CORBA/NO_MEMORY.class new file mode 100644 index 0000000..f3d1ef6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NO_MEMORY.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NO_PERMISSION.class b/idl/orb/.class/org/omg/CORBA/NO_PERMISSION.class new file mode 100644 index 0000000..eb7e87b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NO_PERMISSION.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NO_RESOURCES.class b/idl/orb/.class/org/omg/CORBA/NO_RESOURCES.class new file mode 100644 index 0000000..c897b30 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NO_RESOURCES.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NO_RESPONSE.class b/idl/orb/.class/org/omg/CORBA/NO_RESPONSE.class new file mode 100644 index 0000000..ce64f45 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NO_RESPONSE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NVList.class b/idl/orb/.class/org/omg/CORBA/NVList.class new file mode 100644 index 0000000..c72f0b3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NVList.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NamedValue.class b/idl/orb/.class/org/omg/CORBA/NamedValue.class new file mode 100644 index 0000000..a288a76 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NamedValue.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDef.class b/idl/orb/.class/org/omg/CORBA/NativeDef.class new file mode 100644 index 0000000..7656719 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDefHelper.class b/idl/orb/.class/org/omg/CORBA/NativeDefHelper.class new file mode 100644 index 0000000..10b3d9d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDefHolder.class b/idl/orb/.class/org/omg/CORBA/NativeDefHolder.class new file mode 100644 index 0000000..e581ff3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDefOperations.class b/idl/orb/.class/org/omg/CORBA/NativeDefOperations.class new file mode 100644 index 0000000..5b63f4a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDefPOA.class b/idl/orb/.class/org/omg/CORBA/NativeDefPOA.class new file mode 100644 index 0000000..c4141e2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/NativeDefPOATie.class b/idl/orb/.class/org/omg/CORBA/NativeDefPOATie.class new file mode 100644 index 0000000..df4e522 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/NativeDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OBJECT_NOT_EXIST.class b/idl/orb/.class/org/omg/CORBA/OBJECT_NOT_EXIST.class new file mode 100644 index 0000000..2ba8741 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OBJECT_NOT_EXIST.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OBJ_ADAPTER.class b/idl/orb/.class/org/omg/CORBA/OBJ_ADAPTER.class new file mode 100644 index 0000000..d1fd437 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OBJ_ADAPTER.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OMGVMCID.class b/idl/orb/.class/org/omg/CORBA/OMGVMCID.class new file mode 100644 index 0000000..4a9cd00 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OMGVMCID.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ORB.class b/idl/orb/.class/org/omg/CORBA/ORB.class new file mode 100644 index 0000000..239a5fb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ORB.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ORBPackage/InvalidName.class b/idl/orb/.class/org/omg/CORBA/ORBPackage/InvalidName.class new file mode 100644 index 0000000..5667bba Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ORBPackage/InvalidName.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Object.class b/idl/orb/.class/org/omg/CORBA/Object.class new file mode 100644 index 0000000..1b62e20 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Object.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ObjectHolder.class b/idl/orb/.class/org/omg/CORBA/ObjectHolder.class new file mode 100644 index 0000000..9bb6f40 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ObjectHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OctetSeqHelper.class b/idl/orb/.class/org/omg/CORBA/OctetSeqHelper.class new file mode 100644 index 0000000..328e140 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OctetSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OctetSeqHolder.class b/idl/orb/.class/org/omg/CORBA/OctetSeqHolder.class new file mode 100644 index 0000000..2b1e7e0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OctetSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHelper.class b/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHelper.class new file mode 100644 index 0000000..7762928 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHolder.class b/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHolder.class new file mode 100644 index 0000000..2a1d97a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OpDescriptionSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDef.class b/idl/orb/.class/org/omg/CORBA/OperationDef.class new file mode 100644 index 0000000..dd88e61 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDefHelper.class b/idl/orb/.class/org/omg/CORBA/OperationDefHelper.class new file mode 100644 index 0000000..c9a4ece Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDefHolder.class b/idl/orb/.class/org/omg/CORBA/OperationDefHolder.class new file mode 100644 index 0000000..6139327 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDefOperations.class b/idl/orb/.class/org/omg/CORBA/OperationDefOperations.class new file mode 100644 index 0000000..3fac0ef Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDefPOA.class b/idl/orb/.class/org/omg/CORBA/OperationDefPOA.class new file mode 100644 index 0000000..a52cbb6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDefPOATie.class b/idl/orb/.class/org/omg/CORBA/OperationDefPOATie.class new file mode 100644 index 0000000..59df32c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDescription.class b/idl/orb/.class/org/omg/CORBA/OperationDescription.class new file mode 100644 index 0000000..ef3d57c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/OperationDescriptionHelper.class new file mode 100644 index 0000000..113887f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/OperationDescriptionHolder.class new file mode 100644 index 0000000..9518488 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationMode.class b/idl/orb/.class/org/omg/CORBA/OperationMode.class new file mode 100644 index 0000000..b1b424d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationMode.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationModeHelper.class b/idl/orb/.class/org/omg/CORBA/OperationModeHelper.class new file mode 100644 index 0000000..674c6c7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationModeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/OperationModeHolder.class b/idl/orb/.class/org/omg/CORBA/OperationModeHolder.class new file mode 100644 index 0000000..713fa39 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/OperationModeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PERSIST_STORE.class b/idl/orb/.class/org/omg/CORBA/PERSIST_STORE.class new file mode 100644 index 0000000..c1b0026 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PERSIST_STORE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PRIVATE_MEMBER.class b/idl/orb/.class/org/omg/CORBA/PRIVATE_MEMBER.class new file mode 100644 index 0000000..10ef47a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PRIVATE_MEMBER.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PUBLIC_MEMBER.class b/idl/orb/.class/org/omg/CORBA/PUBLIC_MEMBER.class new file mode 100644 index 0000000..8521c41 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PUBLIC_MEMBER.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHelper.class new file mode 100644 index 0000000..a3aa46d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHolder.class new file mode 100644 index 0000000..fd8f022 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParDescriptionSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterDescription.class b/idl/orb/.class/org/omg/CORBA/ParameterDescription.class new file mode 100644 index 0000000..6739d08 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHelper.class new file mode 100644 index 0000000..f92b563 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHolder.class new file mode 100644 index 0000000..84a3078 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterMode.class b/idl/orb/.class/org/omg/CORBA/ParameterMode.class new file mode 100644 index 0000000..aca9c19 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterMode.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterModeHelper.class b/idl/orb/.class/org/omg/CORBA/ParameterModeHelper.class new file mode 100644 index 0000000..0d049d1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterModeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ParameterModeHolder.class b/idl/orb/.class/org/omg/CORBA/ParameterModeHolder.class new file mode 100644 index 0000000..0364a0b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ParameterModeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Policy.class b/idl/orb/.class/org/omg/CORBA/Policy.class new file mode 100644 index 0000000..50e9551 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Policy.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrent.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrent.class new file mode 100644 index 0000000..4a7f883 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrent.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrentHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrentHelper.class new file mode 100644 index 0000000..70cc1b8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrentHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrentHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrentHolder.class new file mode 100644 index 0000000..a13abb9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrentHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalBase.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalBase.class new file mode 100644 index 0000000..26784cd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalBase.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalTie.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalTie.class new file mode 100644 index 0000000..ebc539b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrentLocalTie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyCurrentOperations.class b/idl/orb/.class/org/omg/CORBA/PolicyCurrentOperations.class new file mode 100644 index 0000000..aa2fb3e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyCurrentOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyError.class b/idl/orb/.class/org/omg/CORBA/PolicyError.class new file mode 100644 index 0000000..2008c2e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyError.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyErrorCodeHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyErrorCodeHelper.class new file mode 100644 index 0000000..5de814e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyErrorCodeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyErrorHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyErrorHelper.class new file mode 100644 index 0000000..35bb706 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyErrorHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyErrorHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyErrorHolder.class new file mode 100644 index 0000000..77054c2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyErrorHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyHelper.class new file mode 100644 index 0000000..bd12702 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyHolder.class new file mode 100644 index 0000000..148634e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyListHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyListHelper.class new file mode 100644 index 0000000..7889063 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyListHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyListHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyListHolder.class new file mode 100644 index 0000000..9dea350 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyListHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManager.class b/idl/orb/.class/org/omg/CORBA/PolicyManager.class new file mode 100644 index 0000000..98d9c0a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManager.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManagerHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyManagerHelper.class new file mode 100644 index 0000000..91e38ef Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManagerHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManagerHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyManagerHolder.class new file mode 100644 index 0000000..932587a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManagerHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalBase.class b/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalBase.class new file mode 100644 index 0000000..0a990c3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalBase.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalTie.class b/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalTie.class new file mode 100644 index 0000000..a88c20a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManagerLocalTie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyManagerOperations.class b/idl/orb/.class/org/omg/CORBA/PolicyManagerOperations.class new file mode 100644 index 0000000..cbafd36 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyManagerOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyOperations.class b/idl/orb/.class/org/omg/CORBA/PolicyOperations.class new file mode 100644 index 0000000..b745016 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyPOA.class b/idl/orb/.class/org/omg/CORBA/PolicyPOA.class new file mode 100644 index 0000000..61e7fa1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyPOATie.class b/idl/orb/.class/org/omg/CORBA/PolicyPOATie.class new file mode 100644 index 0000000..9a58ccd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyTypeHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyTypeHelper.class new file mode 100644 index 0000000..af6e5ac Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyTypeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHelper.class b/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHelper.class new file mode 100644 index 0000000..4e60f17 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHolder.class b/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHolder.class new file mode 100644 index 0000000..f6f13bc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PolicyTypeSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDef.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDef.class new file mode 100644 index 0000000..6ffd7e3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDefHelper.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDefHelper.class new file mode 100644 index 0000000..430537b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDefHolder.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDefHolder.class new file mode 100644 index 0000000..1e70e3c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDefOperations.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDefOperations.class new file mode 100644 index 0000000..3029b2c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOA.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOA.class new file mode 100644 index 0000000..0793180 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOATie.class b/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOATie.class new file mode 100644 index 0000000..67e7187 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveKind.class b/idl/orb/.class/org/omg/CORBA/PrimitiveKind.class new file mode 100644 index 0000000..a826d5e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveKind.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveKindHelper.class b/idl/orb/.class/org/omg/CORBA/PrimitiveKindHelper.class new file mode 100644 index 0000000..2a46990 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveKindHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrimitiveKindHolder.class b/idl/orb/.class/org/omg/CORBA/PrimitiveKindHolder.class new file mode 100644 index 0000000..431f9e0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrimitiveKindHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Principal.class b/idl/orb/.class/org/omg/CORBA/Principal.class new file mode 100644 index 0000000..96559ad Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Principal.class differ diff --git a/idl/orb/.class/org/omg/CORBA/PrincipalHolder.class b/idl/orb/.class/org/omg/CORBA/PrincipalHolder.class new file mode 100644 index 0000000..68d9541 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/PrincipalHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Repository.class b/idl/orb/.class/org/omg/CORBA/Repository.class new file mode 100644 index 0000000..93ec97b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Repository.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryHelper.class b/idl/orb/.class/org/omg/CORBA/RepositoryHelper.class new file mode 100644 index 0000000..493a665 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryHolder.class b/idl/orb/.class/org/omg/CORBA/RepositoryHolder.class new file mode 100644 index 0000000..03db3d7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryIdHelper.class b/idl/orb/.class/org/omg/CORBA/RepositoryIdHelper.class new file mode 100644 index 0000000..eb4b34d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryIdHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHelper.class b/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHelper.class new file mode 100644 index 0000000..cfc95a9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHolder.class b/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHolder.class new file mode 100644 index 0000000..4b3e01c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryIdSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryOperations.class b/idl/orb/.class/org/omg/CORBA/RepositoryOperations.class new file mode 100644 index 0000000..467b457 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryPOA.class b/idl/orb/.class/org/omg/CORBA/RepositoryPOA.class new file mode 100644 index 0000000..588ed97 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/RepositoryPOATie.class b/idl/orb/.class/org/omg/CORBA/RepositoryPOATie.class new file mode 100644 index 0000000..e96a3ab Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/RepositoryPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Request.class b/idl/orb/.class/org/omg/CORBA/Request.class new file mode 100644 index 0000000..3a54450 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Request.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ScopedNameHelper.class b/idl/orb/.class/org/omg/CORBA/ScopedNameHelper.class new file mode 100644 index 0000000..5461c28 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ScopedNameHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SecConstruction.class b/idl/orb/.class/org/omg/CORBA/SecConstruction.class new file mode 100644 index 0000000..093316c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SecConstruction.class differ diff --git a/idl/orb/.class/org/omg/CORBA/Security.class b/idl/orb/.class/org/omg/CORBA/Security.class new file mode 100644 index 0000000..485207c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/Security.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDef.class b/idl/orb/.class/org/omg/CORBA/SequenceDef.class new file mode 100644 index 0000000..042593c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDefHelper.class b/idl/orb/.class/org/omg/CORBA/SequenceDefHelper.class new file mode 100644 index 0000000..f0fce07 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDefHolder.class b/idl/orb/.class/org/omg/CORBA/SequenceDefHolder.class new file mode 100644 index 0000000..554c3f2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDefOperations.class b/idl/orb/.class/org/omg/CORBA/SequenceDefOperations.class new file mode 100644 index 0000000..d254e90 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDefPOA.class b/idl/orb/.class/org/omg/CORBA/SequenceDefPOA.class new file mode 100644 index 0000000..f8eb451 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SequenceDefPOATie.class b/idl/orb/.class/org/omg/CORBA/SequenceDefPOATie.class new file mode 100644 index 0000000..00fdf67 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SequenceDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServerRequest.class b/idl/orb/.class/org/omg/CORBA/ServerRequest.class new file mode 100644 index 0000000..65c6605 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServerRequest.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceDetail.class b/idl/orb/.class/org/omg/CORBA/ServiceDetail.class new file mode 100644 index 0000000..e10ae82 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceDetail.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceDetailHelper.class b/idl/orb/.class/org/omg/CORBA/ServiceDetailHelper.class new file mode 100644 index 0000000..e454954 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceDetailHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceDetailHolder.class b/idl/orb/.class/org/omg/CORBA/ServiceDetailHolder.class new file mode 100644 index 0000000..230dfde Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceDetailHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceDetailTypeHelper.class b/idl/orb/.class/org/omg/CORBA/ServiceDetailTypeHelper.class new file mode 100644 index 0000000..f14635e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceDetailTypeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceInformation.class b/idl/orb/.class/org/omg/CORBA/ServiceInformation.class new file mode 100644 index 0000000..f21e776 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceInformation.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceInformationHelper.class b/idl/orb/.class/org/omg/CORBA/ServiceInformationHelper.class new file mode 100644 index 0000000..a8da6f5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceInformationHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceInformationHolder.class b/idl/orb/.class/org/omg/CORBA/ServiceInformationHolder.class new file mode 100644 index 0000000..be47e90 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceInformationHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceOptionHelper.class b/idl/orb/.class/org/omg/CORBA/ServiceOptionHelper.class new file mode 100644 index 0000000..8a2439d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceOptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ServiceTypeHelper.class b/idl/orb/.class/org/omg/CORBA/ServiceTypeHelper.class new file mode 100644 index 0000000..7aa4199 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ServiceTypeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SetOverrideType.class b/idl/orb/.class/org/omg/CORBA/SetOverrideType.class new file mode 100644 index 0000000..d0cb5e2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SetOverrideType.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHelper.class b/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHelper.class new file mode 100644 index 0000000..caefb18 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHolder.class b/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHolder.class new file mode 100644 index 0000000..e7763f3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SetOverrideTypeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ShortHolder.class b/idl/orb/.class/org/omg/CORBA/ShortHolder.class new file mode 100644 index 0000000..883b3fb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ShortHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ShortSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ShortSeqHelper.class new file mode 100644 index 0000000..0764c76 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ShortSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ShortSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ShortSeqHolder.class new file mode 100644 index 0000000..1a29aae Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ShortSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDef.class b/idl/orb/.class/org/omg/CORBA/StringDef.class new file mode 100644 index 0000000..32cf848 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDefHelper.class b/idl/orb/.class/org/omg/CORBA/StringDefHelper.class new file mode 100644 index 0000000..7a78986 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDefHolder.class b/idl/orb/.class/org/omg/CORBA/StringDefHolder.class new file mode 100644 index 0000000..bedc90d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDefOperations.class b/idl/orb/.class/org/omg/CORBA/StringDefOperations.class new file mode 100644 index 0000000..59b9ba5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDefPOA.class b/idl/orb/.class/org/omg/CORBA/StringDefPOA.class new file mode 100644 index 0000000..99e8b50 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringDefPOATie.class b/idl/orb/.class/org/omg/CORBA/StringDefPOATie.class new file mode 100644 index 0000000..1f4881d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringHolder.class b/idl/orb/.class/org/omg/CORBA/StringHolder.class new file mode 100644 index 0000000..709c3c4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringSeqHelper.class b/idl/orb/.class/org/omg/CORBA/StringSeqHelper.class new file mode 100644 index 0000000..538848c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringSeqHolder.class b/idl/orb/.class/org/omg/CORBA/StringSeqHolder.class new file mode 100644 index 0000000..f922391 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringValueHelper.class b/idl/orb/.class/org/omg/CORBA/StringValueHelper.class new file mode 100644 index 0000000..b8e254f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringValueHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StringValueHolder.class b/idl/orb/.class/org/omg/CORBA/StringValueHolder.class new file mode 100644 index 0000000..634fe12 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StringValueHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDef.class b/idl/orb/.class/org/omg/CORBA/StructDef.class new file mode 100644 index 0000000..632630c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDefHelper.class b/idl/orb/.class/org/omg/CORBA/StructDefHelper.class new file mode 100644 index 0000000..a15cac3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDefHolder.class b/idl/orb/.class/org/omg/CORBA/StructDefHolder.class new file mode 100644 index 0000000..8ace241 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDefOperations.class b/idl/orb/.class/org/omg/CORBA/StructDefOperations.class new file mode 100644 index 0000000..423d5a9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDefPOA.class b/idl/orb/.class/org/omg/CORBA/StructDefPOA.class new file mode 100644 index 0000000..595b594 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructDefPOATie.class b/idl/orb/.class/org/omg/CORBA/StructDefPOATie.class new file mode 100644 index 0000000..d34a31e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructMember.class b/idl/orb/.class/org/omg/CORBA/StructMember.class new file mode 100644 index 0000000..14e5b73 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructMember.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructMemberHelper.class b/idl/orb/.class/org/omg/CORBA/StructMemberHelper.class new file mode 100644 index 0000000..99f238d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructMemberHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructMemberHolder.class b/idl/orb/.class/org/omg/CORBA/StructMemberHolder.class new file mode 100644 index 0000000..c7bf842 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructMemberHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructMemberSeqHelper.class b/idl/orb/.class/org/omg/CORBA/StructMemberSeqHelper.class new file mode 100644 index 0000000..de82a51 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructMemberSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/StructMemberSeqHolder.class b/idl/orb/.class/org/omg/CORBA/StructMemberSeqHolder.class new file mode 100644 index 0000000..cfafa22 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/StructMemberSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/SystemException.class b/idl/orb/.class/org/omg/CORBA/SystemException.class new file mode 100644 index 0000000..a5cd5c2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/SystemException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TCKind.class b/idl/orb/.class/org/omg/CORBA/TCKind.class new file mode 100644 index 0000000..617290d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TCKind.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TCKindHelper.class b/idl/orb/.class/org/omg/CORBA/TCKindHelper.class new file mode 100644 index 0000000..c7ef4f0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TCKindHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TCKindHolder.class b/idl/orb/.class/org/omg/CORBA/TCKindHolder.class new file mode 100644 index 0000000..a372699 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TCKindHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TIMEOUT.class b/idl/orb/.class/org/omg/CORBA/TIMEOUT.class new file mode 100644 index 0000000..c54db00 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TIMEOUT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TRANSACTION_REQUIRED.class b/idl/orb/.class/org/omg/CORBA/TRANSACTION_REQUIRED.class new file mode 100644 index 0000000..3cadf10 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TRANSACTION_REQUIRED.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class b/idl/orb/.class/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class new file mode 100644 index 0000000..6885c5c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TRANSACTION_ROLLEDBACK.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TRANSIENT.class b/idl/orb/.class/org/omg/CORBA/TRANSIENT.class new file mode 100644 index 0000000..5b21925 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TRANSIENT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeCode.class b/idl/orb/.class/org/omg/CORBA/TypeCode.class new file mode 100644 index 0000000..8cefffa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeCode.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeCodeHelper.class b/idl/orb/.class/org/omg/CORBA/TypeCodeHelper.class new file mode 100644 index 0000000..6264d47 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeCodeHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeCodeHolder.class b/idl/orb/.class/org/omg/CORBA/TypeCodeHolder.class new file mode 100644 index 0000000..d9e5037 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeCodeHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeCodePackage/BadKind.class b/idl/orb/.class/org/omg/CORBA/TypeCodePackage/BadKind.class new file mode 100644 index 0000000..c512847 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeCodePackage/BadKind.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeCodePackage/Bounds.class b/idl/orb/.class/org/omg/CORBA/TypeCodePackage/Bounds.class new file mode 100644 index 0000000..12fba0d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeCodePackage/Bounds.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeDescription.class b/idl/orb/.class/org/omg/CORBA/TypeDescription.class new file mode 100644 index 0000000..1d11541 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/TypeDescriptionHelper.class new file mode 100644 index 0000000..4eabcad Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypeDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/TypeDescriptionHolder.class new file mode 100644 index 0000000..4451d61 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypeDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDef.class b/idl/orb/.class/org/omg/CORBA/TypedefDef.class new file mode 100644 index 0000000..94d7224 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDefHelper.class b/idl/orb/.class/org/omg/CORBA/TypedefDefHelper.class new file mode 100644 index 0000000..bab459a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDefHolder.class b/idl/orb/.class/org/omg/CORBA/TypedefDefHolder.class new file mode 100644 index 0000000..9a94b3e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDefOperations.class b/idl/orb/.class/org/omg/CORBA/TypedefDefOperations.class new file mode 100644 index 0000000..49bd6f6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDefPOA.class b/idl/orb/.class/org/omg/CORBA/TypedefDefPOA.class new file mode 100644 index 0000000..9ad0d9a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/TypedefDefPOATie.class b/idl/orb/.class/org/omg/CORBA/TypedefDefPOATie.class new file mode 100644 index 0000000..6ca73d4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/TypedefDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ULongLongSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ULongLongSeqHelper.class new file mode 100644 index 0000000..02c441a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ULongLongSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ULongLongSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ULongLongSeqHolder.class new file mode 100644 index 0000000..746ab8d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ULongLongSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ULongSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ULongSeqHelper.class new file mode 100644 index 0000000..41e0eea Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ULongSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ULongSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ULongSeqHolder.class new file mode 100644 index 0000000..469cde0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ULongSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UNKNOWN.class b/idl/orb/.class/org/omg/CORBA/UNKNOWN.class new file mode 100644 index 0000000..d549678 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UNKNOWN.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY.class b/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY.class new file mode 100644 index 0000000..a6f7f57 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class b/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class new file mode 100644 index 0000000..47166a7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UNSUPPORTED_POLICY_VALUE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UShortSeqHelper.class b/idl/orb/.class/org/omg/CORBA/UShortSeqHelper.class new file mode 100644 index 0000000..a3a287f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UShortSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UShortSeqHolder.class b/idl/orb/.class/org/omg/CORBA/UShortSeqHolder.class new file mode 100644 index 0000000..a7414f0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UShortSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDef.class b/idl/orb/.class/org/omg/CORBA/UnionDef.class new file mode 100644 index 0000000..2dc2336 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDefHelper.class b/idl/orb/.class/org/omg/CORBA/UnionDefHelper.class new file mode 100644 index 0000000..074fb2d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDefHolder.class b/idl/orb/.class/org/omg/CORBA/UnionDefHolder.class new file mode 100644 index 0000000..4a48b1f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDefOperations.class b/idl/orb/.class/org/omg/CORBA/UnionDefOperations.class new file mode 100644 index 0000000..fd8826e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDefPOA.class b/idl/orb/.class/org/omg/CORBA/UnionDefPOA.class new file mode 100644 index 0000000..f66cfc5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionDefPOATie.class b/idl/orb/.class/org/omg/CORBA/UnionDefPOATie.class new file mode 100644 index 0000000..e318a82 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionMember.class b/idl/orb/.class/org/omg/CORBA/UnionMember.class new file mode 100644 index 0000000..79b7b9e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionMember.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionMemberHelper.class b/idl/orb/.class/org/omg/CORBA/UnionMemberHelper.class new file mode 100644 index 0000000..8cc1391 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionMemberHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionMemberHolder.class b/idl/orb/.class/org/omg/CORBA/UnionMemberHolder.class new file mode 100644 index 0000000..96bce6a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionMemberHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHelper.class b/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHelper.class new file mode 100644 index 0000000..2db0ef4 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHolder.class b/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHolder.class new file mode 100644 index 0000000..7417f25 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnionMemberSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UnknownUserException.class b/idl/orb/.class/org/omg/CORBA/UnknownUserException.class new file mode 100644 index 0000000..9447cc6 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UnknownUserException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/UserException.class b/idl/orb/.class/org/omg/CORBA/UserException.class new file mode 100644 index 0000000..c45ffd5 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/UserException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VM_ABSTRACT.class b/idl/orb/.class/org/omg/CORBA/VM_ABSTRACT.class new file mode 100644 index 0000000..2d16b9a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VM_ABSTRACT.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VM_CUSTOM.class b/idl/orb/.class/org/omg/CORBA/VM_CUSTOM.class new file mode 100644 index 0000000..b562a4c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VM_CUSTOM.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VM_NONE.class b/idl/orb/.class/org/omg/CORBA/VM_NONE.class new file mode 100644 index 0000000..1b42253 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VM_NONE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VM_TRUNCATABLE.class b/idl/orb/.class/org/omg/CORBA/VM_TRUNCATABLE.class new file mode 100644 index 0000000..b30a5ad Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VM_TRUNCATABLE.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBaseHelper.class b/idl/orb/.class/org/omg/CORBA/ValueBaseHelper.class new file mode 100644 index 0000000..8f0f82e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBaseHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBaseHolder.class b/idl/orb/.class/org/omg/CORBA/ValueBaseHolder.class new file mode 100644 index 0000000..b5e5fcc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBaseHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDef.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDef.class new file mode 100644 index 0000000..348157c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDefHelper.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDefHelper.class new file mode 100644 index 0000000..cbebae0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDefHolder.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDefHolder.class new file mode 100644 index 0000000..15c7c81 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDefOperations.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDefOperations.class new file mode 100644 index 0000000..f7d9363 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOA.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOA.class new file mode 100644 index 0000000..0b6c88d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOATie.class new file mode 100644 index 0000000..6045b00 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueBoxDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDef.class b/idl/orb/.class/org/omg/CORBA/ValueDef.class new file mode 100644 index 0000000..6c4fed0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefHelper.class b/idl/orb/.class/org/omg/CORBA/ValueDefHelper.class new file mode 100644 index 0000000..e115fb9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefHolder.class b/idl/orb/.class/org/omg/CORBA/ValueDefHolder.class new file mode 100644 index 0000000..7e025cb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefOperations.class b/idl/orb/.class/org/omg/CORBA/ValueDefOperations.class new file mode 100644 index 0000000..3f3d04e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefPOA.class b/idl/orb/.class/org/omg/CORBA/ValueDefPOA.class new file mode 100644 index 0000000..30c2d0e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ValueDefPOATie.class new file mode 100644 index 0000000..1bdc052 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescription.class b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescription.class new file mode 100644 index 0000000..9484a9b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.class new file mode 100644 index 0000000..a0e1eaa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHolder.class new file mode 100644 index 0000000..5498392 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefPackage/FullValueDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ValueDefSeqHelper.class new file mode 100644 index 0000000..dfaf360 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDefSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ValueDefSeqHolder.class new file mode 100644 index 0000000..8e5acee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDefSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDescription.class b/idl/orb/.class/org/omg/CORBA/ValueDescription.class new file mode 100644 index 0000000..f033afe Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDescription.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDescriptionHelper.class b/idl/orb/.class/org/omg/CORBA/ValueDescriptionHelper.class new file mode 100644 index 0000000..aff5bfa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDescriptionHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueDescriptionHolder.class b/idl/orb/.class/org/omg/CORBA/ValueDescriptionHolder.class new file mode 100644 index 0000000..3d0b975 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueDescriptionHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMember.class b/idl/orb/.class/org/omg/CORBA/ValueMember.class new file mode 100644 index 0000000..9ff6fc7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMember.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDef.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDef.class new file mode 100644 index 0000000..adcba35 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDefHelper.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDefHelper.class new file mode 100644 index 0000000..06c53ee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDefHolder.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDefHolder.class new file mode 100644 index 0000000..dfbb716 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDefOperations.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDefOperations.class new file mode 100644 index 0000000..1152d10 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOA.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOA.class new file mode 100644 index 0000000..1cadf6b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOATie.class b/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOATie.class new file mode 100644 index 0000000..3707c3e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberHelper.class b/idl/orb/.class/org/omg/CORBA/ValueMemberHelper.class new file mode 100644 index 0000000..c36d9a9 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberHolder.class b/idl/orb/.class/org/omg/CORBA/ValueMemberHolder.class new file mode 100644 index 0000000..4e9c38b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHelper.class b/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHelper.class new file mode 100644 index 0000000..b02fc7c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHolder.class b/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHolder.class new file mode 100644 index 0000000..9bb8729 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueMemberSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/ValueModifierHelper.class b/idl/orb/.class/org/omg/CORBA/ValueModifierHelper.class new file mode 100644 index 0000000..c58992a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/ValueModifierHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VersionSpecHelper.class b/idl/orb/.class/org/omg/CORBA/VersionSpecHelper.class new file mode 100644 index 0000000..c188fe0 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VersionSpecHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/VisibilityHelper.class b/idl/orb/.class/org/omg/CORBA/VisibilityHelper.class new file mode 100644 index 0000000..7e0a7bc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/VisibilityHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WCharSeqHelper.class b/idl/orb/.class/org/omg/CORBA/WCharSeqHelper.class new file mode 100644 index 0000000..4ece8ec Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WCharSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WCharSeqHolder.class b/idl/orb/.class/org/omg/CORBA/WCharSeqHolder.class new file mode 100644 index 0000000..94d9f5a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WCharSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WStringSeqHelper.class b/idl/orb/.class/org/omg/CORBA/WStringSeqHelper.class new file mode 100644 index 0000000..698e335 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WStringSeqHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WStringSeqHolder.class b/idl/orb/.class/org/omg/CORBA/WStringSeqHolder.class new file mode 100644 index 0000000..a4ff27f Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WStringSeqHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WStringValueHelper.class b/idl/orb/.class/org/omg/CORBA/WStringValueHelper.class new file mode 100644 index 0000000..cf9ac50 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WStringValueHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WStringValueHolder.class b/idl/orb/.class/org/omg/CORBA/WStringValueHolder.class new file mode 100644 index 0000000..f9c9b7d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WStringValueHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WrongTransaction.class b/idl/orb/.class/org/omg/CORBA/WrongTransaction.class new file mode 100644 index 0000000..d5f0fdb Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WrongTransaction.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDef.class b/idl/orb/.class/org/omg/CORBA/WstringDef.class new file mode 100644 index 0000000..e44b839 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDef.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDefHelper.class b/idl/orb/.class/org/omg/CORBA/WstringDefHelper.class new file mode 100644 index 0000000..1623d16 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDefHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDefHolder.class b/idl/orb/.class/org/omg/CORBA/WstringDefHolder.class new file mode 100644 index 0000000..a2fda2d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDefHolder.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDefOperations.class b/idl/orb/.class/org/omg/CORBA/WstringDefOperations.class new file mode 100644 index 0000000..504fcab Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDefOperations.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDefPOA.class b/idl/orb/.class/org/omg/CORBA/WstringDefPOA.class new file mode 100644 index 0000000..f6cf1d2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDefPOA.class differ diff --git a/idl/orb/.class/org/omg/CORBA/WstringDefPOATie.class b/idl/orb/.class/org/omg/CORBA/WstringDefPOATie.class new file mode 100644 index 0000000..9c017ad Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/WstringDefPOATie.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_AliasDefStub.class b/idl/orb/.class/org/omg/CORBA/_AliasDefStub.class new file mode 100644 index 0000000..b921196 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_AliasDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ArrayDefStub.class b/idl/orb/.class/org/omg/CORBA/_ArrayDefStub.class new file mode 100644 index 0000000..836e10a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ArrayDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_AttributeDefStub.class b/idl/orb/.class/org/omg/CORBA/_AttributeDefStub.class new file mode 100644 index 0000000..85960ba Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_AttributeDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ConstantDefStub.class b/idl/orb/.class/org/omg/CORBA/_ConstantDefStub.class new file mode 100644 index 0000000..6ec42c8 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ConstantDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ConstructionPolicyStub.class b/idl/orb/.class/org/omg/CORBA/_ConstructionPolicyStub.class new file mode 100644 index 0000000..7e44255 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ConstructionPolicyStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ContainedStub.class b/idl/orb/.class/org/omg/CORBA/_ContainedStub.class new file mode 100644 index 0000000..035bc16 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ContainedStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ContainerStub.class b/idl/orb/.class/org/omg/CORBA/_ContainerStub.class new file mode 100644 index 0000000..524d5dd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ContainerStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_CurrentStub.class b/idl/orb/.class/org/omg/CORBA/_CurrentStub.class new file mode 100644 index 0000000..1e1f739 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_CurrentStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_DomainManagerStub.class b/idl/orb/.class/org/omg/CORBA/_DomainManagerStub.class new file mode 100644 index 0000000..db338b2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_DomainManagerStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_EnumDefStub.class b/idl/orb/.class/org/omg/CORBA/_EnumDefStub.class new file mode 100644 index 0000000..a7c330d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_EnumDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ExceptionDefStub.class b/idl/orb/.class/org/omg/CORBA/_ExceptionDefStub.class new file mode 100644 index 0000000..2073558 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ExceptionDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_FixedDefStub.class b/idl/orb/.class/org/omg/CORBA/_FixedDefStub.class new file mode 100644 index 0000000..74fbda3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_FixedDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_IDLTypeStub.class b/idl/orb/.class/org/omg/CORBA/_IDLTypeStub.class new file mode 100644 index 0000000..f729a4b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_IDLTypeStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_IRObjectStub.class b/idl/orb/.class/org/omg/CORBA/_IRObjectStub.class new file mode 100644 index 0000000..6a8bc2b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_IRObjectStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_InterfaceDefStub.class b/idl/orb/.class/org/omg/CORBA/_InterfaceDefStub.class new file mode 100644 index 0000000..408afa1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_InterfaceDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ModuleDefStub.class b/idl/orb/.class/org/omg/CORBA/_ModuleDefStub.class new file mode 100644 index 0000000..4b91bee Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ModuleDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_NativeDefStub.class b/idl/orb/.class/org/omg/CORBA/_NativeDefStub.class new file mode 100644 index 0000000..9d41585 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_NativeDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_OperationDefStub.class b/idl/orb/.class/org/omg/CORBA/_OperationDefStub.class new file mode 100644 index 0000000..c18d723 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_OperationDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_PolicyStub.class b/idl/orb/.class/org/omg/CORBA/_PolicyStub.class new file mode 100644 index 0000000..eece555 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_PolicyStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_PrimitiveDefStub.class b/idl/orb/.class/org/omg/CORBA/_PrimitiveDefStub.class new file mode 100644 index 0000000..fdfb2ec Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_PrimitiveDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_RepositoryStub.class b/idl/orb/.class/org/omg/CORBA/_RepositoryStub.class new file mode 100644 index 0000000..73ae8ce Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_RepositoryStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_SequenceDefStub.class b/idl/orb/.class/org/omg/CORBA/_SequenceDefStub.class new file mode 100644 index 0000000..a975245 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_SequenceDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_StringDefStub.class b/idl/orb/.class/org/omg/CORBA/_StringDefStub.class new file mode 100644 index 0000000..78d9c86 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_StringDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_StructDefStub.class b/idl/orb/.class/org/omg/CORBA/_StructDefStub.class new file mode 100644 index 0000000..d208a88 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_StructDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_TypedefDefStub.class b/idl/orb/.class/org/omg/CORBA/_TypedefDefStub.class new file mode 100644 index 0000000..ae7575a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_TypedefDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_UnionDefStub.class b/idl/orb/.class/org/omg/CORBA/_UnionDefStub.class new file mode 100644 index 0000000..b07b9bc Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_UnionDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ValueBoxDefStub.class b/idl/orb/.class/org/omg/CORBA/_ValueBoxDefStub.class new file mode 100644 index 0000000..17d97ea Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ValueBoxDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ValueDefStub.class b/idl/orb/.class/org/omg/CORBA/_ValueDefStub.class new file mode 100644 index 0000000..6351a70 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ValueDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_ValueMemberDefStub.class b/idl/orb/.class/org/omg/CORBA/_ValueMemberDefStub.class new file mode 100644 index 0000000..7ef4a4e Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_ValueMemberDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/_WstringDefStub.class b/idl/orb/.class/org/omg/CORBA/_WstringDefStub.class new file mode 100644 index 0000000..35c5699 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/_WstringDefStub.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ApplicationException.class b/idl/orb/.class/org/omg/CORBA/portable/ApplicationException.class new file mode 100644 index 0000000..0e776de Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ApplicationException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/BoxedValueHelper.class b/idl/orb/.class/org/omg/CORBA/portable/BoxedValueHelper.class new file mode 100644 index 0000000..2928923 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/BoxedValueHelper.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/CustomValue.class b/idl/orb/.class/org/omg/CORBA/portable/CustomValue.class new file mode 100644 index 0000000..81f189a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/CustomValue.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/Delegate.class b/idl/orb/.class/org/omg/CORBA/portable/Delegate.class new file mode 100644 index 0000000..c2a84f3 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/Delegate.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/IDLEntity.class b/idl/orb/.class/org/omg/CORBA/portable/IDLEntity.class new file mode 100644 index 0000000..0a5c736 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/IDLEntity.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/IndirectionException.class b/idl/orb/.class/org/omg/CORBA/portable/IndirectionException.class new file mode 100644 index 0000000..2fd406b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/IndirectionException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/InputStream.class b/idl/orb/.class/org/omg/CORBA/portable/InputStream.class new file mode 100644 index 0000000..3d5c9f7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/InputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/InvokeHandler.class b/idl/orb/.class/org/omg/CORBA/portable/InvokeHandler.class new file mode 100644 index 0000000..0d37d6c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/InvokeHandler.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ObjectImpl.class b/idl/orb/.class/org/omg/CORBA/portable/ObjectImpl.class new file mode 100644 index 0000000..7c4061c Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ObjectImpl.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/OutputStream.class b/idl/orb/.class/org/omg/CORBA/portable/OutputStream.class new file mode 100644 index 0000000..ded95cd Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/OutputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/RemarshalException.class b/idl/orb/.class/org/omg/CORBA/portable/RemarshalException.class new file mode 100644 index 0000000..8e1a69d Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/RemarshalException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ResponseHandler.class b/idl/orb/.class/org/omg/CORBA/portable/ResponseHandler.class new file mode 100644 index 0000000..16ba320 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ResponseHandler.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ServantObject.class b/idl/orb/.class/org/omg/CORBA/portable/ServantObject.class new file mode 100644 index 0000000..84e177a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ServantObject.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/Streamable.class b/idl/orb/.class/org/omg/CORBA/portable/Streamable.class new file mode 100644 index 0000000..ca597fa Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/Streamable.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/StreamableValue.class b/idl/orb/.class/org/omg/CORBA/portable/StreamableValue.class new file mode 100644 index 0000000..1f1113b Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/StreamableValue.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/UnknownException.class b/idl/orb/.class/org/omg/CORBA/portable/UnknownException.class new file mode 100644 index 0000000..2c65319 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/UnknownException.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ValueBase.class b/idl/orb/.class/org/omg/CORBA/portable/ValueBase.class new file mode 100644 index 0000000..5a31875 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ValueBase.class differ diff --git a/idl/orb/.class/org/omg/CORBA/portable/ValueFactory.class b/idl/orb/.class/org/omg/CORBA/portable/ValueFactory.class new file mode 100644 index 0000000..fba639a Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA/portable/ValueFactory.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_3/ORB.class b/idl/orb/.class/org/omg/CORBA_2_3/ORB.class new file mode 100644 index 0000000..3568a26 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_3/ORB.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_3/portable/Delegate.class b/idl/orb/.class/org/omg/CORBA_2_3/portable/Delegate.class new file mode 100644 index 0000000..26d8e46 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_3/portable/Delegate.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_3/portable/InputStream.class b/idl/orb/.class/org/omg/CORBA_2_3/portable/InputStream.class new file mode 100644 index 0000000..8783ef7 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_3/portable/InputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_3/portable/ObjectImpl.class b/idl/orb/.class/org/omg/CORBA_2_3/portable/ObjectImpl.class new file mode 100644 index 0000000..fa368e2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_3/portable/ObjectImpl.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_3/portable/OutputStream.class b/idl/orb/.class/org/omg/CORBA_2_3/portable/OutputStream.class new file mode 100644 index 0000000..02da5a2 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_3/portable/OutputStream.class differ diff --git a/idl/orb/.class/org/omg/CORBA_2_5/ORB.class b/idl/orb/.class/org/omg/CORBA_2_5/ORB.class new file mode 100644 index 0000000..aa49ae1 Binary files /dev/null and b/idl/orb/.class/org/omg/CORBA_2_5/ORB.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivator.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivator.class new file mode 100644 index 0000000..4a30e62 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivator.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHelper.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHelper.class new file mode 100644 index 0000000..012fac5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHolder.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHolder.class new file mode 100644 index 0000000..2dcdecf Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalBase.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalBase.class new file mode 100644 index 0000000..282be8f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalTie.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalTie.class new file mode 100644 index 0000000..409b7e0 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/AdapterActivatorOperations.class b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorOperations.class new file mode 100644 index 0000000..f2b8866 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/AdapterActivatorOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/Current.class b/idl/orb/.class/org/omg/PortableServer/Current.class new file mode 100644 index 0000000..09d7601 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/Current.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentHelper.class b/idl/orb/.class/org/omg/PortableServer/CurrentHelper.class new file mode 100644 index 0000000..0d1863e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentHolder.class b/idl/orb/.class/org/omg/PortableServer/CurrentHolder.class new file mode 100644 index 0000000..281c1d9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentLocalBase.class b/idl/orb/.class/org/omg/PortableServer/CurrentLocalBase.class new file mode 100644 index 0000000..ffe3d9b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentLocalTie.class b/idl/orb/.class/org/omg/PortableServer/CurrentLocalTie.class new file mode 100644 index 0000000..7676387 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentOperations.class b/idl/orb/.class/org/omg/PortableServer/CurrentOperations.class new file mode 100644 index 0000000..45763b1 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContext.class b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContext.class new file mode 100644 index 0000000..6d38b0d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContext.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHelper.class b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHelper.class new file mode 100644 index 0000000..7ed4e51 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHolder.class b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHolder.class new file mode 100644 index 0000000..030da06 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/CurrentPackage/NoContextHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/DynamicImplementation.class b/idl/orb/.class/org/omg/PortableServer/DynamicImplementation.class new file mode 100644 index 0000000..a70801d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/DynamicImplementation.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ForwardRequest.class b/idl/orb/.class/org/omg/PortableServer/ForwardRequest.class new file mode 100644 index 0000000..5f4acd5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ForwardRequest.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ForwardRequestHelper.class b/idl/orb/.class/org/omg/PortableServer/ForwardRequestHelper.class new file mode 100644 index 0000000..bfc992e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ForwardRequestHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ForwardRequestHolder.class b/idl/orb/.class/org/omg/PortableServer/ForwardRequestHolder.class new file mode 100644 index 0000000..0f2e558 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ForwardRequestHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class new file mode 100644 index 0000000..59d9acd Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ID_ASSIGNMENT_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class new file mode 100644 index 0000000..f76f202 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ID_UNIQUENESS_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class new file mode 100644 index 0000000..29992b7 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IMPLICIT_ACTIVATION_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicy.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicy.class new file mode 100644 index 0000000..907dcdf Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHelper.class new file mode 100644 index 0000000..0ddcae7 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHolder.class new file mode 100644 index 0000000..7076035 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalBase.class new file mode 100644 index 0000000..71bcad4 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalTie.class new file mode 100644 index 0000000..fdaa58e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyOperations.class new file mode 100644 index 0000000..12bc965 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValue.class new file mode 100644 index 0000000..1eb0a30 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHelper.class new file mode 100644 index 0000000..98dd3da Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHolder.class new file mode 100644 index 0000000..51c4ca6 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdAssignmentPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicy.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicy.class new file mode 100644 index 0000000..77bfb4a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHelper.class new file mode 100644 index 0000000..eba6948 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHolder.class new file mode 100644 index 0000000..5a0c277 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalBase.class new file mode 100644 index 0000000..4e8e9d5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalTie.class new file mode 100644 index 0000000..675586e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyOperations.class new file mode 100644 index 0000000..9c59bb8 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValue.class new file mode 100644 index 0000000..da2625f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHelper.class new file mode 100644 index 0000000..ab69218 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHolder.class new file mode 100644 index 0000000..a92de55 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/IdUniquenessPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicy.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicy.class new file mode 100644 index 0000000..9b1bef9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHelper.class new file mode 100644 index 0000000..6febe42 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHolder.class new file mode 100644 index 0000000..5a4ee31 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalBase.class new file mode 100644 index 0000000..469a6d9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalTie.class new file mode 100644 index 0000000..190f223 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyOperations.class new file mode 100644 index 0000000..b9a2ba4 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValue.class new file mode 100644 index 0000000..4af8cc0 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHelper.class new file mode 100644 index 0000000..d82e61b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHolder.class new file mode 100644 index 0000000..f0cae2d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ImplicitActivationPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LIFESPAN_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/LIFESPAN_POLICY_ID.class new file mode 100644 index 0000000..99f1c0d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LIFESPAN_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicy.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicy.class new file mode 100644 index 0000000..a0a1f8b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHelper.class new file mode 100644 index 0000000..fbf68b0 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHolder.class new file mode 100644 index 0000000..3d2c111 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalBase.class new file mode 100644 index 0000000..69a5caa Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalTie.class new file mode 100644 index 0000000..acc0251 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyOperations.class new file mode 100644 index 0000000..b7d1d8c Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValue.class new file mode 100644 index 0000000..5dd16d8 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHelper.class new file mode 100644 index 0000000..c5632a6 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHolder.class new file mode 100644 index 0000000..de9c4bc Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/LifespanPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ObjectIdHelper.class b/idl/orb/.class/org/omg/PortableServer/ObjectIdHelper.class new file mode 100644 index 0000000..2ac8bed Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ObjectIdHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POA.class b/idl/orb/.class/org/omg/PortableServer/POA.class new file mode 100644 index 0000000..582e3fb Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POA.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAHelper.class b/idl/orb/.class/org/omg/PortableServer/POAHelper.class new file mode 100644 index 0000000..58e7a49 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAHolder.class b/idl/orb/.class/org/omg/PortableServer/POAHolder.class new file mode 100644 index 0000000..8c9e161 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAListHelper.class b/idl/orb/.class/org/omg/PortableServer/POAListHelper.class new file mode 100644 index 0000000..0d0f456 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAListHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAListHolder.class b/idl/orb/.class/org/omg/PortableServer/POAListHolder.class new file mode 100644 index 0000000..3d2484a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAListHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POALocalBase.class b/idl/orb/.class/org/omg/PortableServer/POALocalBase.class new file mode 100644 index 0000000..2626c1e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POALocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POALocalTie.class b/idl/orb/.class/org/omg/PortableServer/POALocalTie.class new file mode 100644 index 0000000..ce69b29 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POALocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManager.class b/idl/orb/.class/org/omg/PortableServer/POAManager.class new file mode 100644 index 0000000..1683a08 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManager.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerHelper.class b/idl/orb/.class/org/omg/PortableServer/POAManagerHelper.class new file mode 100644 index 0000000..0b75ae6 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerHolder.class b/idl/orb/.class/org/omg/PortableServer/POAManagerHolder.class new file mode 100644 index 0000000..f25546d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerLocalBase.class b/idl/orb/.class/org/omg/PortableServer/POAManagerLocalBase.class new file mode 100644 index 0000000..a510d20 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerLocalTie.class b/idl/orb/.class/org/omg/PortableServer/POAManagerLocalTie.class new file mode 100644 index 0000000..85742ec Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerOperations.class b/idl/orb/.class/org/omg/PortableServer/POAManagerOperations.class new file mode 100644 index 0000000..2f2e4ee Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class new file mode 100644 index 0000000..edbec29 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactive.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class new file mode 100644 index 0000000..700894f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.class new file mode 100644 index 0000000..7b41d54 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/AdapterInactiveHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/State.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/State.class new file mode 100644 index 0000000..ca9659a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/State.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHelper.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHelper.class new file mode 100644 index 0000000..d14a7a8 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHolder.class b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHolder.class new file mode 100644 index 0000000..bf61f33 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAManagerPackage/StateHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAOperations.class b/idl/orb/.class/org/omg/PortableServer/POAOperations.class new file mode 100644 index 0000000..16d62b7 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class new file mode 100644 index 0000000..25bc423 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExists.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class new file mode 100644 index 0000000..e1f92d9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.class new file mode 100644 index 0000000..3635112 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterAlreadyExistsHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistent.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistent.class new file mode 100644 index 0000000..d19c5e5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistent.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class new file mode 100644 index 0000000..11a5f97 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.class new file mode 100644 index 0000000..8ed9a5f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/AdapterNonExistentHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicy.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicy.class new file mode 100644 index 0000000..15b2b57 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class new file mode 100644 index 0000000..18a762d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHolder.class new file mode 100644 index 0000000..130d964 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/InvalidPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServant.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServant.class new file mode 100644 index 0000000..80cfd0b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServant.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHelper.class new file mode 100644 index 0000000..d79282a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHolder.class new file mode 100644 index 0000000..8fed18b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/NoServantHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class new file mode 100644 index 0000000..9c903b1 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActive.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class new file mode 100644 index 0000000..4ff3ecd Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.class new file mode 100644 index 0000000..7cd101f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectAlreadyActiveHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActive.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActive.class new file mode 100644 index 0000000..c45a11e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActive.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class new file mode 100644 index 0000000..952dfe8 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.class new file mode 100644 index 0000000..62647f2 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ObjectNotActiveHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class new file mode 100644 index 0000000..e0577ca Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActive.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class new file mode 100644 index 0000000..fe58d7f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.class new file mode 100644 index 0000000..d8fd705 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantAlreadyActiveHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActive.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActive.class new file mode 100644 index 0000000..1473720 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActive.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class new file mode 100644 index 0000000..99932f9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHolder.class new file mode 100644 index 0000000..62ae661 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/ServantNotActiveHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapter.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapter.class new file mode 100644 index 0000000..f3f3161 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapter.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class new file mode 100644 index 0000000..64e0fff Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHolder.class new file mode 100644 index 0000000..af9a60b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongAdapterHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicy.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicy.class new file mode 100644 index 0000000..5c95f36 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class new file mode 100644 index 0000000..c58cef5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHolder.class new file mode 100644 index 0000000..46871e3 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/POAPackage/WrongPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class new file mode 100644 index 0000000..05c056a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/REQUEST_PROCESSING_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicy.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicy.class new file mode 100644 index 0000000..9dc0829 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHelper.class new file mode 100644 index 0000000..9154bc7 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHolder.class new file mode 100644 index 0000000..689d8f1 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalBase.class new file mode 100644 index 0000000..97301b9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalTie.class new file mode 100644 index 0000000..011858c Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyOperations.class new file mode 100644 index 0000000..9a003e2 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValue.class new file mode 100644 index 0000000..e9082f5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHelper.class new file mode 100644 index 0000000..42f9336 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHolder.class new file mode 100644 index 0000000..868b81d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/RequestProcessingPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class new file mode 100644 index 0000000..d1d1ef9 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/SERVANT_RETENTION_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/Servant.class b/idl/orb/.class/org/omg/PortableServer/Servant.class new file mode 100644 index 0000000..c19b581 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/Servant.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivator.class b/idl/orb/.class/org/omg/PortableServer/ServantActivator.class new file mode 100644 index 0000000..f91f30e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivator.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivatorHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantActivatorHelper.class new file mode 100644 index 0000000..c8e036e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivatorHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivatorHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantActivatorHolder.class new file mode 100644 index 0000000..ad26a71 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivatorHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalBase.class new file mode 100644 index 0000000..8cea8e5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalTie.class new file mode 100644 index 0000000..243ce13 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivatorLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantActivatorOperations.class b/idl/orb/.class/org/omg/PortableServer/ServantActivatorOperations.class new file mode 100644 index 0000000..6cb257d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantActivatorOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantHelper.class new file mode 100644 index 0000000..1d75f3e Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocator.class b/idl/orb/.class/org/omg/PortableServer/ServantLocator.class new file mode 100644 index 0000000..4c107f2 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocator.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorHelper.class new file mode 100644 index 0000000..3d6c332 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorHolder.class new file mode 100644 index 0000000..8a2b47f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalBase.class new file mode 100644 index 0000000..680f75a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalTie.class new file mode 100644 index 0000000..612ea16 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorOperations.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorOperations.class new file mode 100644 index 0000000..c968d96 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.class new file mode 100644 index 0000000..cfda3ef Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class new file mode 100644 index 0000000..49ef686 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManager.class b/idl/orb/.class/org/omg/PortableServer/ServantManager.class new file mode 100644 index 0000000..f760d37 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManager.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManagerHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantManagerHelper.class new file mode 100644 index 0000000..3581cfb Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManagerHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManagerHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantManagerHolder.class new file mode 100644 index 0000000..f1f8a31 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManagerHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalBase.class new file mode 100644 index 0000000..4484a37 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalTie.class new file mode 100644 index 0000000..6e2a6a8 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManagerLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantManagerOperations.class b/idl/orb/.class/org/omg/PortableServer/ServantManagerOperations.class new file mode 100644 index 0000000..75f9d0b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantManagerOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicy.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicy.class new file mode 100644 index 0000000..eb91319 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHelper.class new file mode 100644 index 0000000..15c0656 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHolder.class new file mode 100644 index 0000000..ad69ec3 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalBase.class new file mode 100644 index 0000000..81f4e0b Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalTie.class new file mode 100644 index 0000000..b3cf591 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyOperations.class new file mode 100644 index 0000000..3ee5db7 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValue.class new file mode 100644 index 0000000..caffd3f Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHelper.class new file mode 100644 index 0000000..d2453bc Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHolder.class new file mode 100644 index 0000000..f965477 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ServantRetentionPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/THREAD_POLICY_ID.class b/idl/orb/.class/org/omg/PortableServer/THREAD_POLICY_ID.class new file mode 100644 index 0000000..ea26a37 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/THREAD_POLICY_ID.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicy.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicy.class new file mode 100644 index 0000000..63b52f0 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicy.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHelper.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHelper.class new file mode 100644 index 0000000..40196e4 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHolder.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHolder.class new file mode 100644 index 0000000..d26285d Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalBase.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalBase.class new file mode 100644 index 0000000..78456e5 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalBase.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalTie.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalTie.class new file mode 100644 index 0000000..6882e14 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyLocalTie.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyOperations.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyOperations.class new file mode 100644 index 0000000..e25ce32 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyOperations.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValue.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValue.class new file mode 100644 index 0000000..5e8f60a Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValue.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHelper.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHelper.class new file mode 100644 index 0000000..9edb389 Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHelper.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHolder.class b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHolder.class new file mode 100644 index 0000000..1d36cbe Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/ThreadPolicyValueHolder.class differ diff --git a/idl/orb/.class/org/omg/PortableServer/portable/Delegate.class b/idl/orb/.class/org/omg/PortableServer/portable/Delegate.class new file mode 100644 index 0000000..72073bd Binary files /dev/null and b/idl/orb/.class/org/omg/PortableServer/portable/Delegate.class differ diff --git a/idl/orb/.cvsignore b/idl/orb/.cvsignore new file mode 100644 index 0000000..9890ac7 --- /dev/null +++ b/idl/orb/.cvsignore @@ -0,0 +1,2 @@ +.class +.java diff --git a/idl/orb/.java/es/tid/CORBA/Any.java b/idl/orb/.java/es/tid/CORBA/Any.java new file mode 100644 index 0000000..2b08b44 --- /dev/null +++ b/idl/orb/.java/es/tid/CORBA/Any.java @@ -0,0 +1,10 @@ +package es.tid.CORBA; + +public abstract class Any extends org.omg.CORBA.Any { + + public org.omg.CORBA.portable.Streamable extract_Streamable() { + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/idl/orb/.java/org/omg/CORBA/ARG_IN.java b/idl/orb/.java/org/omg/CORBA/ARG_IN.java new file mode 100644 index 0000000..28d4744 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/ARG_IN.java @@ -0,0 +1,12 @@ +// +// ARG_IN.java (const) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public interface ARG_IN { + int value = (int)1; +} diff --git a/idl/orb/.java/org/omg/CORBA/ARG_INOUT.java b/idl/orb/.java/org/omg/CORBA/ARG_INOUT.java new file mode 100644 index 0000000..fd182b6 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/ARG_INOUT.java @@ -0,0 +1,12 @@ +// +// ARG_INOUT.java (const) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public interface ARG_INOUT { + int value = (int)3; +} diff --git a/idl/orb/.java/org/omg/CORBA/ARG_OUT.java b/idl/orb/.java/org/omg/CORBA/ARG_OUT.java new file mode 100644 index 0000000..8277c4a --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/ARG_OUT.java @@ -0,0 +1,12 @@ +// +// ARG_OUT.java (const) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public interface ARG_OUT { + int value = (int)2; +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDef.java b/idl/orb/.java/org/omg/CORBA/AliasDef.java new file mode 100644 index 0000000..4792373 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDef.java @@ -0,0 +1,16 @@ +// +// AliasDef.java (interface) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public interface AliasDef + extends AliasDefOperations, + org.omg.CORBA.TypedefDef, + org.omg.CORBA.Object, + org.omg.CORBA.portable.IDLEntity { + +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDefHelper.java b/idl/orb/.java/org/omg/CORBA/AliasDefHelper.java new file mode 100644 index 0000000..4857a3e --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDefHelper.java @@ -0,0 +1,76 @@ +// +// AliasDefHelper.java (helper) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +abstract public class AliasDefHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().create_interface_tc(id(), "AliasDef"); + } + return _type; + } + + public static String id() { + return "IDL:omg.org/CORBA/AliasDef:1.0"; + }; + + public static void insert(org.omg.CORBA.Any any, AliasDef value) { + any.insert_Object((org.omg.CORBA.Object)value, type()); + }; + + public static AliasDef extract(org.omg.CORBA.Any any) { + org.omg.CORBA.Object obj = any.extract_Object(); + AliasDef value = narrow(obj); + return value; + }; + + public static AliasDef read(org.omg.CORBA.portable.InputStream is) { + return narrow(is.read_Object(), true); + } + + public static void write(org.omg.CORBA.portable.OutputStream os, AliasDef val) { + if (!(os instanceof org.omg.CORBA_2_3.portable.OutputStream)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + if (val != null && !(val instanceof org.omg.CORBA.portable.ObjectImpl)) {; + throw new org.omg.CORBA.BAD_PARAM(); + }; + os.write_Object((org.omg.CORBA.Object)val); + } + + public static AliasDef narrow(org.omg.CORBA.Object obj) { + return narrow(obj, false); + } + + public static AliasDef unchecked_narrow(org.omg.CORBA.Object obj) { + return narrow(obj, true); + } + + private static AliasDef narrow(org.omg.CORBA.Object obj, boolean is_a) { + if (obj == null) { + return null; + } + if (obj instanceof AliasDef) { + return (AliasDef)obj; + } + if (is_a || obj._is_a(id())) { + _AliasDefStub result = (_AliasDefStub)new _AliasDefStub(); + ((org.omg.CORBA.portable.ObjectImpl) result)._set_delegate + (((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate()); + return (AliasDef)result; + } + throw new org.omg.CORBA.BAD_PARAM(); + } + +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDefHolder.java b/idl/orb/.java/org/omg/CORBA/AliasDefHolder.java new file mode 100644 index 0000000..b8a23d1 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDefHolder.java @@ -0,0 +1,33 @@ +// +// AliasDefHolder.java (holder) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +final public class AliasDefHolder + implements org.omg.CORBA.portable.Streamable { + + public AliasDef value; + public AliasDefHolder() { + } + + public AliasDefHolder(AliasDef initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = org.omg.CORBA.AliasDefHelper.read(is); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + org.omg.CORBA.AliasDefHelper.write(os, value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.AliasDefHelper.type(); + }; + +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDefOperations.java b/idl/orb/.java/org/omg/CORBA/AliasDefOperations.java new file mode 100644 index 0000000..6bdbff6 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDefOperations.java @@ -0,0 +1,18 @@ +// +// AliasDef.java (interfaceOperations) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public interface AliasDefOperations + extends org.omg.CORBA.TypedefDefOperations { + + org.omg.CORBA.IDLType original_type_def(); + void original_type_def(org.omg.CORBA.IDLType value); + + + +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDefPOA.java b/idl/orb/.java/org/omg/CORBA/AliasDefPOA.java new file mode 100644 index 0000000..3e10afd --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDefPOA.java @@ -0,0 +1,224 @@ +// +// AliasDefPOA.java (skeleton) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +abstract public class AliasDefPOA + extends org.omg.PortableServer.DynamicImplementation + implements AliasDefOperations { + + public AliasDef _this() { + return AliasDefHelper.narrow(super._this_object()); + }; + + public AliasDef _this(org.omg.CORBA.ORB orb) { + return AliasDefHelper.narrow(super._this_object(orb)); + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/CORBA/AliasDef:1.0", + "IDL:omg.org/CORBA/TypedefDef:1.0", + "IDL:omg.org/CORBA/Contained:1.0", + "IDL:omg.org/CORBA/IRObject:1.0", + "IDL:omg.org/CORBA/IDLType:1.0" + }; + + private static java.util.Dictionary _methods = new java.util.Hashtable(); + static { + _methods.put("_get_original_type_def", new Integer(0)); + _methods.put("_set_original_type_def", new Integer(1)); + _methods.put("_get_id", new Integer(2)); + _methods.put("_set_id", new Integer(3)); + _methods.put("_get_name", new Integer(4)); + _methods.put("_set_name", new Integer(5)); + _methods.put("_get_version", new Integer(6)); + _methods.put("_set_version", new Integer(7)); + _methods.put("_get_defined_in", new Integer(8)); + _methods.put("_get_absolute_name", new Integer(9)); + _methods.put("_get_containing_repository", new Integer(10)); + _methods.put("describe", new Integer(11)); + _methods.put("move", new Integer(12)); + _methods.put("_get_def_kind", new Integer(13)); + _methods.put("destroy", new Integer(14)); + _methods.put("_get_type", new Integer(15)); + } + + public void invoke(org.omg.CORBA.ServerRequest _request) { + java.lang.Object _method = _methods.get(_request.operation()); + if (_method == null) { + throw new org.omg.CORBA.BAD_OPERATION(_request.operation()); + } + int _method_id = ((java.lang.Integer)_method).intValue(); + switch(_method_id) { + case 0: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.IDLType _result = this.original_type_def(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.IDLTypeHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 1: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $value = _orb().create_any(); + $value.type(org.omg.CORBA.IDLTypeHelper.type()); + _params.add_value("value", $value, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + org.omg.CORBA.IDLType value; + value = org.omg.CORBA.IDLTypeHelper.extract($value); + this.original_type_def(value); + return; + } + case 2: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + java.lang.String _result = this.id(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_string(_result); + _request.set_result(_resultAny); + return; + } + case 3: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $value = _orb().create_any(); + $value.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("value", $value, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String value; + value = $value.extract_string(); + this.id(value); + return; + } + case 4: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + java.lang.String _result = this.name(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_string(_result); + _request.set_result(_resultAny); + return; + } + case 5: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $value = _orb().create_any(); + $value.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("value", $value, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String value; + value = $value.extract_string(); + this.name(value); + return; + } + case 6: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + java.lang.String _result = this.version(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_string(_result); + _request.set_result(_resultAny); + return; + } + case 7: { + org.omg.CORBA.NVList _params = _orb().create_list(1); + org.omg.CORBA.Any $value = _orb().create_any(); + $value.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("value", $value, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + java.lang.String value; + value = $value.extract_string(); + this.version(value); + return; + } + case 8: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.Container _result = this.defined_in(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.ContainerHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 9: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + java.lang.String _result = this.absolute_name(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + _resultAny.insert_string(_result); + _request.set_result(_resultAny); + return; + } + case 10: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.Repository _result = this.containing_repository(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.RepositoryHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 11: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.ContainedPackage.Description _result = this.describe(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.ContainedPackage.DescriptionHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 12: { + org.omg.CORBA.NVList _params = _orb().create_list(3); + org.omg.CORBA.Any $new_container = _orb().create_any(); + $new_container.type(org.omg.CORBA.ContainerHelper.type()); + _params.add_value("new_container", $new_container, org.omg.CORBA.ARG_IN.value); + org.omg.CORBA.Any $new_name = _orb().create_any(); + $new_name.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("new_name", $new_name, org.omg.CORBA.ARG_IN.value); + org.omg.CORBA.Any $new_version = _orb().create_any(); + $new_version.type(org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + _params.add_value("new_version", $new_version, org.omg.CORBA.ARG_IN.value); + _request.arguments(_params); + org.omg.CORBA.Container new_container; + new_container = org.omg.CORBA.ContainerHelper.extract($new_container); + java.lang.String new_name; + new_name = $new_name.extract_string(); + java.lang.String new_version; + new_version = $new_version.extract_string(); + this.move(new_container, new_name, new_version); + return; + } + case 13: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.DefinitionKind _result = this.def_kind(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.DefinitionKindHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + case 14: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + this.destroy(); + return; + } + case 15: { + org.omg.CORBA.NVList _params = _orb().create_list(0); + _request.arguments(_params); + org.omg.CORBA.TypeCode _result = this.type(); + org.omg.CORBA.Any _resultAny = _orb().create_any(); + org.omg.CORBA.TypeCodeHelper.insert(_resultAny, _result); + _request.set_result(_resultAny); + return; + } + } + } +} diff --git a/idl/orb/.java/org/omg/CORBA/AliasDefPOATie.java b/idl/orb/.java/org/omg/CORBA/AliasDefPOATie.java new file mode 100644 index 0000000..0087802 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AliasDefPOATie.java @@ -0,0 +1,109 @@ +// +// AliasDefPOATie.java (tie) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +public class AliasDefPOATie + extends AliasDefPOA + implements AliasDefOperations { + + private AliasDefOperations _delegate; + public AliasDefPOATie(AliasDefOperations delegate) { + this._delegate = delegate; + }; + + public AliasDefOperations _delegate() { + return this._delegate; + }; + + public java.lang.String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectID) { + return __ids; + }; + + private static java.lang.String[] __ids = { + "IDL:omg.org/CORBA/AliasDef:1.0", + "IDL:omg.org/CORBA/TypedefDef:1.0", + "IDL:omg.org/CORBA/Contained:1.0", + "IDL:omg.org/CORBA/IRObject:1.0", + "IDL:omg.org/CORBA/IDLType:1.0" }; + + public org.omg.CORBA.IDLType original_type_def() { + return this._delegate.original_type_def(); + } + + public void original_type_def(org.omg.CORBA.IDLType value) { + this._delegate.original_type_def(value); + } + + public java.lang.String id() { + return this._delegate.id(); + } + + public void id(java.lang.String value) { + this._delegate.id(value); + } + + public java.lang.String name() { + return this._delegate.name(); + } + + public void name(java.lang.String value) { + this._delegate.name(value); + } + + public java.lang.String version() { + return this._delegate.version(); + } + + public void version(java.lang.String value) { + this._delegate.version(value); + } + + public org.omg.CORBA.Container defined_in() { + return this._delegate.defined_in(); + } + + public java.lang.String absolute_name() { + return this._delegate.absolute_name(); + } + + public org.omg.CORBA.Repository containing_repository() { + return this._delegate.containing_repository(); + } + + public org.omg.CORBA.ContainedPackage.Description describe() { + return this._delegate.describe( + ); + }; + + public void move(org.omg.CORBA.Container new_container, java.lang.String new_name, java.lang.String new_version) { + this._delegate.move( + new_container, + new_name, + new_version + ); + }; + + public org.omg.CORBA.DefinitionKind def_kind() { + return this._delegate.def_kind(); + } + + public void destroy() { + this._delegate.destroy( + ); + }; + + + + public org.omg.CORBA.TypeCode type() { + return this._delegate.type(); + } + + + + +} diff --git a/idl/orb/.java/org/omg/CORBA/Any.java b/idl/orb/.java/org/omg/CORBA/Any.java new file mode 100644 index 0000000..32eba80 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/Any.java @@ -0,0 +1,116 @@ +package org.omg.CORBA; + +public abstract class Any implements org.omg.CORBA.portable.IDLEntity { + + abstract public boolean equal(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.TypeCode type(); + abstract public void type(org.omg.CORBA.TypeCode type); + + abstract public void read_value(org.omg.CORBA.portable.InputStream is, + org.omg.CORBA.TypeCode type) throws org.omg.CORBA.MARSHAL; + abstract public void write_value(org.omg.CORBA.portable.OutputStream os); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + abstract public org.omg.CORBA.portable.InputStream create_input_stream(); + + abstract public short extract_short() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_short(short s); + + abstract public int extract_long() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_long(int i); + + abstract public long extract_longlong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_longlong(long l); + + abstract public short extract_ushort() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ushort(short s); + + abstract public int extract_ulong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulong(int i); + + abstract public long extract_ulonglong() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulonglong(long l); + + abstract public float extract_float() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_float(float f); + + abstract public double extract_double() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_double(double d); + + abstract public boolean extract_boolean() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_boolean(boolean b); + + abstract public char extract_char() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_char(char c); + + abstract public char extract_wchar() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wchar(char c); + + abstract public byte extract_octet() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_octet(byte b); + + abstract public org.omg.CORBA.Any extract_any() + throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_any(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.Object extract_Object() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Object(org.omg.CORBA.Object obj); + + abstract public java.io.Serializable extract_Value() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Value(java.io.Serializable v); + abstract public void insert_Value(java.io.Serializable v, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.MARSHAL; + + abstract public void insert_Object(org.omg.CORBA.Object obj, + org.omg.CORBA.TypeCode type) throws + org.omg.CORBA.BAD_PARAM; + + abstract public String extract_string() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_string(String s) throws + org.omg.CORBA.DATA_CONVERSION, org.omg.CORBA.MARSHAL; + + abstract public String extract_wstring() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wstring(String value) throws + org.omg.CORBA.MARSHAL; + + abstract public TypeCode extract_TypeCode() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_TypeCode(TypeCode value); + + /** + *@ deprecated + */ + public Principal extract_Principal() throws org.omg.CORBA.BAD_OPERATION { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + /** + *@ deprecated + */ + public void insert_Principal(Principal p) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.Streamable extract_Streamable() throws + org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_Streamable(org.omg.CORBA.portable.Streamable s) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.math.BigDecimal extract_fixed() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_fixed(java.math.BigDecimal f, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} + diff --git a/idl/orb/.java/org/omg/CORBA/AnyHolder.java b/idl/orb/.java/org/omg/CORBA/AnyHolder.java new file mode 100644 index 0000000..3faeb1e --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AnyHolder.java @@ -0,0 +1,39 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class AnyHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Any value; + protected org.omg.CORBA.TypeCode type; + + public AnyHolder() { + value = null; + type = null; + } + + public AnyHolder(org.omg.CORBA.Any initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_any(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_any(value); + } + + public synchronized org.omg.CORBA.TypeCode _type() + { + if(type == null) + type = org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_any); + return type; + } + +} diff --git a/idl/orb/.java/org/omg/CORBA/AnySeqHelper.java b/idl/orb/.java/org/omg/CORBA/AnySeqHelper.java new file mode 100644 index 0000000..512e7dc --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/AnySeqHelper.java @@ -0,0 +1,64 @@ +// +// AnySeqHelper.java (helper) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +abstract public class AnySeqHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, org.omg.CORBA.Any[] value) { + any.insert_Streamable(new AnySeqHolder(value)); + }; + + public static org.omg.CORBA.Any[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof AnySeqHolder){ + return ((AnySeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_any)); + _type = _orb().create_alias_tc(id(), "AnySeq", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CORBA/AnySeq:1.0"; + }; + + public static org.omg.CORBA.Any[] read(org.omg.CORBA.portable.InputStream is) { + org.omg.CORBA.Any[] result; + int length0 = is.read_ulong(); + result = new org.omg.CORBA.Any[length0]; + for (int i0=0; i0org.omg.CORBA.ORBClass + */ + private final static String orb_key = "org.omg.CORBA.ORBClass"; + /** + * ORB Singleton Class name property name: org.omg.CORBA.ORBSingletonClass + */ + private final static String singleton_key = + "org.omg.CORBA.ORBSingletonClass"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.TIDORB + */ + private final static String TIDorb_class_name = "es.tid.TIDorbj.core.TIDORB"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.SingletonORB + */ + private final static String TIDorb_singleton_class_name = + "es.tid.TIDorbj.core.SingletonORB"; + + private static ORB singleton_orb = null; + + private static ORB create_orb(String class_name) + { + try { + return (ORB) Class.forName(class_name).newInstance(); + + } catch (Exception e) { + throw new INITIALIZE("Cannot create a " + class_name + " instance"); + } + } + + + public static ORB init() + { + if (singleton_orb == null) { + String class_name = null; + + try { + class_name = SystemProperties.findProperty(singleton_key); + } catch (SecurityException ex) { + //Applet Security violation + } + + if(class_name != null) + singleton_orb = create_orb(class_name); + else + singleton_orb = create_orb(TIDorb_singleton_class_name); + } + + return singleton_orb; + + } + + public static ORB init(String[] args, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(args != null) { + int size = args.length - 1; + for(int i = 0; i < size; i++) { + if (args[i].equals(orb_key)) { + str_class = args[i+1]; + break; + } + } + } + if (str_class == null) { + if(props != null) + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + str_class = SystemProperties.findProperty(orb_key); + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(args, props); + + return new_orb; + } + + public static ORB init(java.applet.Applet app, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(app != null) + str_class = app.getParameter(orb_key); + + if ((str_class == null) && (props != null)) { + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + try { + str_class = SystemProperties.findProperty(orb_key); + } catch (SecurityException se) {} + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(app, props); + + return new_orb; + } + + abstract protected void set_parameters(String[] args, + java.util.Properties props); + + abstract protected void set_parameters(java.applet.Applet app, + java.util.Properties props); + + public void connect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void disconnect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public String[] list_initial_services(); + + abstract public + org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName; + + abstract public String object_to_string(org.omg.CORBA.Object obj); + + abstract public org.omg.CORBA.Object string_to_object(String str); + + abstract public NVList create_list(int count); + + public NVList create_operation_list(org.omg.CORBA.Object oper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public NamedValue create_named_value(String s, Any any, int flags); + + abstract public ExceptionList create_exception_list(); + + abstract public ContextList create_context_list(); + + abstract public Context get_default_context(); + + abstract public Environment create_environment(); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + + abstract public void send_multiple_requests_oneway(Request[] req); + + abstract public void send_multiple_requests_deferred(Request[] req); + + abstract public boolean poll_next_response(); + + abstract public Request get_next_response() throws WrongTransaction; + + abstract public TypeCode get_primitive_tc(TCKind tcKind); + + abstract public TypeCode create_struct_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_union_tc(String id, String name, + TypeCode discriminator_type, + UnionMember[] members); + + abstract public TypeCode create_enum_tc(String id, String name, + String[] members); + + abstract public TypeCode create_alias_tc(String id, String name, + TypeCode original_type); + + abstract public TypeCode create_exception_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_interface_tc(String id, String name); + + abstract public TypeCode create_string_tc(int bound); + + abstract public TypeCode create_wstring_tc(int bound); + + abstract public TypeCode create_sequence_tc(int bound, + TypeCode element_type); + + abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); + + abstract public TypeCode create_array_tc(int length, TypeCode element_type); + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_abstract_interface_tc( + String id, + String name) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_value_tc(String id, + String name, + short type_modifier, + TypeCode concrete_base, + ValueMember[] members) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_value_box_tc(String id, + String name, + TypeCode boxed_type) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public Any create_any(); + + public org.omg.CORBA.Current get_current() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void run() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void shutdown(boolean wait_for_completion) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void destroy() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean work_pending() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void perform_work() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean get_service_information(short service_type, + ServiceInformationHolder service_info) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/.java/org/omg/CORBA/ORBPackage/InvalidName.java b/idl/orb/.java/org/omg/CORBA/ORBPackage/InvalidName.java new file mode 100644 index 0000000..a3563bb --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/ORBPackage/InvalidName.java @@ -0,0 +1,15 @@ +package org.omg.CORBA.ORBPackage; + +final public class InvalidName + extends org.omg.CORBA.UserException { + + public InvalidName() { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0"); + } + + public InvalidName(String reason) { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/.java/org/omg/CORBA/Object.java b/idl/orb/.java/org/omg/CORBA/Object.java new file mode 100644 index 0000000..f32d0a6 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/Object.java @@ -0,0 +1,52 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface Object { + + boolean _is_a(String repositoryIdentifier); + + boolean _is_equivalent(org.omg.CORBA.Object other); + + boolean _non_existent(); + + int _hash(int maximum); + + org.omg.CORBA.Object _duplicate(); + + void _release(); + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + org.omg.CORBA.InterfaceDef _get_interface(); + + org.omg.CORBA.Object _get_interface_def(); + + Request _request(String operation); + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result); + + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result, + ExceptionList exclist, + ContextList ctxlist); + + Policy _get_policy(int policy_type); + + DomainManager[] _get_domain_managers(); + + + org.omg.CORBA.Object _set_policy_override(Policy[] policies, + SetOverrideType set_add); + +} diff --git a/idl/orb/.java/org/omg/CORBA/ObjectHolder.java b/idl/orb/.java/org/omg/CORBA/ObjectHolder.java new file mode 100644 index 0000000..72f12cb --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/ObjectHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ObjectHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Object value; + + public ObjectHolder() { + } + + public ObjectHolder(org.omg.CORBA.Object initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_Object(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_Object(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_objref); + } + +} diff --git a/idl/orb/.java/org/omg/CORBA/OctetSeqHelper.java b/idl/orb/.java/org/omg/CORBA/OctetSeqHelper.java new file mode 100644 index 0000000..7bdf920 --- /dev/null +++ b/idl/orb/.java/org/omg/CORBA/OctetSeqHelper.java @@ -0,0 +1,64 @@ +// +// OctetSeqHelper.java (helper) +// +// File generated: Thu May 19 07:31:32 CEST 2011 +// by TIDorb idl2java 1.3.12 +// + +package org.omg.CORBA; + +abstract public class OctetSeqHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, byte[] value) { + any.insert_Streamable(new OctetSeqHolder(value)); + }; + + public static byte[] extract(org.omg.CORBA.Any any) { + if(any instanceof es.tid.CORBA.Any) { + try { + org.omg.CORBA.portable.Streamable holder = + ((es.tid.CORBA.Any)any).extract_Streamable(); + if(holder instanceof OctetSeqHolder){ + return ((OctetSeqHolder) holder).value; + } + } catch (Exception e) {} + } + + return read(any.create_input_stream()); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + org.omg.CORBA.TypeCode original_type = _orb().create_sequence_tc(0 , org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet)); + _type = _orb().create_alias_tc(id(), "OctetSeq", original_type); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CORBA/OctetSeq:1.0"; + }; + + public static byte[] read(org.omg.CORBA.portable.InputStream is) { + byte[] result; + int length0 = is.read_ulong(); + result = new byte[length0]; + for (int i0=0; i0 InterfaceDefSeq; + interface ValueDef; + typedef sequence ValueDefSeq; + interface ValueBoxDef; + typedef sequence ContainedSeq; + + typedef sequence AnySeq; + typedef sequence BooleanSeq; + typedef sequence CharSeq; + typedef sequence WCharSeq; + typedef sequence OctetSeq; + typedef sequence ShortSeq; + typedef sequence UShortSeq; + typedef sequence LongSeq; + typedef sequence ULongSeq; + typedef sequence LongLongSeq; + typedef sequence ULongLongSeq; + typedef sequence FloatSeq; + typedef sequence DoubleSeq; + typedef sequence StringSeq; + typedef sequence WStringSeq; + + + + typedef string RepositoryId; + typedef string ScopedName; + typedef string Identifier; + + + const unsigned long OMGVMCID = 1330446336; + + enum SetOverrideType {SET_OVERRIDE, ADD_OVERRIDE}; + + native AbstractBase; + native ValueFactory; + + + local interface ORB { // PIDL + typedef string ObjectId; + typedef sequence ObjectIdList; + exception InvalidName {}; + }; + + + + ////////////////////// + // Java Mapping // + ////////////////////// + + typedef unsigned long Flags; + + const Flags ARG_IN = 1; + const Flags ARG_OUT = 2; + const Flags ARG_INOUT = 3; + + const Flags CTX_RESTRICT_SCOPE = 15; + + + //////////////////////// + // ServiceInformation // + //////////////////////// + + typedef unsigned short ServiceType; + typedef unsigned long ServiceOption; + typedef unsigned long ServiceDetailType; + + const ServiceType Security = 1; + + struct ServiceDetail { + ServiceDetailType service_detail_type; + sequence service_detail; + }; + + + struct ServiceInformation { + sequence service_options; + sequence service_details; + }; + + ///////////////////////////////// + // Policy Basic IDL definition // + ///////////////////////////////// + + typedef unsigned long PolicyType; + + interface Policy { + readonly attribute PolicyType policy_type; + Policy copy(); + void destroy(); + }; + + typedef sequence PolicyList; + typedef sequence PolicyTypeSeq; + + exception InvalidPolicies { sequence indices; }; + + typedef short PolicyErrorCode; + + const PolicyErrorCode BAD_POLICY = 0; + const PolicyErrorCode UNSUPPORTED_POLICY = 1; + const PolicyErrorCode BAD_POLICY_TYPE = 2; + const PolicyErrorCode BAD_POLICY_VALUE = 3; + const PolicyErrorCode UNSUPPORTED_POLICY_VALUE = 4; + + exception PolicyError {PolicyErrorCode reason;}; + + + //////////////////////// + // DomainManager // + //////////////////////// + + + interface DomainManager { + Policy get_domain_policy (in PolicyType policy_type); + }; + + const PolicyType SecConstruction = 11; + + interface ConstructionPolicy: Policy{ + void make_domain_manager(in InterfaceDef object_type, + in boolean constr_policy); + + }; + + + typedef sequence DomainManagerList; + + + ///////////// + // Current // + ///////////// + + interface Current { + }; + + + valuetype StringValue string; + valuetype WStringValue wstring; + + + + /////////////////////////// + // Interface Repository // + /////////////////////////// + + enum DefinitionKind { + dk_none, dk_all, dk_Attribute, dk_Constant, dk_Exception, dk_Interface, + dk_Module, dk_Operation, dk_Typedef, dk_Alias, dk_Struct, dk_Union, dk_Enum, + dk_Primitive, dk_String, dk_Sequence, dk_Array, dk_Repository, dk_Wstring, + dk_Fixed, dk_Value, dk_ValueBox, dk_ValueMember, dk_Native + }; + + interface IRObject { + // read interface + readonly attribute DefinitionKind def_kind; + // write interface + void destroy (); + }; + + typedef string VersionSpec; + + interface Contained : IRObject { + // read/write interface + attribute RepositoryId id; + attribute Identifier name; + attribute VersionSpec version; + + // read interface + readonly attribute Container defined_in; + readonly attribute ScopedName absolute_name; + readonly attribute Repository containing_repository; + + struct Description { + DefinitionKind kind; + any value; + }; + + Description describe (); + + // write interface + void move ( + in Container new_container, + in Identifier new_name, + in VersionSpec new_version + ); + }; + + + struct StructMember { + Identifier name; + TypeCode type; + IDLType type_def; + }; + + typedef sequence StructMemberSeq; + + struct Initializer { + StructMemberSeq members; + Identifier name; + }; + + typedef sequence InitializerSeq; + + struct UnionMember { + Identifier name; + any label; + TypeCode type; + IDLType type_def; + }; + + typedef sequence UnionMemberSeq; + typedef sequence EnumMemberSeq; + + interface Container : IRObject { + // read interface + Contained lookup (in ScopedName search_name); + + ContainedSeq contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + ContainedSeq lookup_name ( + in Identifier search_name, + in long levels_to_search, + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + struct Description { + Contained contained_object; + DefinitionKind kind; + any value; + }; + + typedef sequence DescriptionSeq; + + DescriptionSeq describe_contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited, + in long max_returned_objs + ); + + // write interface + ModuleDef create_module ( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + + ConstantDef create_constant ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in any value + ); + + StructDef create_struct ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + UnionDef create_union ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType discriminator_type, + in UnionMemberSeq members + ); + + EnumDef create_enum ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in EnumMemberSeq members + ); + + AliasDef create_alias ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type + ); + + InterfaceDef create_interface ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in InterfaceDefSeq base_interfaces, + in boolean is_abstract + ); + + ValueDef create_value( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in boolean is_custom, + in boolean is_abstract, + in ValueDef base_value, + in boolean is_truncatable, + in ValueDefSeq abstract_base_values, + in InterfaceDefSeq supported_interfaces, + in InitializerSeq initializers + ); + + ValueBoxDef create_value_box( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type_def + ); + + ExceptionDef create_exception( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + NativeDef create_native( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + }; + + interface IDLType : IRObject { + readonly attribute TypeCode type; + }; + + interface PrimitiveDef; + interface StringDef; + interface SequenceDef; + interface ArrayDef; + interface WstringDef; + interface FixedDef; + + enum PrimitiveKind { + pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, + pk_float, pk_double, pk_boolean, pk_char, pk_octet, + pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref, + pk_longlong, pk_ulonglong, pk_longdouble, + pk_wchar, pk_wstring, pk_value_base + }; + + interface Repository : Container { + // read interface + Contained lookup_id (in RepositoryId search_id); + + TypeCode get_canonical_typecode(in TypeCode tc); + + PrimitiveDef get_primitive (in PrimitiveKind kind); + + // write interface + StringDef create_string (in unsigned long bound); + + WstringDef create_wstring (in unsigned long bound); + + SequenceDef create_sequence ( + in unsigned long bound, + in IDLType element_type + ); + + ArrayDef create_array ( + in unsigned long length, + in IDLType element_type + ); + + FixedDef create_fixed ( + in unsigned short digits, + in short scale + ); + }; + + interface ModuleDef : Container, Contained { + }; + + struct ModuleDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + }; + + interface ConstantDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute any value; + }; + + struct ConstantDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + any value; + }; + + interface TypedefDef : Contained, IDLType { + }; + + struct TypeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + interface StructDef : TypedefDef, Container { + attribute StructMemberSeq members; + }; + + interface UnionDef : TypedefDef, Container { + readonly attribute TypeCode discriminator_type; + attribute IDLType discriminator_type_def; + attribute UnionMemberSeq members; + }; + + interface EnumDef : TypedefDef { + attribute EnumMemberSeq members; + }; + + interface AliasDef : TypedefDef { + attribute IDLType original_type_def; + }; + + interface NativeDef : TypedefDef { + }; + + interface PrimitiveDef: IDLType { + readonly attribute PrimitiveKind kind; + }; + + interface StringDef : IDLType { + attribute unsigned long bound; + }; + + interface WstringDef : IDLType { + attribute unsigned long bound; + }; + + interface FixedDef : IDLType { + attribute unsigned short digits; + attribute short scale; + }; + + interface SequenceDef : IDLType { + attribute unsigned long bound; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ArrayDef : IDLType { + attribute unsigned long length; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ExceptionDef : Contained, Container { + readonly attribute TypeCode type; + attribute StructMemberSeq members; + }; + + struct ExceptionDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; + + interface AttributeDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute AttributeMode mode; + }; + + struct AttributeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + AttributeMode mode; + }; + + enum OperationMode {OP_NORMAL, OP_ONEWAY}; + + enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; + + struct ParameterDescription { + Identifier name; + TypeCode type; + IDLType type_def; + ParameterMode mode; + }; + + typedef sequence ParDescriptionSeq; + typedef Identifier ContextIdentifier; + typedef sequence ContextIdSeq; + typedef sequence ExceptionDefSeq; + typedef sequence ExcDescriptionSeq; + + interface OperationDef : Contained { + readonly attribute TypeCode result; + attribute IDLType result_def; + attribute ParDescriptionSeq params; + attribute OperationMode mode; + attribute ContextIdSeq contexts; + attribute ExceptionDefSeq exceptions; + }; + + struct OperationDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode result; + OperationMode mode; + ContextIdSeq contexts; + ParDescriptionSeq parameters; + ExcDescriptionSeq exceptions; + }; + + typedef sequence RepositoryIdSeq; + typedef sequence OpDescriptionSeq; + typedef sequence AttrDescriptionSeq; + + interface InterfaceDef : Container, Contained, IDLType { + // read/write interface + attribute InterfaceDefSeq base_interfaces; + attribute boolean is_abstract; + + // read interface + boolean is_a (in RepositoryId interface_id); + + struct FullInterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + RepositoryIdSeq base_interfaces; + TypeCode type; + boolean is_abstract; + }; + + FullInterfaceDescription describe_interface(); + + // write interface + AttributeDef create_attribute ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct InterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq base_interfaces; + boolean is_abstract; + }; + + typedef short Visibility; + + const Visibility PRIVATE_MEMBER = 0; + const Visibility PUBLIC_MEMBER = 1; + + struct ValueMember { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + IDLType type_def; + Visibility access; + }; + + typedef sequence ValueMemberSeq; + + interface ValueMemberDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute Visibility access; + }; + + interface ValueDef : Container, Contained, IDLType { + // read/write interface + attribute InterfaceDefSeq supported_interfaces; + attribute InitializerSeq initializers; + attribute ValueDef base_value; + attribute ValueDefSeq abstract_base_values; + attribute boolean is_abstract; + attribute boolean is_custom; + attribute boolean is_truncatable; + + // read interface + boolean is_a(in RepositoryId id); + + struct FullValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + ValueMemberSeq members; + InitializerSeq initializers; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean is_truncatable; + RepositoryId base_value; + TypeCode type; + }; + + FullValueDescription describe_value(); + + ValueMemberDef create_value_member( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in Visibility access + ); + + AttributeDef create_attribute( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct ValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean is_truncatable; + RepositoryId base_value; + }; + + interface ValueBoxDef : TypedefDef { + attribute IDLType original_type_def; + }; + + enum TCKind { //JAVA MAPPING PIDL + tk_null, tk_void, + tk_short, tk_long, tk_ushort, tk_ulong, + tk_float, tk_double, tk_boolean, tk_char, + tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, + tk_struct, tk_union, tk_enum, tk_string, + tk_sequence, tk_array, tk_alias, tk_except, + tk_longlong, tk_ulonglong, tk_longdouble, + tk_wchar, tk_wstring, tk_fixed, + tk_value, tk_value_box, + tk_native, + tk_abstract_interface, + tk_local_interface + }; + + + typedef short ValueModifier; // JAVA MAPPING PIDL + + const ValueModifier VM_NONE = 0; + const ValueModifier VM_CUSTOM = 1; + const ValueModifier VM_ABSTRACT = 2; + const ValueModifier VM_TRUNCATABLE = 3; + + local interface TypeCode { // JAVA MAPPING PIDL + exception Bounds {}; + exception BadKind {}; + + // for all TypeCode kinds + boolean equal (in TypeCode tc); + boolean equivalent(in TypeCode tc); + TypeCode get_compact_typecode(); + TCKind kind (); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, + // tk_value, tk_value_box, tk_native, tk_abstract_interface + // and tk_except + RepositoryId id () raises (BadKind); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, + // tk_value, tk_value_box, tk_native, tk_abstract_interface + // and tk_except + Identifier name () raises (BadKind); + + // for tk_struct, tk_union, tk_enum, tk_value, + // and tk_except + unsigned long member_count () raises (BadKind); + Identifier member_name (in unsigned long index) + raises (BadKind, Bounds); + + // for tk_struct, tk_union, tk_value, and tk_except + TypeCode member_type (in unsigned long index) + raises (BadKind, Bounds); + + // for tk_union + any member_label (in unsigned long index) + raises (BadKind, Bounds); + TypeCode discriminator_type () raises (BadKind); + long default_index () raises (BadKind); + + // for tk_string, tk_sequence, and tk_array + unsigned long length () raises (BadKind); + + // for tk_sequence, tk_array, tk_value_box, and tk_alias + TypeCode content_type () raises (BadKind); + + // for tk_fixed + unsigned short fixed_digits() raises (BadKind); + short fixed_scale() raises (BadKind); + + // for tk_value + Visibility member_visibility(in unsigned long index) + raises(BadKind, Bounds); + ValueModifier type_modifier() raises(BadKind); + TypeCode concrete_base_type() raises(BadKind); + }; + + exception BadFixedValue { + unsigned long offset; + }; + + abstract valuetype DataOutputStream { + void write_any(in any value); + void write_boolean(in boolean value); + void write_char(in char value); + void write_wchar(in wchar value); + void write_octet(in octet value); + void write_short(in short value); + void write_ushort(in unsigned short value); + void write_long(in long value); + void write_ulong(in unsigned long value); + void write_longlong(in long long value); + void write_ulonglong(in unsigned long long value); + void write_float(in float value); + void write_double(in double value); +// void write_longdouble(in long double value); + void write_string(in string value); + void write_wstring(in wstring value); + void write_Object(in Object value); + void write_Abstract(in AbstractBase value); + void write_Value(in ValueBase value); + void write_TypeCode(in TypeCode value); + void write_any_array(in AnySeq seq, in unsigned long offset, in unsigned long length); + void write_boolean_array( in BooleanSeq seq, in unsigned long offset, in unsigned long length); + void write_char_array(in CharSeq seq, in unsigned long offset, in unsigned long length); + void write_wchar_array(in WCharSeq seq, in unsigned long offset, in unsigned long length); + void write_octet_array( in OctetSeq seq, in unsigned long offset, in unsigned long length); + void write_short_array( in ShortSeq seq, in unsigned long offset, in unsigned long length); + void write_ushort_array( in UShortSeq seq, in unsigned long offset, in unsigned long length); + void write_long_array(in LongSeq seq, in unsigned long offset, in unsigned long length); + void write_ulong_array(in ULongSeq seq, in unsigned long offset,in unsigned long length); + void write_ulonglong_array(in ULongLongSeq seq,in unsigned long offset,in unsigned long length); + void write_longlong_array(in LongLongSeq seq,in unsigned long offset, in unsigned long length); + void write_float_array(in FloatSeq seq, in unsigned long offset, in unsigned long length); + void write_double_array(in DoubleSeq seq,in unsigned long offset,in unsigned long length); + // void write_long_double_array(in LongDoubleSeq seq, in unsigned long offset, in unsigned long length); + void write_fixed(in any fixed_value) raises (BadFixedValue); + void write_fixed_array(in AnySeq seq,in unsigned long offset,in unsigned long length) raises (BadFixedValue); + }; + + abstract valuetype DataInputStream { + any read_any(); + boolean read_boolean(); + char read_char(); + wchar read_wchar(); + octet read_octet(); + short read_short(); + unsigned short read_ushort(); + long read_long(); + unsigned long read_ulong(); + long long read_longlong(); + unsigned long long read_ulonglong(); + float read_float(); + double read_double(); + // long double read_longdouble(); + string read_string(); + wstring read_wstring(); + Object read_Object(); + AbstractBase read_Abstract(); + ValueBase read_Value(); + TypeCode read_TypeCode(); + void read_any_array(inout AnySeq seq, in unsigned long offset, in unsigned long length); + void read_boolean_array(inout BooleanSeq seq, in unsigned long offset, in unsigned long length); + void read_char_array(inout CharSeq seq, in unsigned long offset, in unsigned long length); + void read_wchar_array(inout WCharSeq seq, in unsigned long offset, in unsigned long length); + void read_octet_array( inout OctetSeq seq, in unsigned long offset, in unsigned long length); + void read_short_array( inout ShortSeq seq, in unsigned long offset, in unsigned long length); + void read_ushort_array(inout UShortSeq seq, in unsigned long offset, in unsigned long length); + void read_long_array(inout LongSeq seq, in unsigned long offset, in unsigned long length); + void read_ulong_array( inout ULongSeq seq, in unsigned long offset, in unsigned long length); + void read_ulonglong_array(inout ULongLongSeq seq, in unsigned long offset, in unsigned long length); + void read_longlong_array( inout LongLongSeq seq, in unsigned long offset, in unsigned long length); + void read_float_array(inout FloatSeq seq, in unsigned long offset, in unsigned long length); + void read_double_array( inout DoubleSeq seq, in unsigned long offset,in unsigned long length); +// void read_long_double_array( inout LongDoubleSeq seq, in unsigned long offset, in unsigned long length); + any read_fixed( in unsigned short digits, in short scale) raises (BadFixedValue); + void read_fixed_array(inout AnySeq seq, in unsigned long offset,in unsigned long length, in unsigned short digits,in short scale) raises (BadFixedValue); + }; + + abstract valuetype CustomMarshal { + void marshal(in DataOutputStream os); + void unmarshal(in DataInputStream is); + }; + + /////////////////////////////// + // CORBA 2.6: PolicyManager // + /////////////////////////////// + + local interface PolicyManager { + PolicyList get_policy_overrides(in PolicyTypeSeq ts); + + void set_policy_overrides(in PolicyList policies, + in SetOverrideType set_add) + raises (InvalidPolicies); + }; + + local interface PolicyCurrent : PolicyManager, Current { + + }; + +}; + + +#pragma prefix "omg.org" + +module PortableServer { + + local interface POA; // forward declaration + + typedef sequence POAList; + + native Servant; + + typedef CORBA::OctetSeq ObjectId; + + exception ForwardRequest { + Object forward_reference; + }; + + // Policy interfaces + + const CORBA::PolicyType THREAD_POLICY_ID = 16; + const CORBA::PolicyType LIFESPAN_POLICY_ID = 17; + const CORBA::PolicyType ID_UNIQUENESS_POLICY_ID = 18; + const CORBA::PolicyType ID_ASSIGNMENT_POLICY_ID = 19; + const CORBA::PolicyType IMPLICIT_ACTIVATION_POLICY_ID = 20; + const CORBA::PolicyType SERVANT_RETENTION_POLICY_ID = 21; + const CORBA::PolicyType REQUEST_PROCESSING_POLICY_ID = 22; + + enum ThreadPolicyValue {ORB_CTRL_MODEL,SINGLE_THREAD_MODEL, MAIN_THREAD_MODEL}; + + + local interface ThreadPolicy : CORBA::Policy { + readonly attribute ThreadPolicyValue value; + }; + + enum LifespanPolicyValue {TRANSIENT,PERSISTENT}; + + local interface LifespanPolicy : CORBA::Policy { + readonly attribute LifespanPolicyValue value; + }; + + enum IdUniquenessPolicyValue {UNIQUE_ID,MULTIPLE_ID}; + + local interface IdUniquenessPolicy : CORBA::Policy { + readonly attribute IdUniquenessPolicyValue value; + }; + + enum IdAssignmentPolicyValue {USER_ID,SYSTEM_ID}; + + local interface IdAssignmentPolicy : CORBA::Policy { + readonly attribute IdAssignmentPolicyValue value; + }; + + enum ImplicitActivationPolicyValue {IMPLICIT_ACTIVATION,NO_IMPLICIT_ACTIVATION}; + + local interface ImplicitActivationPolicy : CORBA::Policy { + readonly attribute ImplicitActivationPolicyValue value; + }; + + enum ServantRetentionPolicyValue {RETAIN,NON_RETAIN}; + + local interface ServantRetentionPolicy : CORBA::Policy { + readonly attribute ServantRetentionPolicyValue value; + }; + + enum RequestProcessingPolicyValue { + USE_ACTIVE_OBJECT_MAP_ONLY, + USE_DEFAULT_SERVANT, + USE_SERVANT_MANAGER + }; + + local interface RequestProcessingPolicy : CORBA::Policy { + readonly attribute RequestProcessingPolicyValue value; + }; + + + // POAManager interface + + local interface POAManager { + + exception AdapterInactive{}; + + enum State {HOLDING, ACTIVE, DISCARDING, INACTIVE}; + + void activate() raises(AdapterInactive); + + void hold_requests(in boolean wait_for_completion) raises(AdapterInactive); + + void discard_requests(in boolean wait_for_completion) raises(AdapterInactive); + + void deactivate(in boolean etherealize_objects, in boolean wait_for_completion) + raises(AdapterInactive); + + State get_state(); + }; + + + // AdapterActivator interface + + local interface AdapterActivator { + + boolean unknown_adapter(in POA parent, in string name); + + }; + + // ServantManager interface + + local interface ServantManager{ }; + + local interface ServantActivator : ServantManager { + + Servant incarnate (in ObjectId oid,in POA adapter) raises (ForwardRequest); + + void etherealize (in ObjectId oid,in POA adapter, + in Servant serv, in boolean cleanup_in_progress, + in boolean remaining_activations); + }; + + local interface ServantLocator : ServantManager { + + native Cookie; + + Servant preinvoke(in ObjectId oid,in POA adapter, + in CORBA::Identifier operation, out Cookie the_cookie) + raises (ForwardRequest); + + void postinvoke(in ObjectId oid,in POA adapter, in CORBA::Identifier operation, + in Cookie the_cookie, in Servant the_servant); + }; + + // POA interface + + local interface POA { + + exception AdapterAlreadyExists {}; + exception AdapterNonExistent {}; + exception InvalidPolicy {unsigned short index;}; + exception NoServant {}; + exception ObjectAlreadyActive {}; + exception ObjectNotActive {}; + exception ServantAlreadyActive {}; + exception ServantNotActive {}; + exception WrongAdapter {}; + exception WrongPolicy {}; + + // POA creation and destruction + + POA create_POA(in string adapter_name, in POAManager a_POAManager, + in CORBA::PolicyList policies) + raises (AdapterAlreadyExists, InvalidPolicy); + + POA find_POA(in string adapter_name, in boolean activate_it) raises (AdapterNonExistent); + + void destroy(in boolean etherealize_objects,in boolean wait_for_completion); + + // Factories for Policy objects + + ThreadPolicy create_thread_policy(in ThreadPolicyValue value); + + LifespanPolicy create_lifespan_policy(in LifespanPolicyValue value); + + IdUniquenessPolicy create_id_uniqueness_policy(in IdUniquenessPolicyValue value); + + IdAssignmentPolicy create_id_assignment_policy(in IdAssignmentPolicyValue value); + + ImplicitActivationPolicy create_implicit_activation_policy(in ImplicitActivationPolicyValue value); + + ServantRetentionPolicy create_servant_retention_policy(in ServantRetentionPolicyValue value); + + RequestProcessingPolicy create_request_processing_policy(in RequestProcessingPolicyValue value); + + // POA attributes + + readonly attribute string the_name; + readonly attribute POA the_parent; + readonly attribute POAList the_children; + readonly attribute POAManager the_POAManager; + attribute AdapterActivator the_activator; + + // Servant Manager registration: + ServantManager get_servant_manager() raises (WrongPolicy); + + void set_servant_manager(in ServantManager imgr) raises (WrongPolicy); + + // operations for the USE_DEFAULT_SERVANT policy + Servant get_servant() raises (NoServant, WrongPolicy); + + void set_servant(in Servant p_servant) raises (WrongPolicy); + + // object activation and deactivation + ObjectId activate_object(in Servant p_servant) + raises (ServantAlreadyActive, WrongPolicy); + + void activate_object_with_id(in ObjectId id, in Servant p_servant) + raises (ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy); + + void deactivate_object(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + // reference creation operations + Object create_reference (in CORBA::RepositoryId intf) raises (WrongPolicy); + + Object create_reference_with_id (in ObjectId oid, + in CORBA::RepositoryId intf); + + // Identity mapping operations: + + ObjectId servant_to_id(in Servant p_servant) raises (ServantNotActive, WrongPolicy); + + Object servant_to_reference(in Servant p_servant) raises (ServantNotActive, WrongPolicy); + + Servant reference_to_servant(in Object reference) raises(ObjectNotActive, WrongAdapter, WrongPolicy); + + ObjectId reference_to_id(in Object reference) raises (WrongAdapter, WrongPolicy); + + Servant id_to_servant(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + Object id_to_reference(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + readonly attribute CORBA::OctetSeq id; + }; + + // Current interface + + local interface Current : CORBA::Current { + + exception NoContext { }; + + POA get_POA() raises (NoContext); + + ObjectId get_object_id() raises (NoContext); + + Object get_reference() raises(NoContext); + + Servant get_servant() raises (NoContext); + + }; + +}; + diff --git a/idl/orb/.svn/text-base/build.xml.svn-base b/idl/orb/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..b4d73a0 --- /dev/null +++ b/idl/orb/.svn/text-base/build.xml.svn-base @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/orb/CORBA.idl b/idl/orb/CORBA.idl new file mode 100644 index 0000000..5a265fe --- /dev/null +++ b/idl/orb/CORBA.idl @@ -0,0 +1,1127 @@ +/* CORBA 2.6 MODULE */ + +#pragma prefix "omg.org" + +module CORBA { + + local interface TypeCode; + interface Contained; + interface Repository; + interface Container; + interface ModuleDef; + interface ConstantDef; + interface IDLType; + interface StructDef; + interface UnionDef; + interface EnumDef; + interface AliasDef; + interface InterfaceDef; + interface ExceptionDef; + interface NativeDef; + typedef sequence InterfaceDefSeq; + interface ValueDef; + typedef sequence ValueDefSeq; + interface ValueBoxDef; + typedef sequence ContainedSeq; + + typedef sequence AnySeq; + typedef sequence BooleanSeq; + typedef sequence CharSeq; + typedef sequence WCharSeq; + typedef sequence OctetSeq; + typedef sequence ShortSeq; + typedef sequence UShortSeq; + typedef sequence LongSeq; + typedef sequence ULongSeq; + typedef sequence LongLongSeq; + typedef sequence ULongLongSeq; + typedef sequence FloatSeq; + typedef sequence DoubleSeq; + typedef sequence StringSeq; + typedef sequence WStringSeq; + + + + typedef string RepositoryId; + typedef string ScopedName; + typedef string Identifier; + + + const unsigned long OMGVMCID = 1330446336; + + enum SetOverrideType {SET_OVERRIDE, ADD_OVERRIDE}; + + native AbstractBase; + native ValueFactory; + + + local interface ORB { // PIDL + typedef string ObjectId; + typedef sequence ObjectIdList; + exception InvalidName {}; + }; + + + + ////////////////////// + // Java Mapping // + ////////////////////// + + typedef unsigned long Flags; + + const Flags ARG_IN = 1; + const Flags ARG_OUT = 2; + const Flags ARG_INOUT = 3; + + const Flags CTX_RESTRICT_SCOPE = 15; + + + //////////////////////// + // ServiceInformation // + //////////////////////// + + typedef unsigned short ServiceType; + typedef unsigned long ServiceOption; + typedef unsigned long ServiceDetailType; + + const ServiceType Security = 1; + + struct ServiceDetail { + ServiceDetailType service_detail_type; + sequence service_detail; + }; + + + struct ServiceInformation { + sequence service_options; + sequence service_details; + }; + + ///////////////////////////////// + // Policy Basic IDL definition // + ///////////////////////////////// + + typedef unsigned long PolicyType; + + interface Policy { + readonly attribute PolicyType policy_type; + Policy copy(); + void destroy(); + }; + + typedef sequence PolicyList; + typedef sequence PolicyTypeSeq; + + exception InvalidPolicies { sequence indices; }; + + typedef short PolicyErrorCode; + + const PolicyErrorCode BAD_POLICY = 0; + const PolicyErrorCode UNSUPPORTED_POLICY = 1; + const PolicyErrorCode BAD_POLICY_TYPE = 2; + const PolicyErrorCode BAD_POLICY_VALUE = 3; + const PolicyErrorCode UNSUPPORTED_POLICY_VALUE = 4; + + exception PolicyError {PolicyErrorCode reason;}; + + + //////////////////////// + // DomainManager // + //////////////////////// + + + interface DomainManager { + Policy get_domain_policy (in PolicyType policy_type); + }; + + const PolicyType SecConstruction = 11; + + interface ConstructionPolicy: Policy{ + void make_domain_manager(in InterfaceDef object_type, + in boolean constr_policy); + + }; + + + typedef sequence DomainManagerList; + + + ///////////// + // Current // + ///////////// + + interface Current { + }; + + + valuetype StringValue string; + valuetype WStringValue wstring; + + + + /////////////////////////// + // Interface Repository // + /////////////////////////// + + enum DefinitionKind { + dk_none, dk_all, dk_Attribute, dk_Constant, dk_Exception, dk_Interface, + dk_Module, dk_Operation, dk_Typedef, dk_Alias, dk_Struct, dk_Union, dk_Enum, + dk_Primitive, dk_String, dk_Sequence, dk_Array, dk_Repository, dk_Wstring, + dk_Fixed, dk_Value, dk_ValueBox, dk_ValueMember, dk_Native + }; + + interface IRObject { + // read interface + readonly attribute DefinitionKind def_kind; + // write interface + void destroy (); + }; + + typedef string VersionSpec; + + interface Contained : IRObject { + // read/write interface + attribute RepositoryId id; + attribute Identifier name; + attribute VersionSpec version; + + // read interface + readonly attribute Container defined_in; + readonly attribute ScopedName absolute_name; + readonly attribute Repository containing_repository; + + struct Description { + DefinitionKind kind; + any value; + }; + + Description describe (); + + // write interface + void move ( + in Container new_container, + in Identifier new_name, + in VersionSpec new_version + ); + }; + + + struct StructMember { + Identifier name; + TypeCode type; + IDLType type_def; + }; + + typedef sequence StructMemberSeq; + + struct Initializer { + StructMemberSeq members; + Identifier name; + }; + + typedef sequence InitializerSeq; + + struct UnionMember { + Identifier name; + any label; + TypeCode type; + IDLType type_def; + }; + + typedef sequence UnionMemberSeq; + typedef sequence EnumMemberSeq; + + interface Container : IRObject { + // read interface + Contained lookup (in ScopedName search_name); + + ContainedSeq contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + ContainedSeq lookup_name ( + in Identifier search_name, + in long levels_to_search, + in DefinitionKind limit_type, + in boolean exclude_inherited + ); + + struct Description { + Contained contained_object; + DefinitionKind kind; + any value; + }; + + typedef sequence DescriptionSeq; + + DescriptionSeq describe_contents ( + in DefinitionKind limit_type, + in boolean exclude_inherited, + in long max_returned_objs + ); + + // write interface + ModuleDef create_module ( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + + ConstantDef create_constant ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in any value + ); + + StructDef create_struct ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + UnionDef create_union ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType discriminator_type, + in UnionMemberSeq members + ); + + EnumDef create_enum ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in EnumMemberSeq members + ); + + AliasDef create_alias ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type + ); + + InterfaceDef create_interface ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in InterfaceDefSeq base_interfaces, + in boolean is_abstract + ); + + ValueDef create_value( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in boolean is_custom, + in boolean is_abstract, + in ValueDef base_value, + in boolean is_truncatable, + in ValueDefSeq abstract_base_values, + in InterfaceDefSeq supported_interfaces, + in InitializerSeq initializers + ); + + ValueBoxDef create_value_box( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType original_type_def + ); + + ExceptionDef create_exception( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in StructMemberSeq members + ); + + NativeDef create_native( + in RepositoryId id, + in Identifier name, + in VersionSpec version + ); + }; + + interface IDLType : IRObject { + readonly attribute TypeCode type; + }; + + interface PrimitiveDef; + interface StringDef; + interface SequenceDef; + interface ArrayDef; + interface WstringDef; + interface FixedDef; + + enum PrimitiveKind { + pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong, + pk_float, pk_double, pk_boolean, pk_char, pk_octet, + pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref, + pk_longlong, pk_ulonglong, pk_longdouble, + pk_wchar, pk_wstring, pk_value_base + }; + + interface Repository : Container { + // read interface + Contained lookup_id (in RepositoryId search_id); + + TypeCode get_canonical_typecode(in TypeCode tc); + + PrimitiveDef get_primitive (in PrimitiveKind kind); + + // write interface + StringDef create_string (in unsigned long bound); + + WstringDef create_wstring (in unsigned long bound); + + SequenceDef create_sequence ( + in unsigned long bound, + in IDLType element_type + ); + + ArrayDef create_array ( + in unsigned long length, + in IDLType element_type + ); + + FixedDef create_fixed ( + in unsigned short digits, + in short scale + ); + }; + + interface ModuleDef : Container, Contained { + }; + + struct ModuleDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + }; + + interface ConstantDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute any value; + }; + + struct ConstantDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + any value; + }; + + interface TypedefDef : Contained, IDLType { + }; + + struct TypeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + interface StructDef : TypedefDef, Container { + attribute StructMemberSeq members; + }; + + interface UnionDef : TypedefDef, Container { + readonly attribute TypeCode discriminator_type; + attribute IDLType discriminator_type_def; + attribute UnionMemberSeq members; + }; + + interface EnumDef : TypedefDef { + attribute EnumMemberSeq members; + }; + + interface AliasDef : TypedefDef { + attribute IDLType original_type_def; + }; + + interface NativeDef : TypedefDef { + }; + + interface PrimitiveDef: IDLType { + readonly attribute PrimitiveKind kind; + }; + + interface StringDef : IDLType { + attribute unsigned long bound; + }; + + interface WstringDef : IDLType { + attribute unsigned long bound; + }; + + interface FixedDef : IDLType { + attribute unsigned short digits; + attribute short scale; + }; + + interface SequenceDef : IDLType { + attribute unsigned long bound; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ArrayDef : IDLType { + attribute unsigned long length; + readonly attribute TypeCode element_type; + attribute IDLType element_type_def; + }; + + interface ExceptionDef : Contained, Container { + readonly attribute TypeCode type; + attribute StructMemberSeq members; + }; + + struct ExceptionDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + }; + + enum AttributeMode {ATTR_NORMAL, ATTR_READONLY}; + + interface AttributeDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute AttributeMode mode; + }; + + struct AttributeDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + AttributeMode mode; + }; + + enum OperationMode {OP_NORMAL, OP_ONEWAY}; + + enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT}; + + struct ParameterDescription { + Identifier name; + TypeCode type; + IDLType type_def; + ParameterMode mode; + }; + + typedef sequence ParDescriptionSeq; + typedef Identifier ContextIdentifier; + typedef sequence ContextIdSeq; + typedef sequence ExceptionDefSeq; + typedef sequence ExcDescriptionSeq; + + interface OperationDef : Contained { + readonly attribute TypeCode result; + attribute IDLType result_def; + attribute ParDescriptionSeq params; + attribute OperationMode mode; + attribute ContextIdSeq contexts; + attribute ExceptionDefSeq exceptions; + }; + + struct OperationDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode result; + OperationMode mode; + ContextIdSeq contexts; + ParDescriptionSeq parameters; + ExcDescriptionSeq exceptions; + }; + + typedef sequence RepositoryIdSeq; + typedef sequence OpDescriptionSeq; + typedef sequence AttrDescriptionSeq; + + interface InterfaceDef : Container, Contained, IDLType { + // read/write interface + attribute InterfaceDefSeq base_interfaces; + attribute boolean is_abstract; + + // read interface + boolean is_a (in RepositoryId interface_id); + + struct FullInterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + RepositoryIdSeq base_interfaces; + TypeCode type; + boolean is_abstract; + }; + + FullInterfaceDescription describe_interface(); + + // write interface + AttributeDef create_attribute ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct InterfaceDescription { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq base_interfaces; + boolean is_abstract; + }; + + typedef short Visibility; + + const Visibility PRIVATE_MEMBER = 0; + const Visibility PUBLIC_MEMBER = 1; + + struct ValueMember { + Identifier name; + RepositoryId id; + RepositoryId defined_in; + VersionSpec version; + TypeCode type; + IDLType type_def; + Visibility access; + }; + + typedef sequence ValueMemberSeq; + + interface ValueMemberDef : Contained { + readonly attribute TypeCode type; + attribute IDLType type_def; + attribute Visibility access; + }; + + interface ValueDef : Container, Contained, IDLType { + // read/write interface + attribute InterfaceDefSeq supported_interfaces; + attribute InitializerSeq initializers; + attribute ValueDef base_value; + attribute ValueDefSeq abstract_base_values; + attribute boolean is_abstract; + attribute boolean is_custom; + attribute boolean is_truncatable; + + // read interface + boolean is_a(in RepositoryId id); + + struct FullValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + RepositoryId defined_in; + VersionSpec version; + OpDescriptionSeq operations; + AttrDescriptionSeq attributes; + ValueMemberSeq members; + InitializerSeq initializers; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean is_truncatable; + RepositoryId base_value; + TypeCode type; + }; + + FullValueDescription describe_value(); + + ValueMemberDef create_value_member( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in Visibility access + ); + + AttributeDef create_attribute( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType type, + in AttributeMode mode + ); + + OperationDef create_operation ( + in RepositoryId id, + in Identifier name, + in VersionSpec version, + in IDLType result, + in OperationMode mode, + in ParDescriptionSeq params, + in ExceptionDefSeq exceptions, + in ContextIdSeq contexts + ); + }; + + struct ValueDescription { + Identifier name; + RepositoryId id; + boolean is_abstract; + boolean is_custom; + RepositoryId defined_in; + VersionSpec version; + RepositoryIdSeq supported_interfaces; + RepositoryIdSeq abstract_base_values; + boolean is_truncatable; + RepositoryId base_value; + }; + + interface ValueBoxDef : TypedefDef { + attribute IDLType original_type_def; + }; + + enum TCKind { //JAVA MAPPING PIDL + tk_null, tk_void, + tk_short, tk_long, tk_ushort, tk_ulong, + tk_float, tk_double, tk_boolean, tk_char, + tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, + tk_struct, tk_union, tk_enum, tk_string, + tk_sequence, tk_array, tk_alias, tk_except, + tk_longlong, tk_ulonglong, tk_longdouble, + tk_wchar, tk_wstring, tk_fixed, + tk_value, tk_value_box, + tk_native, + tk_abstract_interface, + tk_local_interface + }; + + + typedef short ValueModifier; // JAVA MAPPING PIDL + + const ValueModifier VM_NONE = 0; + const ValueModifier VM_CUSTOM = 1; + const ValueModifier VM_ABSTRACT = 2; + const ValueModifier VM_TRUNCATABLE = 3; + + local interface TypeCode { // JAVA MAPPING PIDL + exception Bounds {}; + exception BadKind {}; + + // for all TypeCode kinds + boolean equal (in TypeCode tc); + boolean equivalent(in TypeCode tc); + TypeCode get_compact_typecode(); + TCKind kind (); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, + // tk_value, tk_value_box, tk_native, tk_abstract_interface + // and tk_except + RepositoryId id () raises (BadKind); + + // for tk_objref, tk_struct, tk_union, tk_enum, tk_alias, + // tk_value, tk_value_box, tk_native, tk_abstract_interface + // and tk_except + Identifier name () raises (BadKind); + + // for tk_struct, tk_union, tk_enum, tk_value, + // and tk_except + unsigned long member_count () raises (BadKind); + Identifier member_name (in unsigned long index) + raises (BadKind, Bounds); + + // for tk_struct, tk_union, tk_value, and tk_except + TypeCode member_type (in unsigned long index) + raises (BadKind, Bounds); + + // for tk_union + any member_label (in unsigned long index) + raises (BadKind, Bounds); + TypeCode discriminator_type () raises (BadKind); + long default_index () raises (BadKind); + + // for tk_string, tk_sequence, and tk_array + unsigned long length () raises (BadKind); + + // for tk_sequence, tk_array, tk_value_box, and tk_alias + TypeCode content_type () raises (BadKind); + + // for tk_fixed + unsigned short fixed_digits() raises (BadKind); + short fixed_scale() raises (BadKind); + + // for tk_value + Visibility member_visibility(in unsigned long index) + raises(BadKind, Bounds); + ValueModifier type_modifier() raises(BadKind); + TypeCode concrete_base_type() raises(BadKind); + }; + + exception BadFixedValue { + unsigned long offset; + }; + + abstract valuetype DataOutputStream { + void write_any(in any value); + void write_boolean(in boolean value); + void write_char(in char value); + void write_wchar(in wchar value); + void write_octet(in octet value); + void write_short(in short value); + void write_ushort(in unsigned short value); + void write_long(in long value); + void write_ulong(in unsigned long value); + void write_longlong(in long long value); + void write_ulonglong(in unsigned long long value); + void write_float(in float value); + void write_double(in double value); +// void write_longdouble(in long double value); + void write_string(in string value); + void write_wstring(in wstring value); + void write_Object(in Object value); + void write_Abstract(in AbstractBase value); + void write_Value(in ValueBase value); + void write_TypeCode(in TypeCode value); + void write_any_array(in AnySeq seq, in unsigned long offset, in unsigned long length); + void write_boolean_array( in BooleanSeq seq, in unsigned long offset, in unsigned long length); + void write_char_array(in CharSeq seq, in unsigned long offset, in unsigned long length); + void write_wchar_array(in WCharSeq seq, in unsigned long offset, in unsigned long length); + void write_octet_array( in OctetSeq seq, in unsigned long offset, in unsigned long length); + void write_short_array( in ShortSeq seq, in unsigned long offset, in unsigned long length); + void write_ushort_array( in UShortSeq seq, in unsigned long offset, in unsigned long length); + void write_long_array(in LongSeq seq, in unsigned long offset, in unsigned long length); + void write_ulong_array(in ULongSeq seq, in unsigned long offset,in unsigned long length); + void write_ulonglong_array(in ULongLongSeq seq,in unsigned long offset,in unsigned long length); + void write_longlong_array(in LongLongSeq seq,in unsigned long offset, in unsigned long length); + void write_float_array(in FloatSeq seq, in unsigned long offset, in unsigned long length); + void write_double_array(in DoubleSeq seq,in unsigned long offset,in unsigned long length); + // void write_long_double_array(in LongDoubleSeq seq, in unsigned long offset, in unsigned long length); + void write_fixed(in any fixed_value) raises (BadFixedValue); + void write_fixed_array(in AnySeq seq,in unsigned long offset,in unsigned long length) raises (BadFixedValue); + }; + + abstract valuetype DataInputStream { + any read_any(); + boolean read_boolean(); + char read_char(); + wchar read_wchar(); + octet read_octet(); + short read_short(); + unsigned short read_ushort(); + long read_long(); + unsigned long read_ulong(); + long long read_longlong(); + unsigned long long read_ulonglong(); + float read_float(); + double read_double(); + // long double read_longdouble(); + string read_string(); + wstring read_wstring(); + Object read_Object(); + AbstractBase read_Abstract(); + ValueBase read_Value(); + TypeCode read_TypeCode(); + void read_any_array(inout AnySeq seq, in unsigned long offset, in unsigned long length); + void read_boolean_array(inout BooleanSeq seq, in unsigned long offset, in unsigned long length); + void read_char_array(inout CharSeq seq, in unsigned long offset, in unsigned long length); + void read_wchar_array(inout WCharSeq seq, in unsigned long offset, in unsigned long length); + void read_octet_array( inout OctetSeq seq, in unsigned long offset, in unsigned long length); + void read_short_array( inout ShortSeq seq, in unsigned long offset, in unsigned long length); + void read_ushort_array(inout UShortSeq seq, in unsigned long offset, in unsigned long length); + void read_long_array(inout LongSeq seq, in unsigned long offset, in unsigned long length); + void read_ulong_array( inout ULongSeq seq, in unsigned long offset, in unsigned long length); + void read_ulonglong_array(inout ULongLongSeq seq, in unsigned long offset, in unsigned long length); + void read_longlong_array( inout LongLongSeq seq, in unsigned long offset, in unsigned long length); + void read_float_array(inout FloatSeq seq, in unsigned long offset, in unsigned long length); + void read_double_array( inout DoubleSeq seq, in unsigned long offset,in unsigned long length); +// void read_long_double_array( inout LongDoubleSeq seq, in unsigned long offset, in unsigned long length); + any read_fixed( in unsigned short digits, in short scale) raises (BadFixedValue); + void read_fixed_array(inout AnySeq seq, in unsigned long offset,in unsigned long length, in unsigned short digits,in short scale) raises (BadFixedValue); + }; + + abstract valuetype CustomMarshal { + void marshal(in DataOutputStream os); + void unmarshal(in DataInputStream is); + }; + + /////////////////////////////// + // CORBA 2.6: PolicyManager // + /////////////////////////////// + + local interface PolicyManager { + PolicyList get_policy_overrides(in PolicyTypeSeq ts); + + void set_policy_overrides(in PolicyList policies, + in SetOverrideType set_add) + raises (InvalidPolicies); + }; + + local interface PolicyCurrent : PolicyManager, Current { + + }; + +}; + + +#pragma prefix "omg.org" + +module PortableServer { + + local interface POA; // forward declaration + + typedef sequence POAList; + + native Servant; + + typedef CORBA::OctetSeq ObjectId; + + exception ForwardRequest { + Object forward_reference; + }; + + // Policy interfaces + + const CORBA::PolicyType THREAD_POLICY_ID = 16; + const CORBA::PolicyType LIFESPAN_POLICY_ID = 17; + const CORBA::PolicyType ID_UNIQUENESS_POLICY_ID = 18; + const CORBA::PolicyType ID_ASSIGNMENT_POLICY_ID = 19; + const CORBA::PolicyType IMPLICIT_ACTIVATION_POLICY_ID = 20; + const CORBA::PolicyType SERVANT_RETENTION_POLICY_ID = 21; + const CORBA::PolicyType REQUEST_PROCESSING_POLICY_ID = 22; + + enum ThreadPolicyValue {ORB_CTRL_MODEL,SINGLE_THREAD_MODEL, MAIN_THREAD_MODEL}; + + + local interface ThreadPolicy : CORBA::Policy { + readonly attribute ThreadPolicyValue value; + }; + + enum LifespanPolicyValue {TRANSIENT,PERSISTENT}; + + local interface LifespanPolicy : CORBA::Policy { + readonly attribute LifespanPolicyValue value; + }; + + enum IdUniquenessPolicyValue {UNIQUE_ID,MULTIPLE_ID}; + + local interface IdUniquenessPolicy : CORBA::Policy { + readonly attribute IdUniquenessPolicyValue value; + }; + + enum IdAssignmentPolicyValue {USER_ID,SYSTEM_ID}; + + local interface IdAssignmentPolicy : CORBA::Policy { + readonly attribute IdAssignmentPolicyValue value; + }; + + enum ImplicitActivationPolicyValue {IMPLICIT_ACTIVATION,NO_IMPLICIT_ACTIVATION}; + + local interface ImplicitActivationPolicy : CORBA::Policy { + readonly attribute ImplicitActivationPolicyValue value; + }; + + enum ServantRetentionPolicyValue {RETAIN,NON_RETAIN}; + + local interface ServantRetentionPolicy : CORBA::Policy { + readonly attribute ServantRetentionPolicyValue value; + }; + + enum RequestProcessingPolicyValue { + USE_ACTIVE_OBJECT_MAP_ONLY, + USE_DEFAULT_SERVANT, + USE_SERVANT_MANAGER + }; + + local interface RequestProcessingPolicy : CORBA::Policy { + readonly attribute RequestProcessingPolicyValue value; + }; + + + // POAManager interface + + local interface POAManager { + + exception AdapterInactive{}; + + enum State {HOLDING, ACTIVE, DISCARDING, INACTIVE}; + + void activate() raises(AdapterInactive); + + void hold_requests(in boolean wait_for_completion) raises(AdapterInactive); + + void discard_requests(in boolean wait_for_completion) raises(AdapterInactive); + + void deactivate(in boolean etherealize_objects, in boolean wait_for_completion) + raises(AdapterInactive); + + State get_state(); + }; + + + // AdapterActivator interface + + local interface AdapterActivator { + + boolean unknown_adapter(in POA parent, in string name); + + }; + + // ServantManager interface + + local interface ServantManager{ }; + + local interface ServantActivator : ServantManager { + + Servant incarnate (in ObjectId oid,in POA adapter) raises (ForwardRequest); + + void etherealize (in ObjectId oid,in POA adapter, + in Servant serv, in boolean cleanup_in_progress, + in boolean remaining_activations); + }; + + local interface ServantLocator : ServantManager { + + native Cookie; + + Servant preinvoke(in ObjectId oid,in POA adapter, + in CORBA::Identifier operation, out Cookie the_cookie) + raises (ForwardRequest); + + void postinvoke(in ObjectId oid,in POA adapter, in CORBA::Identifier operation, + in Cookie the_cookie, in Servant the_servant); + }; + + // POA interface + + local interface POA { + + exception AdapterAlreadyExists {}; + exception AdapterNonExistent {}; + exception InvalidPolicy {unsigned short index;}; + exception NoServant {}; + exception ObjectAlreadyActive {}; + exception ObjectNotActive {}; + exception ServantAlreadyActive {}; + exception ServantNotActive {}; + exception WrongAdapter {}; + exception WrongPolicy {}; + + // POA creation and destruction + + POA create_POA(in string adapter_name, in POAManager a_POAManager, + in CORBA::PolicyList policies) + raises (AdapterAlreadyExists, InvalidPolicy); + + POA find_POA(in string adapter_name, in boolean activate_it) raises (AdapterNonExistent); + + void destroy(in boolean etherealize_objects,in boolean wait_for_completion); + + // Factories for Policy objects + + ThreadPolicy create_thread_policy(in ThreadPolicyValue value); + + LifespanPolicy create_lifespan_policy(in LifespanPolicyValue value); + + IdUniquenessPolicy create_id_uniqueness_policy(in IdUniquenessPolicyValue value); + + IdAssignmentPolicy create_id_assignment_policy(in IdAssignmentPolicyValue value); + + ImplicitActivationPolicy create_implicit_activation_policy(in ImplicitActivationPolicyValue value); + + ServantRetentionPolicy create_servant_retention_policy(in ServantRetentionPolicyValue value); + + RequestProcessingPolicy create_request_processing_policy(in RequestProcessingPolicyValue value); + + // POA attributes + + readonly attribute string the_name; + readonly attribute POA the_parent; + readonly attribute POAList the_children; + readonly attribute POAManager the_POAManager; + attribute AdapterActivator the_activator; + + // Servant Manager registration: + ServantManager get_servant_manager() raises (WrongPolicy); + + void set_servant_manager(in ServantManager imgr) raises (WrongPolicy); + + // operations for the USE_DEFAULT_SERVANT policy + Servant get_servant() raises (NoServant, WrongPolicy); + + void set_servant(in Servant p_servant) raises (WrongPolicy); + + // object activation and deactivation + ObjectId activate_object(in Servant p_servant) + raises (ServantAlreadyActive, WrongPolicy); + + void activate_object_with_id(in ObjectId id, in Servant p_servant) + raises (ServantAlreadyActive, ObjectAlreadyActive, WrongPolicy); + + void deactivate_object(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + // reference creation operations + Object create_reference (in CORBA::RepositoryId intf) raises (WrongPolicy); + + Object create_reference_with_id (in ObjectId oid, + in CORBA::RepositoryId intf); + + // Identity mapping operations: + + ObjectId servant_to_id(in Servant p_servant) raises (ServantNotActive, WrongPolicy); + + Object servant_to_reference(in Servant p_servant) raises (ServantNotActive, WrongPolicy); + + Servant reference_to_servant(in Object reference) raises(ObjectNotActive, WrongAdapter, WrongPolicy); + + ObjectId reference_to_id(in Object reference) raises (WrongAdapter, WrongPolicy); + + Servant id_to_servant(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + Object id_to_reference(in ObjectId oid) raises (ObjectNotActive, WrongPolicy); + + readonly attribute CORBA::OctetSeq id; + }; + + // Current interface + + local interface Current : CORBA::Current { + + exception NoContext { }; + + POA get_POA() raises (NoContext); + + ObjectId get_object_id() raises (NoContext); + + Object get_reference() raises(NoContext); + + Servant get_servant() raises (NoContext); + + }; + +}; + diff --git a/idl/orb/build.xml b/idl/orb/build.xml new file mode 100644 index 0000000..863c603 --- /dev/null +++ b/idl/orb/build.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/idl/orb/extra/.svn/all-wcprops b/idl/orb/extra/.svn/all-wcprops new file mode 100644 index 0000000..cc9cc5f --- /dev/null +++ b/idl/orb/extra/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/orb/extra +END diff --git a/idl/orb/extra/.svn/entries b/idl/orb/extra/.svn/entries new file mode 100644 index 0000000..2afbb07 --- /dev/null +++ b/idl/orb/extra/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +es +dir + +org +dir + diff --git a/idl/orb/extra/es/.svn/all-wcprops b/idl/orb/extra/es/.svn/all-wcprops new file mode 100644 index 0000000..64fbf50 --- /dev/null +++ b/idl/orb/extra/es/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/es +END diff --git a/idl/orb/extra/es/.svn/entries b/idl/orb/extra/es/.svn/entries new file mode 100644 index 0000000..3f73b2f --- /dev/null +++ b/idl/orb/extra/es/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/es +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +tid +dir + diff --git a/idl/orb/extra/es/tid/.svn/all-wcprops b/idl/orb/extra/es/tid/.svn/all-wcprops new file mode 100644 index 0000000..3dfaa8a --- /dev/null +++ b/idl/orb/extra/es/tid/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/es/tid +END diff --git a/idl/orb/extra/es/tid/.svn/entries b/idl/orb/extra/es/tid/.svn/entries new file mode 100644 index 0000000..3e3423f --- /dev/null +++ b/idl/orb/extra/es/tid/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/es/tid +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +CORBA +dir + diff --git a/idl/orb/extra/es/tid/CORBA/.svn/all-wcprops b/idl/orb/extra/es/tid/CORBA/.svn/all-wcprops new file mode 100644 index 0000000..62e088e --- /dev/null +++ b/idl/orb/extra/es/tid/CORBA/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/es/tid/CORBA +END +Any.java +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/es/tid/CORBA/Any.java +END diff --git a/idl/orb/extra/es/tid/CORBA/.svn/entries b/idl/orb/extra/es/tid/CORBA/.svn/entries new file mode 100644 index 0000000..b5743f3 --- /dev/null +++ b/idl/orb/extra/es/tid/CORBA/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/es/tid/CORBA +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Any.java +file + + + + +2009-02-16T09:48:55.000000Z +7c3176874483d68755f140b8539bca7e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +203 + diff --git a/idl/orb/extra/es/tid/CORBA/.svn/prop-base/Any.java.svn-base b/idl/orb/extra/es/tid/CORBA/.svn/prop-base/Any.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/es/tid/CORBA/.svn/prop-base/Any.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/es/tid/CORBA/.svn/text-base/Any.java.svn-base b/idl/orb/extra/es/tid/CORBA/.svn/text-base/Any.java.svn-base new file mode 100644 index 0000000..2b08b44 --- /dev/null +++ b/idl/orb/extra/es/tid/CORBA/.svn/text-base/Any.java.svn-base @@ -0,0 +1,10 @@ +package es.tid.CORBA; + +public abstract class Any extends org.omg.CORBA.Any { + + public org.omg.CORBA.portable.Streamable extract_Streamable() { + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/idl/orb/extra/es/tid/CORBA/Any.java b/idl/orb/extra/es/tid/CORBA/Any.java new file mode 100644 index 0000000..2b08b44 --- /dev/null +++ b/idl/orb/extra/es/tid/CORBA/Any.java @@ -0,0 +1,10 @@ +package es.tid.CORBA; + +public abstract class Any extends org.omg.CORBA.Any { + + public org.omg.CORBA.portable.Streamable extract_Streamable() { + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/.svn/all-wcprops b/idl/orb/extra/org/.svn/all-wcprops new file mode 100644 index 0000000..5e73bdc --- /dev/null +++ b/idl/orb/extra/org/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/orb/extra/org +END diff --git a/idl/orb/extra/org/.svn/entries b/idl/orb/extra/org/.svn/entries new file mode 100644 index 0000000..8aa22ae --- /dev/null +++ b/idl/orb/extra/org/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +omg +dir + diff --git a/idl/orb/extra/org/omg/.svn/all-wcprops b/idl/orb/extra/org/omg/.svn/all-wcprops new file mode 100644 index 0000000..958bd1e --- /dev/null +++ b/idl/orb/extra/org/omg/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg +END diff --git a/idl/orb/extra/org/omg/.svn/entries b/idl/orb/extra/org/omg/.svn/entries new file mode 100644 index 0000000..f8b9405 --- /dev/null +++ b/idl/orb/extra/org/omg/.svn/entries @@ -0,0 +1,40 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +PortableServer +dir + +CORBA +dir + +CORBA_2_3 +dir + +CORBA_2_5 +dir + diff --git a/idl/orb/extra/org/omg/CORBA/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA/.svn/all-wcprops new file mode 100644 index 0000000..7a31cfe --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/all-wcprops @@ -0,0 +1,449 @@ +K 25 +svn:wc:ra_dav:version-url +V 75 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA +END +SystemException.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/SystemException.java +END +ObjectHolder.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ObjectHolder.java +END +StringHolder.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/StringHolder.java +END +Object.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Object.java +END +INTF_REPOS.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INTF_REPOS.java +END +PolicyError.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/PolicyError.java +END +UnknownUserException.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/UnknownUserException.java +END +LocalObject.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/LocalObject.java +END +NamedValue.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NamedValue.java +END +BAD_TYPECODE.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_TYPECODE.java +END +IntHolder.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/IntHolder.java +END +NO_RESPONSE.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NO_RESPONSE.java +END +UNKNOWN.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/UNKNOWN.java +END +BAD_POLICY_VALUE.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_POLICY_VALUE.java +END +WrongTransaction.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/WrongTransaction.java +END +PERSIST_STORE.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/PERSIST_STORE.java +END +ValueBaseHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ValueBaseHolder.java +END +BAD_OPERATION.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_OPERATION.java +END +BAD_POLICY_TYPE.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_POLICY_TYPE.java +END +NO_RESOURCES.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NO_RESOURCES.java +END +DoubleHolder.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/DoubleHolder.java +END +OBJ_ADAPTER.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/OBJ_ADAPTER.java +END +LocalInterface.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/LocalInterface.java +END +TypeCodeHelper.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodeHelper.java +END +CompletionStatus.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/CompletionStatus.java +END +DATA_CONVERSION.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/DATA_CONVERSION.java +END +NVList.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NVList.java +END +ContextList.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ContextList.java +END +Principal.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Principal.java +END +TRANSACTION_REQUIRED.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TRANSACTION_REQUIRED.java +END +INV_FLAG.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INV_FLAG.java +END +NO_IMPLEMENT.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NO_IMPLEMENT.java +END +MARSHAL.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/MARSHAL.java +END +Any.java +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Any.java +END +Request.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Request.java +END +UserException.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/UserException.java +END +COMM_FAILURE.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/COMM_FAILURE.java +END +BAD_PARAM.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_PARAM.java +END +TRANSACTION_ROLLEDBACK.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java +END +CharHolder.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/CharHolder.java +END +INTERNAL.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INTERNAL.java +END +BooleanHolder.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BooleanHolder.java +END +FREE_MEM.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/FREE_MEM.java +END +ORB.java +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ORB.java +END +IMP_LIMIT.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/IMP_LIMIT.java +END +DynamicImplementation.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/DynamicImplementation.java +END +BAD_CONTEXT.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_CONTEXT.java +END +ExceptionList.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ExceptionList.java +END +INVALID_TRANSACTION.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INVALID_TRANSACTION.java +END +LongHolder.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/LongHolder.java +END +ShortHolder.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ShortHolder.java +END +ByteHolder.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ByteHolder.java +END +INITIALIZE.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INITIALIZE.java +END +OBJECT_NOT_EXIST.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/OBJECT_NOT_EXIST.java +END +FloatHolder.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/FloatHolder.java +END +Environment.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Environment.java +END +NO_MEMORY.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NO_MEMORY.java +END +BAD_POLICY.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_POLICY.java +END +ValueBaseHelper.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ValueBaseHelper.java +END +TRANSIENT.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TRANSIENT.java +END +TypeCodeHolder.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodeHolder.java +END +INV_POLICY.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INV_POLICY.java +END +TypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCode.java +END +CODESET_INCOMPATIBLE.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/CODESET_INCOMPATIBLE.java +END +PrincipalHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/PrincipalHolder.java +END +ServerRequest.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ServerRequest.java +END +INV_IDENT.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INV_IDENT.java +END +INV_OBJREF.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/INV_OBJREF.java +END +NO_PERMISSION.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/NO_PERMISSION.java +END +Context.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Context.java +END +AnyHolder.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/AnyHolder.java +END +TIMEOUT.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TIMEOUT.java +END +Bounds.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/Bounds.java +END +BAD_INV_ORDER.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/BAD_INV_ORDER.java +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/entries b/idl/orb/extra/org/omg/CORBA/.svn/entries new file mode 100644 index 0000000..b4a2159 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/entries @@ -0,0 +1,2553 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +SystemException.java +file + + + + +2009-02-16T09:48:55.000000Z +3edf3f309dbb80df255b6d41dcb728af +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1164 + +StringHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +f5a139c3d19e8f4c2f2801b34d1e49f7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +767 + +ObjectHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +64b52bddab21dc6ea9cba3d581b4c600 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +795 + +Object.java +file + + + + +2009-02-16T09:48:55.000000Z +63ccf40dbc4cc14ab6923f70299de790 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1363 + +INTF_REPOS.java +file + + + + +2009-02-16T09:48:55.000000Z +d58b6b7a0311beda25004575809e2699 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +708 + +PolicyError.java +file + + + + +2009-02-16T09:48:55.000000Z +cb0fd4b8241c4116a9bf67b9b8a49c8c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +555 + +UnknownUserException.java +file + + + + +2009-02-16T09:48:55.000000Z +909f0220b992610b63cd1fcaf25de888 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +492 + +ORBPackage +dir + +NamedValue.java +file + + + + +2009-02-16T09:48:55.000000Z +5f4021ad35ad7395ba4d76fb9791012d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +368 + +LocalObject.java +file + + + + +2009-02-16T09:48:55.000000Z +95a5d14a92d0905b9466822041b5977c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3330 + +BAD_TYPECODE.java +file + + + + +2009-02-16T09:48:55.000000Z +bb56172e1407ea77b7345dd9cd2e0ae8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +686 + +IntHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +6fa758e370392da07f6082057a426e1c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +746 + +NO_RESPONSE.java +file + + + + +2009-02-16T09:48:55.000000Z +c4f066ab5a474c252e83a7b0f9e7ac09 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +713 + +UNKNOWN.java +file + + + + +2009-02-16T09:48:55.000000Z +c37d55b6df90e7a66af8bd4b840b4c3d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +693 + +BAD_POLICY_VALUE.java +file + + + + +2009-02-16T09:48:55.000000Z +dc06f0c9c0607a8b46d7f546dea7f654 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +282 + +WrongTransaction.java +file + + + + +2009-02-16T09:48:55.000000Z +a01e97d9c9716260c1665e681ad238dd +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +524 + +PERSIST_STORE.java +file + + + + +2009-02-16T09:48:55.000000Z +c66d5ccb5f47e3087babcd5c1f2f2905 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +723 + +ValueBaseHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +6d0cd26244fb43e43ec8cbcc2143e7f4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +845 + +NO_RESOURCES.java +file + + + + +2009-02-16T09:48:55.000000Z +06e584b5d182f49871c876641ac79f7c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +718 + +BAD_POLICY_TYPE.java +file + + + + +2009-02-16T09:48:55.000000Z +5c99bb20f5d0891e4b0b9882aa3c86ff +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +281 + +BAD_OPERATION.java +file + + + + +2009-02-16T09:48:55.000000Z +230c8ab2dbb47460edda00774d2597c4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +691 + +DoubleHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +db46babaa0061091f3e94b7c862de81e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +767 + +TypeCodePackage +dir + +OBJ_ADAPTER.java +file + + + + +2009-02-16T09:48:55.000000Z +bf9c67c5dfb2dfcd261ca8d17ab1bd67 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +713 + +LocalInterface.java +file + + + + +2009-02-16T09:48:55.000000Z +c43fe2d78d88c559b91b8cf1476975ed +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +87 + +TypeCodeHelper.java +file + + + + +2009-02-16T09:48:55.000000Z +5d12c91b3a3e29ae1ff507ee7fd0648e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +999 + +CompletionStatus.java +file + + + + +2009-02-16T09:48:55.000000Z +f8db87e07305482114f1b6067589692a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1077 + +DATA_CONVERSION.java +file + + + + +2009-02-16T09:48:55.000000Z +ead5b8da753fceea2da2a688ce3c962f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +701 + +NVList.java +file + + + + +2009-02-16T09:48:55.000000Z +0bd7d07beb77e06af4306a40d11fd49e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +766 + +ContextList.java +file + + + + +2009-02-16T09:48:55.000000Z +25d5c46cff94a4c99e9dbf960e860aec +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +475 + +Principal.java +file + + + + +2009-02-16T09:48:55.000000Z +14328129ee831772e3c6fe276af4a88b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +559 + +INV_FLAG.java +file + + + + +2009-02-16T09:48:55.000000Z +807e9640e172f7314739dd27b6110b79 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +698 + +TRANSACTION_REQUIRED.java +file + + + + +2009-02-16T09:48:55.000000Z +7cefa288c1f8d06e1e1ee801d8a892c6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +778 + +NO_IMPLEMENT.java +file + + + + +2009-02-16T09:48:55.000000Z +7b72ed7e4412e13a084503a108dcab35 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +718 + +MARSHAL.java +file + + + + +2009-02-16T09:48:55.000000Z +9051d9bff56bc8e3dd0e58fcf3f12e02 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +693 + +Any.java +file + + + + +2009-02-16T09:48:55.000000Z +09915d3dea77992efe9879ef553030c7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4586 + +Request.java +file + + + + +2010-04-28T10:47:59.000000Z +26266cb7604fe0e19222f08ef6c9da7a +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +1831 + +portable +dir + +UserException.java +file + + + + +2009-02-16T09:48:55.000000Z +e4b47eb59c934ee914aa930db2cadd50 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +453 + +COMM_FAILURE.java +file + + + + +2009-02-16T09:48:55.000000Z +b349c38d52f2994465d23aa77e20632f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +686 + +BAD_PARAM.java +file + + + + +2009-02-16T09:48:55.000000Z +0107670b90c427a0b4ffdfe1d7a22f4f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +671 + +TRANSACTION_ROLLEDBACK.java +file + + + + +2009-02-16T09:48:55.000000Z +4093dde1e69fcb789f91d7e92b58a2f1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +788 + +CharHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +8a356db4de5acfc8a9a64e82dcdfc6c0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +751 + +INTERNAL.java +file + + + + +2009-02-16T09:48:55.000000Z +45de4fdfc692fbe8e9a99a5dd007e44f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +698 + +BooleanHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +abf3afd57d86c02c6f572647bcbcaf30 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +775 + +FREE_MEM.java +file + + + + +2009-02-16T09:48:55.000000Z +1fa1a1e7ec32049efadb3b12a4726e1d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +698 + +ORB.java +file + + + + +2009-02-16T09:48:55.000000Z +f35fd1782bf32436087f3ed9242eeac5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8038 + +IMP_LIMIT.java +file + + + + +2009-02-16T09:48:55.000000Z +a6f5c54d9bff7166e544507121b96301 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +703 + +BAD_CONTEXT.java +file + + + + +2009-02-16T09:48:55.000000Z +16f410047d0c761ac58ce174d250de0b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +681 + +DynamicImplementation.java +file + + + + +2009-02-16T09:48:55.000000Z +2bc0f77f7c9b27d349939271d3709e57 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +578 + +ExceptionList.java +file + + + + +2009-02-16T09:48:55.000000Z +cbbd2d08b4431f8d09f83e7dd1e3523d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +534 + +INVALID_TRANSACTION.java +file + + + + +2009-02-16T09:48:55.000000Z +4acc48d39aea15a62c5c6a3b54fa53f6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +769 + +ShortHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +6415cd7cb941b7f01b132ae1b6e01c1d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +759 + +LongHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +0b537367a0b80c96ab5a3168a4f8ad00 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +763 + +ByteHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +a94b255f90ac7f4bc739179f8c2620bc +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +754 + +INITIALIZE.java +file + + + + +2009-02-16T09:48:55.000000Z +5d9121dbafcbebc746c65ced4ff0452a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +708 + +OBJECT_NOT_EXIST.java +file + + + + +2009-02-16T09:48:55.000000Z +2d83ba4a824b9350a1b378585e392044 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +756 + +FloatHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +0d142ce963e6537bbea81c0bf8a556a6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +759 + +NO_MEMORY.java +file + + + + +2009-02-16T09:48:55.000000Z +d6fd254f49600b3b75a4525c2cbcc58c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +703 + +Environment.java +file + + + + +2009-02-16T09:48:55.000000Z +7a35c14586cac497c9c6b5d0c2d0900b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +408 + +BAD_POLICY.java +file + + + + +2009-02-16T09:48:55.000000Z +936fc441236e3915bebad37d0e839720 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +276 + +TRANSIENT.java +file + + + + +2009-02-16T09:48:55.000000Z +2e5d8b0f100f7c8bd6f231466a424f6c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +703 + +ValueBaseHelper.java +file + + + + +2009-02-16T09:48:55.000000Z +42f2f4851bd0e630e8fa669df6e94704 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1482 + +TypeCodeHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +820d8b18930408d50dbc7b193dee15f7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +691 + +INV_POLICY.java +file + + + + +2009-02-16T09:48:55.000000Z +9d859cb970521fa24cc34e25c4ca8b13 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +708 + +CODESET_INCOMPATIBLE.java +file + + + + +2009-02-16T09:48:55.000000Z +2abf4cb6b8bce46fade5d20322fa1f80 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +726 + +TypeCode.java +file + + + + +2009-02-16T09:48:55.000000Z +5ed518716675ab17f2da8ef1234a94e8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2589 + +ServerRequest.java +file + + + + +2009-02-16T09:48:55.000000Z +791c3be1a3954b265b07933c38e2c91f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1262 + +PrincipalHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +17f5efd98fa7a6718642be75e27cf8a9 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +843 + +INV_IDENT.java +file + + + + +2009-02-16T09:48:55.000000Z +00884a1105a2f72381b38c0e8a3d5390 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +703 + +INV_OBJREF.java +file + + + + +2009-02-16T09:48:55.000000Z +57005d3240328101f1ab0e95c509522f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +708 + +NO_PERMISSION.java +file + + + + +2009-02-16T09:48:55.000000Z +1849f31262ffc7bcfce67fca8270768f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +723 + +Context.java +file + + + + +2009-02-16T09:48:55.000000Z +78f653efb21ac1d35b675604b4adcced +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +787 + +AnyHolder.java +file + + + + +2009-02-16T09:48:55.000000Z +77eb20c5a0e7724f33ade08e21ffda7e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +914 + +TIMEOUT.java +file + + + + +2009-02-16T09:48:55.000000Z +95736b453c44012032d5675e233119c1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +693 + +Bounds.java +file + + + + +2009-02-16T09:48:55.000000Z +6e2136e78f52c936870592d98c336093 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +372 + +BAD_INV_ORDER.java +file + + + + +2009-02-16T09:48:55.000000Z +19e02a4ea08e4d869b3cba9533e23a71 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +691 + diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Any.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Any.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Any.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/AnyHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/AnyHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/AnyHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_CONTEXT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_CONTEXT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_CONTEXT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_INV_ORDER.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_INV_ORDER.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_INV_ORDER.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_OPERATION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_OPERATION.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_OPERATION.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_PARAM.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_PARAM.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_PARAM.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_TYPE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_TYPE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_TYPE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_VALUE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_VALUE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_POLICY_VALUE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_TYPECODE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_TYPECODE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BAD_TYPECODE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BooleanHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BooleanHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/BooleanHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Bounds.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Bounds.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Bounds.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ByteHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ByteHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ByteHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CODESET_INCOMPATIBLE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CODESET_INCOMPATIBLE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CODESET_INCOMPATIBLE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/COMM_FAILURE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/COMM_FAILURE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/COMM_FAILURE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CharHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CharHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CharHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CompletionStatus.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CompletionStatus.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/CompletionStatus.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Context.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Context.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Context.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ContextList.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ContextList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ContextList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DATA_CONVERSION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DATA_CONVERSION.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DATA_CONVERSION.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DoubleHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DoubleHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DoubleHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DynamicImplementation.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DynamicImplementation.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/DynamicImplementation.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Environment.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Environment.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Environment.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ExceptionList.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ExceptionList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ExceptionList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FREE_MEM.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FREE_MEM.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FREE_MEM.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FloatHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FloatHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/FloatHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IMP_LIMIT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IMP_LIMIT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IMP_LIMIT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INITIALIZE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INITIALIZE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INITIALIZE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTERNAL.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTERNAL.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTERNAL.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTF_REPOS.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTF_REPOS.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INTF_REPOS.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INVALID_TRANSACTION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INVALID_TRANSACTION.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INVALID_TRANSACTION.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_FLAG.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_FLAG.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_FLAG.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_IDENT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_IDENT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_IDENT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_OBJREF.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_OBJREF.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_OBJREF.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_POLICY.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_POLICY.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/INV_POLICY.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IntHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IntHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/IntHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalInterface.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalInterface.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalInterface.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalObject.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalObject.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LocalObject.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LongHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LongHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/LongHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/MARSHAL.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/MARSHAL.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/MARSHAL.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_IMPLEMENT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_IMPLEMENT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_IMPLEMENT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_MEMORY.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_MEMORY.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_MEMORY.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_PERMISSION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_PERMISSION.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_PERMISSION.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESOURCES.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESOURCES.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESOURCES.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESPONSE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESPONSE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NO_RESPONSE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NVList.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NVList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NVList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NamedValue.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NamedValue.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/NamedValue.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJECT_NOT_EXIST.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJECT_NOT_EXIST.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJECT_NOT_EXIST.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJ_ADAPTER.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJ_ADAPTER.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/OBJ_ADAPTER.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ORB.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Object.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Object.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Object.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ObjectHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ObjectHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ObjectHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PERSIST_STORE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PERSIST_STORE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PERSIST_STORE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PolicyError.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PolicyError.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PolicyError.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Principal.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Principal.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Principal.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PrincipalHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PrincipalHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/PrincipalHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Request.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Request.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/Request.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ServerRequest.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ServerRequest.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ServerRequest.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ShortHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ShortHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ShortHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/StringHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/StringHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/StringHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/SystemException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/SystemException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/SystemException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TIMEOUT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TIMEOUT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TIMEOUT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_REQUIRED.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_REQUIRED.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_REQUIRED.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_ROLLEDBACK.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_ROLLEDBACK.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSACTION_ROLLEDBACK.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSIENT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSIENT.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TRANSIENT.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCode.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHelper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHelper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/TypeCodeHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UNKNOWN.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UNKNOWN.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UNKNOWN.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UnknownUserException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UnknownUserException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UnknownUserException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UserException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UserException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/UserException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHelper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHelper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/ValueBaseHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/prop-base/WrongTransaction.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/WrongTransaction.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/prop-base/WrongTransaction.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Any.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Any.java.svn-base new file mode 100644 index 0000000..32eba80 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Any.java.svn-base @@ -0,0 +1,116 @@ +package org.omg.CORBA; + +public abstract class Any implements org.omg.CORBA.portable.IDLEntity { + + abstract public boolean equal(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.TypeCode type(); + abstract public void type(org.omg.CORBA.TypeCode type); + + abstract public void read_value(org.omg.CORBA.portable.InputStream is, + org.omg.CORBA.TypeCode type) throws org.omg.CORBA.MARSHAL; + abstract public void write_value(org.omg.CORBA.portable.OutputStream os); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + abstract public org.omg.CORBA.portable.InputStream create_input_stream(); + + abstract public short extract_short() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_short(short s); + + abstract public int extract_long() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_long(int i); + + abstract public long extract_longlong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_longlong(long l); + + abstract public short extract_ushort() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ushort(short s); + + abstract public int extract_ulong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulong(int i); + + abstract public long extract_ulonglong() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulonglong(long l); + + abstract public float extract_float() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_float(float f); + + abstract public double extract_double() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_double(double d); + + abstract public boolean extract_boolean() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_boolean(boolean b); + + abstract public char extract_char() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_char(char c); + + abstract public char extract_wchar() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wchar(char c); + + abstract public byte extract_octet() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_octet(byte b); + + abstract public org.omg.CORBA.Any extract_any() + throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_any(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.Object extract_Object() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Object(org.omg.CORBA.Object obj); + + abstract public java.io.Serializable extract_Value() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Value(java.io.Serializable v); + abstract public void insert_Value(java.io.Serializable v, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.MARSHAL; + + abstract public void insert_Object(org.omg.CORBA.Object obj, + org.omg.CORBA.TypeCode type) throws + org.omg.CORBA.BAD_PARAM; + + abstract public String extract_string() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_string(String s) throws + org.omg.CORBA.DATA_CONVERSION, org.omg.CORBA.MARSHAL; + + abstract public String extract_wstring() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wstring(String value) throws + org.omg.CORBA.MARSHAL; + + abstract public TypeCode extract_TypeCode() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_TypeCode(TypeCode value); + + /** + *@ deprecated + */ + public Principal extract_Principal() throws org.omg.CORBA.BAD_OPERATION { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + /** + *@ deprecated + */ + public void insert_Principal(Principal p) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.Streamable extract_Streamable() throws + org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_Streamable(org.omg.CORBA.portable.Streamable s) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.math.BigDecimal extract_fixed() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_fixed(java.math.BigDecimal f, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} + diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/AnyHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/AnyHolder.java.svn-base new file mode 100644 index 0000000..3faeb1e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/AnyHolder.java.svn-base @@ -0,0 +1,39 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class AnyHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Any value; + protected org.omg.CORBA.TypeCode type; + + public AnyHolder() { + value = null; + type = null; + } + + public AnyHolder(org.omg.CORBA.Any initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_any(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_any(value); + } + + public synchronized org.omg.CORBA.TypeCode _type() + { + if(type == null) + type = org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_any); + return type; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_CONTEXT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_CONTEXT.java.svn-base new file mode 100644 index 0000000..b8063c6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_CONTEXT.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_CONTEXT extends org.omg.CORBA.SystemException { + + public BAD_CONTEXT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_CONTEXT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_CONTEXT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_CONTEXT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_INV_ORDER.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_INV_ORDER.java.svn-base new file mode 100644 index 0000000..9f16b1f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_INV_ORDER.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_INV_ORDER extends org.omg.CORBA.SystemException { + + public BAD_INV_ORDER() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_INV_ORDER(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_INV_ORDER(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_INV_ORDER(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_OPERATION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_OPERATION.java.svn-base new file mode 100644 index 0000000..7bc62d0 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_OPERATION.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_OPERATION extends org.omg.CORBA.SystemException { + + public BAD_OPERATION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_OPERATION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_OPERATION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_OPERATION(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_PARAM.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_PARAM.java.svn-base new file mode 100644 index 0000000..ce96fce --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_PARAM.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_PARAM extends org.omg.CORBA.SystemException { + + public BAD_PARAM() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_PARAM(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_PARAM(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_PARAM(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY.java.svn-base new file mode 100644 index 0000000..1f2440e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY { + short value = (short) 0; +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_TYPE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_TYPE.java.svn-base new file mode 100644 index 0000000..66fd021 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_TYPE.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY_TYPE { + short value = (short) 2; +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_VALUE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_VALUE.java.svn-base new file mode 100644 index 0000000..7514fc6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_POLICY_VALUE.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY_VALUE { + short value = (short) 3; +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_TYPECODE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_TYPECODE.java.svn-base new file mode 100644 index 0000000..0c336b3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BAD_TYPECODE.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_TYPECODE extends org.omg.CORBA.SystemException { + + public BAD_TYPECODE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_TYPECODE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_TYPECODE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_TYPECODE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/BooleanHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BooleanHolder.java.svn-base new file mode 100644 index 0000000..824bb17 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/BooleanHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class BooleanHolder implements org.omg.CORBA.portable.Streamable { + + public boolean value; + + public BooleanHolder() { + } + + public BooleanHolder(boolean initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_boolean(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_boolean(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_boolean); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Bounds.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Bounds.java.svn-base new file mode 100644 index 0000000..75fa0ac --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Bounds.java.svn-base @@ -0,0 +1,23 @@ +// +// Bounds.java (exception) +// +// File generated: Mon Sep 25 18:46:50 GMT+02:00 2000 +// by TidORB Idl2Java 1.0 +// + +package org.omg.CORBA; + +final public class Bounds + extends org.omg.CORBA.UserException { + + + public Bounds() { + super("IDL:omg.org/CORBA/Bounds:1.0"); + } + + public Bounds(String reason) { + super("IDL:omg.org/CORBA/Bounds:1.0 "+reason); + + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ByteHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ByteHolder.java.svn-base new file mode 100644 index 0000000..6b7db45 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ByteHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ByteHolder implements org.omg.CORBA.portable.Streamable { + + public byte value; + + public ByteHolder() { + } + + public ByteHolder(byte initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_octet(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_octet(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_octet); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/CODESET_INCOMPATIBLE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CODESET_INCOMPATIBLE.java.svn-base new file mode 100644 index 0000000..5f9c15e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CODESET_INCOMPATIBLE.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class CODESET_INCOMPATIBLE extends org.omg.CORBA.SystemException { + + public CODESET_INCOMPATIBLE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public CODESET_INCOMPATIBLE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public CODESET_INCOMPATIBLE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public CODESET_INCOMPATIBLE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/COMM_FAILURE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/COMM_FAILURE.java.svn-base new file mode 100644 index 0000000..7170db9 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/COMM_FAILURE.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class COMM_FAILURE extends org.omg.CORBA.SystemException { + + public COMM_FAILURE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public COMM_FAILURE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public COMM_FAILURE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public COMM_FAILURE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/CharHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CharHolder.java.svn-base new file mode 100644 index 0000000..8e06bdb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CharHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class CharHolder implements org.omg.CORBA.portable.Streamable { + + public char value; + + public CharHolder() { + } + + public CharHolder(char initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_char(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_char(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_char); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/CompletionStatus.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CompletionStatus.java.svn-base new file mode 100644 index 0000000..b3e6b3b --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/CompletionStatus.java.svn-base @@ -0,0 +1,43 @@ +package org.omg.CORBA; + +public class CompletionStatus implements org.omg.CORBA.portable.IDLEntity { + + protected int completion_value; + + protected CompletionStatus(int _value) { + completion_value = _value; + } + + public int value() + { + return completion_value; + } + + public static CompletionStatus from_int(int val) + throws org.omg.CORBA.BAD_PARAM + { + switch (val) { + case _COMPLETED_YES: + return COMPLETED_YES; + case _COMPLETED_NO: + return COMPLETED_NO; + case _COMPLETED_MAYBE: + return COMPLETED_MAYBE; + default: + throw new org.omg.CORBA.BAD_PARAM(); + } + } + + public static final int _COMPLETED_YES = 0; + public static final CompletionStatus COMPLETED_YES = + new CompletionStatus(_COMPLETED_YES); + + public static final int _COMPLETED_NO = 1; + public static final CompletionStatus COMPLETED_NO = + new CompletionStatus(_COMPLETED_NO); + + public static final int _COMPLETED_MAYBE = 2; + public static final CompletionStatus COMPLETED_MAYBE = + new CompletionStatus(_COMPLETED_MAYBE); + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Context.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Context.java.svn-base new file mode 100644 index 0000000..5c9cccd --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Context.java.svn-base @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class Context { + + abstract public String context_name(); + abstract public org.omg.CORBA.Context parent(); + abstract public org.omg.CORBA.Context create_child( + String child_context_name); + abstract public void set_one_value(String prop_name, + org.omg.CORBA.Any value); + abstract public void set_values(org.omg.CORBA.NVList values); + abstract public void delete_values(String prop_name); + abstract public org.omg.CORBA.NVList get_values(String start_scope, + int op_flags, String pattern); +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ContextList.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ContextList.java.svn-base new file mode 100644 index 0000000..48ff706 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ContextList.java.svn-base @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ContextList { + + abstract public int count(); + abstract public void add(String ctx); + abstract public String item( int index) throws org.omg.CORBA.Bounds; + abstract public void remove( int index) throws org.omg.CORBA.Bounds; +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/DATA_CONVERSION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DATA_CONVERSION.java.svn-base new file mode 100644 index 0000000..816e20e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DATA_CONVERSION.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class DATA_CONVERSION extends org.omg.CORBA.SystemException { + + public DATA_CONVERSION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public DATA_CONVERSION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public DATA_CONVERSION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public DATA_CONVERSION(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/DoubleHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DoubleHolder.java.svn-base new file mode 100644 index 0000000..51db57c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DoubleHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class DoubleHolder implements org.omg.CORBA.portable.Streamable { + + public double value; + + public DoubleHolder() { + } + + public DoubleHolder(double initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_double(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_double(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_double); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/DynamicImplementation.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DynamicImplementation.java.svn-base new file mode 100644 index 0000000..4d0f219 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/DynamicImplementation.java.svn-base @@ -0,0 +1,22 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +/** +* @deprecated org.omg.CORBA.DynamicImplementation +*/ +abstract public class DynamicImplementation + extends org.omg.CORBA.portable.ObjectImpl { + + /** + * @deprecated Deprecated by the Portable Object Adapter (POA). + */ + public void invoke(org.omg.CORBA.ServerRequest request) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Environment.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Environment.java.svn-base new file mode 100644 index 0000000..4b3a7cc --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Environment.java.svn-base @@ -0,0 +1,12 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public abstract class Environment { + abstract public void exception(java.lang.Exception exception); + abstract public java.lang.Exception exception(); + abstract public void clear(); +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ExceptionList.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ExceptionList.java.svn-base new file mode 100644 index 0000000..620fc11 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ExceptionList.java.svn-base @@ -0,0 +1,18 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ExceptionList { + + abstract public int count(); + + abstract public void add(org.omg.CORBA.TypeCode exc); + + abstract public org.omg.CORBA.TypeCode item(int index) throws + org.omg.CORBA.Bounds; + + abstract public void remove(int index) throws org.omg.CORBA.Bounds; +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/FREE_MEM.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/FREE_MEM.java.svn-base new file mode 100644 index 0000000..e5fa173 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/FREE_MEM.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class FREE_MEM extends org.omg.CORBA.SystemException { + + public FREE_MEM() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public FREE_MEM(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public FREE_MEM(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public FREE_MEM(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/FloatHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/FloatHolder.java.svn-base new file mode 100644 index 0000000..4b665a8 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/FloatHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class FloatHolder implements org.omg.CORBA.portable.Streamable { + + public float value; + + public FloatHolder() { + } + + public FloatHolder(float initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_float(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_float(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_float); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/IMP_LIMIT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/IMP_LIMIT.java.svn-base new file mode 100644 index 0000000..62db106 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/IMP_LIMIT.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class IMP_LIMIT extends org.omg.CORBA.SystemException { + + public IMP_LIMIT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public IMP_LIMIT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public IMP_LIMIT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public IMP_LIMIT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INITIALIZE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INITIALIZE.java.svn-base new file mode 100644 index 0000000..5781227 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INITIALIZE.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INITIALIZE extends org.omg.CORBA.SystemException { + + public INITIALIZE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INITIALIZE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INITIALIZE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INITIALIZE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTERNAL.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTERNAL.java.svn-base new file mode 100644 index 0000000..d2adce5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTERNAL.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INTERNAL extends org.omg.CORBA.SystemException { + + public INTERNAL() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INTERNAL(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INTERNAL(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INTERNAL(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTF_REPOS.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTF_REPOS.java.svn-base new file mode 100644 index 0000000..0c5f7e2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INTF_REPOS.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INTF_REPOS extends org.omg.CORBA.SystemException { + + public INTF_REPOS() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INTF_REPOS(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INTF_REPOS(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INTF_REPOS(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INVALID_TRANSACTION.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INVALID_TRANSACTION.java.svn-base new file mode 100644 index 0000000..8c9f922 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INVALID_TRANSACTION.java.svn-base @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INVALID_TRANSACTION extends org.omg.CORBA.SystemException { + + public INVALID_TRANSACTION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INVALID_TRANSACTION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INVALID_TRANSACTION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INVALID_TRANSACTION(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_FLAG.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_FLAG.java.svn-base new file mode 100644 index 0000000..928eb88 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_FLAG.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_FLAG extends org.omg.CORBA.SystemException { + + public INV_FLAG() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_FLAG(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_FLAG(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_FLAG(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_IDENT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_IDENT.java.svn-base new file mode 100644 index 0000000..c276e88 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_IDENT.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_IDENT extends org.omg.CORBA.SystemException { + + public INV_IDENT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_IDENT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_IDENT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_IDENT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_OBJREF.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_OBJREF.java.svn-base new file mode 100644 index 0000000..f5dc7e5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_OBJREF.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_OBJREF extends org.omg.CORBA.SystemException { + + public INV_OBJREF() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_OBJREF(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_OBJREF(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_OBJREF(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_POLICY.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_POLICY.java.svn-base new file mode 100644 index 0000000..432a76f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/INV_POLICY.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_POLICY extends org.omg.CORBA.SystemException { + + public INV_POLICY() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_POLICY(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_POLICY(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_POLICY(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/IntHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/IntHolder.java.svn-base new file mode 100644 index 0000000..7bbbda7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/IntHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class IntHolder implements org.omg.CORBA.portable.Streamable { + + public int value; + + public IntHolder() { + } + + public IntHolder(int initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_long(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_long(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_long); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalInterface.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalInterface.java.svn-base new file mode 100644 index 0000000..48141e1 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalInterface.java.svn-base @@ -0,0 +1,3 @@ +package org.omg.CORBA; +public interface LocalInterface extends org.omg.CORBA.Object{} + diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalObject.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalObject.java.svn-base new file mode 100644 index 0000000..db98dc8 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/LocalObject.java.svn-base @@ -0,0 +1,143 @@ +package org.omg.CORBA; + +import org.omg.CORBA.portable.*; + +public abstract class LocalObject implements org.omg.CORBA.Object +{ + public LocalObject() + {} + + public boolean _is_equivalent(org.omg.CORBA.Object that) + { + return equals(that); + } + + public boolean _non_existent() + { + return false; + } + + public int _hash(int maximum) + { + return hashCode(); + } + + public String [] _ids()// new CORBA3.0 + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean _is_a(String repositoryId) + { + // throw new org.omg.CORBA.NO_IMPLEMENT(); // new CORBA 3.0 + String ids[]=_ids(); // new CORBA 3.0 + for(int i=0; iorg.omg.CORBA.ORBClass + */ + private final static String orb_key = "org.omg.CORBA.ORBClass"; + /** + * ORB Singleton Class name property name: org.omg.CORBA.ORBSingletonClass + */ + private final static String singleton_key = + "org.omg.CORBA.ORBSingletonClass"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.TIDORB + */ + private final static String TIDorb_class_name = "es.tid.TIDorbj.core.TIDORB"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.SingletonORB + */ + private final static String TIDorb_singleton_class_name = + "es.tid.TIDorbj.core.SingletonORB"; + + private static ORB singleton_orb = null; + + private static ORB create_orb(String class_name) + { + try { + return (ORB) Class.forName(class_name).newInstance(); + + } catch (Exception e) { + throw new INITIALIZE("Cannot create a " + class_name + " instance"); + } + } + + + public static ORB init() + { + if (singleton_orb == null) { + String class_name = null; + + try { + class_name = SystemProperties.findProperty(singleton_key); + } catch (SecurityException ex) { + //Applet Security violation + } + + if(class_name != null) + singleton_orb = create_orb(class_name); + else + singleton_orb = create_orb(TIDorb_singleton_class_name); + } + + return singleton_orb; + + } + + public static ORB init(String[] args, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(args != null) { + int size = args.length - 1; + for(int i = 0; i < size; i++) { + if (args[i].equals(orb_key)) { + str_class = args[i+1]; + break; + } + } + } + if (str_class == null) { + if(props != null) + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + str_class = SystemProperties.findProperty(orb_key); + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(args, props); + + return new_orb; + } + + public static ORB init(java.applet.Applet app, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(app != null) + str_class = app.getParameter(orb_key); + + if ((str_class == null) && (props != null)) { + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + try { + str_class = SystemProperties.findProperty(orb_key); + } catch (SecurityException se) {} + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(app, props); + + return new_orb; + } + + abstract protected void set_parameters(String[] args, + java.util.Properties props); + + abstract protected void set_parameters(java.applet.Applet app, + java.util.Properties props); + + public void connect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void disconnect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public String[] list_initial_services(); + + abstract public + org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName; + + abstract public String object_to_string(org.omg.CORBA.Object obj); + + abstract public org.omg.CORBA.Object string_to_object(String str); + + abstract public NVList create_list(int count); + + public NVList create_operation_list(org.omg.CORBA.Object oper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public NamedValue create_named_value(String s, Any any, int flags); + + abstract public ExceptionList create_exception_list(); + + abstract public ContextList create_context_list(); + + abstract public Context get_default_context(); + + abstract public Environment create_environment(); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + + abstract public void send_multiple_requests_oneway(Request[] req); + + abstract public void send_multiple_requests_deferred(Request[] req); + + abstract public boolean poll_next_response(); + + abstract public Request get_next_response() throws WrongTransaction; + + abstract public TypeCode get_primitive_tc(TCKind tcKind); + + abstract public TypeCode create_struct_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_union_tc(String id, String name, + TypeCode discriminator_type, + UnionMember[] members); + + abstract public TypeCode create_enum_tc(String id, String name, + String[] members); + + abstract public TypeCode create_alias_tc(String id, String name, + TypeCode original_type); + + abstract public TypeCode create_exception_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_interface_tc(String id, String name); + + abstract public TypeCode create_string_tc(int bound); + + abstract public TypeCode create_wstring_tc(int bound); + + abstract public TypeCode create_sequence_tc(int bound, + TypeCode element_type); + + abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); + + abstract public TypeCode create_array_tc(int length, TypeCode element_type); + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_abstract_interface_tc( + String id, + String name) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_value_tc(String id, + String name, + short type_modifier, + TypeCode concrete_base, + ValueMember[] members) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_value_box_tc(String id, + String name, + TypeCode boxed_type) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public Any create_any(); + + public org.omg.CORBA.Current get_current() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void run() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void shutdown(boolean wait_for_completion) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void destroy() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean work_pending() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void perform_work() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean get_service_information(short service_type, + ServiceInformationHolder service_info) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Object.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Object.java.svn-base new file mode 100644 index 0000000..f32d0a6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Object.java.svn-base @@ -0,0 +1,52 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface Object { + + boolean _is_a(String repositoryIdentifier); + + boolean _is_equivalent(org.omg.CORBA.Object other); + + boolean _non_existent(); + + int _hash(int maximum); + + org.omg.CORBA.Object _duplicate(); + + void _release(); + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + org.omg.CORBA.InterfaceDef _get_interface(); + + org.omg.CORBA.Object _get_interface_def(); + + Request _request(String operation); + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result); + + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result, + ExceptionList exclist, + ContextList ctxlist); + + Policy _get_policy(int policy_type); + + DomainManager[] _get_domain_managers(); + + + org.omg.CORBA.Object _set_policy_override(Policy[] policies, + SetOverrideType set_add); + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ObjectHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ObjectHolder.java.svn-base new file mode 100644 index 0000000..72f12cb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ObjectHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ObjectHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Object value; + + public ObjectHolder() { + } + + public ObjectHolder(org.omg.CORBA.Object initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_Object(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_Object(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_objref); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/PERSIST_STORE.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PERSIST_STORE.java.svn-base new file mode 100644 index 0000000..ebcc735 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PERSIST_STORE.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class PERSIST_STORE extends org.omg.CORBA.SystemException { + + public PERSIST_STORE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public PERSIST_STORE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public PERSIST_STORE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public PERSIST_STORE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/PolicyError.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PolicyError.java.svn-base new file mode 100644 index 0000000..37c9a9d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PolicyError.java.svn-base @@ -0,0 +1,31 @@ +// +// PolicyError.java (exception) +// +// File generated: Wed Feb 21 17:45:49 CET 2001 +// by TIDorbJ idl2Java 1.0 +// + +package org.omg.CORBA; + +final public class PolicyError + extends org.omg.CORBA.UserException { + + public short reason; + + public PolicyError() { + super(PolicyErrorHelper.id()); + } + + public PolicyError(short reason) { + super(PolicyErrorHelper.id()); + + this.reason = reason; + } + + public PolicyError(String reason_string, short reason) { + super(PolicyErrorHelper.id()+" "+reason_string); + + this.reason = reason; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Principal.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Principal.java.svn-base new file mode 100644 index 0000000..272c39f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Principal.java.svn-base @@ -0,0 +1,25 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +/** +* @deprecated Principal +*/ +public class Principal { + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public byte[] name() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public void name(byte[] name) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/PrincipalHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PrincipalHolder.java.svn-base new file mode 100644 index 0000000..010f0ba --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/PrincipalHolder.java.svn-base @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class PrincipalHolder + implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Principal value; + + public PrincipalHolder() { + } + + public PrincipalHolder(org.omg.CORBA.Principal initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_Principal(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_Principal(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_Principal); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/Request.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Request.java.svn-base new file mode 100644 index 0000000..06d776c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/Request.java.svn-base @@ -0,0 +1,46 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +import org.omg.CORBA.Object; + +abstract public class Request { + + abstract public org.omg.CORBA.Object target(); + abstract public String operation(); + abstract public org.omg.CORBA.NVList arguments(); + abstract public org.omg.CORBA.NamedValue result(); + abstract public org.omg.CORBA.Environment env(); + abstract public org.omg.CORBA.ExceptionList exceptions(); + abstract public org.omg.CORBA.ContextList contexts(); + + abstract public void ctx( org.omg.CORBA.Context ctx); + abstract public org.omg.CORBA.Context ctx(); + + abstract public org.omg.CORBA.Any add_in_arg(); + abstract public org.omg.CORBA.Any add_named_in_arg(String name); + abstract public org.omg.CORBA.Any add_inout_arg(); + abstract public org.omg.CORBA.Any add_named_inout_arg(String name); + abstract public org.omg.CORBA.Any add_out_arg(); + abstract public org.omg.CORBA.Any add_named_out_arg(String name); + abstract public void set_return_type( org.omg.CORBA.TypeCode tc); + abstract public org.omg.CORBA.Any return_value(); + + abstract public void invoke(); + abstract public void send_oneway(); + abstract public void send_deferred(); + abstract public void get_response() throws + org.omg.CORBA.WrongTransaction; + abstract public boolean poll_response(); + + //BUG [#956] Invalid call to org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI + //additional Messaging functions + //abstract public void sendc(org.omg.CORBA.Object handler); + //abstract public void sendc(); + abstract public Object sendp(); + abstract public void prepare(Object p); + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ServerRequest.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ServerRequest.java.svn-base new file mode 100644 index 0000000..d3d2fa3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ServerRequest.java.svn-base @@ -0,0 +1,52 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ServerRequest { + + /** + * @deprecated use operation() + */ + public String op_name() { + return operation(); + } + public String operation() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public org.omg.CORBA.Context ctx(); + + /** + * @deprecated use arguments() + */ + public void params(org.omg.CORBA.NVList params) { + arguments(params); + } + public void arguments(org.omg.CORBA.NVList nv) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated use set_result() + */ + public void result(org.omg.CORBA.Any result) { + set_result(result); + } + public void set_result(org.omg.CORBA.Any result) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated use set_exception() + */ + public void except(org.omg.CORBA.Any except) { + set_exception(except); + } + public void set_exception(org.omg.CORBA.Any except) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ShortHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ShortHolder.java.svn-base new file mode 100644 index 0000000..03eb1c7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ShortHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ShortHolder implements org.omg.CORBA.portable.Streamable { + + public short value; + + public ShortHolder() { + } + + public ShortHolder(short initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_short(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_short(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_short); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/StringHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/StringHolder.java.svn-base new file mode 100644 index 0000000..8f75986 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/StringHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class StringHolder implements org.omg.CORBA.portable.Streamable { + + public String value; + + public StringHolder() { + } + + public StringHolder(String initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_string(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_string(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_string); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/SystemException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/SystemException.java.svn-base new file mode 100644 index 0000000..f98fda9 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/SystemException.java.svn-base @@ -0,0 +1,42 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class SystemException extends java.lang.RuntimeException { + + public int minor; + public CompletionStatus completed; + + protected SystemException(String reason, int minor, + CompletionStatus completed) { + super(reason); + this.minor = minor; + this.completed = completed; + } + + public String toString() + { + StringBuffer buffer = new StringBuffer(); + + buffer.append(super.toString()); + buffer.append(" Minor: "); + buffer.append(minor); + buffer.append(" CompletionStatus: "); + switch(completed.value()) { + case CompletionStatus._COMPLETED_NO: + buffer.append("COMPLETED_NO."); + break; + case CompletionStatus._COMPLETED_YES: + buffer.append("COMPLETED_YES."); + break; + case CompletionStatus._COMPLETED_MAYBE: + buffer.append("COMPLETED_MAYBE."); + break; + } + + return buffer.toString(); + } +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TIMEOUT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TIMEOUT.java.svn-base new file mode 100644 index 0000000..0749add --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TIMEOUT.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 2001 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TIMEOUT extends org.omg.CORBA.SystemException { + + public TIMEOUT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TIMEOUT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TIMEOUT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TIMEOUT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_REQUIRED.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_REQUIRED.java.svn-base new file mode 100644 index 0000000..af7198a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_REQUIRED.java.svn-base @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSACTION_REQUIRED extends org.omg.CORBA.SystemException { + + public TRANSACTION_REQUIRED() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_REQUIRED(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSACTION_REQUIRED(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_REQUIRED(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_ROLLEDBACK.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_ROLLEDBACK.java.svn-base new file mode 100644 index 0000000..c0193eb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSACTION_ROLLEDBACK.java.svn-base @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSACTION_ROLLEDBACK extends org.omg.CORBA.SystemException { + + public TRANSACTION_ROLLEDBACK() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_ROLLEDBACK(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSACTION_ROLLEDBACK(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_ROLLEDBACK(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSIENT.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSIENT.java.svn-base new file mode 100644 index 0000000..8d8b568 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TRANSIENT.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSIENT extends org.omg.CORBA.SystemException { + + public TRANSIENT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSIENT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSIENT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSIENT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCode.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCode.java.svn-base new file mode 100644 index 0000000..0597061 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCode.java.svn-base @@ -0,0 +1,66 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class TypeCode implements org.omg.CORBA.portable.IDLEntity { + + abstract public boolean equal(org.omg.CORBA.TypeCode tc); + abstract public boolean equivalent(org.omg.CORBA.TypeCode tc); + abstract public org.omg.CORBA.TypeCode get_compact_typecode(); + abstract public org.omg.CORBA.TCKind kind(); + + abstract public java.lang.String id() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public java.lang.String name() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public int member_count() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public java.lang.String member_name(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + abstract public org.omg.CORBA.TypeCode member_type(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + abstract public org.omg.CORBA.Any member_label(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + abstract public org.omg.CORBA.TypeCode discriminator_type() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public int default_index() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public int length() throws org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public org.omg.CORBA.TypeCode content_type() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + public short fixed_digits() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public short fixed_scale() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public short member_visibility(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public org.omg.CORBA.TypeCode concrete_base_type() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHelper.java.svn-base new file mode 100644 index 0000000..df1fd39 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHelper.java.svn-base @@ -0,0 +1,44 @@ +// +// TypeCodeHelper.java (helper) +// +// File generated: Wed Feb 21 16:59:33 CET 2001 +// by TIDorbJ idl2Java 1.0 +// + +package org.omg.CORBA; + +abstract public class TypeCodeHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, TypeCode value) { + any.insert_TypeCode(value); + }; + + public static TypeCode extract(org.omg.CORBA.Any any) { + return any.extract_TypeCode(); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().get_primitive_tc(TCKind.tk_TypeCode); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CORBA/TypeCode:1.0"; + }; + + public static TypeCode read(org.omg.CORBA.portable.InputStream is) { + return is.read_TypeCode(); + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, TypeCode val) { + os.write_TypeCode(val); + }; + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHolder.java.svn-base new file mode 100644 index 0000000..edefd9d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/TypeCodeHolder.java.svn-base @@ -0,0 +1,31 @@ +// +// TypeCodeHolder.java (holder) +// +// File generated: Mon Sep 25 11:22:55 GMT+02:00 2000 +// by TidORB Idl2Java 1.0 +// + +package org.omg.CORBA; + +public class TypeCodeHolder + implements org.omg.CORBA.portable.Streamable { + + public TypeCode value; + public TypeCodeHolder() {} + public TypeCodeHolder(TypeCode initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_TypeCode(); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_TypeCode(value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc((org.omg.CORBA.TCKind.tk_TypeCode)); + }; + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/UNKNOWN.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UNKNOWN.java.svn-base new file mode 100644 index 0000000..3a01b0e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UNKNOWN.java.svn-base @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class UNKNOWN extends org.omg.CORBA.SystemException { + + public UNKNOWN() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public UNKNOWN(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public UNKNOWN(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public UNKNOWN(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/UnknownUserException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UnknownUserException.java.svn-base new file mode 100644 index 0000000..0cbd4a2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UnknownUserException.java.svn-base @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class UnknownUserException extends org.omg.CORBA.UserException { + public org.omg.CORBA.Any except; + + public UnknownUserException() { + super(); + } + + public UnknownUserException(org.omg.CORBA.Any a) { + super(); + except = a; + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/UserException.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UserException.java.svn-base new file mode 100644 index 0000000..750e8e1 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/UserException.java.svn-base @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class UserException extends java.lang.Exception + implements org.omg.CORBA.portable.IDLEntity { + + public UserException () { + super(); +} + +public UserException (java.lang.String value) { + + super(value); +} + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHelper.java.svn-base new file mode 100644 index 0000000..b56f011 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHelper.java.svn-base @@ -0,0 +1,61 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public final class ValueBaseHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static String id() { + return "IDL:omg.org/CORBA/ValueBase:1.0"; + }; + + private static org.omg.CORBA.TypeCode _type = null; + + + public static org.omg.CORBA.TypeCode type() + { + if (_type == null){ + + org.omg.CORBA.ValueMember[] _members = new org.omg.CORBA.ValueMember[0]; + + _type = _orb().create_value_tc(id(), + "CustomMarshal", + org.omg.CORBA.VM_NONE.value, + null, + _members); + } + + return _type; + } + + public static void insert(org.omg.CORBA.Any any, + java.io.Serializable _value) + { + any.insert_Value(_value); + } + + public static java.io.Serializable extract(org.omg.CORBA.Any any) + { + return any.extract_Value(); + } + + public static java.io.Serializable read( + org.omg.CORBA.portable.InputStream _input) + { + return ((org.omg.CORBA_2_3.portable.InputStream)_input).read_value(); + + } + + public static void write(org.omg.CORBA.portable.OutputStream _output, + java.io.Serializable _value) + { + ((org.omg.CORBA_2_3.portable.OutputStream) _output).write_value(_value); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHolder.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHolder.java.svn-base new file mode 100644 index 0000000..d71f82e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/ValueBaseHolder.java.svn-base @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ValueBaseHolder + implements org.omg.CORBA.portable.Streamable { + + public java.io.Serializable value; + + public ValueBaseHolder() { + } + + public ValueBaseHolder(java.io.Serializable initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = ValueBaseHelper.read(is); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + ValueBaseHelper.write(os, value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_value); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/.svn/text-base/WrongTransaction.java.svn-base b/idl/orb/extra/org/omg/CORBA/.svn/text-base/WrongTransaction.java.svn-base new file mode 100644 index 0000000..014e802 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/.svn/text-base/WrongTransaction.java.svn-base @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public final class WrongTransaction extends org.omg.CORBA.UserException { + + public WrongTransaction() { + super("IDL:omg.org/CORBA/WrongTransaction:1.0"); + } + + public WrongTransaction(String reason) { // full constructor + super("IDL:omg.org/CORBA/WrongTransaction:1.0 "+reason); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/Any.java b/idl/orb/extra/org/omg/CORBA/Any.java new file mode 100644 index 0000000..32eba80 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Any.java @@ -0,0 +1,116 @@ +package org.omg.CORBA; + +public abstract class Any implements org.omg.CORBA.portable.IDLEntity { + + abstract public boolean equal(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.TypeCode type(); + abstract public void type(org.omg.CORBA.TypeCode type); + + abstract public void read_value(org.omg.CORBA.portable.InputStream is, + org.omg.CORBA.TypeCode type) throws org.omg.CORBA.MARSHAL; + abstract public void write_value(org.omg.CORBA.portable.OutputStream os); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + abstract public org.omg.CORBA.portable.InputStream create_input_stream(); + + abstract public short extract_short() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_short(short s); + + abstract public int extract_long() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_long(int i); + + abstract public long extract_longlong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_longlong(long l); + + abstract public short extract_ushort() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ushort(short s); + + abstract public int extract_ulong() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulong(int i); + + abstract public long extract_ulonglong() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_ulonglong(long l); + + abstract public float extract_float() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_float(float f); + + abstract public double extract_double() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_double(double d); + + abstract public boolean extract_boolean() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_boolean(boolean b); + + abstract public char extract_char() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_char(char c); + + abstract public char extract_wchar() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wchar(char c); + + abstract public byte extract_octet() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_octet(byte b); + + abstract public org.omg.CORBA.Any extract_any() + throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_any(org.omg.CORBA.Any a); + + abstract public org.omg.CORBA.Object extract_Object() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Object(org.omg.CORBA.Object obj); + + abstract public java.io.Serializable extract_Value() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_Value(java.io.Serializable v); + abstract public void insert_Value(java.io.Serializable v, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.MARSHAL; + + abstract public void insert_Object(org.omg.CORBA.Object obj, + org.omg.CORBA.TypeCode type) throws + org.omg.CORBA.BAD_PARAM; + + abstract public String extract_string() throws org.omg.CORBA.BAD_OPERATION; + abstract public void insert_string(String s) throws + org.omg.CORBA.DATA_CONVERSION, org.omg.CORBA.MARSHAL; + + abstract public String extract_wstring() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_wstring(String value) throws + org.omg.CORBA.MARSHAL; + + abstract public TypeCode extract_TypeCode() throws + org.omg.CORBA.BAD_OPERATION; + abstract public void insert_TypeCode(TypeCode value); + + /** + *@ deprecated + */ + public Principal extract_Principal() throws org.omg.CORBA.BAD_OPERATION { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + /** + *@ deprecated + */ + public void insert_Principal(Principal p) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.Streamable extract_Streamable() throws + org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_Streamable(org.omg.CORBA.portable.Streamable s) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.math.BigDecimal extract_fixed() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public void insert_fixed(java.math.BigDecimal f, + org.omg.CORBA.TypeCode t) throws org.omg.CORBA.BAD_INV_ORDER { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} + diff --git a/idl/orb/extra/org/omg/CORBA/AnyHolder.java b/idl/orb/extra/org/omg/CORBA/AnyHolder.java new file mode 100644 index 0000000..3faeb1e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/AnyHolder.java @@ -0,0 +1,39 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class AnyHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Any value; + protected org.omg.CORBA.TypeCode type; + + public AnyHolder() { + value = null; + type = null; + } + + public AnyHolder(org.omg.CORBA.Any initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_any(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_any(value); + } + + public synchronized org.omg.CORBA.TypeCode _type() + { + if(type == null) + type = org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_any); + return type; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_CONTEXT.java b/idl/orb/extra/org/omg/CORBA/BAD_CONTEXT.java new file mode 100644 index 0000000..b8063c6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_CONTEXT.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_CONTEXT extends org.omg.CORBA.SystemException { + + public BAD_CONTEXT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_CONTEXT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_CONTEXT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_CONTEXT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_INV_ORDER.java b/idl/orb/extra/org/omg/CORBA/BAD_INV_ORDER.java new file mode 100644 index 0000000..9f16b1f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_INV_ORDER.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_INV_ORDER extends org.omg.CORBA.SystemException { + + public BAD_INV_ORDER() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_INV_ORDER(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_INV_ORDER(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_INV_ORDER(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_OPERATION.java b/idl/orb/extra/org/omg/CORBA/BAD_OPERATION.java new file mode 100644 index 0000000..7bc62d0 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_OPERATION.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_OPERATION extends org.omg.CORBA.SystemException { + + public BAD_OPERATION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_OPERATION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_OPERATION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_OPERATION(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_PARAM.java b/idl/orb/extra/org/omg/CORBA/BAD_PARAM.java new file mode 100644 index 0000000..ce96fce --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_PARAM.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_PARAM extends org.omg.CORBA.SystemException { + + public BAD_PARAM() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_PARAM(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_PARAM(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_PARAM(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_POLICY.java b/idl/orb/extra/org/omg/CORBA/BAD_POLICY.java new file mode 100644 index 0000000..1f2440e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_POLICY.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY { + short value = (short) 0; +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_POLICY_TYPE.java b/idl/orb/extra/org/omg/CORBA/BAD_POLICY_TYPE.java new file mode 100644 index 0000000..66fd021 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_POLICY_TYPE.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY_TYPE { + short value = (short) 2; +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_POLICY_VALUE.java b/idl/orb/extra/org/omg/CORBA/BAD_POLICY_VALUE.java new file mode 100644 index 0000000..7514fc6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_POLICY_VALUE.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface BAD_POLICY_VALUE { + short value = (short) 3; +} diff --git a/idl/orb/extra/org/omg/CORBA/BAD_TYPECODE.java b/idl/orb/extra/org/omg/CORBA/BAD_TYPECODE.java new file mode 100644 index 0000000..0c336b3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BAD_TYPECODE.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class BAD_TYPECODE extends org.omg.CORBA.SystemException { + + public BAD_TYPECODE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_TYPECODE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public BAD_TYPECODE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public BAD_TYPECODE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/BooleanHolder.java b/idl/orb/extra/org/omg/CORBA/BooleanHolder.java new file mode 100644 index 0000000..824bb17 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/BooleanHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class BooleanHolder implements org.omg.CORBA.portable.Streamable { + + public boolean value; + + public BooleanHolder() { + } + + public BooleanHolder(boolean initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_boolean(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_boolean(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_boolean); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/Bounds.java b/idl/orb/extra/org/omg/CORBA/Bounds.java new file mode 100644 index 0000000..75fa0ac --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Bounds.java @@ -0,0 +1,23 @@ +// +// Bounds.java (exception) +// +// File generated: Mon Sep 25 18:46:50 GMT+02:00 2000 +// by TidORB Idl2Java 1.0 +// + +package org.omg.CORBA; + +final public class Bounds + extends org.omg.CORBA.UserException { + + + public Bounds() { + super("IDL:omg.org/CORBA/Bounds:1.0"); + } + + public Bounds(String reason) { + super("IDL:omg.org/CORBA/Bounds:1.0 "+reason); + + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/ByteHolder.java b/idl/orb/extra/org/omg/CORBA/ByteHolder.java new file mode 100644 index 0000000..6b7db45 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ByteHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ByteHolder implements org.omg.CORBA.portable.Streamable { + + public byte value; + + public ByteHolder() { + } + + public ByteHolder(byte initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_octet(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_octet(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_octet); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/CODESET_INCOMPATIBLE.java b/idl/orb/extra/org/omg/CORBA/CODESET_INCOMPATIBLE.java new file mode 100644 index 0000000..5f9c15e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/CODESET_INCOMPATIBLE.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class CODESET_INCOMPATIBLE extends org.omg.CORBA.SystemException { + + public CODESET_INCOMPATIBLE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public CODESET_INCOMPATIBLE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public CODESET_INCOMPATIBLE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public CODESET_INCOMPATIBLE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/COMM_FAILURE.java b/idl/orb/extra/org/omg/CORBA/COMM_FAILURE.java new file mode 100644 index 0000000..7170db9 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/COMM_FAILURE.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class COMM_FAILURE extends org.omg.CORBA.SystemException { + + public COMM_FAILURE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public COMM_FAILURE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public COMM_FAILURE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public COMM_FAILURE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/CharHolder.java b/idl/orb/extra/org/omg/CORBA/CharHolder.java new file mode 100644 index 0000000..8e06bdb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/CharHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class CharHolder implements org.omg.CORBA.portable.Streamable { + + public char value; + + public CharHolder() { + } + + public CharHolder(char initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_char(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_char(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_char); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/CompletionStatus.java b/idl/orb/extra/org/omg/CORBA/CompletionStatus.java new file mode 100644 index 0000000..b3e6b3b --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/CompletionStatus.java @@ -0,0 +1,43 @@ +package org.omg.CORBA; + +public class CompletionStatus implements org.omg.CORBA.portable.IDLEntity { + + protected int completion_value; + + protected CompletionStatus(int _value) { + completion_value = _value; + } + + public int value() + { + return completion_value; + } + + public static CompletionStatus from_int(int val) + throws org.omg.CORBA.BAD_PARAM + { + switch (val) { + case _COMPLETED_YES: + return COMPLETED_YES; + case _COMPLETED_NO: + return COMPLETED_NO; + case _COMPLETED_MAYBE: + return COMPLETED_MAYBE; + default: + throw new org.omg.CORBA.BAD_PARAM(); + } + } + + public static final int _COMPLETED_YES = 0; + public static final CompletionStatus COMPLETED_YES = + new CompletionStatus(_COMPLETED_YES); + + public static final int _COMPLETED_NO = 1; + public static final CompletionStatus COMPLETED_NO = + new CompletionStatus(_COMPLETED_NO); + + public static final int _COMPLETED_MAYBE = 2; + public static final CompletionStatus COMPLETED_MAYBE = + new CompletionStatus(_COMPLETED_MAYBE); + +} diff --git a/idl/orb/extra/org/omg/CORBA/Context.java b/idl/orb/extra/org/omg/CORBA/Context.java new file mode 100644 index 0000000..5c9cccd --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Context.java @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class Context { + + abstract public String context_name(); + abstract public org.omg.CORBA.Context parent(); + abstract public org.omg.CORBA.Context create_child( + String child_context_name); + abstract public void set_one_value(String prop_name, + org.omg.CORBA.Any value); + abstract public void set_values(org.omg.CORBA.NVList values); + abstract public void delete_values(String prop_name); + abstract public org.omg.CORBA.NVList get_values(String start_scope, + int op_flags, String pattern); +} diff --git a/idl/orb/extra/org/omg/CORBA/ContextList.java b/idl/orb/extra/org/omg/CORBA/ContextList.java new file mode 100644 index 0000000..48ff706 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ContextList.java @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ContextList { + + abstract public int count(); + abstract public void add(String ctx); + abstract public String item( int index) throws org.omg.CORBA.Bounds; + abstract public void remove( int index) throws org.omg.CORBA.Bounds; +} diff --git a/idl/orb/extra/org/omg/CORBA/DATA_CONVERSION.java b/idl/orb/extra/org/omg/CORBA/DATA_CONVERSION.java new file mode 100644 index 0000000..816e20e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/DATA_CONVERSION.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class DATA_CONVERSION extends org.omg.CORBA.SystemException { + + public DATA_CONVERSION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public DATA_CONVERSION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public DATA_CONVERSION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public DATA_CONVERSION(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/DoubleHolder.java b/idl/orb/extra/org/omg/CORBA/DoubleHolder.java new file mode 100644 index 0000000..51db57c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/DoubleHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class DoubleHolder implements org.omg.CORBA.portable.Streamable { + + public double value; + + public DoubleHolder() { + } + + public DoubleHolder(double initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_double(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_double(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_double); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/DynamicImplementation.java b/idl/orb/extra/org/omg/CORBA/DynamicImplementation.java new file mode 100644 index 0000000..4d0f219 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/DynamicImplementation.java @@ -0,0 +1,22 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +/** +* @deprecated org.omg.CORBA.DynamicImplementation +*/ +abstract public class DynamicImplementation + extends org.omg.CORBA.portable.ObjectImpl { + + /** + * @deprecated Deprecated by the Portable Object Adapter (POA). + */ + public void invoke(org.omg.CORBA.ServerRequest request) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + +} diff --git a/idl/orb/extra/org/omg/CORBA/Environment.java b/idl/orb/extra/org/omg/CORBA/Environment.java new file mode 100644 index 0000000..4b3a7cc --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Environment.java @@ -0,0 +1,12 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public abstract class Environment { + abstract public void exception(java.lang.Exception exception); + abstract public java.lang.Exception exception(); + abstract public void clear(); +} diff --git a/idl/orb/extra/org/omg/CORBA/ExceptionList.java b/idl/orb/extra/org/omg/CORBA/ExceptionList.java new file mode 100644 index 0000000..620fc11 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ExceptionList.java @@ -0,0 +1,18 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ExceptionList { + + abstract public int count(); + + abstract public void add(org.omg.CORBA.TypeCode exc); + + abstract public org.omg.CORBA.TypeCode item(int index) throws + org.omg.CORBA.Bounds; + + abstract public void remove(int index) throws org.omg.CORBA.Bounds; +} diff --git a/idl/orb/extra/org/omg/CORBA/FREE_MEM.java b/idl/orb/extra/org/omg/CORBA/FREE_MEM.java new file mode 100644 index 0000000..e5fa173 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/FREE_MEM.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class FREE_MEM extends org.omg.CORBA.SystemException { + + public FREE_MEM() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public FREE_MEM(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public FREE_MEM(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public FREE_MEM(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/FloatHolder.java b/idl/orb/extra/org/omg/CORBA/FloatHolder.java new file mode 100644 index 0000000..4b665a8 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/FloatHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class FloatHolder implements org.omg.CORBA.portable.Streamable { + + public float value; + + public FloatHolder() { + } + + public FloatHolder(float initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_float(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_float(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_float); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/IMP_LIMIT.java b/idl/orb/extra/org/omg/CORBA/IMP_LIMIT.java new file mode 100644 index 0000000..62db106 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/IMP_LIMIT.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class IMP_LIMIT extends org.omg.CORBA.SystemException { + + public IMP_LIMIT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public IMP_LIMIT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public IMP_LIMIT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public IMP_LIMIT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INITIALIZE.java b/idl/orb/extra/org/omg/CORBA/INITIALIZE.java new file mode 100644 index 0000000..5781227 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INITIALIZE.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INITIALIZE extends org.omg.CORBA.SystemException { + + public INITIALIZE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INITIALIZE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INITIALIZE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INITIALIZE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INTERNAL.java b/idl/orb/extra/org/omg/CORBA/INTERNAL.java new file mode 100644 index 0000000..d2adce5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INTERNAL.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INTERNAL extends org.omg.CORBA.SystemException { + + public INTERNAL() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INTERNAL(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INTERNAL(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INTERNAL(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INTF_REPOS.java b/idl/orb/extra/org/omg/CORBA/INTF_REPOS.java new file mode 100644 index 0000000..0c5f7e2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INTF_REPOS.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INTF_REPOS extends org.omg.CORBA.SystemException { + + public INTF_REPOS() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INTF_REPOS(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INTF_REPOS(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INTF_REPOS(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INVALID_TRANSACTION.java b/idl/orb/extra/org/omg/CORBA/INVALID_TRANSACTION.java new file mode 100644 index 0000000..8c9f922 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INVALID_TRANSACTION.java @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INVALID_TRANSACTION extends org.omg.CORBA.SystemException { + + public INVALID_TRANSACTION() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INVALID_TRANSACTION(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INVALID_TRANSACTION(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INVALID_TRANSACTION(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INV_FLAG.java b/idl/orb/extra/org/omg/CORBA/INV_FLAG.java new file mode 100644 index 0000000..928eb88 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INV_FLAG.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_FLAG extends org.omg.CORBA.SystemException { + + public INV_FLAG() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_FLAG(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_FLAG(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_FLAG(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INV_IDENT.java b/idl/orb/extra/org/omg/CORBA/INV_IDENT.java new file mode 100644 index 0000000..c276e88 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INV_IDENT.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_IDENT extends org.omg.CORBA.SystemException { + + public INV_IDENT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_IDENT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_IDENT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_IDENT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INV_OBJREF.java b/idl/orb/extra/org/omg/CORBA/INV_OBJREF.java new file mode 100644 index 0000000..f5dc7e5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INV_OBJREF.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_OBJREF extends org.omg.CORBA.SystemException { + + public INV_OBJREF() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_OBJREF(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_OBJREF(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_OBJREF(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/INV_POLICY.java b/idl/orb/extra/org/omg/CORBA/INV_POLICY.java new file mode 100644 index 0000000..432a76f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/INV_POLICY.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class INV_POLICY extends org.omg.CORBA.SystemException { + + public INV_POLICY() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_POLICY(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public INV_POLICY(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public INV_POLICY(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/IntHolder.java b/idl/orb/extra/org/omg/CORBA/IntHolder.java new file mode 100644 index 0000000..7bbbda7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/IntHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class IntHolder implements org.omg.CORBA.portable.Streamable { + + public int value; + + public IntHolder() { + } + + public IntHolder(int initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_long(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_long(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_long); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/LocalInterface.java b/idl/orb/extra/org/omg/CORBA/LocalInterface.java new file mode 100644 index 0000000..48141e1 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/LocalInterface.java @@ -0,0 +1,3 @@ +package org.omg.CORBA; +public interface LocalInterface extends org.omg.CORBA.Object{} + diff --git a/idl/orb/extra/org/omg/CORBA/LocalObject.java b/idl/orb/extra/org/omg/CORBA/LocalObject.java new file mode 100644 index 0000000..db98dc8 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/LocalObject.java @@ -0,0 +1,143 @@ +package org.omg.CORBA; + +import org.omg.CORBA.portable.*; + +public abstract class LocalObject implements org.omg.CORBA.Object +{ + public LocalObject() + {} + + public boolean _is_equivalent(org.omg.CORBA.Object that) + { + return equals(that); + } + + public boolean _non_existent() + { + return false; + } + + public int _hash(int maximum) + { + return hashCode(); + } + + public String [] _ids()// new CORBA3.0 + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean _is_a(String repositoryId) + { + // throw new org.omg.CORBA.NO_IMPLEMENT(); // new CORBA 3.0 + String ids[]=_ids(); // new CORBA 3.0 + for(int i=0; iorg.omg.CORBA.ORBClass + */ + private final static String orb_key = "org.omg.CORBA.ORBClass"; + /** + * ORB Singleton Class name property name: org.omg.CORBA.ORBSingletonClass + */ + private final static String singleton_key = + "org.omg.CORBA.ORBSingletonClass"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.TIDORB + */ + private final static String TIDorb_class_name = "es.tid.TIDorbj.core.TIDORB"; + + /** + * TIDorb ORB Class name: es.tid.TIDorbj.core.SingletonORB + */ + private final static String TIDorb_singleton_class_name = + "es.tid.TIDorbj.core.SingletonORB"; + + private static ORB singleton_orb = null; + + private static ORB create_orb(String class_name) + { + try { + return (ORB) Class.forName(class_name).newInstance(); + + } catch (Exception e) { + throw new INITIALIZE("Cannot create a " + class_name + " instance"); + } + } + + + public static ORB init() + { + if (singleton_orb == null) { + String class_name = null; + + try { + class_name = SystemProperties.findProperty(singleton_key); + } catch (SecurityException ex) { + //Applet Security violation + } + + if(class_name != null) + singleton_orb = create_orb(class_name); + else + singleton_orb = create_orb(TIDorb_singleton_class_name); + } + + return singleton_orb; + + } + + public static ORB init(String[] args, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(args != null) { + int size = args.length - 1; + for(int i = 0; i < size; i++) { + if (args[i].equals(orb_key)) { + str_class = args[i+1]; + break; + } + } + } + if (str_class == null) { + if(props != null) + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + str_class = SystemProperties.findProperty(orb_key); + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(args, props); + + return new_orb; + } + + public static ORB init(java.applet.Applet app, java.util.Properties props) + { + // search ORB class + + String str_class = null; + + if(app != null) + str_class = app.getParameter(orb_key); + + if ((str_class == null) && (props != null)) { + str_class = props.getProperty(orb_key); + } + + if (str_class == null) { + try { + str_class = SystemProperties.findProperty(orb_key); + } catch (SecurityException se) {} + } + + if(str_class == null) + str_class = TIDorb_class_name; + + ORB new_orb = create_orb(str_class); + + new_orb.set_parameters(app, props); + + return new_orb; + } + + abstract protected void set_parameters(String[] args, + java.util.Properties props); + + abstract protected void set_parameters(java.applet.Applet app, + java.util.Properties props); + + public void connect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void disconnect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public String[] list_initial_services(); + + abstract public + org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName; + + abstract public String object_to_string(org.omg.CORBA.Object obj); + + abstract public org.omg.CORBA.Object string_to_object(String str); + + abstract public NVList create_list(int count); + + public NVList create_operation_list(org.omg.CORBA.Object oper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public NamedValue create_named_value(String s, Any any, int flags); + + abstract public ExceptionList create_exception_list(); + + abstract public ContextList create_context_list(); + + abstract public Context get_default_context(); + + abstract public Environment create_environment(); + + abstract public org.omg.CORBA.portable.OutputStream create_output_stream(); + + abstract public void send_multiple_requests_oneway(Request[] req); + + abstract public void send_multiple_requests_deferred(Request[] req); + + abstract public boolean poll_next_response(); + + abstract public Request get_next_response() throws WrongTransaction; + + abstract public TypeCode get_primitive_tc(TCKind tcKind); + + abstract public TypeCode create_struct_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_union_tc(String id, String name, + TypeCode discriminator_type, + UnionMember[] members); + + abstract public TypeCode create_enum_tc(String id, String name, + String[] members); + + abstract public TypeCode create_alias_tc(String id, String name, + TypeCode original_type); + + abstract public TypeCode create_exception_tc(String id, String name, + StructMember[] members); + + abstract public TypeCode create_interface_tc(String id, String name); + + abstract public TypeCode create_string_tc(int bound); + + abstract public TypeCode create_wstring_tc(int bound); + + abstract public TypeCode create_sequence_tc(int bound, + TypeCode element_type); + + abstract public TypeCode create_recursive_sequence_tc(int bound, int offset); + + abstract public TypeCode create_array_tc(int length, TypeCode element_type); + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_abstract_interface_tc( + String id, + String name) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.TypeCode create_value_tc(String id, + String name, + short type_modifier, + TypeCode concrete_base, + ValueMember[] members) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_value_box_tc(String id, + String name, + TypeCode boxed_type) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public Any create_any(); + + public org.omg.CORBA.Current get_current() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void run() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void shutdown(boolean wait_for_completion) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void destroy() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean work_pending() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void perform_work() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean get_service_information(short service_type, + ServiceInformationHolder service_info) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/all-wcprops new file mode 100644 index 0000000..4ceedc3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ORBPackage +END +InvalidName.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ORBPackage/InvalidName.java +END diff --git a/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/entries b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/entries new file mode 100644 index 0000000..e4ecace --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/ORBPackage +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +InvalidName.java +file + + + + +2009-02-16T09:48:55.000000Z +3e4773994b84a47ef762930d66b44e3c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +295 + diff --git a/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/prop-base/InvalidName.java.svn-base b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/prop-base/InvalidName.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/prop-base/InvalidName.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/text-base/InvalidName.java.svn-base b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/text-base/InvalidName.java.svn-base new file mode 100644 index 0000000..a3563bb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ORBPackage/.svn/text-base/InvalidName.java.svn-base @@ -0,0 +1,15 @@ +package org.omg.CORBA.ORBPackage; + +final public class InvalidName + extends org.omg.CORBA.UserException { + + public InvalidName() { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0"); + } + + public InvalidName(String reason) { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/ORBPackage/InvalidName.java b/idl/orb/extra/org/omg/CORBA/ORBPackage/InvalidName.java new file mode 100644 index 0000000..a3563bb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ORBPackage/InvalidName.java @@ -0,0 +1,15 @@ +package org.omg.CORBA.ORBPackage; + +final public class InvalidName + extends org.omg.CORBA.UserException { + + public InvalidName() { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0"); + } + + public InvalidName(String reason) { + super("IDL:omg.org/CORBA/ORB/InvalidName:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/Object.java b/idl/orb/extra/org/omg/CORBA/Object.java new file mode 100644 index 0000000..f32d0a6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Object.java @@ -0,0 +1,52 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public interface Object { + + boolean _is_a(String repositoryIdentifier); + + boolean _is_equivalent(org.omg.CORBA.Object other); + + boolean _non_existent(); + + int _hash(int maximum); + + org.omg.CORBA.Object _duplicate(); + + void _release(); + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + org.omg.CORBA.InterfaceDef _get_interface(); + + org.omg.CORBA.Object _get_interface_def(); + + Request _request(String operation); + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result); + + + Request _create_request(Context ctx, + String operation, + NVList arg_list, + NamedValue result, + ExceptionList exclist, + ContextList ctxlist); + + Policy _get_policy(int policy_type); + + DomainManager[] _get_domain_managers(); + + + org.omg.CORBA.Object _set_policy_override(Policy[] policies, + SetOverrideType set_add); + +} diff --git a/idl/orb/extra/org/omg/CORBA/ObjectHolder.java b/idl/orb/extra/org/omg/CORBA/ObjectHolder.java new file mode 100644 index 0000000..72f12cb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ObjectHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ObjectHolder implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Object value; + + public ObjectHolder() { + } + + public ObjectHolder(org.omg.CORBA.Object initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_Object(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_Object(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_objref); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/PERSIST_STORE.java b/idl/orb/extra/org/omg/CORBA/PERSIST_STORE.java new file mode 100644 index 0000000..ebcc735 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/PERSIST_STORE.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class PERSIST_STORE extends org.omg.CORBA.SystemException { + + public PERSIST_STORE() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public PERSIST_STORE(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public PERSIST_STORE(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public PERSIST_STORE(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/PolicyError.java b/idl/orb/extra/org/omg/CORBA/PolicyError.java new file mode 100644 index 0000000..37c9a9d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/PolicyError.java @@ -0,0 +1,31 @@ +// +// PolicyError.java (exception) +// +// File generated: Wed Feb 21 17:45:49 CET 2001 +// by TIDorbJ idl2Java 1.0 +// + +package org.omg.CORBA; + +final public class PolicyError + extends org.omg.CORBA.UserException { + + public short reason; + + public PolicyError() { + super(PolicyErrorHelper.id()); + } + + public PolicyError(short reason) { + super(PolicyErrorHelper.id()); + + this.reason = reason; + } + + public PolicyError(String reason_string, short reason) { + super(PolicyErrorHelper.id()+" "+reason_string); + + this.reason = reason; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/Principal.java b/idl/orb/extra/org/omg/CORBA/Principal.java new file mode 100644 index 0000000..272c39f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Principal.java @@ -0,0 +1,25 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +/** +* @deprecated Principal +*/ +public class Principal { + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public byte[] name() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public void name(byte[] name) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/PrincipalHolder.java b/idl/orb/extra/org/omg/CORBA/PrincipalHolder.java new file mode 100644 index 0000000..010f0ba --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/PrincipalHolder.java @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class PrincipalHolder + implements org.omg.CORBA.portable.Streamable { + + public org.omg.CORBA.Principal value; + + public PrincipalHolder() { + } + + public PrincipalHolder(org.omg.CORBA.Principal initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_Principal(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_Principal(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_Principal); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/Request.java b/idl/orb/extra/org/omg/CORBA/Request.java new file mode 100644 index 0000000..06d776c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/Request.java @@ -0,0 +1,46 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +import org.omg.CORBA.Object; + +abstract public class Request { + + abstract public org.omg.CORBA.Object target(); + abstract public String operation(); + abstract public org.omg.CORBA.NVList arguments(); + abstract public org.omg.CORBA.NamedValue result(); + abstract public org.omg.CORBA.Environment env(); + abstract public org.omg.CORBA.ExceptionList exceptions(); + abstract public org.omg.CORBA.ContextList contexts(); + + abstract public void ctx( org.omg.CORBA.Context ctx); + abstract public org.omg.CORBA.Context ctx(); + + abstract public org.omg.CORBA.Any add_in_arg(); + abstract public org.omg.CORBA.Any add_named_in_arg(String name); + abstract public org.omg.CORBA.Any add_inout_arg(); + abstract public org.omg.CORBA.Any add_named_inout_arg(String name); + abstract public org.omg.CORBA.Any add_out_arg(); + abstract public org.omg.CORBA.Any add_named_out_arg(String name); + abstract public void set_return_type( org.omg.CORBA.TypeCode tc); + abstract public org.omg.CORBA.Any return_value(); + + abstract public void invoke(); + abstract public void send_oneway(); + abstract public void send_deferred(); + abstract public void get_response() throws + org.omg.CORBA.WrongTransaction; + abstract public boolean poll_response(); + + //BUG [#956] Invalid call to org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI + //additional Messaging functions + //abstract public void sendc(org.omg.CORBA.Object handler); + //abstract public void sendc(); + abstract public Object sendp(); + abstract public void prepare(Object p); + +} diff --git a/idl/orb/extra/org/omg/CORBA/ServerRequest.java b/idl/orb/extra/org/omg/CORBA/ServerRequest.java new file mode 100644 index 0000000..d3d2fa3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ServerRequest.java @@ -0,0 +1,52 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class ServerRequest { + + /** + * @deprecated use operation() + */ + public String op_name() { + return operation(); + } + public String operation() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + abstract public org.omg.CORBA.Context ctx(); + + /** + * @deprecated use arguments() + */ + public void params(org.omg.CORBA.NVList params) { + arguments(params); + } + public void arguments(org.omg.CORBA.NVList nv) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated use set_result() + */ + public void result(org.omg.CORBA.Any result) { + set_result(result); + } + public void set_result(org.omg.CORBA.Any result) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated use set_exception() + */ + public void except(org.omg.CORBA.Any except) { + set_exception(except); + } + public void set_exception(org.omg.CORBA.Any except) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/ShortHolder.java b/idl/orb/extra/org/omg/CORBA/ShortHolder.java new file mode 100644 index 0000000..03eb1c7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ShortHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ShortHolder implements org.omg.CORBA.portable.Streamable { + + public short value; + + public ShortHolder() { + } + + public ShortHolder(short initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_short(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_short(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_short); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/StringHolder.java b/idl/orb/extra/org/omg/CORBA/StringHolder.java new file mode 100644 index 0000000..8f75986 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/StringHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class StringHolder implements org.omg.CORBA.portable.Streamable { + + public String value; + + public StringHolder() { + } + + public StringHolder(String initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_string(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_string(value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_string); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/SystemException.java b/idl/orb/extra/org/omg/CORBA/SystemException.java new file mode 100644 index 0000000..f98fda9 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/SystemException.java @@ -0,0 +1,42 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class SystemException extends java.lang.RuntimeException { + + public int minor; + public CompletionStatus completed; + + protected SystemException(String reason, int minor, + CompletionStatus completed) { + super(reason); + this.minor = minor; + this.completed = completed; + } + + public String toString() + { + StringBuffer buffer = new StringBuffer(); + + buffer.append(super.toString()); + buffer.append(" Minor: "); + buffer.append(minor); + buffer.append(" CompletionStatus: "); + switch(completed.value()) { + case CompletionStatus._COMPLETED_NO: + buffer.append("COMPLETED_NO."); + break; + case CompletionStatus._COMPLETED_YES: + buffer.append("COMPLETED_YES."); + break; + case CompletionStatus._COMPLETED_MAYBE: + buffer.append("COMPLETED_MAYBE."); + break; + } + + return buffer.toString(); + } +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/TIMEOUT.java b/idl/orb/extra/org/omg/CORBA/TIMEOUT.java new file mode 100644 index 0000000..0749add --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TIMEOUT.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 2001 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TIMEOUT extends org.omg.CORBA.SystemException { + + public TIMEOUT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TIMEOUT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TIMEOUT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TIMEOUT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/TRANSACTION_REQUIRED.java b/idl/orb/extra/org/omg/CORBA/TRANSACTION_REQUIRED.java new file mode 100644 index 0000000..af7198a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TRANSACTION_REQUIRED.java @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSACTION_REQUIRED extends org.omg.CORBA.SystemException { + + public TRANSACTION_REQUIRED() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_REQUIRED(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSACTION_REQUIRED(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_REQUIRED(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java b/idl/orb/extra/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java new file mode 100644 index 0000000..c0193eb --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TRANSACTION_ROLLEDBACK.java @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSACTION_ROLLEDBACK extends org.omg.CORBA.SystemException { + + public TRANSACTION_ROLLEDBACK() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_ROLLEDBACK(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSACTION_ROLLEDBACK(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSACTION_ROLLEDBACK(String reason, + int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/TRANSIENT.java b/idl/orb/extra/org/omg/CORBA/TRANSIENT.java new file mode 100644 index 0000000..8d8b568 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TRANSIENT.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class TRANSIENT extends org.omg.CORBA.SystemException { + + public TRANSIENT() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSIENT(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public TRANSIENT(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public TRANSIENT(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/TypeCode.java b/idl/orb/extra/org/omg/CORBA/TypeCode.java new file mode 100644 index 0000000..0597061 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCode.java @@ -0,0 +1,66 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class TypeCode implements org.omg.CORBA.portable.IDLEntity { + + abstract public boolean equal(org.omg.CORBA.TypeCode tc); + abstract public boolean equivalent(org.omg.CORBA.TypeCode tc); + abstract public org.omg.CORBA.TypeCode get_compact_typecode(); + abstract public org.omg.CORBA.TCKind kind(); + + abstract public java.lang.String id() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public java.lang.String name() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public int member_count() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public java.lang.String member_name(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + abstract public org.omg.CORBA.TypeCode member_type(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + + abstract public org.omg.CORBA.Any member_label(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds; + abstract public org.omg.CORBA.TypeCode discriminator_type() throws + org.omg.CORBA.TypeCodePackage.BadKind; + abstract public int default_index() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public int length() throws org.omg.CORBA.TypeCodePackage.BadKind; + + abstract public org.omg.CORBA.TypeCode content_type() throws + org.omg.CORBA.TypeCodePackage.BadKind; + + public short fixed_digits() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public short fixed_scale() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public short member_visibility(int index) throws + org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + public org.omg.CORBA.TypeCode concrete_base_type() throws + org.omg.CORBA.TypeCodePackage.BadKind { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodeHelper.java b/idl/orb/extra/org/omg/CORBA/TypeCodeHelper.java new file mode 100644 index 0000000..df1fd39 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodeHelper.java @@ -0,0 +1,44 @@ +// +// TypeCodeHelper.java (helper) +// +// File generated: Wed Feb 21 16:59:33 CET 2001 +// by TIDorbJ idl2Java 1.0 +// + +package org.omg.CORBA; + +abstract public class TypeCodeHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static void insert(org.omg.CORBA.Any any, TypeCode value) { + any.insert_TypeCode(value); + }; + + public static TypeCode extract(org.omg.CORBA.Any any) { + return any.extract_TypeCode(); + }; + + private static org.omg.CORBA.TypeCode _type = null; + public static org.omg.CORBA.TypeCode type() { + if (_type == null) { + _type = _orb().get_primitive_tc(TCKind.tk_TypeCode); + } + return _type; + }; + + public static String id() { + return "IDL:omg.org/CORBA/TypeCode:1.0"; + }; + + public static TypeCode read(org.omg.CORBA.portable.InputStream is) { + return is.read_TypeCode(); + }; + + public static void write(org.omg.CORBA.portable.OutputStream os, TypeCode val) { + os.write_TypeCode(val); + }; + +} diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodeHolder.java b/idl/orb/extra/org/omg/CORBA/TypeCodeHolder.java new file mode 100644 index 0000000..edefd9d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodeHolder.java @@ -0,0 +1,31 @@ +// +// TypeCodeHolder.java (holder) +// +// File generated: Mon Sep 25 11:22:55 GMT+02:00 2000 +// by TidORB Idl2Java 1.0 +// + +package org.omg.CORBA; + +public class TypeCodeHolder + implements org.omg.CORBA.portable.Streamable { + + public TypeCode value; + public TypeCodeHolder() {} + public TypeCodeHolder(TypeCode initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = is.read_TypeCode(); + }; + + public void _write(org.omg.CORBA.portable.OutputStream os) { + os.write_TypeCode(value); + }; + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc((org.omg.CORBA.TCKind.tk_TypeCode)); + }; + +} diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/all-wcprops new file mode 100644 index 0000000..9fdb723 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodePackage +END +BadKind.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodePackage/BadKind.java +END +Bounds.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodePackage/Bounds.java +END diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/entries b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/entries new file mode 100644 index 0000000..5a42ec5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/TypeCodePackage +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Bounds.java +file + + + + +2009-02-16T09:48:55.000000Z +2483115018fc51f57b423eb9c2842b1b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +286 + +BadKind.java +file + + + + +2009-02-16T09:48:55.000000Z +21c3e1a2daa8aacd0ccacefe66306f5a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +291 + diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/BadKind.java.svn-base b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/BadKind.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/BadKind.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/Bounds.java.svn-base b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/Bounds.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/prop-base/Bounds.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/BadKind.java.svn-base b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/BadKind.java.svn-base new file mode 100644 index 0000000..69910a2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/BadKind.java.svn-base @@ -0,0 +1,16 @@ +package org.omg.CORBA.TypeCodePackage; + +final public class BadKind + extends org.omg.CORBA.UserException { + + + public BadKind() { + super("IDL:omg.org/CORBA/TypeCode/BadKind:1.0"); + } + + public BadKind(String reason) { + super("IDL:omg.org/CORBA/TypeCode/BadKind:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/Bounds.java.svn-base b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/Bounds.java.svn-base new file mode 100644 index 0000000..187c0f3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/.svn/text-base/Bounds.java.svn-base @@ -0,0 +1,16 @@ +package org.omg.CORBA.TypeCodePackage; + +final public class Bounds + extends org.omg.CORBA.UserException { + + + public Bounds() { + super("IDL:omg.org/CORBA/TypeCode/Bounds:1.0"); + } + + public Bounds(String reason) { + super("IDL:omg.org/CORBA/TypeCode/Bounds:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/BadKind.java b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/BadKind.java new file mode 100644 index 0000000..69910a2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/BadKind.java @@ -0,0 +1,16 @@ +package org.omg.CORBA.TypeCodePackage; + +final public class BadKind + extends org.omg.CORBA.UserException { + + + public BadKind() { + super("IDL:omg.org/CORBA/TypeCode/BadKind:1.0"); + } + + public BadKind(String reason) { + super("IDL:omg.org/CORBA/TypeCode/BadKind:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/TypeCodePackage/Bounds.java b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/Bounds.java new file mode 100644 index 0000000..187c0f3 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/TypeCodePackage/Bounds.java @@ -0,0 +1,16 @@ +package org.omg.CORBA.TypeCodePackage; + +final public class Bounds + extends org.omg.CORBA.UserException { + + + public Bounds() { + super("IDL:omg.org/CORBA/TypeCode/Bounds:1.0"); + } + + public Bounds(String reason) { + super("IDL:omg.org/CORBA/TypeCode/Bounds:1.0 "+reason); + + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA/UNKNOWN.java b/idl/orb/extra/org/omg/CORBA/UNKNOWN.java new file mode 100644 index 0000000..3a01b0e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/UNKNOWN.java @@ -0,0 +1,26 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public class UNKNOWN extends org.omg.CORBA.SystemException { + + public UNKNOWN() { + super(null, 0, CompletionStatus.COMPLETED_NO); + } + + public UNKNOWN(int minor, CompletionStatus completed) { + super(null, minor, completed); + } + + public UNKNOWN(String reason) { + super(reason, 0, CompletionStatus.COMPLETED_NO); + } + + public UNKNOWN(String reason, int minor, CompletionStatus completed) { + super(reason, minor, completed); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/UnknownUserException.java b/idl/orb/extra/org/omg/CORBA/UnknownUserException.java new file mode 100644 index 0000000..0cbd4a2 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/UnknownUserException.java @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class UnknownUserException extends org.omg.CORBA.UserException { + public org.omg.CORBA.Any except; + + public UnknownUserException() { + super(); + } + + public UnknownUserException(org.omg.CORBA.Any a) { + super(); + except = a; + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/UserException.java b/idl/orb/extra/org/omg/CORBA/UserException.java new file mode 100644 index 0000000..750e8e1 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/UserException.java @@ -0,0 +1,20 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +abstract public class UserException extends java.lang.Exception + implements org.omg.CORBA.portable.IDLEntity { + + public UserException () { + super(); +} + +public UserException (java.lang.String value) { + + super(value); +} + +} diff --git a/idl/orb/extra/org/omg/CORBA/ValueBaseHelper.java b/idl/orb/extra/org/omg/CORBA/ValueBaseHelper.java new file mode 100644 index 0000000..b56f011 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ValueBaseHelper.java @@ -0,0 +1,61 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public final class ValueBaseHelper { + + private static org.omg.CORBA.ORB _orb() { + return org.omg.CORBA.ORB.init(); + } + + public static String id() { + return "IDL:omg.org/CORBA/ValueBase:1.0"; + }; + + private static org.omg.CORBA.TypeCode _type = null; + + + public static org.omg.CORBA.TypeCode type() + { + if (_type == null){ + + org.omg.CORBA.ValueMember[] _members = new org.omg.CORBA.ValueMember[0]; + + _type = _orb().create_value_tc(id(), + "CustomMarshal", + org.omg.CORBA.VM_NONE.value, + null, + _members); + } + + return _type; + } + + public static void insert(org.omg.CORBA.Any any, + java.io.Serializable _value) + { + any.insert_Value(_value); + } + + public static java.io.Serializable extract(org.omg.CORBA.Any any) + { + return any.extract_Value(); + } + + public static java.io.Serializable read( + org.omg.CORBA.portable.InputStream _input) + { + return ((org.omg.CORBA_2_3.portable.InputStream)_input).read_value(); + + } + + public static void write(org.omg.CORBA.portable.OutputStream _output, + java.io.Serializable _value) + { + ((org.omg.CORBA_2_3.portable.OutputStream) _output).write_value(_value); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/ValueBaseHolder.java b/idl/orb/extra/org/omg/CORBA/ValueBaseHolder.java new file mode 100644 index 0000000..d71f82e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/ValueBaseHolder.java @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +final public class ValueBaseHolder + implements org.omg.CORBA.portable.Streamable { + + public java.io.Serializable value; + + public ValueBaseHolder() { + } + + public ValueBaseHolder(java.io.Serializable initial) { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) { + value = ValueBaseHelper.read(is); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) { + ValueBaseHelper.write(os, value); + } + + public org.omg.CORBA.TypeCode _type() { + return org.omg.CORBA.ORB.init().get_primitive_tc(TCKind.tk_value); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/WrongTransaction.java b/idl/orb/extra/org/omg/CORBA/WrongTransaction.java new file mode 100644 index 0000000..014e802 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/WrongTransaction.java @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA; + +public final class WrongTransaction extends org.omg.CORBA.UserException { + + public WrongTransaction() { + super("IDL:omg.org/CORBA/WrongTransaction:1.0"); + } + + public WrongTransaction(String reason) { // full constructor + super("IDL:omg.org/CORBA/WrongTransaction:1.0 "+reason); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA/portable/.svn/all-wcprops new file mode 100644 index 0000000..238fcd1 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/all-wcprops @@ -0,0 +1,113 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable +END +ServantObject.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ServantObject.java +END +InputStream.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/InputStream.java +END +ResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ResponseHandler.java +END +Delegate.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/Delegate.java +END +UnknownException.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/UnknownException.java +END +RemarshalException.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/RemarshalException.java +END +ValueBase.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ValueBase.java +END +OutputStream.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/OutputStream.java +END +CustomValue.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/CustomValue.java +END +ApplicationException.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ApplicationException.java +END +ObjectImpl.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ObjectImpl.java +END +Streamable.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/Streamable.java +END +ValueFactory.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/ValueFactory.java +END +StreamableValue.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/StreamableValue.java +END +BoxedValueHelper.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/BoxedValueHelper.java +END +IndirectionException.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/IndirectionException.java +END +IDLEntity.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/IDLEntity.java +END +InvokeHandler.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable/InvokeHandler.java +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/entries b/idl/orb/extra/org/omg/CORBA/portable/.svn/entries new file mode 100644 index 0000000..e612df5 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/entries @@ -0,0 +1,640 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA/portable +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ValueFactory.java +file + + + + +2009-02-16T09:48:55.000000Z +c00ad73f796a5506a76a638f3fb7a6c8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +339 + +IDLEntity.java +file + + + + +2009-02-16T09:48:55.000000Z +240d576c7f4707a60dc4984803e58c25 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +285 + +CustomValue.java +file + + + + +2009-02-16T09:48:55.000000Z +82a61e349ac2a65c37e29ad0d32549fc +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +305 + +ValueBase.java +file + + + + +2009-02-16T09:48:55.000000Z +4736a599dba51be089d4d43f30676103 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +307 + +ServantObject.java +file + + + + +2009-02-16T09:48:55.000000Z +346ad0be41349180296a8c83c13c9820 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +292 + +Delegate.java +file + + + + +2009-02-16T09:48:55.000000Z +bb2b3501a4b010540d53a5287748ef1d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3871 + +InputStream.java +file + + + + +2009-02-16T09:48:55.000000Z +4f3ce11bc95e1cc77d2c1727da281df2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3191 + +StreamableValue.java +file + + + + +2009-02-16T09:48:55.000000Z +4c79d72ba4301f6b0b0d493d84788484 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +292 + +OutputStream.java +file + + + + +2009-02-16T09:48:55.000000Z +8bb7ccd561f92209b1a290bd7d2e588e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3358 + +UnknownException.java +file + + + + +2009-02-16T09:48:55.000000Z +70db96ba580a1499954b72ad73e81d71 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +473 + +Streamable.java +file + + + + +2009-02-16T09:48:55.000000Z +25d6ee14087eff165027d75b88ecc70b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +405 + +ApplicationException.java +file + + + + +2009-02-16T09:48:55.000000Z +5f3c065fde200e4095e08931fc5e415e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +625 + +IndirectionException.java +file + + + + +2009-02-16T09:48:55.000000Z +57d6f14763199b8cee73495f2846ca9f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +475 + +ObjectImpl.java +file + + + + +2009-02-16T09:48:55.000000Z +0b8567ca2ad9bffc5eb2f59c281c81c5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4313 + +InvokeHandler.java +file + + + + +2009-02-16T09:48:55.000000Z +bc6acc12be8e333be2e100c6a9e6fee1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +472 + +ResponseHandler.java +file + + + + +2009-02-16T09:48:55.000000Z +2e544372fb2cdfe119abdaaba99803b2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +397 + +RemarshalException.java +file + + + + +2009-02-16T09:48:55.000000Z +5de10aaf7d5fafcb698e4df69eed4bb5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +336 + +BoxedValueHelper.java +file + + + + +2009-02-16T09:48:55.000000Z +74593e6a4fed916f8632fb09b0106445 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +479 + diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ApplicationException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ApplicationException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ApplicationException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/BoxedValueHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/BoxedValueHelper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/BoxedValueHelper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/CustomValue.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/CustomValue.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/CustomValue.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Delegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Delegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IDLEntity.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IDLEntity.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IDLEntity.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IndirectionException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IndirectionException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/IndirectionException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InvokeHandler.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InvokeHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/InvokeHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ObjectImpl.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ObjectImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/OutputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/OutputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/OutputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/RemarshalException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/RemarshalException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/RemarshalException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ResponseHandler.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ServantObject.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ServantObject.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ServantObject.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Streamable.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Streamable.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/Streamable.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/StreamableValue.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/StreamableValue.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/StreamableValue.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/UnknownException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/UnknownException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/UnknownException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueBase.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueBase.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueBase.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueFactory.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueFactory.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/prop-base/ValueFactory.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ApplicationException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ApplicationException.java.svn-base new file mode 100644 index 0000000..817762c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ApplicationException.java.svn-base @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class ApplicationException extends Exception { + + private String _id; + private org.omg.CORBA.portable.InputStream _is; + + public ApplicationException(String id, + org.omg.CORBA.portable.InputStream is) { + _id = id; + _is = is; + } + + public String getId() { + return _id; + } + + public InputStream getInputStream() { + return _is; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/BoxedValueHelper.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/BoxedValueHelper.java.svn-base new file mode 100644 index 0000000..5c6f54f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/BoxedValueHelper.java.svn-base @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface BoxedValueHelper { + + java.io.Serializable read_value(org.omg.CORBA.portable.InputStream is); + void write_value(org.omg.CORBA.portable.OutputStream output, + java.io.Serializable obj); + java.lang.String get_id(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/CustomValue.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/CustomValue.java.svn-base new file mode 100644 index 0000000..4996480 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/CustomValue.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface CustomValue extends ValueBase, org.omg.CORBA.CustomMarshal { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Delegate.java.svn-base new file mode 100644 index 0000000..07eaa4a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Delegate.java.svn-base @@ -0,0 +1,118 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class Delegate { + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + public abstract org.omg.CORBA.InterfaceDef get_interface( + org.omg.CORBA.Object self); + + public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract org.omg.CORBA.Object duplicate(org.omg.CORBA.Object self); + + public abstract void release(org.omg.CORBA.Object self); + + public abstract boolean is_a(org.omg.CORBA.Object self, + String repository_id); + + public abstract boolean non_existent(org.omg.CORBA.Object self); + + public abstract boolean is_equivalent(org.omg.CORBA.Object self, + org.omg.CORBA.Object rhs); + + public abstract int hash(org.omg.CORBA.Object self, int max); + + public abstract org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result); + + public abstract org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist); + + public abstract org.omg.CORBA.Request request( + org.omg.CORBA.Object self, + String operation); + + public org.omg.CORBA.portable.OutputStream request( + org.omg.CORBA.Object self, + String operation, + boolean responseExpected) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.InputStream invoke(org.omg.CORBA.Object self, + org.omg.CORBA.portable.OutputStream os) + throws ApplicationException, RemarshalException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void releaseReply(org.omg.CORBA.Object self, + org.omg.CORBA.portable.InputStream is) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self, + int policy_type) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.DomainManager[] get_domain_managers( + org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self, + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public boolean is_local(org.omg.CORBA.Object self) { + return false; + } + + public ServantObject servant_preinvoke(org.omg.CORBA.Object self, + String operation, Class expectedType) { + return null; + } + + public void servant_postinvoke(org.omg.CORBA.Object self, + ServantObject servant) { + } + + public String toString(org.omg.CORBA.Object self) { + return self.getClass().getName() + ":" + this.toString(); + } + + public int hashCode(org.omg.CORBA.Object self) { + return System.identityHashCode(self); + } + + public boolean equals(org.omg.CORBA.Object self, java.lang.Object obj) { + return (self == obj); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IDLEntity.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IDLEntity.java.svn-base new file mode 100644 index 0000000..41d72cf --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IDLEntity.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface IDLEntity extends java.io.Serializable { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IndirectionException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IndirectionException.java.svn-base new file mode 100644 index 0000000..a264e48 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/IndirectionException.java.svn-base @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class IndirectionException extends org.omg.CORBA.SystemException { + + public int offset; + + public IndirectionException(int offset) { + super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_NO); + this.offset = offset; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InputStream.java.svn-base new file mode 100644 index 0000000..082ea62 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InputStream.java.svn-base @@ -0,0 +1,88 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class InputStream extends java.io.InputStream { + + public int read() throws java.io.IOException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract boolean read_boolean(); + public abstract char read_char(); + public abstract char read_wchar(); + public abstract byte read_octet(); + public abstract short read_short(); + public abstract short read_ushort(); + public abstract int read_long(); + public abstract int read_ulong(); + public abstract long read_longlong(); + public abstract long read_ulonglong(); + public abstract float read_float(); + public abstract double read_double(); + public abstract String read_string(); + public abstract String read_wstring(); + + public abstract void read_boolean_array( + boolean[] value, int offset, int length); + public abstract void read_char_array(char[] value, int offset, int length); + public abstract void read_wchar_array( + char[] value, int offset, int length); + public abstract void read_octet_array( + byte[] value, int offset, int length); + public abstract void read_short_array( + short[] value, int offset, int length); + public abstract void read_ushort_array( + short[] value, int offset, int length); + public abstract void read_long_array(int[] value, int offset, int length); + public abstract void read_ulong_array(int[] value, int offset, int length); + public abstract void read_longlong_array( + long[] value, int offset, int length); + public abstract void read_ulonglong_array( + long[] value, int offset, int length); + public abstract void read_float_array( + float[] value, int offset, int length); + public abstract void read_double_array( + double[] value, int offset, int length); + + public abstract org.omg.CORBA.Object read_Object(); + + public org.omg.CORBA.Object read_Object(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract org.omg.CORBA.TypeCode read_TypeCode(); + + public abstract org.omg.CORBA.Any read_any(); + + public org.omg.CORBA.Context read_Context() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public org.omg.CORBA.Principal read_Principal() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + public java.math.BigDecimal read_fixed() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Any read_fixed(short digits, short scale) + throws org.omg.CORBA.BadFixedValue { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InvokeHandler.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InvokeHandler.java.svn-base new file mode 100644 index 0000000..56d786d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/InvokeHandler.java.svn-base @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface InvokeHandler { + + public org.omg.CORBA.portable.OutputStream _invoke(String method, + org.omg.CORBA.portable.InputStream is, + ResponseHandler handler) + throws org.omg.CORBA.SystemException; +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ObjectImpl.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..014204a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ObjectImpl.java.svn-base @@ -0,0 +1,140 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +abstract public class ObjectImpl implements org.omg.CORBA.Object { + + private transient Delegate __delegate; + + public Delegate _get_delegate() { + if (__delegate == null) + throw new org.omg.CORBA.BAD_OPERATION(); + return __delegate; + } + + + public void _set_delegate(Delegate delegate) { + __delegate = delegate; + } + + public abstract String[] _ids(); + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.InterfaceDef _get_interface() { + return _get_delegate().get_interface(this); + } + + public org.omg.CORBA.Object _get_interface_def() { + return _get_delegate().get_interface_def(this); + } + + public org.omg.CORBA.Object _duplicate() { + return _get_delegate().duplicate(this); + } + + public void _release() { + _get_delegate().release(this); + } + + public boolean _is_a(String repository_id) { + return _get_delegate().is_a(this, repository_id); + } + + public boolean _is_equivalent(org.omg.CORBA.Object that) { + return _get_delegate().is_equivalent(this, that); + } + + public boolean _non_existent() { + return _get_delegate().non_existent(this); + } + + public int _hash(int maximum) { + return _get_delegate().hash(this, maximum); + } + + public org.omg.CORBA.Request _request(String operation) { + return _get_delegate().request(this, operation); + } + + public org.omg.CORBA.portable.OutputStream _request(String operation, + boolean responseExpected) { + return _get_delegate().request(this, operation, responseExpected); + } + + public org.omg.CORBA.portable.InputStream _invoke( + org.omg.CORBA.portable.OutputStream output) + throws ApplicationException, RemarshalException { + return _get_delegate().invoke(this, output); + } + + public void _releaseReply(org.omg.CORBA.portable.InputStream input) { + _get_delegate().releaseReply(this, input); + } + + public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result) { + return _get_delegate().create_request(this, ctx,operation, + arg_list,result); + } + + public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exceptions, + org.omg.CORBA.ContextList contexts) { + return _get_delegate().create_request(this, ctx, operation, arg_list, + result, exceptions, contexts); + } + + public org.omg.CORBA.Policy _get_policy(int policy_type) { + return _get_delegate().get_policy(this, policy_type); + } + + public org.omg.CORBA.DomainManager[] _get_domain_managers() { + return _get_delegate().get_domain_managers(this); + } + + public org.omg.CORBA.Object _set_policy_override( + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) { + return _get_delegate().set_policy_override(this, policies, set_add); + } + + public org.omg.CORBA.ORB _orb() { + return _get_delegate().orb(this); + } + + public boolean _is_local() { + return _get_delegate().is_local(this); + } + + public ServantObject _servant_preinvoke(String operation, + Class expectedType) { + return _get_delegate().servant_preinvoke(this, operation,expectedType); + } + + public void _servant_postinvoke(ServantObject servant) { + _get_delegate().servant_postinvoke(this, servant); + } + + public String toString() { + return _get_delegate().toString(this); + } + + public int hashCode() { + return _get_delegate().hashCode(this); + } + + public boolean equals(java.lang.Object obj) { + return _get_delegate().equals(this, obj); + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/OutputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/OutputStream.java.svn-base new file mode 100644 index 0000000..4dd8c9a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/OutputStream.java.svn-base @@ -0,0 +1,76 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class OutputStream extends java.io.OutputStream { + + public void write(int b) throws java.io.IOException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract InputStream create_input_stream(); + + public abstract void write_boolean (boolean value); + public abstract void write_char (char value); + public abstract void write_wchar (char value); + public abstract void write_octet (byte value); + public abstract void write_short (short value); + public abstract void write_ushort (short value); + public abstract void write_long (int value); + public abstract void write_ulong (int value); + public abstract void write_longlong (long value); + public abstract void write_ulonglong (long value); + public abstract void write_float (float value); + public abstract void write_double (double value); + public abstract void write_string (String value); + public abstract void write_wstring (String value); + + + public abstract void write_boolean_array(boolean[] value, int offset, int length); + public abstract void write_char_array(char[] value, int offset, int length); + public abstract void write_wchar_array(char[] value, int offset, int length); + public abstract void write_octet_array(byte[] value, int offset, int length); + public abstract void write_short_array(short[] value, int offset, int length); + public abstract void write_ushort_array(short[] value, int offset, int length); + public abstract void write_long_array(int[] value, int offset, int length); + public abstract void write_ulong_array(int[] value, int offset, int length); + public abstract void write_longlong_array(long[] value, int offset, int length); + public abstract void write_ulonglong_array(long[] value, int offset, int length); + public abstract void write_float_array(float[] value, int offset, int length); + public abstract void write_double_array(double[] value, int offset, int length); + + public abstract void write_Object(org.omg.CORBA.Object value); + public abstract void write_TypeCode(org.omg.CORBA.TypeCode value); + public abstract void write_any(org.omg.CORBA.Any value); + + public void write_Context(org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public void write_Principal (org.omg.CORBA.Principal value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + public void write_fixed(java.math.BigDecimal value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_fixed(java.math.BigDecimal value, short digits, short scale) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/RemarshalException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/RemarshalException.java.svn-base new file mode 100644 index 0000000..a91cd06 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/RemarshalException.java.svn-base @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class RemarshalException extends Exception { + + public RemarshalException() { + super(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ResponseHandler.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ResponseHandler.java.svn-base new file mode 100644 index 0000000..3b6bc06 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ResponseHandler.java.svn-base @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ResponseHandler { + + public org.omg.CORBA.portable.OutputStream createReply(); + + public org.omg.CORBA.portable.OutputStream createExceptionReply(); + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ServantObject.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ServantObject.java.svn-base new file mode 100644 index 0000000..7eddaae --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ServantObject.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class ServantObject { + public java.lang.Object servant; +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Streamable.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Streamable.java.svn-base new file mode 100644 index 0000000..aa8d6b6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/Streamable.java.svn-base @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface Streamable { + + void _read(org.omg.CORBA.portable.InputStream is); + void _write(org.omg.CORBA.portable.OutputStream os); + org.omg.CORBA.TypeCode _type(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/StreamableValue.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/StreamableValue.java.svn-base new file mode 100644 index 0000000..b40f6c7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/StreamableValue.java.svn-base @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface StreamableValue extends Streamable, ValueBase { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/UnknownException.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/UnknownException.java.svn-base new file mode 100644 index 0000000..b3efa61 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/UnknownException.java.svn-base @@ -0,0 +1,16 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class UnknownException extends org.omg.CORBA.SystemException { + + public Throwable originalEx; + public UnknownException(Throwable ex) { + super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_NO); + originalEx = ex; + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueBase.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueBase.java.svn-base new file mode 100644 index 0000000..11e6c1b --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueBase.java.svn-base @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ValueBase extends IDLEntity { + + String[] _truncatable_ids(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueFactory.java.svn-base b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueFactory.java.svn-base new file mode 100644 index 0000000..b338660 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/.svn/text-base/ValueFactory.java.svn-base @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ValueFactory { + + java.io.Serializable read_value(org.omg.CORBA_2_3.portable.InputStream is); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/ApplicationException.java b/idl/orb/extra/org/omg/CORBA/portable/ApplicationException.java new file mode 100644 index 0000000..817762c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ApplicationException.java @@ -0,0 +1,27 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class ApplicationException extends Exception { + + private String _id; + private org.omg.CORBA.portable.InputStream _is; + + public ApplicationException(String id, + org.omg.CORBA.portable.InputStream is) { + _id = id; + _is = is; + } + + public String getId() { + return _id; + } + + public InputStream getInputStream() { + return _is; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/BoxedValueHelper.java b/idl/orb/extra/org/omg/CORBA/portable/BoxedValueHelper.java new file mode 100644 index 0000000..5c6f54f --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/BoxedValueHelper.java @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface BoxedValueHelper { + + java.io.Serializable read_value(org.omg.CORBA.portable.InputStream is); + void write_value(org.omg.CORBA.portable.OutputStream output, + java.io.Serializable obj); + java.lang.String get_id(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/CustomValue.java b/idl/orb/extra/org/omg/CORBA/portable/CustomValue.java new file mode 100644 index 0000000..4996480 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/CustomValue.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface CustomValue extends ValueBase, org.omg.CORBA.CustomMarshal { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/Delegate.java b/idl/orb/extra/org/omg/CORBA/portable/Delegate.java new file mode 100644 index 0000000..07eaa4a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/Delegate.java @@ -0,0 +1,118 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class Delegate { + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + public abstract org.omg.CORBA.InterfaceDef get_interface( + org.omg.CORBA.Object self); + + public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract org.omg.CORBA.Object duplicate(org.omg.CORBA.Object self); + + public abstract void release(org.omg.CORBA.Object self); + + public abstract boolean is_a(org.omg.CORBA.Object self, + String repository_id); + + public abstract boolean non_existent(org.omg.CORBA.Object self); + + public abstract boolean is_equivalent(org.omg.CORBA.Object self, + org.omg.CORBA.Object rhs); + + public abstract int hash(org.omg.CORBA.Object self, int max); + + public abstract org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result); + + public abstract org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist); + + public abstract org.omg.CORBA.Request request( + org.omg.CORBA.Object self, + String operation); + + public org.omg.CORBA.portable.OutputStream request( + org.omg.CORBA.Object self, + String operation, + boolean responseExpected) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.InputStream invoke(org.omg.CORBA.Object self, + org.omg.CORBA.portable.OutputStream os) + throws ApplicationException, RemarshalException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void releaseReply(org.omg.CORBA.Object self, + org.omg.CORBA.portable.InputStream is) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self, + int policy_type) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.DomainManager[] get_domain_managers( + org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self, + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + public boolean is_local(org.omg.CORBA.Object self) { + return false; + } + + public ServantObject servant_preinvoke(org.omg.CORBA.Object self, + String operation, Class expectedType) { + return null; + } + + public void servant_postinvoke(org.omg.CORBA.Object self, + ServantObject servant) { + } + + public String toString(org.omg.CORBA.Object self) { + return self.getClass().getName() + ":" + this.toString(); + } + + public int hashCode(org.omg.CORBA.Object self) { + return System.identityHashCode(self); + } + + public boolean equals(org.omg.CORBA.Object self, java.lang.Object obj) { + return (self == obj); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/IDLEntity.java b/idl/orb/extra/org/omg/CORBA/portable/IDLEntity.java new file mode 100644 index 0000000..41d72cf --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/IDLEntity.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface IDLEntity extends java.io.Serializable { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/IndirectionException.java b/idl/orb/extra/org/omg/CORBA/portable/IndirectionException.java new file mode 100644 index 0000000..a264e48 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/IndirectionException.java @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class IndirectionException extends org.omg.CORBA.SystemException { + + public int offset; + + public IndirectionException(int offset) { + super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_NO); + this.offset = offset; + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/InputStream.java b/idl/orb/extra/org/omg/CORBA/portable/InputStream.java new file mode 100644 index 0000000..082ea62 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/InputStream.java @@ -0,0 +1,88 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class InputStream extends java.io.InputStream { + + public int read() throws java.io.IOException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract boolean read_boolean(); + public abstract char read_char(); + public abstract char read_wchar(); + public abstract byte read_octet(); + public abstract short read_short(); + public abstract short read_ushort(); + public abstract int read_long(); + public abstract int read_ulong(); + public abstract long read_longlong(); + public abstract long read_ulonglong(); + public abstract float read_float(); + public abstract double read_double(); + public abstract String read_string(); + public abstract String read_wstring(); + + public abstract void read_boolean_array( + boolean[] value, int offset, int length); + public abstract void read_char_array(char[] value, int offset, int length); + public abstract void read_wchar_array( + char[] value, int offset, int length); + public abstract void read_octet_array( + byte[] value, int offset, int length); + public abstract void read_short_array( + short[] value, int offset, int length); + public abstract void read_ushort_array( + short[] value, int offset, int length); + public abstract void read_long_array(int[] value, int offset, int length); + public abstract void read_ulong_array(int[] value, int offset, int length); + public abstract void read_longlong_array( + long[] value, int offset, int length); + public abstract void read_ulonglong_array( + long[] value, int offset, int length); + public abstract void read_float_array( + float[] value, int offset, int length); + public abstract void read_double_array( + double[] value, int offset, int length); + + public abstract org.omg.CORBA.Object read_Object(); + + public org.omg.CORBA.Object read_Object(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract org.omg.CORBA.TypeCode read_TypeCode(); + + public abstract org.omg.CORBA.Any read_any(); + + public org.omg.CORBA.Context read_Context() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public org.omg.CORBA.Principal read_Principal() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + public java.math.BigDecimal read_fixed() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Any read_fixed(short digits, short scale) + throws org.omg.CORBA.BadFixedValue { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/InvokeHandler.java b/idl/orb/extra/org/omg/CORBA/portable/InvokeHandler.java new file mode 100644 index 0000000..56d786d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/InvokeHandler.java @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface InvokeHandler { + + public org.omg.CORBA.portable.OutputStream _invoke(String method, + org.omg.CORBA.portable.InputStream is, + ResponseHandler handler) + throws org.omg.CORBA.SystemException; +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/ObjectImpl.java b/idl/orb/extra/org/omg/CORBA/portable/ObjectImpl.java new file mode 100644 index 0000000..014204a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ObjectImpl.java @@ -0,0 +1,140 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +abstract public class ObjectImpl implements org.omg.CORBA.Object { + + private transient Delegate __delegate; + + public Delegate _get_delegate() { + if (__delegate == null) + throw new org.omg.CORBA.BAD_OPERATION(); + return __delegate; + } + + + public void _set_delegate(Delegate delegate) { + __delegate = delegate; + } + + public abstract String[] _ids(); + + /** + *@deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.InterfaceDef _get_interface() { + return _get_delegate().get_interface(this); + } + + public org.omg.CORBA.Object _get_interface_def() { + return _get_delegate().get_interface_def(this); + } + + public org.omg.CORBA.Object _duplicate() { + return _get_delegate().duplicate(this); + } + + public void _release() { + _get_delegate().release(this); + } + + public boolean _is_a(String repository_id) { + return _get_delegate().is_a(this, repository_id); + } + + public boolean _is_equivalent(org.omg.CORBA.Object that) { + return _get_delegate().is_equivalent(this, that); + } + + public boolean _non_existent() { + return _get_delegate().non_existent(this); + } + + public int _hash(int maximum) { + return _get_delegate().hash(this, maximum); + } + + public org.omg.CORBA.Request _request(String operation) { + return _get_delegate().request(this, operation); + } + + public org.omg.CORBA.portable.OutputStream _request(String operation, + boolean responseExpected) { + return _get_delegate().request(this, operation, responseExpected); + } + + public org.omg.CORBA.portable.InputStream _invoke( + org.omg.CORBA.portable.OutputStream output) + throws ApplicationException, RemarshalException { + return _get_delegate().invoke(this, output); + } + + public void _releaseReply(org.omg.CORBA.portable.InputStream input) { + _get_delegate().releaseReply(this, input); + } + + public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result) { + return _get_delegate().create_request(this, ctx,operation, + arg_list,result); + } + + public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exceptions, + org.omg.CORBA.ContextList contexts) { + return _get_delegate().create_request(this, ctx, operation, arg_list, + result, exceptions, contexts); + } + + public org.omg.CORBA.Policy _get_policy(int policy_type) { + return _get_delegate().get_policy(this, policy_type); + } + + public org.omg.CORBA.DomainManager[] _get_domain_managers() { + return _get_delegate().get_domain_managers(this); + } + + public org.omg.CORBA.Object _set_policy_override( + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) { + return _get_delegate().set_policy_override(this, policies, set_add); + } + + public org.omg.CORBA.ORB _orb() { + return _get_delegate().orb(this); + } + + public boolean _is_local() { + return _get_delegate().is_local(this); + } + + public ServantObject _servant_preinvoke(String operation, + Class expectedType) { + return _get_delegate().servant_preinvoke(this, operation,expectedType); + } + + public void _servant_postinvoke(ServantObject servant) { + _get_delegate().servant_postinvoke(this, servant); + } + + public String toString() { + return _get_delegate().toString(this); + } + + public int hashCode() { + return _get_delegate().hashCode(this); + } + + public boolean equals(java.lang.Object obj) { + return _get_delegate().equals(this, obj); + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/OutputStream.java b/idl/orb/extra/org/omg/CORBA/portable/OutputStream.java new file mode 100644 index 0000000..4dd8c9a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/OutputStream.java @@ -0,0 +1,76 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public abstract class OutputStream extends java.io.OutputStream { + + public void write(int b) throws java.io.IOException { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ORB orb() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public abstract InputStream create_input_stream(); + + public abstract void write_boolean (boolean value); + public abstract void write_char (char value); + public abstract void write_wchar (char value); + public abstract void write_octet (byte value); + public abstract void write_short (short value); + public abstract void write_ushort (short value); + public abstract void write_long (int value); + public abstract void write_ulong (int value); + public abstract void write_longlong (long value); + public abstract void write_ulonglong (long value); + public abstract void write_float (float value); + public abstract void write_double (double value); + public abstract void write_string (String value); + public abstract void write_wstring (String value); + + + public abstract void write_boolean_array(boolean[] value, int offset, int length); + public abstract void write_char_array(char[] value, int offset, int length); + public abstract void write_wchar_array(char[] value, int offset, int length); + public abstract void write_octet_array(byte[] value, int offset, int length); + public abstract void write_short_array(short[] value, int offset, int length); + public abstract void write_ushort_array(short[] value, int offset, int length); + public abstract void write_long_array(int[] value, int offset, int length); + public abstract void write_ulong_array(int[] value, int offset, int length); + public abstract void write_longlong_array(long[] value, int offset, int length); + public abstract void write_ulonglong_array(long[] value, int offset, int length); + public abstract void write_float_array(float[] value, int offset, int length); + public abstract void write_double_array(double[] value, int offset, int length); + + public abstract void write_Object(org.omg.CORBA.Object value); + public abstract void write_TypeCode(org.omg.CORBA.TypeCode value); + public abstract void write_any(org.omg.CORBA.Any value); + + public void write_Context(org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public void write_Principal (org.omg.CORBA.Principal value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + public void write_fixed(java.math.BigDecimal value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_fixed(java.math.BigDecimal value, short digits, short scale) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/RemarshalException.java b/idl/orb/extra/org/omg/CORBA/portable/RemarshalException.java new file mode 100644 index 0000000..a91cd06 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/RemarshalException.java @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class RemarshalException extends Exception { + + public RemarshalException() { + super(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/ResponseHandler.java b/idl/orb/extra/org/omg/CORBA/portable/ResponseHandler.java new file mode 100644 index 0000000..3b6bc06 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ResponseHandler.java @@ -0,0 +1,14 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ResponseHandler { + + public org.omg.CORBA.portable.OutputStream createReply(); + + public org.omg.CORBA.portable.OutputStream createExceptionReply(); + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/ServantObject.java b/idl/orb/extra/org/omg/CORBA/portable/ServantObject.java new file mode 100644 index 0000000..7eddaae --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ServantObject.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class ServantObject { + public java.lang.Object servant; +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/Streamable.java b/idl/orb/extra/org/omg/CORBA/portable/Streamable.java new file mode 100644 index 0000000..aa8d6b6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/Streamable.java @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface Streamable { + + void _read(org.omg.CORBA.portable.InputStream is); + void _write(org.omg.CORBA.portable.OutputStream os); + org.omg.CORBA.TypeCode _type(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/StreamableValue.java b/idl/orb/extra/org/omg/CORBA/portable/StreamableValue.java new file mode 100644 index 0000000..b40f6c7 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/StreamableValue.java @@ -0,0 +1,10 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface StreamableValue extends Streamable, ValueBase { + +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/UnknownException.java b/idl/orb/extra/org/omg/CORBA/portable/UnknownException.java new file mode 100644 index 0000000..b3efa61 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/UnknownException.java @@ -0,0 +1,16 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public class UnknownException extends org.omg.CORBA.SystemException { + + public Throwable originalEx; + public UnknownException(Throwable ex) { + super("", 0, org.omg.CORBA.CompletionStatus.COMPLETED_NO); + originalEx = ex; + } +} + diff --git a/idl/orb/extra/org/omg/CORBA/portable/ValueBase.java b/idl/orb/extra/org/omg/CORBA/portable/ValueBase.java new file mode 100644 index 0000000..11e6c1b --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ValueBase.java @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ValueBase extends IDLEntity { + + String[] _truncatable_ids(); +} diff --git a/idl/orb/extra/org/omg/CORBA/portable/ValueFactory.java b/idl/orb/extra/org/omg/CORBA/portable/ValueFactory.java new file mode 100644 index 0000000..b338660 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA/portable/ValueFactory.java @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA.portable; + +public interface ValueFactory { + + java.io.Serializable read_value(org.omg.CORBA_2_3.portable.InputStream is); +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA_2_3/.svn/all-wcprops new file mode 100644 index 0000000..09fa34c --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3 +END +ORB.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/ORB.java +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/.svn/entries b/idl/orb/extra/org/omg/CORBA_2_3/.svn/entries new file mode 100644 index 0000000..d8a2f9e --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/.svn/entries @@ -0,0 +1,65 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3 +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ORB.java +file + + + + +2009-02-16T09:48:55.000000Z +e5e119d0f3fd4ded7a136aff6f0737cc +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1772 + +portable +dir + diff --git a/idl/orb/extra/org/omg/CORBA_2_3/.svn/prop-base/ORB.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/.svn/prop-base/ORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/.svn/prop-base/ORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/.svn/text-base/ORB.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/.svn/text-base/ORB.java.svn-base new file mode 100644 index 0000000..40d0fe6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/.svn/text-base/ORB.java.svn-base @@ -0,0 +1,49 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +/***** This class is specifed by the mapping as abstract. + A "dummy" implementation is provided so that the "official" org.omg.* + packages may be compiled. + + ORB-vendors shall provide a complete implementation of the class + by extending it with a vendor-specific class which + provides "real" implementations for all the methods. E.g. + + package com.acme_orb_vendor.CORBA_2_3; + public class ORB extends org.omg.CORBA_2_3 { ... } + + In order to be conformant the class shall support the signatures + specified here, but will have an orb-specific implementation. + + The class may support additional vendor specific functionality. +*****/ + +package org.omg.CORBA_2_3; + +public abstract class ORB extends org.omg.CORBA.ORB { + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) throws + org.omg.CORBA.BAD_PARAM { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory register_value_factory( + String id, org.omg.CORBA.portable.ValueFactory factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void unregister_value_factory(String id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id){ + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_delegate(java.lang.Object wrapper) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/ORB.java b/idl/orb/extra/org/omg/CORBA_2_3/ORB.java new file mode 100644 index 0000000..40d0fe6 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/ORB.java @@ -0,0 +1,49 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +/***** This class is specifed by the mapping as abstract. + A "dummy" implementation is provided so that the "official" org.omg.* + packages may be compiled. + + ORB-vendors shall provide a complete implementation of the class + by extending it with a vendor-specific class which + provides "real" implementations for all the methods. E.g. + + package com.acme_orb_vendor.CORBA_2_3; + public class ORB extends org.omg.CORBA_2_3 { ... } + + In order to be conformant the class shall support the signatures + specified here, but will have an orb-specific implementation. + + The class may support additional vendor specific functionality. +*****/ + +package org.omg.CORBA_2_3; + +public abstract class ORB extends org.omg.CORBA.ORB { + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) throws + org.omg.CORBA.BAD_PARAM { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory register_value_factory( + String id, org.omg.CORBA.portable.ValueFactory factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void unregister_value_factory(String id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id){ + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_delegate(java.lang.Object wrapper) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/all-wcprops new file mode 100644 index 0000000..7240204 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable +END +ObjectImpl.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable/ObjectImpl.java +END +InputStream.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable/InputStream.java +END +Delegate.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable/Delegate.java +END +OutputStream.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable/OutputStream.java +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/entries b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/entries new file mode 100644 index 0000000..be37080 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_3/portable +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ObjectImpl.java +file + + + + +2009-02-16T09:48:55.000000Z +db934355ba10e52bc3d54ef48cc93c19 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +620 + +Delegate.java +file + + + + +2009-02-16T09:48:55.000000Z +1e16d5479337b3d87cc0850526bf925b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +401 + +InputStream.java +file + + + + +2009-02-16T09:48:55.000000Z +b616b9ef1b10127c5f736853534936c2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1189 + +OutputStream.java +file + + + + +2009-02-16T09:48:55.000000Z +446a0785897ba65519027d4ad1fe694e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1020 + diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/Delegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/Delegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/InputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/InputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/InputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/ObjectImpl.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/ObjectImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/OutputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/OutputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/prop-base/OutputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/Delegate.java.svn-base new file mode 100644 index 0000000..9ad4837 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/Delegate.java.svn-base @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +public abstract class Delegate extends org.omg.CORBA.portable.Delegate { + + public java.lang.String get_codebase(org.omg.CORBA.Object self) { + return null; + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/InputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/InputStream.java.svn-base new file mode 100644 index 0000000..e6af465 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/InputStream.java.svn-base @@ -0,0 +1,39 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +abstract public class InputStream extends org.omg.CORBA.portable.InputStream { + + public java.io.Serializable read_value() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.lang.String rep_id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value( + org.omg.CORBA.portable.BoxedValueHelper factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.io.Serializable value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object read_abstract_interface() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object read_abstract_interface(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/ObjectImpl.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..d651e7d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/ObjectImpl.java.svn-base @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +public abstract class ObjectImpl extends org.omg.CORBA.portable.ObjectImpl { + + public String _get_codebase() { + org.omg.CORBA.portable.Delegate delegate = _get_delegate(); + if (delegate instanceof org.omg.CORBA_2_3.portable.Delegate) + return ((org.omg.CORBA_2_3.portable.Delegate) + delegate).get_codebase(this); + return null; + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/OutputStream.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/OutputStream.java.svn-base new file mode 100644 index 0000000..003829a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/.svn/text-base/OutputStream.java.svn-base @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +abstract public class OutputStream extends org.omg.CORBA.portable.OutputStream{ + + public void write_value(java.io.Serializable value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, + java.lang.String rep_id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_abstract_interface(java.lang.Object object) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/Delegate.java b/idl/orb/extra/org/omg/CORBA_2_3/portable/Delegate.java new file mode 100644 index 0000000..9ad4837 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/Delegate.java @@ -0,0 +1,13 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +public abstract class Delegate extends org.omg.CORBA.portable.Delegate { + + public java.lang.String get_codebase(org.omg.CORBA.Object self) { + return null; + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/InputStream.java b/idl/orb/extra/org/omg/CORBA_2_3/portable/InputStream.java new file mode 100644 index 0000000..e6af465 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/InputStream.java @@ -0,0 +1,39 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +abstract public class InputStream extends org.omg.CORBA.portable.InputStream { + + public java.io.Serializable read_value() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.lang.String rep_id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value( + org.omg.CORBA.portable.BoxedValueHelper factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.io.Serializable read_value(java.io.Serializable value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object read_abstract_interface() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object read_abstract_interface(java.lang.Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/ObjectImpl.java b/idl/orb/extra/org/omg/CORBA_2_3/portable/ObjectImpl.java new file mode 100644 index 0000000..d651e7d --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/ObjectImpl.java @@ -0,0 +1,17 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +public abstract class ObjectImpl extends org.omg.CORBA.portable.ObjectImpl { + + public String _get_codebase() { + org.omg.CORBA.portable.Delegate delegate = _get_delegate(); + if (delegate instanceof org.omg.CORBA_2_3.portable.Delegate) + return ((org.omg.CORBA_2_3.portable.Delegate) + delegate).get_codebase(this); + return null; + } +} diff --git a/idl/orb/extra/org/omg/CORBA_2_3/portable/OutputStream.java b/idl/orb/extra/org/omg/CORBA_2_3/portable/OutputStream.java new file mode 100644 index 0000000..003829a --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_3/portable/OutputStream.java @@ -0,0 +1,32 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.CORBA_2_3.portable; + +abstract public class OutputStream extends org.omg.CORBA.portable.OutputStream{ + + public void write_value(java.io.Serializable value) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, + java.lang.String rep_id) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, Class clz) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_value(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_abstract_interface(java.lang.Object object) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} diff --git a/idl/orb/extra/org/omg/CORBA_2_5/.svn/all-wcprops b/idl/orb/extra/org/omg/CORBA_2_5/.svn/all-wcprops new file mode 100644 index 0000000..225ffcd --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_5/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_5 +END +ORB.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_5/ORB.java +END diff --git a/idl/orb/extra/org/omg/CORBA_2_5/.svn/entries b/idl/orb/extra/org/omg/CORBA_2_5/.svn/entries new file mode 100644 index 0000000..c88e502 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_5/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/CORBA_2_5 +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ORB.java +file + + + + +2009-02-16T09:48:55.000000Z +c74354246c8fc68b6991275505e4f983 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +530 + diff --git a/idl/orb/extra/org/omg/CORBA_2_5/.svn/prop-base/ORB.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_5/.svn/prop-base/ORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_5/.svn/prop-base/ORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/CORBA_2_5/.svn/text-base/ORB.java.svn-base b/idl/orb/extra/org/omg/CORBA_2_5/.svn/text-base/ORB.java.svn-base new file mode 100644 index 0000000..d9041fc --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_5/.svn/text-base/ORB.java.svn-base @@ -0,0 +1,21 @@ +package org.omg.CORBA_2_5; + +public abstract class ORB extends org.omg.CORBA_2_3.ORB +{ + public String id() + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object object) + throws org.omg.CORBA.ORBPackage.InvalidName + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } + + public org.omg.CORBA.TypeCode create_local_interface_tc(String id, String name) + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/CORBA_2_5/ORB.java b/idl/orb/extra/org/omg/CORBA_2_5/ORB.java new file mode 100644 index 0000000..d9041fc --- /dev/null +++ b/idl/orb/extra/org/omg/CORBA_2_5/ORB.java @@ -0,0 +1,21 @@ +package org.omg.CORBA_2_5; + +public abstract class ORB extends org.omg.CORBA_2_3.ORB +{ + public String id() + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object object) + throws org.omg.CORBA.ORBPackage.InvalidName + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } + + public org.omg.CORBA.TypeCode create_local_interface_tc(String id, String name) + { + throw new org.omg.CORBA.NO_IMPLEMENT() ; + } +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/all-wcprops b/idl/orb/extra/org/omg/PortableServer/.svn/all-wcprops new file mode 100644 index 0000000..6836da3 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer +END +ServantHelper.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantHelper.java +END +ServantLocatorLocalTie.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorLocalTie.java +END +DynamicImplementation.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/DynamicImplementation.java +END +Servant.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/Servant.java +END +ServantLocatorOperations.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorOperations.java +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/entries b/idl/orb/extra/org/omg/PortableServer/.svn/entries new file mode 100644 index 0000000..8bd50a8 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/entries @@ -0,0 +1,204 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Servant.java +file + + + + +2009-02-16T09:48:55.000000Z +65b267ed412c4a11d3a0097e24293cf2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2192 + +ServantHelper.java +file + + + + +2009-02-16T09:48:55.000000Z +bbcedf7bab9330ed372c1fccdd3aeda8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +982 + +ServantLocatorPackage +dir + +ServantLocatorLocalTie.java +file + + + + +2009-02-16T09:48:55.000000Z +e89abe899dc7a5d7817870ea3771a640 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1115 + +portable +dir + +DynamicImplementation.java +file + + + + +2009-02-16T09:48:55.000000Z +f3c61d7d8d8b3d3a3d2eeee19d0ca5ee +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +359 + +ServantLocatorOperations.java +file + + + + +2009-02-16T09:48:55.000000Z +c58b83542a8e1fd16545280d6d19bbeb +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +843 + diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/DynamicImplementation.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/DynamicImplementation.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/DynamicImplementation.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/Servant.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/Servant.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/Servant.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantHelper.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantHelper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantHelper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorLocalTie.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorLocalTie.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorLocalTie.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorOperations.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorOperations.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/prop-base/ServantLocatorOperations.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/text-base/DynamicImplementation.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/DynamicImplementation.java.svn-base new file mode 100644 index 0000000..cc880fb --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/DynamicImplementation.java.svn-base @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +abstract public class DynamicImplementation extends Servant { + + abstract public void invoke(org.omg.CORBA.ServerRequest request); +} diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/text-base/Servant.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/Servant.java.svn-base new file mode 100644 index 0000000..ce71353 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/Servant.java.svn-base @@ -0,0 +1,76 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +abstract public class Servant { + + final public org.omg.CORBA.Object _this_object() { + return _get_delegate().this_object(this); + } + + final public org.omg.CORBA.Object _this_object(org.omg.CORBA.ORB orb) { + try { + ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this); + } + catch (ClassCastException e) { + throw new org.omg.CORBA.BAD_PARAM( + "POA Servant requires an instanceof org.omg.CORBA_2_3.ORB"); + } + return _this_object(); + } + + final public org.omg.CORBA.ORB _orb() { + return _get_delegate().orb(this); + } + + final public POA _poa() { + return _get_delegate().poa(this); + } + + final public byte[] _object_id() { + return _get_delegate().object_id(this); + } + + final public POA _default_POA() { + return _get_delegate().default_POA(this); + } + + final public boolean _is_a(String repository_id) { + return _get_delegate().is_a(this, repository_id); + } + + final public boolean _non_existent() { + return _get_delegate().non_existent(this); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + final public org.omg.CORBA.InterfaceDef _get_interface() { + return _get_delegate().get_interface(this); + } + + final public org.omg.CORBA.Object _get_interface_def() { + return _get_delegate().get_interface_def(this); + } + + abstract public String[] _all_interfaces(POA poa, byte[] objectID); + + private transient org.omg.PortableServer.portable.Delegate _delegate =null; + + final public org.omg.PortableServer.portable.Delegate _get_delegate() { + if (_delegate == null) { + throw new org.omg.CORBA.BAD_INV_ORDER( + "The Servant has not been associated with an ORBinstance"); + } + return _delegate; + } + + final public void _set_delegate( + org.omg.PortableServer.portable.Delegate delegate) { + _delegate = delegate; + } +} diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantHelper.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantHelper.java.svn-base new file mode 100644 index 0000000..63d508f --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantHelper.java.svn-base @@ -0,0 +1,47 @@ +package org.omg.PortableServer; + +public class ServantHelper +{ + + public static void insert( org.omg.CORBA.Any a, org.omg.PortableServer.Servant t ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + public static org.omg.PortableServer.Servant extract( org.omg.CORBA.Any a ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + private static org.omg.CORBA.TypeCode _tc = null; + + + public static org.omg.CORBA.TypeCode type() + { + if ( _tc != null ) + return _tc; + else + { + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); + _tc = orb.create_native_tc(id(),"Servant"); + return _tc; + } + } + + public static String id() + { + return new String("IDL:omg.org/PortableServer/Servant:1.0"); + } + + public static org.omg.PortableServer.Servant read( org.omg.CORBA.portable.InputStream istream ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + + public static void write( org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableServer.Servant value ) + { + throw new org.omg.CORBA.MARSHAL(); + } + +} diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorLocalTie.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorLocalTie.java.svn-base new file mode 100644 index 0000000..b56c022 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorLocalTie.java.svn-base @@ -0,0 +1,45 @@ +// +// ServantLocatorLocalTie.java (tie) +// +// File generated: Mon May 03 12:56:49 CEST 2004 +// by TIDorbJ idl2Java 1.0.3 +// + +package org.omg.PortableServer; + +public class ServantLocatorLocalTie + extends ServantLocatorLocalBase + { + + private ServantLocatorOperations _delegate; + public ServantLocatorLocalTie(ServantLocatorOperations delegate) { + this._delegate = delegate; + }; + + public ServantLocatorOperations _delegate() { + return this._delegate; + }; + + public org.omg.PortableServer.Servant preinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder the_cookie) + throws org.omg.PortableServer.ForwardRequest { + return this._delegate.preinvoke( + oid, + adapter, + operation, + the_cookie + ); + }; + + public void postinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, java.lang.Object the_cookie, org.omg.PortableServer.Servant the_servant) { + this._delegate.postinvoke( + oid, + adapter, + operation, + the_cookie, + the_servant + ); + }; + + + +} diff --git a/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorOperations.java.svn-base b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorOperations.java.svn-base new file mode 100644 index 0000000..a06bbe1 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/.svn/text-base/ServantLocatorOperations.java.svn-base @@ -0,0 +1,22 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +public interface ServantLocatorOperations extends + org.omg.PortableServer.ServantManagerOperations { + + public org.omg.PortableServer.Servant preinvoke(byte[] oid, + org.omg.PortableServer.POA adapter, + java.lang.String operation, + org.omg.PortableServer.ServantLocatorPackage.CookieHolder + the_cookie) throws org.omg.PortableServer.ForwardRequest; + + public void postinvoke(byte[] oid, + org.omg.PortableServer.POA adapter, + java.lang.String operation, + java.lang.Object the_cookie, + org.omg.PortableServer.Servant the_servant); +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/PortableServer/DynamicImplementation.java b/idl/orb/extra/org/omg/PortableServer/DynamicImplementation.java new file mode 100644 index 0000000..cc880fb --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/DynamicImplementation.java @@ -0,0 +1,11 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +abstract public class DynamicImplementation extends Servant { + + abstract public void invoke(org.omg.CORBA.ServerRequest request); +} diff --git a/idl/orb/extra/org/omg/PortableServer/Servant.java b/idl/orb/extra/org/omg/PortableServer/Servant.java new file mode 100644 index 0000000..ce71353 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/Servant.java @@ -0,0 +1,76 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +abstract public class Servant { + + final public org.omg.CORBA.Object _this_object() { + return _get_delegate().this_object(this); + } + + final public org.omg.CORBA.Object _this_object(org.omg.CORBA.ORB orb) { + try { + ((org.omg.CORBA_2_3.ORB)orb).set_delegate(this); + } + catch (ClassCastException e) { + throw new org.omg.CORBA.BAD_PARAM( + "POA Servant requires an instanceof org.omg.CORBA_2_3.ORB"); + } + return _this_object(); + } + + final public org.omg.CORBA.ORB _orb() { + return _get_delegate().orb(this); + } + + final public POA _poa() { + return _get_delegate().poa(this); + } + + final public byte[] _object_id() { + return _get_delegate().object_id(this); + } + + final public POA _default_POA() { + return _get_delegate().default_POA(this); + } + + final public boolean _is_a(String repository_id) { + return _get_delegate().is_a(this, repository_id); + } + + final public boolean _non_existent() { + return _get_delegate().non_existent(this); + } + + /** + * @deprecated Deprecated by CORBA 2.4 + */ + final public org.omg.CORBA.InterfaceDef _get_interface() { + return _get_delegate().get_interface(this); + } + + final public org.omg.CORBA.Object _get_interface_def() { + return _get_delegate().get_interface_def(this); + } + + abstract public String[] _all_interfaces(POA poa, byte[] objectID); + + private transient org.omg.PortableServer.portable.Delegate _delegate =null; + + final public org.omg.PortableServer.portable.Delegate _get_delegate() { + if (_delegate == null) { + throw new org.omg.CORBA.BAD_INV_ORDER( + "The Servant has not been associated with an ORBinstance"); + } + return _delegate; + } + + final public void _set_delegate( + org.omg.PortableServer.portable.Delegate delegate) { + _delegate = delegate; + } +} diff --git a/idl/orb/extra/org/omg/PortableServer/ServantHelper.java b/idl/orb/extra/org/omg/PortableServer/ServantHelper.java new file mode 100644 index 0000000..63d508f --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantHelper.java @@ -0,0 +1,47 @@ +package org.omg.PortableServer; + +public class ServantHelper +{ + + public static void insert( org.omg.CORBA.Any a, org.omg.PortableServer.Servant t ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + public static org.omg.PortableServer.Servant extract( org.omg.CORBA.Any a ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + private static org.omg.CORBA.TypeCode _tc = null; + + + public static org.omg.CORBA.TypeCode type() + { + if ( _tc != null ) + return _tc; + else + { + org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); + _tc = orb.create_native_tc(id(),"Servant"); + return _tc; + } + } + + public static String id() + { + return new String("IDL:omg.org/PortableServer/Servant:1.0"); + } + + public static org.omg.PortableServer.Servant read( org.omg.CORBA.portable.InputStream istream ) + { + throw new org.omg.CORBA.MARSHAL(); + } + + + public static void write( org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableServer.Servant value ) + { + throw new org.omg.CORBA.MARSHAL(); + } + +} diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorLocalTie.java b/idl/orb/extra/org/omg/PortableServer/ServantLocatorLocalTie.java new file mode 100644 index 0000000..b56c022 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorLocalTie.java @@ -0,0 +1,45 @@ +// +// ServantLocatorLocalTie.java (tie) +// +// File generated: Mon May 03 12:56:49 CEST 2004 +// by TIDorbJ idl2Java 1.0.3 +// + +package org.omg.PortableServer; + +public class ServantLocatorLocalTie + extends ServantLocatorLocalBase + { + + private ServantLocatorOperations _delegate; + public ServantLocatorLocalTie(ServantLocatorOperations delegate) { + this._delegate = delegate; + }; + + public ServantLocatorOperations _delegate() { + return this._delegate; + }; + + public org.omg.PortableServer.Servant preinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder the_cookie) + throws org.omg.PortableServer.ForwardRequest { + return this._delegate.preinvoke( + oid, + adapter, + operation, + the_cookie + ); + }; + + public void postinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, java.lang.Object the_cookie, org.omg.PortableServer.Servant the_servant) { + this._delegate.postinvoke( + oid, + adapter, + operation, + the_cookie, + the_servant + ); + }; + + + +} diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorOperations.java b/idl/orb/extra/org/omg/PortableServer/ServantLocatorOperations.java new file mode 100644 index 0000000..a06bbe1 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorOperations.java @@ -0,0 +1,22 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer; + +public interface ServantLocatorOperations extends + org.omg.PortableServer.ServantManagerOperations { + + public org.omg.PortableServer.Servant preinvoke(byte[] oid, + org.omg.PortableServer.POA adapter, + java.lang.String operation, + org.omg.PortableServer.ServantLocatorPackage.CookieHolder + the_cookie) throws org.omg.PortableServer.ForwardRequest; + + public void postinvoke(byte[] oid, + org.omg.PortableServer.POA adapter, + java.lang.String operation, + java.lang.Object the_cookie, + org.omg.PortableServer.Servant the_servant); +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/all-wcprops b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/all-wcprops new file mode 100644 index 0000000..0ca1887 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/all-wcprops @@ -0,0 +1,17 @@ +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage +END +CookieHolder.java +K 25 +svn:wc:ra_dav:version-url +V 124 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java +END +CookieHelper.java +K 25 +svn:wc:ra_dav:version-url +V 124 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.java +END diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/entries b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/entries new file mode 100644 index 0000000..f63fa94 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/entries @@ -0,0 +1,96 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +CookieHolder.java +file + + + + +2009-02-16T09:48:54.000000Z +f72fa9c70425e8bae73882105664f99b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +807 + +CookieHelper.java +file + + + + +2009-02-16T09:48:54.000000Z +8bfaf4d1c608d4ae12051bd69962e9e0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +996 + diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHelper.java.svn-base b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHelper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHelper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHolder.java.svn-base b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/prop-base/CookieHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHelper.java.svn-base b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHelper.java.svn-base new file mode 100644 index 0000000..76ca88b --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHelper.java.svn-base @@ -0,0 +1,43 @@ +package org.omg.PortableServer.ServantLocatorPackage; + +public final class CookieHelper { + + public static void insert(org.omg.CORBA.Any any, java.lang.Object _value) + { + throw new org.omg.CORBA.MARSHAL(); + } + + public static java.lang.Object extract(org.omg.CORBA.Any any) + { + throw new org.omg.CORBA.MARSHAL(); + } + + private static org.omg.CORBA.TypeCode _tc = null; + + public static org.omg.CORBA.TypeCode type() + { + if ( _tc != null ) + return _tc; + else + { + _tc = org.omg.CORBA.ORB.init().create_native_tc(id(),"Cookie"); + return _tc; + } + } + + public static String id() + { + return new String("IDL:omg.org/PortableServer/ServantLocator/Cookie:1.0"); + } + + public static java.lang.Object read( + org.omg.CORBA.portable.InputStream _input) { + throw new org.omg.CORBA.MARSHAL(); + } + + public static void write (org.omg.CORBA.portable.OutputStream _output, + java.lang.Object _value) { + throw new org.omg.CORBA.MARSHAL(); + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHolder.java.svn-base b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHolder.java.svn-base new file mode 100644 index 0000000..ba00aec --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/.svn/text-base/CookieHolder.java.svn-base @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer.ServantLocatorPackage; + +final public class CookieHolder implements org.omg.CORBA.portable.Streamable { + + public java.lang.Object value; + + public CookieHolder() { + } + + public CookieHolder(java.lang.Object intial) { + this.value = intial; + } + + public void _read(org.omg.CORBA.portable.InputStream input) { + value = CookieHelper.read(input); + } + + public void _write(org.omg.CORBA.portable.OutputStream output) { + CookieHelper.write(output, value); + } + + public org.omg.CORBA.TypeCode _type() { + return CookieHelper.type(); + } + +} diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.java b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.java new file mode 100644 index 0000000..76ca88b --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHelper.java @@ -0,0 +1,43 @@ +package org.omg.PortableServer.ServantLocatorPackage; + +public final class CookieHelper { + + public static void insert(org.omg.CORBA.Any any, java.lang.Object _value) + { + throw new org.omg.CORBA.MARSHAL(); + } + + public static java.lang.Object extract(org.omg.CORBA.Any any) + { + throw new org.omg.CORBA.MARSHAL(); + } + + private static org.omg.CORBA.TypeCode _tc = null; + + public static org.omg.CORBA.TypeCode type() + { + if ( _tc != null ) + return _tc; + else + { + _tc = org.omg.CORBA.ORB.init().create_native_tc(id(),"Cookie"); + return _tc; + } + } + + public static String id() + { + return new String("IDL:omg.org/PortableServer/ServantLocator/Cookie:1.0"); + } + + public static java.lang.Object read( + org.omg.CORBA.portable.InputStream _input) { + throw new org.omg.CORBA.MARSHAL(); + } + + public static void write (org.omg.CORBA.portable.OutputStream _output, + java.lang.Object _value) { + throw new org.omg.CORBA.MARSHAL(); + } + +} \ No newline at end of file diff --git a/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java new file mode 100644 index 0000000..ba00aec --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/ServantLocatorPackage/CookieHolder.java @@ -0,0 +1,31 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer.ServantLocatorPackage; + +final public class CookieHolder implements org.omg.CORBA.portable.Streamable { + + public java.lang.Object value; + + public CookieHolder() { + } + + public CookieHolder(java.lang.Object intial) { + this.value = intial; + } + + public void _read(org.omg.CORBA.portable.InputStream input) { + value = CookieHelper.read(input); + } + + public void _write(org.omg.CORBA.portable.OutputStream output) { + CookieHelper.write(output, value); + } + + public org.omg.CORBA.TypeCode _type() { + return CookieHelper.type(); + } + +} diff --git a/idl/orb/extra/org/omg/PortableServer/portable/.svn/all-wcprops b/idl/orb/extra/org/omg/PortableServer/portable/.svn/all-wcprops new file mode 100644 index 0000000..1b5d6d8 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/portable/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/portable +END +Delegate.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/portable/Delegate.java +END diff --git a/idl/orb/extra/org/omg/PortableServer/portable/.svn/entries b/idl/orb/extra/org/omg/PortableServer/portable/.svn/entries new file mode 100644 index 0000000..f22b108 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/portable/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/idl/orb/extra/org/omg/PortableServer/portable +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Delegate.java +file + + + + +2009-02-16T09:48:55.000000Z +a84d0768159aa68113866db2479f9233 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1014 + diff --git a/idl/orb/extra/org/omg/PortableServer/portable/.svn/prop-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/PortableServer/portable/.svn/prop-base/Delegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/portable/.svn/prop-base/Delegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/idl/orb/extra/org/omg/PortableServer/portable/.svn/text-base/Delegate.java.svn-base b/idl/orb/extra/org/omg/PortableServer/portable/.svn/text-base/Delegate.java.svn-base new file mode 100644 index 0000000..b3c376d --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/portable/.svn/text-base/Delegate.java.svn-base @@ -0,0 +1,24 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer.portable; + +public interface Delegate { + + org.omg.CORBA.ORB orb(org.omg.PortableServer.Servant self); + org.omg.CORBA.Object this_object(org.omg.PortableServer.Servant self); + org.omg.PortableServer.POA poa(org.omg.PortableServer.Servant self); + byte[] object_id(org.omg.PortableServer.Servant self); + org.omg.PortableServer.POA default_POA( + org.omg.PortableServer.Servant self); + boolean is_a(org.omg.PortableServer.Servant self, + java.lang.String repository_id); + boolean non_existent(org.omg.PortableServer.Servant self); + org.omg.CORBA.InterfaceDef get_interface( + org.omg.PortableServer.Servant self); + org.omg.CORBA.Object get_interface_def( + org.omg.PortableServer.Servant self); + +} diff --git a/idl/orb/extra/org/omg/PortableServer/portable/Delegate.java b/idl/orb/extra/org/omg/PortableServer/portable/Delegate.java new file mode 100644 index 0000000..b3c376d --- /dev/null +++ b/idl/orb/extra/org/omg/PortableServer/portable/Delegate.java @@ -0,0 +1,24 @@ +/***** Copyright (c) 1999 Object Management Group. Unlimited rights to + duplicate and use this code are hereby granted provided that this + copyright notice is included. +*****/ + +package org.omg.PortableServer.portable; + +public interface Delegate { + + org.omg.CORBA.ORB orb(org.omg.PortableServer.Servant self); + org.omg.CORBA.Object this_object(org.omg.PortableServer.Servant self); + org.omg.PortableServer.POA poa(org.omg.PortableServer.Servant self); + byte[] object_id(org.omg.PortableServer.Servant self); + org.omg.PortableServer.POA default_POA( + org.omg.PortableServer.Servant self); + boolean is_a(org.omg.PortableServer.Servant self, + java.lang.String repository_id); + boolean non_existent(org.omg.PortableServer.Servant self); + org.omg.CORBA.InterfaceDef get_interface( + org.omg.PortableServer.Servant self); + org.omg.CORBA.Object get_interface_def( + org.omg.PortableServer.Servant self); + +} diff --git a/idl/properties.xml b/idl/properties.xml new file mode 100644 index 0000000..794195c --- /dev/null +++ b/idl/properties.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/CompressionIdl.jar b/lib/CompressionIdl.jar new file mode 100644 index 0000000..c198839 Binary files /dev/null and b/lib/CompressionIdl.jar differ diff --git a/lib/SecurityIdl.jar b/lib/SecurityIdl.jar new file mode 100644 index 0000000..917ff8f Binary files /dev/null and b/lib/SecurityIdl.jar differ diff --git a/lib/SendingContextIdl.jar b/lib/SendingContextIdl.jar new file mode 100644 index 0000000..a508aea Binary files /dev/null and b/lib/SendingContextIdl.jar differ diff --git a/lib/bidirpolicyIdl.jar b/lib/bidirpolicyIdl.jar new file mode 100644 index 0000000..63f86f5 Binary files /dev/null and b/lib/bidirpolicyIdl.jar differ diff --git a/lib/commIdl.jar b/lib/commIdl.jar new file mode 100644 index 0000000..fa17503 Binary files /dev/null and b/lib/commIdl.jar differ diff --git a/lib/core.jar b/lib/core.jar new file mode 100644 index 0000000..ee03544 Binary files /dev/null and b/lib/core.jar differ diff --git a/lib/dynAnyIdl.jar b/lib/dynAnyIdl.jar new file mode 100644 index 0000000..5c94777 Binary files /dev/null and b/lib/dynAnyIdl.jar differ diff --git a/lib/messagingIdl.jar b/lib/messagingIdl.jar new file mode 100644 index 0000000..9c15fe8 Binary files /dev/null and b/lib/messagingIdl.jar differ diff --git a/lib/namingIdl.jar b/lib/namingIdl.jar new file mode 100644 index 0000000..e6e5812 Binary files /dev/null and b/lib/namingIdl.jar differ diff --git a/lib/orbIdl.jar b/lib/orbIdl.jar new file mode 100644 index 0000000..b0388d7 Binary files /dev/null and b/lib/orbIdl.jar differ diff --git a/lib/tidorbj.jar b/lib/tidorbj.jar new file mode 100644 index 0000000..fcc9d48 Binary files /dev/null and b/lib/tidorbj.jar differ diff --git a/lib/timebaseIdl.jar b/lib/timebaseIdl.jar new file mode 100644 index 0000000..e85f361 Binary files /dev/null and b/lib/timebaseIdl.jar differ diff --git a/lib/tools.jar b/lib/tools.jar new file mode 100644 index 0000000..14ae5ef Binary files /dev/null and b/lib/tools.jar differ diff --git a/lib/util.jar b/lib/util.jar new file mode 100644 index 0000000..ddd37ef Binary files /dev/null and b/lib/util.jar differ diff --git a/properties.xml b/properties.xml new file mode 100644 index 0000000..f7d4ac2 --- /dev/null +++ b/properties.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/source/.class/es/tid/PortableServer/POAManager.class b/source/.class/es/tid/PortableServer/POAManager.class new file mode 100644 index 0000000..92359ad Binary files /dev/null and b/source/.class/es/tid/PortableServer/POAManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/AnyImpl.class b/source/.class/es/tid/TIDorbj/core/AnyImpl.class new file mode 100644 index 0000000..280daee Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/AnyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/BidirectionalPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/BidirectionalPolicyImpl.class new file mode 100644 index 0000000..ffde8f7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/BidirectionalPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/CodecFactoryImpl.class b/source/.class/es/tid/TIDorbj/core/CodecFactoryImpl.class new file mode 100644 index 0000000..127213c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/CodecFactoryImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/CodecImpl.class b/source/.class/es/tid/TIDorbj/core/CodecImpl.class new file mode 100644 index 0000000..ec00487 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/CodecImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ConfORB.class b/source/.class/es/tid/TIDorbj/core/ConfORB.class new file mode 100644 index 0000000..29533af Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ConfORB.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ContextImpl.class b/source/.class/es/tid/TIDorbj/core/ContextImpl.class new file mode 100644 index 0000000..f5ef9a7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ContextImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ContextListImpl.class b/source/.class/es/tid/TIDorbj/core/ContextListImpl.class new file mode 100644 index 0000000..1a0edb6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ContextListImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/EnvironmentImpl.class b/source/.class/es/tid/TIDorbj/core/EnvironmentImpl.class new file mode 100644 index 0000000..f518231 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/EnvironmentImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ExceptionListImpl.class b/source/.class/es/tid/TIDorbj/core/ExceptionListImpl.class new file mode 100644 index 0000000..f0e22f6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ExceptionListImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ForwardRequest.class b/source/.class/es/tid/TIDorbj/core/ForwardRequest.class new file mode 100644 index 0000000..ae6105f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ForwardRequest.class differ diff --git a/source/.class/es/tid/TIDorbj/core/NVListImpl.class b/source/.class/es/tid/TIDorbj/core/NVListImpl.class new file mode 100644 index 0000000..a6a9a09 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/NVListImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/NamedValueImpl.class b/source/.class/es/tid/TIDorbj/core/NamedValueImpl.class new file mode 100644 index 0000000..a38d20c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/NamedValueImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ORBComponent.class b/source/.class/es/tid/TIDorbj/core/ORBComponent.class new file mode 100644 index 0000000..d8c694c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ORBComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ORBServices.class b/source/.class/es/tid/TIDorbj/core/ORBServices.class new file mode 100644 index 0000000..68a2441 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ORBServices.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ObjectImpl.class b/source/.class/es/tid/TIDorbj/core/ObjectImpl.class new file mode 100644 index 0000000..08dbde6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ObjectImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ObjectKey.class b/source/.class/es/tid/TIDorbj/core/ObjectKey.class new file mode 100644 index 0000000..3a64fb8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ObjectKey.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ProcessingState.class b/source/.class/es/tid/TIDorbj/core/ProcessingState.class new file mode 100644 index 0000000..65fc62e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ProcessingState.class differ diff --git a/source/.class/es/tid/TIDorbj/core/PseudoObject.class b/source/.class/es/tid/TIDorbj/core/PseudoObject.class new file mode 100644 index 0000000..494ab5f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/PseudoObject.class differ diff --git a/source/.class/es/tid/TIDorbj/core/RequestCounter.class b/source/.class/es/tid/TIDorbj/core/RequestCounter.class new file mode 100644 index 0000000..884d99c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/RequestCounter.class differ diff --git a/source/.class/es/tid/TIDorbj/core/RequestImpl.class b/source/.class/es/tid/TIDorbj/core/RequestImpl.class new file mode 100644 index 0000000..b05fc34 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/RequestImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ServerRequestImpl.class b/source/.class/es/tid/TIDorbj/core/ServerRequestImpl.class new file mode 100644 index 0000000..f6cfaa8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ServerRequestImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ShutdownThread.class b/source/.class/es/tid/TIDorbj/core/ShutdownThread.class new file mode 100644 index 0000000..32a53e8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ShutdownThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/SingletonORB.class b/source/.class/es/tid/TIDorbj/core/SingletonORB.class new file mode 100644 index 0000000..1fcdeb2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/SingletonORB.class differ diff --git a/source/.class/es/tid/TIDorbj/core/StreamRequestImpl.class b/source/.class/es/tid/TIDorbj/core/StreamRequestImpl.class new file mode 100644 index 0000000..9f925c9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/StreamRequestImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/TIDORB.class b/source/.class/es/tid/TIDorbj/core/TIDORB.class new file mode 100644 index 0000000..d3ad7b6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/TIDORB.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/AbsolutePosition.class b/source/.class/es/tid/TIDorbj/core/cdr/AbsolutePosition.class new file mode 100644 index 0000000..a1e1921 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/AbsolutePosition.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/AlignmentOffset.class b/source/.class/es/tid/TIDorbj/core/cdr/AlignmentOffset.class new file mode 100644 index 0000000..014758f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/AlignmentOffset.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/BufferCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/BufferCDR.class new file mode 100644 index 0000000..d12fb1e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/BufferCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/CDR.class b/source/.class/es/tid/TIDorbj/core/cdr/CDR.class new file mode 100644 index 0000000..bd4a035 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/CDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/CDRInputStream.class b/source/.class/es/tid/TIDorbj/core/cdr/CDRInputStream.class new file mode 100644 index 0000000..89b9bc4 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/CDRInputStream.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/CDROutputStream.class b/source/.class/es/tid/TIDorbj/core/cdr/CDROutputStream.class new file mode 100644 index 0000000..a650dcb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/CDROutputStream.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/ChunkCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/ChunkCDR.class new file mode 100644 index 0000000..00e83a8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/ChunkCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/ContextCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/ContextCDR.class new file mode 100644 index 0000000..4cefd04 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/ContextCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/Encapsulation.class b/source/.class/es/tid/TIDorbj/core/cdr/Encapsulation.class new file mode 100644 index 0000000..4a3920d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/Encapsulation.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/IndirectionNode.class b/source/.class/es/tid/TIDorbj/core/cdr/IndirectionNode.class new file mode 100644 index 0000000..a7d3182 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/IndirectionNode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/IteratorCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/IteratorCDR.class new file mode 100644 index 0000000..8dfcaaf Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/IteratorCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/MarkCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/MarkCDR.class new file mode 100644 index 0000000..ba41e58 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/MarkCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/PointerCDR.class b/source/.class/es/tid/TIDorbj/core/cdr/PointerCDR.class new file mode 100644 index 0000000..0680ef9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/PointerCDR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/PositionsNode.class b/source/.class/es/tid/TIDorbj/core/cdr/PositionsNode.class new file mode 100644 index 0000000..2d576d7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/PositionsNode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/TypeCodeReader.class b/source/.class/es/tid/TIDorbj/core/cdr/TypeCodeReader.class new file mode 100644 index 0000000..9c14f68 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/TypeCodeReader.class differ diff --git a/source/.class/es/tid/TIDorbj/core/cdr/ValueTypeInfo.class b/source/.class/es/tid/TIDorbj/core/cdr/ValueTypeInfo.class new file mode 100644 index 0000000..cf83250 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/cdr/ValueTypeInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/CommunicationDelegate.class b/source/.class/es/tid/TIDorbj/core/comm/CommunicationDelegate.class new file mode 100644 index 0000000..fa4ebdb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/CommunicationDelegate.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/CommunicationException.class b/source/.class/es/tid/TIDorbj/core/comm/CommunicationException.class new file mode 100644 index 0000000..1658c71 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/CommunicationException.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/CommunicationLayer.class b/source/.class/es/tid/TIDorbj/core/comm/CommunicationLayer.class new file mode 100644 index 0000000..2698dd7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/CommunicationLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/CommunicationManager.class b/source/.class/es/tid/TIDorbj/core/comm/CommunicationManager.class new file mode 100644 index 0000000..918f24c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/CommunicationManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/Connection.class b/source/.class/es/tid/TIDorbj/core/comm/Connection.class new file mode 100644 index 0000000..62c8ddb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/Connection.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ForwardRequest.class b/source/.class/es/tid/TIDorbj/core/comm/ForwardRequest.class new file mode 100644 index 0000000..6b07a79 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ForwardRequest.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/LayerInfo.class b/source/.class/es/tid/TIDorbj/core/comm/LayerInfo.class new file mode 100644 index 0000000..7cd3662 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/LayerInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/LocateResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/LocateResponseHandler.class new file mode 100644 index 0000000..4dc2d3f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/LocateResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/PropertyInfo.class b/source/.class/es/tid/TIDorbj/core/comm/PropertyInfo.class new file mode 100644 index 0000000..ad1666b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/PropertyInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/RequestDispatcher.class b/source/.class/es/tid/TIDorbj/core/comm/RequestDispatcher.class new file mode 100644 index 0000000..543f2ab Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/RequestDispatcher.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/ResponseHandler.class new file mode 100644 index 0000000..8f1c214 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.class b/source/.class/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.class new file mode 100644 index 0000000..93a374f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.class b/source/.class/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.class new file mode 100644 index 0000000..302b5c1 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.class new file mode 100644 index 0000000..679f00f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.class new file mode 100644 index 0000000..4fcdfa3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.class new file mode 100644 index 0000000..8c7b256 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPHeader.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPHeader.class new file mode 100644 index 0000000..df38e45 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPHeader.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.class new file mode 100644 index 0000000..04dcee7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.class new file mode 100644 index 0000000..78d12ca Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPMessage.class new file mode 100644 index 0000000..6995d42 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.class new file mode 100644 index 0000000..b2ba1be Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.class new file mode 100644 index 0000000..1d7a6fa Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPVersion.class b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPVersion.class new file mode 100644 index 0000000..ac86ae9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/GIOPVersion.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.class b/source/.class/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.class new file mode 100644 index 0000000..f46f332 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.class b/source/.class/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.class new file mode 100644 index 0000000..5f9e186 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/MessageFactory.class b/source/.class/es/tid/TIDorbj/core/comm/giop/MessageFactory.class new file mode 100644 index 0000000..25ca669 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/MessageFactory.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/MsgType.class b/source/.class/es/tid/TIDorbj/core/comm/giop/MsgType.class new file mode 100644 index 0000000..e156446 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/MsgType.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.class new file mode 100644 index 0000000..f17cabe Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/RequestId.class b/source/.class/es/tid/TIDorbj/core/comm/giop/RequestId.class new file mode 100644 index 0000000..e64ea6c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/RequestId.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContext.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContext.class new file mode 100644 index 0000000..ead0ed3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContext.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextList.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextList.class new file mode 100644 index 0000000..ef59a6f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextList.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.class new file mode 100644 index 0000000..ea5daab Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceId.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceId.class new file mode 100644 index 0000000..02ea8f3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ServiceId.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.class b/source/.class/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.class new file mode 100644 index 0000000..afab6e7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/CommLayer.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/CommLayer.class new file mode 100644 index 0000000..6215596 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/CommLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.class new file mode 100644 index 0000000..e75eb22 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionState.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionState.class new file mode 100644 index 0000000..10e1776 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionState.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.class new file mode 100644 index 0000000..31bac4d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.class new file mode 100644 index 0000000..8cea10a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.class new file mode 100644 index 0000000..abbcb33 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.class new file mode 100644 index 0000000..39f54ca Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.class new file mode 100644 index 0000000..19b9245 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.class new file mode 100644 index 0000000..14974a2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.class new file mode 100644 index 0000000..49914f5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.class new file mode 100644 index 0000000..64b05f1 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.class new file mode 100644 index 0000000..a12b167 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.class new file mode 100644 index 0000000..6adc9f3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.class new file mode 100644 index 0000000..44c397e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.class new file mode 100644 index 0000000..c064265 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.class new file mode 100644 index 0000000..44670f7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.class new file mode 100644 index 0000000..f6b0bc2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.class new file mode 100644 index 0000000..2fc65a8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ListenPoint.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ListenPoint.class new file mode 100644 index 0000000..79c6722 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ListenPoint.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/Lock.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/Lock.class new file mode 100644 index 0000000..965135e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/Lock.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.class new file mode 100644 index 0000000..2847482 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/LockList.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/LockList.class new file mode 100644 index 0000000..2aa0617 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/LockList.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/OpeningLock.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/OpeningLock.class new file mode 100644 index 0000000..647a443 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/OpeningLock.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.class new file mode 100644 index 0000000..fc35a73 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.class new file mode 100644 index 0000000..101f755 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/ServerListener.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/ServerListener.class new file mode 100644 index 0000000..6fc048b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/ServerListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/TargetAddress.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/TargetAddress.class new file mode 100644 index 0000000..c67cac2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/TargetAddress.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.class b/source/.class/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.class new file mode 100644 index 0000000..fe43806 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.class new file mode 100644 index 0000000..24d3852 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/local/LocalCommLayer.class b/source/.class/es/tid/TIDorbj/core/comm/local/LocalCommLayer.class new file mode 100644 index 0000000..77e614e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/local/LocalCommLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.class new file mode 100644 index 0000000..91b0ea2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.class new file mode 100644 index 0000000..fa478bb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/local/LocalServerRequest.class b/source/.class/es/tid/TIDorbj/core/comm/local/LocalServerRequest.class new file mode 100644 index 0000000..20b90e2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/local/LocalServerRequest.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.class new file mode 100644 index 0000000..c78b6a0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.class new file mode 100644 index 0000000..5dc591a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.class new file mode 100644 index 0000000..aedeafe Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.class new file mode 100644 index 0000000..cdfa40b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.class new file mode 100644 index 0000000..f8e92db Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.class new file mode 100644 index 0000000..67d8cef Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.class new file mode 100644 index 0000000..540b707 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.class new file mode 100644 index 0000000..7ece875 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.class new file mode 100644 index 0000000..edd18f5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.class b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.class new file mode 100644 index 0000000..a8a9a0e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/compression/CompressionManagerImpl.class b/source/.class/es/tid/TIDorbj/core/compression/CompressionManagerImpl.class new file mode 100644 index 0000000..2d64ed9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/compression/CompressionManagerImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.class b/source/.class/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.class new file mode 100644 index 0000000..8cb4735 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/compression/CompressorImpl.class b/source/.class/es/tid/TIDorbj/core/compression/CompressorImpl.class new file mode 100644 index 0000000..2be0d77 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/compression/CompressorImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.class b/source/.class/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.class new file mode 100644 index 0000000..43445a8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/CSIComponent.class b/source/.class/es/tid/TIDorbj/core/iop/CSIComponent.class new file mode 100644 index 0000000..7a6b9e5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/CSIComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/DefaultIOR.class b/source/.class/es/tid/TIDorbj/core/iop/DefaultIOR.class new file mode 100644 index 0000000..334ec58 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/DefaultIOR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/IOR$1.class b/source/.class/es/tid/TIDorbj/core/iop/IOR$1.class new file mode 100644 index 0000000..c5305eb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/IOR$1.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/IOR.class b/source/.class/es/tid/TIDorbj/core/iop/IOR.class new file mode 100644 index 0000000..6f858bb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/IOR.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/ORBComponent.class b/source/.class/es/tid/TIDorbj/core/iop/ORBComponent.class new file mode 100644 index 0000000..bc49c05 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/ORBComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.class b/source/.class/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.class new file mode 100644 index 0000000..1615a87 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/SSLComponent.class b/source/.class/es/tid/TIDorbj/core/iop/SSLComponent.class new file mode 100644 index 0000000..7254d4a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/SSLComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/TaggedComponent.class b/source/.class/es/tid/TIDorbj/core/iop/TaggedComponent.class new file mode 100644 index 0000000..e702977 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/TaggedComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/TaggedComponentReader.class b/source/.class/es/tid/TIDorbj/core/iop/TaggedComponentReader.class new file mode 100644 index 0000000..436834f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/TaggedComponentReader.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/TaggedProfile.class b/source/.class/es/tid/TIDorbj/core/iop/TaggedProfile.class new file mode 100644 index 0000000..f20f3d5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/TaggedProfile.class differ diff --git a/source/.class/es/tid/TIDorbj/core/iop/TaggedProfileReader.class b/source/.class/es/tid/TIDorbj/core/iop/TaggedProfileReader.class new file mode 100644 index 0000000..a6923e0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/iop/TaggedProfileReader.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMILock.class b/source/.class/es/tid/TIDorbj/core/messaging/AMILock.class new file mode 100644 index 0000000..f3d23c5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMILock.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMILockEnumeration.class b/source/.class/es/tid/TIDorbj/core/messaging/AMILockEnumeration.class new file mode 100644 index 0000000..bcbb2e1 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMILockEnumeration.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMILockList.class b/source/.class/es/tid/TIDorbj/core/messaging/AMILockList.class new file mode 100644 index 0000000..d8ba003 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMILockList.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMIManager.class b/source/.class/es/tid/TIDorbj/core/messaging/AMIManager.class new file mode 100644 index 0000000..0e08bac Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMIManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConf.class b/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConf.class new file mode 100644 index 0000000..ddac598 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConf.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.class b/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.class new file mode 100644 index 0000000..5c19efd Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMIThread.class b/source/.class/es/tid/TIDorbj/core/messaging/AMIThread.class new file mode 100644 index 0000000..0e3db36 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMIThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/AMIThreadPool.class b/source/.class/es/tid/TIDorbj/core/messaging/AMIThreadPool.class new file mode 100644 index 0000000..6ac7bce Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/AMIThreadPool.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/PoliciesComponent.class b/source/.class/es/tid/TIDorbj/core/messaging/PoliciesComponent.class new file mode 100644 index 0000000..0bd908e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/PoliciesComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/QoS.class b/source/.class/es/tid/TIDorbj/core/messaging/QoS.class new file mode 100644 index 0000000..aa71c62 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/QoS.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.class new file mode 100644 index 0000000..228d161 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.class new file mode 100644 index 0000000..bf96654 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.class new file mode 100644 index 0000000..8b6f246 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.class new file mode 100644 index 0000000..8a91f46 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.class new file mode 100644 index 0000000..650cef3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.class new file mode 100644 index 0000000..9fb95f7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.class new file mode 100644 index 0000000..256b016 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/ThreadStateListener.class b/source/.class/es/tid/TIDorbj/core/messaging/ThreadStateListener.class new file mode 100644 index 0000000..3acef6a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/ThreadStateListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.class b/source/.class/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.class new file mode 100644 index 0000000..13a2586 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMElement.class b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMElement.class new file mode 100644 index 0000000..105c8b5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMElement.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMEnumeration.class b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMEnumeration.class new file mode 100644 index 0000000..28a3a58 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap$AOMEnumeration.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap.class b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap.class new file mode 100644 index 0000000..8a2e46c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ActiveObjectMap.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/CompletionWaiter.class b/source/.class/es/tid/TIDorbj/core/poa/CompletionWaiter.class new file mode 100644 index 0000000..f5261e5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/CompletionWaiter.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/CurrentImpl.class b/source/.class/es/tid/TIDorbj/core/poa/CurrentImpl.class new file mode 100644 index 0000000..d1c11c0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/CurrentImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/CurrentInfo.class b/source/.class/es/tid/TIDorbj/core/poa/CurrentInfo.class new file mode 100644 index 0000000..7c8fe97 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/CurrentInfo.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.class b/source/.class/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.class new file mode 100644 index 0000000..0a430d2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ExecThread.class b/source/.class/es/tid/TIDorbj/core/poa/ExecThread.class new file mode 100644 index 0000000..7b67bf5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ExecThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/OID.class b/source/.class/es/tid/TIDorbj/core/poa/OID.class new file mode 100644 index 0000000..8d73c80 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/OID.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAImpl.class b/source/.class/es/tid/TIDorbj/core/poa/POAImpl.class new file mode 100644 index 0000000..c6237c6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAKey.class b/source/.class/es/tid/TIDorbj/core/poa/POAKey.class new file mode 100644 index 0000000..0c42834 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAKey.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAManagerConf.class b/source/.class/es/tid/TIDorbj/core/poa/POAManagerConf.class new file mode 100644 index 0000000..8f57cb0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAManagerConf.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAManagerConfListener.class b/source/.class/es/tid/TIDorbj/core/poa/POAManagerConfListener.class new file mode 100644 index 0000000..6cd493b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAManagerConfListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl$EtherealizerThread.class b/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl$EtherealizerThread.class new file mode 100644 index 0000000..c720986 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl$EtherealizerThread.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl.class b/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl.class new file mode 100644 index 0000000..71a0231 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/POAManagerImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/PriorityRequestComparator.class b/source/.class/es/tid/TIDorbj/core/poa/PriorityRequestComparator.class new file mode 100644 index 0000000..4637603 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/PriorityRequestComparator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/QueueReaderManager.class b/source/.class/es/tid/TIDorbj/core/poa/QueueReaderManager.class new file mode 100644 index 0000000..390940c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/QueueReaderManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.class b/source/.class/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.class new file mode 100644 index 0000000..2ec7dad Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/QueuedRequest.class b/source/.class/es/tid/TIDorbj/core/poa/QueuedRequest.class new file mode 100644 index 0000000..8206be2 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/QueuedRequest.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/QueuedResponseHandler.class b/source/.class/es/tid/TIDorbj/core/poa/QueuedResponseHandler.class new file mode 100644 index 0000000..3dfa30f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/QueuedResponseHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/RequestQueue.class b/source/.class/es/tid/TIDorbj/core/poa/RequestQueue.class new file mode 100644 index 0000000..7284a89 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/RequestQueue.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ServantDelegate.class b/source/.class/es/tid/TIDorbj/core/poa/ServantDelegate.class new file mode 100644 index 0000000..23b8cb0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ServantDelegate.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/SystemOID.class b/source/.class/es/tid/TIDorbj/core/poa/SystemOID.class new file mode 100644 index 0000000..8d2d08b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/SystemOID.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/TemporalRequestComparator.class b/source/.class/es/tid/TIDorbj/core/poa/TemporalRequestComparator.class new file mode 100644 index 0000000..dfa1326 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/TemporalRequestComparator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ThreadPool.class b/source/.class/es/tid/TIDorbj/core/poa/ThreadPool.class new file mode 100644 index 0000000..bee0253 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ThreadPool.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/ThreadStateListener.class b/source/.class/es/tid/TIDorbj/core/poa/ThreadStateListener.class new file mode 100644 index 0000000..040b2a5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/ThreadStateListener.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.class new file mode 100644 index 0000000..a0afb8f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.class new file mode 100644 index 0000000..cce3fed Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.class new file mode 100644 index 0000000..d6571f0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.class new file mode 100644 index 0000000..564594a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.class new file mode 100644 index 0000000..26a3a4e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.class new file mode 100644 index 0000000..498f542 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.class new file mode 100644 index 0000000..6659530 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/PolicyContext.class b/source/.class/es/tid/TIDorbj/core/policy/PolicyContext.class new file mode 100644 index 0000000..4fd8574 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/PolicyContext.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/PolicyContextManager.class b/source/.class/es/tid/TIDorbj/core/policy/PolicyContextManager.class new file mode 100644 index 0000000..b55c5fc Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/PolicyContextManager.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.class b/source/.class/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.class new file mode 100644 index 0000000..a9ae999 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/PolicyFactory.class b/source/.class/es/tid/TIDorbj/core/policy/PolicyFactory.class new file mode 100644 index 0000000..f5f1e74 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/PolicyFactory.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/PolicyManagerImpl.class b/source/.class/es/tid/TIDorbj/core/policy/PolicyManagerImpl.class new file mode 100644 index 0000000..05f86a5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/PolicyManagerImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/policy/UnsuportedPolicy.class b/source/.class/es/tid/TIDorbj/core/policy/UnsuportedPolicy.class new file mode 100644 index 0000000..686026a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/policy/UnsuportedPolicy.class differ diff --git a/source/.class/es/tid/TIDorbj/core/security/CSIComponent.class b/source/.class/es/tid/TIDorbj/core/security/CSIComponent.class new file mode 100644 index 0000000..4a3c2ed Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/security/CSIComponent.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.class new file mode 100644 index 0000000..3793207 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/AliasTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/AliasTypeCode.class new file mode 100644 index 0000000..64e640a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/AliasTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ArrayTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ArrayTypeCode.class new file mode 100644 index 0000000..7b5141b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ArrayTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ComplexTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ComplexTypeCode.class new file mode 100644 index 0000000..9a3c89c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ComplexTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/EnumTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/EnumTypeCode.class new file mode 100644 index 0000000..b17aec7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/EnumTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.class new file mode 100644 index 0000000..ae73601 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/FixedTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/FixedTypeCode.class new file mode 100644 index 0000000..6e079c9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/FixedTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/NativeTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/NativeTypeCode.class new file mode 100644 index 0000000..9bcc188 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/NativeTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.class new file mode 100644 index 0000000..21e975d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.class new file mode 100644 index 0000000..b102ebb Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/SequenceTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/SequenceTypeCode.class new file mode 100644 index 0000000..16b7046 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/SequenceTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/StringTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/StringTypeCode.class new file mode 100644 index 0000000..2eb068e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/StringTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/StructTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/StructTypeCode.class new file mode 100644 index 0000000..de156ae Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/StructTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.class new file mode 100644 index 0000000..d12de06 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeCache.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeCache.class new file mode 100644 index 0000000..d4b9122 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeCache.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeDumper.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeDumper.class new file mode 100644 index 0000000..af3a00c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeDumper.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeFactory.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeFactory.class new file mode 100644 index 0000000..a55fc32 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeFactory.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeHandler.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeHandler.class new file mode 100644 index 0000000..8009857 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeHandler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeImpl.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeImpl.class new file mode 100644 index 0000000..811c632 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.class b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.class new file mode 100644 index 0000000..c00bed9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/UnionTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/UnionTypeCode.class new file mode 100644 index 0000000..c28303f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/UnionTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.class new file mode 100644 index 0000000..12f1cbd Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/ValueTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/ValueTypeCode.class new file mode 100644 index 0000000..44cb2f1 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/ValueTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/typecode/WStringTypeCode.class b/source/.class/es/tid/TIDorbj/core/typecode/WStringTypeCode.class new file mode 100644 index 0000000..a94d7d0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/typecode/WStringTypeCode.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.class b/source/.class/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.class new file mode 100644 index 0000000..76b9a4a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.class b/source/.class/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.class new file mode 100644 index 0000000..4179ca0 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/CodeBaseURL.class b/source/.class/es/tid/TIDorbj/core/util/CodeBaseURL.class new file mode 100644 index 0000000..221eaac Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/CodeBaseURL.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/Corbaloc.class b/source/.class/es/tid/TIDorbj/core/util/Corbaloc.class new file mode 100644 index 0000000..5e79bd3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/Corbaloc.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/Corbaname.class b/source/.class/es/tid/TIDorbj/core/util/Corbaname.class new file mode 100644 index 0000000..a43d45a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/Corbaname.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/Counter.class b/source/.class/es/tid/TIDorbj/core/util/Counter.class new file mode 100644 index 0000000..3e87c02 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/Counter.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/DestructionState.class b/source/.class/es/tid/TIDorbj/core/util/DestructionState.class new file mode 100644 index 0000000..601ca59 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/DestructionState.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/EnumHolder.class b/source/.class/es/tid/TIDorbj/core/util/EnumHolder.class new file mode 100644 index 0000000..e61689b Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/EnumHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/FixedHolder.class b/source/.class/es/tid/TIDorbj/core/util/FixedHolder.class new file mode 100644 index 0000000..86eb87a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/FixedHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/FullUseTableException.class b/source/.class/es/tid/TIDorbj/core/util/FullUseTableException.class new file mode 100644 index 0000000..60d6d31 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/FullUseTableException.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/HashedLinkedList.class b/source/.class/es/tid/TIDorbj/core/util/HashedLinkedList.class new file mode 100644 index 0000000..e4cfd04 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/HashedLinkedList.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/InitialReference.class b/source/.class/es/tid/TIDorbj/core/util/InitialReference.class new file mode 100644 index 0000000..89786a8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/InitialReference.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/LinkedList$LinkedListEnumeration.class b/source/.class/es/tid/TIDorbj/core/util/LinkedList$LinkedListEnumeration.class new file mode 100644 index 0000000..be2f403 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/LinkedList$LinkedListEnumeration.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/LinkedList.class b/source/.class/es/tid/TIDorbj/core/util/LinkedList.class new file mode 100644 index 0000000..08591f9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/LinkedList.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/Mutex.class b/source/.class/es/tid/TIDorbj/core/util/Mutex.class new file mode 100644 index 0000000..565fb53 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/Mutex.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.class b/source/.class/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.class new file mode 100644 index 0000000..0602a08 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/OperationCompletion.class b/source/.class/es/tid/TIDorbj/core/util/OperationCompletion.class new file mode 100644 index 0000000..6e817a3 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/OperationCompletion.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/RemovableObject.class b/source/.class/es/tid/TIDorbj/core/util/RemovableObject.class new file mode 100644 index 0000000..5a7858a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/RemovableObject.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/RepositoryId.class b/source/.class/es/tid/TIDorbj/core/util/RepositoryId.class new file mode 100644 index 0000000..dc19021 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/RepositoryId.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/StringHolder.class b/source/.class/es/tid/TIDorbj/core/util/StringHolder.class new file mode 100644 index 0000000..074cf6f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/StringHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/ULongHolder.class b/source/.class/es/tid/TIDorbj/core/util/ULongHolder.class new file mode 100644 index 0000000..7719953 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/ULongHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/ULongLongHolder.class b/source/.class/es/tid/TIDorbj/core/util/ULongLongHolder.class new file mode 100644 index 0000000..dc4733c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/ULongLongHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/UShortHolder.class b/source/.class/es/tid/TIDorbj/core/util/UShortHolder.class new file mode 100644 index 0000000..f5a7f1a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/UShortHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/UseTable.class b/source/.class/es/tid/TIDorbj/core/util/UseTable.class new file mode 100644 index 0000000..5e11fd7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/UseTable.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/UserSystemExceptionEncoder.class b/source/.class/es/tid/TIDorbj/core/util/UserSystemExceptionEncoder.class new file mode 100644 index 0000000..a4dadee Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/UserSystemExceptionEncoder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/ValueHolder.class b/source/.class/es/tid/TIDorbj/core/util/ValueHolder.class new file mode 100644 index 0000000..ff8e579 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/ValueHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/WCharHolder.class b/source/.class/es/tid/TIDorbj/core/util/WCharHolder.class new file mode 100644 index 0000000..a5e27f4 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/WCharHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/WStringHolder.class b/source/.class/es/tid/TIDorbj/core/util/WStringHolder.class new file mode 100644 index 0000000..a9af817 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/WStringHolder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.class new file mode 100644 index 0000000..ba5125d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.class new file mode 100644 index 0000000..713f1cc Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.class new file mode 100644 index 0000000..502beff Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.class new file mode 100644 index 0000000..e3b8e89 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.class new file mode 100644 index 0000000..d590d64 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.class new file mode 100644 index 0000000..cc9f33e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.class new file mode 100644 index 0000000..9ab7ea4 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.class new file mode 100644 index 0000000..32f3407 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.class new file mode 100644 index 0000000..d48a485 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.class new file mode 100644 index 0000000..b3e1c2a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.class new file mode 100644 index 0000000..749a273 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.class new file mode 100644 index 0000000..3b4927f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.class new file mode 100644 index 0000000..6eca552 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.class new file mode 100644 index 0000000..412b520 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.class new file mode 100644 index 0000000..55f8cce Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.class new file mode 100644 index 0000000..263d054 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.class new file mode 100644 index 0000000..84fa2b6 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.class new file mode 100644 index 0000000..64e3c29 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.class new file mode 100644 index 0000000..de80b5a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.class new file mode 100644 index 0000000..dc93c6a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.class new file mode 100644 index 0000000..910c742 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.class new file mode 100644 index 0000000..4979a89 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.class new file mode 100644 index 0000000..6ba8d7d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.class new file mode 100644 index 0000000..89dcd86 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.class new file mode 100644 index 0000000..ce8c0f7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.class new file mode 100644 index 0000000..0282b73 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.class b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.class new file mode 100644 index 0000000..3dd4842 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.class b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.class new file mode 100644 index 0000000..5755fca Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.class b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.class new file mode 100644 index 0000000..1d6eecc Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.class new file mode 100644 index 0000000..cc96d13 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.class new file mode 100644 index 0000000..aa1a023 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.class new file mode 100644 index 0000000..9834c4c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.class new file mode 100644 index 0000000..87fff07 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.class b/source/.class/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.class new file mode 100644 index 0000000..c8c9fc8 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.class new file mode 100644 index 0000000..588f250 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.class b/source/.class/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.class new file mode 100644 index 0000000..e840e7f Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.class new file mode 100644 index 0000000..a45969a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.class b/source/.class/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.class new file mode 100644 index 0000000..84f48e9 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/core/ziop/ZIOP.class b/source/.class/es/tid/TIDorbj/core/ziop/ZIOP.class new file mode 100644 index 0000000..19d510a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/core/ziop/ZIOP.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynAnyBase.class b/source/.class/es/tid/TIDorbj/dynAny/DynAnyBase.class new file mode 100644 index 0000000..5442832 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynAnyBase.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.class new file mode 100644 index 0000000..b998571 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynAnyImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynAnyImpl.class new file mode 100644 index 0000000..46c35e5 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynAnyImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynAnyWithAny.class b/source/.class/es/tid/TIDorbj/dynAny/DynAnyWithAny.class new file mode 100644 index 0000000..16b5a18 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynAnyWithAny.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynArrayImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynArrayImpl.class new file mode 100644 index 0000000..7973e22 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynArrayImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynComposite.class b/source/.class/es/tid/TIDorbj/dynAny/DynComposite.class new file mode 100644 index 0000000..749872a Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynComposite.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynEnumImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynEnumImpl.class new file mode 100644 index 0000000..ff66d86 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynEnumImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynExceptImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynExceptImpl.class new file mode 100644 index 0000000..d277c59 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynExceptImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynFixedImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynFixedImpl.class new file mode 100644 index 0000000..55a90cd Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynFixedImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynSequenceImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynSequenceImpl.class new file mode 100644 index 0000000..866706c Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynSequenceImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynSingleton.class b/source/.class/es/tid/TIDorbj/dynAny/DynSingleton.class new file mode 100644 index 0000000..b104ff7 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynSingleton.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynStructBase.class b/source/.class/es/tid/TIDorbj/dynAny/DynStructBase.class new file mode 100644 index 0000000..98507fd Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynStructBase.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynStructImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynStructImpl.class new file mode 100644 index 0000000..6df281e Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynStructImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynUnionImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynUnionImpl.class new file mode 100644 index 0000000..ddbf038 Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynUnionImpl.class differ diff --git a/source/.class/es/tid/TIDorbj/dynAny/DynValueImpl.class b/source/.class/es/tid/TIDorbj/dynAny/DynValueImpl.class new file mode 100644 index 0000000..91c471d Binary files /dev/null and b/source/.class/es/tid/TIDorbj/dynAny/DynValueImpl.class differ diff --git a/source/.cvsignore b/source/.cvsignore new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/source/.cvsignore @@ -0,0 +1 @@ +.class diff --git a/source/.svn/all-wcprops b/source/.svn/all-wcprops new file mode 100644 index 0000000..e346dc7 --- /dev/null +++ b/source/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 54 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source +END +properties.xml +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/properties.xml +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 65 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/.cvsignore +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/build.xml +END diff --git a/source/.svn/dir-prop-base b/source/.svn/dir-prop-base new file mode 100644 index 0000000..b15a857 --- /dev/null +++ b/source/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 6 +.class +END diff --git a/source/.svn/entries b/source/.svn/entries new file mode 100644 index 0000000..0d974c2 --- /dev/null +++ b/source/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +es +dir + +properties.xml +file + + + + +2009-05-27T12:24:02.000000Z +393940abe72f9ac0293352812327df25 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1670 + +.cvsignore +file + + + + +2009-05-27T12:24:02.000000Z +9139eabf1b8942aaa41f16fe329f2507 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7 + +build.xml +file + + + + +2009-05-27T12:24:02.000000Z +44e25077210f3da89335608b150d9e6c +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2446 + diff --git a/source/.svn/prop-base/.cvsignore.svn-base b/source/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/.svn/prop-base/build.xml.svn-base b/source/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/.svn/prop-base/properties.xml.svn-base b/source/.svn/prop-base/properties.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/.svn/prop-base/properties.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/.svn/text-base/.cvsignore.svn-base b/source/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/source/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1 @@ +.class diff --git a/source/.svn/text-base/build.xml.svn-base b/source/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..e9b78e8 --- /dev/null +++ b/source/.svn/text-base/build.xml.svn-base @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/.svn/text-base/properties.xml.svn-base b/source/.svn/text-base/properties.xml.svn-base new file mode 100644 index 0000000..95cf74f --- /dev/null +++ b/source/.svn/text-base/properties.xml.svn-base @@ -0,0 +1,51 @@ + + + + + + + + + + \ No newline at end of file diff --git a/source/build.xml b/source/build.xml new file mode 100644 index 0000000..8ed6920 --- /dev/null +++ b/source/build.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/source/es/.svn/all-wcprops b/source/es/.svn/all-wcprops new file mode 100644 index 0000000..bd97c56 --- /dev/null +++ b/source/es/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 57 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es +END diff --git a/source/es/.svn/entries b/source/es/.svn/entries new file mode 100644 index 0000000..98c9d68 --- /dev/null +++ b/source/es/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +tid +dir + diff --git a/source/es/tid/.svn/all-wcprops b/source/es/tid/.svn/all-wcprops new file mode 100644 index 0000000..8b8a6e4 --- /dev/null +++ b/source/es/tid/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 61 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid +END diff --git a/source/es/tid/.svn/entries b/source/es/tid/.svn/entries new file mode 100644 index 0000000..05e6d76 --- /dev/null +++ b/source/es/tid/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +PortableServer +dir + +TIDorbj +dir + diff --git a/source/es/tid/PortableServer/.svn/all-wcprops b/source/es/tid/PortableServer/.svn/all-wcprops new file mode 100644 index 0000000..4d69121 --- /dev/null +++ b/source/es/tid/PortableServer/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/PortableServer +END +POAManager.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/PortableServer/POAManager.java +END diff --git a/source/es/tid/PortableServer/.svn/entries b/source/es/tid/PortableServer/.svn/entries new file mode 100644 index 0000000..2b663db --- /dev/null +++ b/source/es/tid/PortableServer/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/PortableServer +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +POAManager.java +file + + + + +2009-05-27T12:24:00.000000Z +8c2bbb8d50defa401a0e8325bdacd411 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3100 + diff --git a/source/es/tid/PortableServer/.svn/prop-base/POAManager.java.svn-base b/source/es/tid/PortableServer/.svn/prop-base/POAManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/PortableServer/.svn/prop-base/POAManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/PortableServer/.svn/text-base/POAManager.java.svn-base b/source/es/tid/PortableServer/.svn/text-base/POAManager.java.svn-base new file mode 100644 index 0000000..bde49ae --- /dev/null +++ b/source/es/tid/PortableServer/.svn/text-base/POAManager.java.svn-base @@ -0,0 +1,115 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.PortableServer; + +/** + * TIDorbj POAManager extended interface. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public interface POAManager + extends org.omg.PortableServer.POAManager +{ + + /** + * Sets the mininum number of execution threads + */ + void set_min_threads(int min_threads); + + /** + * Sets the maximun number of execution threads + */ + void set_max_threads(int max_threads); + + /** + * Sets the maximun number of request queued in the POAManager + */ + void set_max_queued_requests(int max_queued_requests); + + /** + * Sets the maximun time an execution thread is inactive. + */ + void set_starving_time(int millisecs); + + /** + * Sets the queue order, see Messaging module in CORBA specification + */ + + void set_queue_order(short order); + + /** + * @return maximun number of request queued in the POAManager + */ + int get_max_queued_requests(); + + /** + * @return the maximun number of execution threads + */ + int get_max_threads(); + + /** + * @return the mininum number of execution threads + */ + int get_min_threads(); + + /** + * @return the maximun time an execution thread is inactive. + */ + int get_starving_time(); + + /** + * @return the state of the POA manager. + */ + org.omg.PortableServer.POAManagerPackage.State get_state(); + + + /** + * + * @return the queue order used defined as vaulue of the Messaging policy + * + */ + + short get_queue_order(); + +} \ No newline at end of file diff --git a/source/es/tid/PortableServer/POAManager.java b/source/es/tid/PortableServer/POAManager.java new file mode 100644 index 0000000..76af598 --- /dev/null +++ b/source/es/tid/PortableServer/POAManager.java @@ -0,0 +1,115 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.PortableServer; + +/** + * TIDorbj POAManager extended interface. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public interface POAManager + extends org.omg.PortableServer.POAManager +{ + + /** + * Sets the mininum number of execution threads + */ + void set_min_threads(int min_threads); + + /** + * Sets the maximun number of execution threads + */ + void set_max_threads(int max_threads); + + /** + * Sets the maximun number of request queued in the POAManager + */ + void set_max_queued_requests(int max_queued_requests); + + /** + * Sets the maximun time an execution thread is inactive. + */ + void set_starving_time(int millisecs); + + /** + * Sets the queue order, see Messaging module in CORBA specification + */ + + void set_queue_order(short order); + + /** + * @return maximun number of request queued in the POAManager + */ + int get_max_queued_requests(); + + /** + * @return the maximun number of execution threads + */ + int get_max_threads(); + + /** + * @return the mininum number of execution threads + */ + int get_min_threads(); + + /** + * @return the maximun time an execution thread is inactive. + */ + int get_starving_time(); + + /** + * @return the state of the POA manager. + */ + org.omg.PortableServer.POAManagerPackage.State get_state(); + + + /** + * + * @return the queue order used defined as vaulue of the Messaging policy + * + */ + + short get_queue_order(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/.svn/all-wcprops b/source/es/tid/TIDorbj/.svn/all-wcprops new file mode 100644 index 0000000..b9f0783 --- /dev/null +++ b/source/es/tid/TIDorbj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 69 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj +END diff --git a/source/es/tid/TIDorbj/.svn/entries b/source/es/tid/TIDorbj/.svn/entries new file mode 100644 index 0000000..52a852c --- /dev/null +++ b/source/es/tid/TIDorbj/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +dynAny +dir + +core +dir + diff --git a/source/es/tid/TIDorbj/core/.svn/all-wcprops b/source/es/tid/TIDorbj/core/.svn/all-wcprops new file mode 100644 index 0000000..b9d631a --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/all-wcprops @@ -0,0 +1,155 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core +END +CodecImpl.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/CodecImpl.java +END +ServerRequestImpl.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ServerRequestImpl.java +END +NVListImpl.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/NVListImpl.java +END +ContextListImpl.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ContextListImpl.java +END +NamedValueImpl.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/NamedValueImpl.java +END +ShutdownThread.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ShutdownThread.java +END +SingletonORB.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/SingletonORB.java +END +ORBComponent.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ORBComponent.java +END +ContextImpl.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ContextImpl.java +END +AnyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/AnyImpl.java +END +BidirectionalPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/BidirectionalPolicyImpl.java +END +RequestImpl.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/RequestImpl.java +END +ExceptionListImpl.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ExceptionListImpl.java +END +ProcessingState.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ProcessingState.java +END +ForwardRequest.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ForwardRequest.java +END +ObjectKey.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ObjectKey.java +END +TIDORB.java +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/TIDORB.java +END +StreamRequestImpl.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/StreamRequestImpl.java +END +ORBServices.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ORBServices.java +END +PseudoObject.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/PseudoObject.java +END +EnvironmentImpl.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/EnvironmentImpl.java +END +CodecFactoryImpl.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/CodecFactoryImpl.java +END +ObjectImpl.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ObjectImpl.java +END +RequestCounter.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/RequestCounter.java +END +ConfORB.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ConfORB.java +END diff --git a/source/es/tid/TIDorbj/core/.svn/entries b/source/es/tid/TIDorbj/core/.svn/entries new file mode 100644 index 0000000..ea84545 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/entries @@ -0,0 +1,920 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + + + +() + +ShutdownThread.java +file + + + + +2009-05-27T12:24:02.000000Z +b1bec33a48e4b2301c8976e6416b9125 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1778 + +NamedValueImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +885ed7fb8c64a3039fc3c9e0137c90f0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3102 + +SingletonORB.java +file + + + + +2009-05-27T12:24:02.000000Z +9f46431d3368bbbb1ee078ee86196d40 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +12370 + +BidirectionalPolicyImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +7f8607c6b701ebbdccc945db0430202e +2007-07-05T05:42:09.781394Z +82 +avega +has-props + + + + + + + + + + + + + + + + + + + + +4699 + +ExceptionListImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +bc4e79d231e6d5b55e0cfdb92005e286 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2965 + +ForwardRequest.java +file + + + + +2009-05-27T12:24:02.000000Z +e81cfbc16b20b521d0a99cc3157ea707 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1771 + +ObjectKey.java +file + + + + +2009-05-27T12:24:02.000000Z +1095809f2ea58393b17a6e487c7a5f7d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3941 + +TIDORB.java +file +478 + + + +2011-04-29T14:42:47.000000Z +6b766501fff9807d978117b9a7b8ec37 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +50308 + +StreamRequestImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +f6c33b15e2de57994ff7198ba9d430bf +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3573 + +PseudoObject.java +file + + + + +2009-05-27T12:24:02.000000Z +d691730889b4f0d4fafef5cf6a7bf72e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5033 + +EnvironmentImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +2b3646a22da15d4a7fa2b7926bbcc7e5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2119 + +CodecFactoryImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +8a4dcfcbbb716bc89d46f0840182574e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3125 + +messaging +dir + +poa +dir + +CodecImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +1103fbbab002a64513b6240944592705 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5236 + +ziop +dir + +NVListImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +fae04b462985efdf6b902ab160bae76e +2006-02-22T12:30:10.000000Z +14 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +9733 + +ServerRequestImpl.java +file + + + + +2009-05-27T14:10:33.000000Z +d8a4a4bb0a3afa19b259f0f75a3b942a +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +6935 + +ContextListImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +ce69d348cbdb04873ec790203702266f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2490 + +ORBComponent.java +file + + + + +2009-05-27T12:24:02.000000Z +cffb7894dc5ca0c127ec4f010b709cba +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1967 + +ContextImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +3d83ee7ea22c2283c9426486d7650c0e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9207 + +iop +dir + +AnyImpl.java +file + + + + +2010-04-28T10:47:58.000000Z +18a2d815069e4e7fb7c1715b6361713f +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +40740 + +RequestImpl.java +file + + + + +2010-04-28T10:50:56.000000Z +3991d7cac7ca57cfa5197a0822609de8 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +14536 + +comm +dir + +ProcessingState.java +file + + + + +2009-05-27T12:24:02.000000Z +06a7b50094b4510553ef652595c0b06a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3441 + +policy +dir + +compression +dir + +ORBServices.java +file + + + + +2009-05-27T14:10:33.000000Z +f2bb60f44d8943326e945aed53b5d568 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +12217 + +security +dir + +cdr +dir + +RequestCounter.java +file + + + + +2009-05-27T12:24:02.000000Z +2d44b656e3315aab5c4c25f72c37cdba +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +239 + +ConfORB.java +file +478 + + + +2011-04-29T14:42:47.000000Z +06e7509f06f0f61c4eeaf9877d1c7381 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +48556 + +ObjectImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +ce18d6b788cd4cdd0af8baa788f3dc46 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2284 + +typecode +dir + +util +dir + diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/AnyImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/AnyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/AnyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/BidirectionalPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/BidirectionalPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/BidirectionalPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/CodecFactoryImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/CodecFactoryImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/CodecFactoryImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/CodecImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/CodecImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/CodecImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ConfORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ConfORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ConfORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ContextImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ContextImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ContextImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ContextListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ContextListImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ContextListImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/EnvironmentImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/EnvironmentImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/EnvironmentImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ExceptionListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ExceptionListImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ExceptionListImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ForwardRequest.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ForwardRequest.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ForwardRequest.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/NVListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/NVListImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/NVListImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/NamedValueImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/NamedValueImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/NamedValueImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ORBComponent.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ORBComponent.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ORBComponent.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ORBServices.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ORBServices.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ORBServices.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectKey.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectKey.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ObjectKey.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ProcessingState.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ProcessingState.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ProcessingState.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/PseudoObject.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/PseudoObject.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/PseudoObject.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/RequestCounter.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/RequestCounter.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/RequestCounter.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/RequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/RequestImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/RequestImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ServerRequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ServerRequestImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ServerRequestImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/ShutdownThread.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/ShutdownThread.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/ShutdownThread.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/SingletonORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/SingletonORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/SingletonORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/StreamRequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/StreamRequestImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/StreamRequestImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/prop-base/TIDORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/prop-base/TIDORB.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/prop-base/TIDORB.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/AnyImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/AnyImpl.java.svn-base new file mode 100644 index 0000000..0df3684 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/AnyImpl.java.svn-base @@ -0,0 +1,1282 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeDumper; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; +import es.tid.TIDorbj.core.util.AbstractInterfaceHolder; +import es.tid.TIDorbj.core.util.FixedHolder; +import es.tid.TIDorbj.core.util.StringHolder; +import es.tid.TIDorbj.core.util.ULongHolder; +import es.tid.TIDorbj.core.util.ULongLongHolder; +import es.tid.TIDorbj.core.util.UShortHolder; +import es.tid.TIDorbj.core.util.ValueHolder; +import es.tid.TIDorbj.core.util.WCharHolder; +import es.tid.TIDorbj.core.util.WStringHolder; + +/** + * TIDorb Any pseudobject implementation. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class AnyImpl extends es.tid.CORBA.Any +{ + + /** + * ORB where the any has been created. If null is a ORB + * singleton. + */ + + TIDORB m_orb; + + protected TypeCode m_type; + + protected CDRInputStream m_marshaled_value; + + protected org.omg.CORBA.portable.Streamable m_value; + + protected org.omg.CORBA.Any m_wrapped_any; + + /** + * The Streamable value has been inserted by the user with + * insert_Streamable() + */ + protected boolean m_user_value; + + public AnyImpl(TIDORB orb) + { + m_orb = orb; + m_type = TypeCodeFactory.tc_null; + if ((m_orb != null) && (m_orb.m_conf.exhaustive_equal)) { + ((es.tid.TIDorbj.core.typecode.TypeCodeImpl)m_type).setExhaustiveEqual(m_orb.m_conf.exhaustive_equal); + } + m_marshaled_value = null; + m_value = null; + m_user_value = false; + m_wrapped_any = null; + } + + private synchronized void reset_value() + { + m_value = null; + m_marshaled_value = null; + m_user_value = false; + m_wrapped_any = null; + } + + protected boolean hasStreamable() + { + return m_value != null; + } + + // asigns the new vaule and reads from the _marshaled value. + private void initValue(org.omg.CORBA.portable.Streamable holder) + { + if (m_marshaled_value != null) { + m_marshaled_value.rewind(); + m_value = holder; + m_value._read(m_marshaled_value); + } else { + throw new BAD_OPERATION("Any without value.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized boolean equal(org.omg.CORBA.Any a) + { + if (a == null) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + if (m_wrapped_any != null) { + return m_wrapped_any.equal(a); + } + + if (!m_type.equal(a.type())) { + return false; + } + + switch (m_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + return true; + case TCKind._tk_short: + return extract_short() == a.extract_short(); + case TCKind._tk_long: + return extract_long() == a.extract_long(); + case TCKind._tk_longlong: + return extract_longlong() == a.extract_longlong(); + case TCKind._tk_ushort: + return extract_ushort() == a.extract_ushort(); + case TCKind._tk_ulong: + return extract_ulong() == a.extract_ulong(); + case TCKind._tk_ulonglong: + return extract_longlong() == a.extract_longlong(); + case TCKind._tk_float: + return extract_float() == a.extract_float(); + case TCKind._tk_double: + return extract_double() == a.extract_double(); + case TCKind._tk_boolean: + return extract_boolean() == a.extract_boolean(); + case TCKind._tk_char: + return extract_char() == a.extract_char(); + case TCKind._tk_wchar: + return extract_wchar() == a.extract_wchar(); + case TCKind._tk_octet: + return extract_octet() == a.extract_octet(); + case TCKind._tk_any: + return extract_any().equal(a.extract_any()); + case TCKind._tk_objref: + { + org.omg.CORBA.Object obj_ref, obj_ref_a; + obj_ref = extract_Object(); + obj_ref_a = a.extract_Object(); + if (obj_ref == null) { + if (obj_ref_a == null) { + return true; + } else { + return false; + } + } else { + return obj_ref._is_equivalent(obj_ref_a); + } + } + case TCKind._tk_string: + try { + if (m_type.length() == 0) { //unbounded string + return extract_string().equals(a.extract_string()); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_wstring: + try { + if (m_type.length() == 0) { //unbounded string + return extract_wstring().equals(a.extract_wstring()); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_TypeCode: + return extract_TypeCode().equal(a.extract_TypeCode()); + case TCKind._tk_fixed: + return extract_fixed().equals(a.extract_fixed()); + } + + return TypeCodeMarshaler.valuesEqual(m_type, create_input_stream(), + a.create_input_stream()); + } + + protected synchronized void wrapValue(org.omg.CORBA.Any a) + { + reset_value(); + m_wrapped_any = a; + } + + public static void assign(org.omg.CORBA.Any from, org.omg.CORBA.Any to) + { + assign(from, to, false); + } + + public static void assign(org.omg.CORBA.Any from, org.omg.CORBA.Any to, + boolean wrap) + { + if ((from == null) || (to == null)) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + TypeCode type = from.type(); + + switch (type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + to.type(type); + return; + case TCKind._tk_short: + to.insert_short(from.extract_short()); + return; + case TCKind._tk_long: + to.insert_long(from.extract_long()); + return; + case TCKind._tk_longlong: + to.insert_longlong(from.extract_longlong()); + return; + case TCKind._tk_ushort: + to.insert_ushort(from.extract_ushort()); + return; + case TCKind._tk_ulong: + to.insert_ulong(from.extract_ulong()); + return; + case TCKind._tk_ulonglong: + to.insert_ulonglong(from.extract_ulonglong()); + return; + case TCKind._tk_float: + to.insert_float(from.extract_float()); + return; + case TCKind._tk_double: + to.insert_double(from.extract_double()); + return; + case TCKind._tk_boolean: + to.insert_boolean(from.extract_boolean()); + return; + case TCKind._tk_char: + to.insert_char(from.extract_char()); + return; + case TCKind._tk_wchar: + to.insert_wchar(from.extract_wchar()); + return; + case TCKind._tk_octet: + to.insert_octet(from.extract_octet()); + return; + case TCKind._tk_any: + to.insert_any(from.extract_any()); + return; + case TCKind._tk_objref: + to.insert_Object(from.extract_Object()); + return; + case TCKind._tk_value: + to.insert_Value(from.extract_Value(), from.type()); + return; + + case TCKind._tk_string: + try { + if (type.length() == 0) { //unbounded string + to.insert_string(from.extract_string()); + return; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_wstring: + try { + if (type.length() == 0) { //unbounded string + to.insert_wstring(from.extract_wstring()); + return; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_TypeCode: + to.insert_TypeCode(from.extract_TypeCode()); + return; + case TCKind._tk_fixed: + to.insert_fixed(from.extract_fixed(), type); + return; + } + + // while JDKs API Any had no extract_Streamable() + if (from instanceof AnyImpl) { + AnyImpl tidorb_from = (AnyImpl) from; + if (tidorb_from.hasStreamable()) { + to.insert_Streamable(tidorb_from.extract_Streamable()); + return; + } + } + + // Only wraps complex types + + if (wrap && (to instanceof AnyImpl)) { + ((AnyImpl) to).wrapValue(from); + return; + } + + to.read_value(from.create_input_stream(), type); + } + + public static void assignValue(org.omg.CORBA.Any from, org.omg.CORBA.Any to) + { + assignValue(from, to, false); + } + + public static void assignValue(org.omg.CORBA.Any from, + org.omg.CORBA.Any to, boolean wrap) + { + if ((from == null) || (to == null)) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + if (!to.type().equivalent(from.type())) + throw new BAD_OPERATION("No Equivalent types.", 0, + CompletionStatus.COMPLETED_NO); + + assign(from, to, wrap); + } + + public org.omg.CORBA.TypeCode type() + { + return m_type; + } + + /** + * Changes the any typecode, is needed to minizimie overhead in any creation + * of alias types: first create the any, and then change the typecode. + */ + + public synchronized void setEquivalentType(TypeCode type) + { + if (!m_type.equivalent(type)) { + throw new BAD_OPERATION("Types are not equivalent.", 0, + CompletionStatus.COMPLETED_NO); + } else { + m_type = type; + } + } + + public synchronized void type(org.omg.CORBA.TypeCode type) + { + if (type == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + m_type = type; + reset_value(); + } + + public synchronized void read_value(org.omg.CORBA.portable.InputStream is, + org.omg.CORBA.TypeCode type) + { + if ((is == null) || (type == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + // basic types are read directly from the stream + + switch (type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + this.type(type); + return; + case TCKind._tk_short: + insert_short(is.read_short()); + return; + case TCKind._tk_long: + insert_long(is.read_long()); + return; + case TCKind._tk_longlong: + insert_longlong(is.read_longlong()); + return; + case TCKind._tk_ushort: + insert_ushort(is.read_ushort()); + return; + case TCKind._tk_ulong: + insert_ulong(is.read_ulong()); + return; + case TCKind._tk_ulonglong: + insert_ulonglong(is.read_ulonglong()); + return; + case TCKind._tk_float: + insert_float(is.read_float()); + return; + case TCKind._tk_double: + insert_double(is.read_double()); + return; + case TCKind._tk_boolean: + insert_boolean(is.read_boolean()); + return; + case TCKind._tk_char: + insert_char(is.read_char()); + return; + case TCKind._tk_wchar: + insert_wchar(is.read_wchar()); + return; + case TCKind._tk_octet: + insert_octet(is.read_octet()); + return; + case TCKind._tk_any: + insert_any(is.read_any()); + return; + case TCKind._tk_fixed: //special case: fixed values + { + FixedHolder fixed_holder = new FixedHolder(m_type); + fixed_holder._read(is); + insert_Streamable(fixed_holder); + return; + } + case TCKind._tk_value: + case TCKind._tk_value_box: + { + ValueHolder value_holder = new ValueHolder(m_type); + value_holder._read(is); + insert_Streamable(value_holder); + return; + } + case TCKind._tk_abstract_interface: + { + + AbstractInterfaceHolder interface_holder = + new AbstractInterfaceHolder(m_type); + interface_holder._read(is); + insert_Streamable(interface_holder); + return; + } + } + + this.type(type); + + if (is instanceof CDRInputStream) { + // the value is not a streamable value + m_marshaled_value = ((CDRInputStream) is).copy(); + + // saves the actual position + m_marshaled_value.fixStarting(); + + // set the input stream to the end of the value + TypeCodeMarshaler.skipValue(m_type, (CDRInputStream) is); + } else { + // I only can remarshal the value in my own buffer + CDROutputStream out = null; + + if (m_orb != null) { // orbsingleton + out = (CDROutputStream) m_orb.create_output_stream(); + } else { + out = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } + + TypeCodeMarshaler.remarshalValue(m_type, is, out); + m_marshaled_value = (CDRInputStream) out.create_input_stream(); + } + } + + public synchronized void write_value(org.omg.CORBA.portable.OutputStream os) + { + if (os == null) { + throw new BAD_PARAM("Null OutputStream reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + if (m_wrapped_any != null) { + m_wrapped_any.write_value(os); + return; + } + + int kind = m_type.kind().value(); + + if ((kind == TCKind._tk_null) || (kind == TCKind._tk_void)) { + return; + } else if (m_value != null) { + m_value._write(os); + } else if (m_marshaled_value != null) { + CDRInputStream _marshaled_value_copy = m_marshaled_value.copy(); + _marshaled_value_copy.rewind(); + TypeCodeMarshaler.remarshalValue(m_type, _marshaled_value_copy, os); + } else { + throw new BAD_OPERATION("Uncompleted Any.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized org.omg.CORBA.portable.OutputStream create_output_stream() + { + org.omg.CORBA.portable.OutputStream out = null; + + if (m_orb == null) { + out = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } else { + out = m_orb.create_output_stream(); + } + m_marshaled_value = (CDRInputStream) out.create_input_stream(); + + return out; + } + + public synchronized org.omg.CORBA.portable.InputStream create_input_stream() + { + if (m_wrapped_any != null) { + return m_wrapped_any.create_input_stream(); + } + + if (m_marshaled_value == null) { + createMarshaledValue(); + } + + CDRInputStream new_stream = m_marshaled_value.copy(); + new_stream.rewind(); + return new_stream; + } + + protected void createMarshaledValue() + { + if (m_marshaled_value != null) + return; + + int kind = m_type.kind().value(); + + if ((kind == TCKind._tk_null) || (kind == TCKind._tk_void)) { + m_marshaled_value = new CDRInputStream(m_orb, new byte[0]); + return; + } + + if (m_value != null) { + CDROutputStream output; + + if (m_orb == null) { + output = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } else { + output = (CDROutputStream) m_orb.create_output_stream(); + } + m_value._write(output); + m_marshaled_value = (CDRInputStream) output.create_input_stream(); + } else { + throw new BAD_OPERATION("Any without value.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized short extract_short() + { + if (m_type.kind().value() != TCKind._tk_short) { + throw new BAD_OPERATION("No short in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + try { + return ((org.omg.CORBA.ShortHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_short(); + } + } + + public synchronized void insert_short(short s) + { + m_value = new org.omg.CORBA.ShortHolder(s); + m_type = m_value._type(); + } + + public synchronized int extract_long() + { + if (m_type.kind().value() != TCKind._tk_long) { + throw new BAD_OPERATION("No long in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) { + initValue(new org.omg.CORBA.IntHolder()); + } + + try { + return ((org.omg.CORBA.IntHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_long(); + } + } + + public synchronized void insert_long(int i) + { + reset_value(); + m_value = new org.omg.CORBA.IntHolder(i); + m_type = m_value._type(); + } + + public synchronized long extract_longlong() + { + if (m_type.kind().value() != TCKind._tk_longlong) { + throw new BAD_OPERATION("No longlong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + if (m_value == null) { + initValue(new org.omg.CORBA.LongHolder()); + } + + try { + return ((org.omg.CORBA.LongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_longlong(); + } + } + + public synchronized void insert_longlong(long l) + { + reset_value(); + m_value = new org.omg.CORBA.LongHolder(l); + m_type = m_value._type(); + } + + public synchronized short extract_ushort() + { + if (m_type.kind().value() != TCKind._tk_ushort) { + throw new BAD_OPERATION("No ushort in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + if (m_value == null) + initValue(new UShortHolder()); + + try { + return ((UShortHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ushort(); + } + } + + public synchronized void insert_ushort(short s) + { + reset_value(); + m_value = new UShortHolder(s); + m_type = TypeCodeFactory.tc_ushort; + } + + public synchronized int extract_ulong() + { + if (m_type.kind().value() != TCKind._tk_ulong) { + throw new BAD_OPERATION("No ulong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new ULongHolder()); + + try { + return ((ULongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ulong(); + } + } + + public synchronized void insert_ulong(int i) + { + reset_value(); + m_value = new ULongHolder(i); + m_type = TypeCodeFactory.tc_ulong; + } + + public synchronized long extract_ulonglong() + { + if (m_type.kind().value() != TCKind._tk_ulonglong) { + throw new BAD_OPERATION("No ulonglong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new ULongLongHolder()); + try { + return ((ULongLongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ulonglong(); + } + + } + + public synchronized void insert_ulonglong(long l) + { + reset_value(); + m_value = new ULongLongHolder(l); + m_type = TypeCodeFactory.tc_ulonglong; + } + + public synchronized float extract_float() + { + if (m_type.kind().value() != TCKind._tk_float) { + throw new BAD_OPERATION("No float in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.FloatHolder()); + try { + return ((org.omg.CORBA.FloatHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_float(); + } + } + + public synchronized void insert_float(float f) + { + reset_value(); + m_value = new org.omg.CORBA.FloatHolder(f); + m_type = m_value._type(); + } + + public synchronized double extract_double() + { + if (m_type.kind().value() != TCKind._tk_double) + throw new BAD_OPERATION("No float in Any.", 0, + CompletionStatus.COMPLETED_NO); + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.DoubleHolder()); + + try { + return ((org.omg.CORBA.DoubleHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_double(); + } + } + + public synchronized void insert_double(double d) + { + reset_value(); + m_value = new org.omg.CORBA.DoubleHolder(d); + m_type = m_value._type(); + } + + public synchronized boolean extract_boolean() + { + if (m_type.kind().value() != TCKind._tk_boolean) { + throw new BAD_OPERATION("No boolean in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.BooleanHolder()); + + try { + return ((org.omg.CORBA.BooleanHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_boolean(); + } + } + + public synchronized void insert_boolean(boolean b) + { + reset_value(); + m_value = new org.omg.CORBA.BooleanHolder(b); + m_type = m_value._type(); + } + + public synchronized char extract_char() + { + if (m_type.kind().value() != TCKind._tk_char) { + throw new BAD_OPERATION("No char in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.CharHolder()); + + try { + return ((org.omg.CORBA.CharHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_char(); + } + + } + + public synchronized void insert_char(char c) + { + reset_value(); + m_value = new org.omg.CORBA.CharHolder(c); + m_type = m_value._type(); + } + + public synchronized char extract_wchar() + { + if (m_type.kind().value() != TCKind._tk_wchar) { + throw new BAD_OPERATION("No wchar in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new WCharHolder()); + try { + return ((WCharHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_wchar(); + } + } + + public synchronized void insert_wchar(char c) + { + reset_value(); + m_value = new WCharHolder(c); + m_type = m_value._type(); + } + + public synchronized byte extract_octet() + { + if (m_type.kind().value() != TCKind._tk_octet) { + throw new BAD_OPERATION("No octet in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.ByteHolder()); + + try { + return ((org.omg.CORBA.ByteHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_octet(); + } + + } + + public synchronized void insert_octet(byte b) + { + reset_value(); + m_value = new org.omg.CORBA.ByteHolder(b); + m_type = m_value._type(); + } + + public synchronized org.omg.CORBA.Any extract_any() + { + if (m_type.kind().value() != TCKind._tk_any) { + throw new BAD_OPERATION("No any in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.AnyHolder()); + + try { + return ((org.omg.CORBA.AnyHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_any(); + } + } + + public synchronized void insert_any(org.omg.CORBA.Any a) + { + if (a == null) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.AnyHolder(a); + m_type = TypeCodeFactory.tc_any; + } + + public synchronized org.omg.CORBA.TypeCode extract_TypeCode() + { + if (m_type.kind().value() != TCKind._tk_TypeCode) { + throw new BAD_OPERATION("No TypeCode in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.TypeCodeHolder()); + + try { + return ((org.omg.CORBA.TypeCodeHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_TypeCode(); + } + } + + public synchronized void insert_TypeCode(org.omg.CORBA.TypeCode t) + { + if (t == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new org.omg.CORBA.TypeCodeHolder(t); + m_type = m_value._type(); + } + + public synchronized String extract_string() + { + try { + if ((m_type.kind().value() != TCKind._tk_string) + || (m_type.length() != 0)) { + throw new BAD_OPERATION("No unbounded string in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new StringHolder(m_type)); + + try { + + return ((StringHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_string(); + } + } + + public synchronized void insert_string(String s) + { + if (s == null) { + throw new BAD_PARAM("Null String reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.StringHolder(s); + m_type = m_value._type(); + } + + public synchronized String extract_wstring() + { + if (m_type.kind().value() != TCKind._tk_wstring) { + throw new BAD_OPERATION("No wstring in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new WStringHolder(m_type)); + + try { + return ((WStringHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_wstring(); + } + } + + public synchronized void insert_wstring(String s) + { + if (s == null) { + throw new BAD_PARAM("Null String reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new WStringHolder(s); + m_type = m_value._type(); + } + + public synchronized java.math.BigDecimal extract_fixed() + { + if (m_type.kind().value() != TCKind._tk_fixed) { + throw new BAD_OPERATION("No fixed in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new FixedHolder(m_type)); + + try { + return ((FixedHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + throw new BAD_OPERATION("Can not obtain fixed", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized void insert_fixed(java.math.BigDecimal f, + org.omg.CORBA.TypeCode t) + throws BAD_INV_ORDER + { + if ((f == null) || (t == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new FixedHolder(t, f); + m_type = t; + } + + /** + * @ deprecated + */ + public org.omg.CORBA.Principal extract_Principal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @ deprecated + */ + public void insert_Principal(org.omg.CORBA.Principal p) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public synchronized org.omg.CORBA.portable.Streamable extract_Streamable() + { + //if(!m_type.equivalent(m_value._type())) + // System.out.println("AnyImpl.extract_Streamable no equivalente"); + if (m_user_value) { + if (m_value != null) { + return m_value; + } else { + throw new org.omg.CORBA.INTERNAL("No Streamable in Any."); + } + } else { + throw new BAD_INV_ORDER("No Streamable in Any."); + } + } + + public synchronized void + insert_Streamable(org.omg.CORBA.portable.Streamable s) + { + if (s == null) { + throw new BAD_PARAM("Null Streamable reference.", 0, + CompletionStatus.COMPLETED_NO); + } + //if(!m_type.equivalent(s._type())) + // System.out.println("AnyImpl.insert_Streamable no equivalente"); + reset_value(); + m_user_value = true; + m_value = s; + m_type = m_value._type(); + } + + public synchronized org.omg.CORBA.Object extract_Object() + { + if (m_type.kind().value() != TCKind._tk_objref) { + throw new BAD_OPERATION("No Object in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.ObjectHolder()); + + try { + return ((org.omg.CORBA.ObjectHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_Object(); + } + } + + public synchronized void insert_Object(org.omg.CORBA.Object obj) + { + if (obj instanceof org.omg.CORBA.LocalObject) { + throw new MARSHAL("Impossible to marshall a local object.", 4, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new org.omg.CORBA.ObjectHolder(obj); + m_type = m_value._type(); + } + + public synchronized void insert_Object(org.omg.CORBA.Object obj, + org.omg.CORBA.TypeCode type) + { + if (type == null) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.ObjectHolder(obj); + m_type = type; + } + + public synchronized java.io.Serializable extract_Value() + { + int kind = m_type.kind().value(); + + if ((kind != TCKind._tk_value) && (kind != TCKind._tk_value_box)) { + throw new BAD_OPERATION("No Value in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value != null) { + if (m_value instanceof ValueHolder) { + + java.io.Serializable js = ((ValueHolder) m_value).value; + + return js; + } else { // there is another holder + createMarshaledValue(); + } + } + + if (m_marshaled_value != null) { + m_marshaled_value.rewind(); + return m_marshaled_value.read_value(); + } + + throw new BAD_OPERATION("Any without value"); + } + + public synchronized void insert_Value(java.io.Serializable v) + { + reset_value(); + + if (v instanceof org.omg.CORBA.portable.StreamableValue) { + org.omg.CORBA.portable.StreamableValue val = + (org.omg.CORBA.portable.StreamableValue) v; + + insert_Streamable(new ValueHolder(val._type(), val)); + m_type = val._type(); + return; + } else { + throw new BAD_PARAM("It is not StreamableValue"); + } + } + + public synchronized void insert_Value(java.io.Serializable v, + org.omg.CORBA.TypeCode t) + { + if (t == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + int kind = t.kind().value(); + + if ((kind == TCKind._tk_value) || (kind == TCKind._tk_value_box)) { + insert_Streamable(new ValueHolder(t, v)); + m_type = t; + } else { + throw new BAD_OPERATION(); + } + } + + public static boolean dump(org.omg.CORBA.Any any, + java.io.PrintWriter output) + throws java.io.IOException + { + if ((any == null) || (output == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + output.print("[ANY]"); + TypeCodeDumper.dump(any.type(), output); + + org.omg.CORBA.portable.InputStream input = any.create_input_stream(); + + return TypeCodeDumper.dumpValue(any.type(), input, output); + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/BidirectionalPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/BidirectionalPolicyImpl.java.svn-base new file mode 100644 index 0000000..72751b9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/BidirectionalPolicyImpl.java.svn-base @@ -0,0 +1,170 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.BiDirPolicy.BOTH; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.BidirectionalPolicyHelper; +import org.omg.BiDirPolicy.BidirectionalPolicyValueHelper; +import org.omg.BiDirPolicy.NORMAL; +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * Implementation of BidirectionalPolicy + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class BidirectionalPolicyImpl extends PseudoObject + implements org.omg.BiDirPolicy.BidirectionalPolicy +{ + /** + * The policy value: BidirPolicy::BOTH or BiDirPolicy::NORMAL + */ + private short m_value; + + public BidirectionalPolicyImpl(short value) + { + m_value = value; + } + + public short value() + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST(); + } + + return m_value; + } + + public int policy_type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return new BidirectionalPolicyImpl(m_value); + } + + public void destroy() + { + m_destroyed = true; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST("Policy destroyed."); + } + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals( + "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0")) { + return true; + } + + return super._is_a(repositoryIdentifier); + + } + + public static Policy read(CDRInputStream input) + { + short value = input.read_short(); + + if(value != BOTH.value && value != NORMAL.value) { + throw new MARSHAL(); + } + + return new BidirectionalPolicyImpl(value); + } + + /** + * @param output + */ + public static void write(CDROutputStream output, Policy policy) + { + BidirectionalPolicy bidir_policy = + BidirectionalPolicyHelper.narrow(policy); + + output.write_ushort(bidir_policy.value()); + + } + + public static BidirectionalPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + short policy_value = BidirectionalPolicyValueHelper.extract(val); + + if ((policy_value != org.omg.BiDirPolicy.BOTH.value) + && (policy_value != org.omg.BiDirPolicy.NORMAL.value)) + throw new PolicyError(BAD_POLICY_VALUE.value); + + return new BidirectionalPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/CodecFactoryImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/CodecFactoryImpl.java.svn-base new file mode 100644 index 0000000..0835a16 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/CodecFactoryImpl.java.svn-base @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.OBJECT_NOT_EXIST; + +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +public class CodecFactoryImpl extends org.omg.IOP.CodecFactoryLocalBase +{ + + private boolean m_destroyed; + + private es.tid.TIDorbj.core.TIDORB m_orb; + + public CodecFactoryImpl(es.tid.TIDorbj.core.TIDORB orb) + { + m_destroyed = false; + this.m_orb = orb; + } + + public synchronized void destroy() + { + m_destroyed = true; + m_orb = null; + } + + public synchronized org.omg.IOP.Codec create_codec(org.omg.IOP.Encoding enc) + throws org.omg.IOP.CodecFactoryPackage.UnknownEncoding + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST(); + } + + if (enc == null) { + throw new BAD_PARAM("Null Object reference"); + } + + if (enc.format != org.omg.IOP.ENCODING_CDR_ENCAPS.value) { + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + if (enc.major_version != 1) { + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + switch (enc.minor_version) + { + case 0: + return new + CodecImpl(m_orb,GIOPVersion.VERSION_1_0); + case 1: + return new CodecImpl(m_orb,GIOPVersion.VERSION_1_1); + case 2: + return new CodecImpl(m_orb,GIOPVersion.VERSION_1_2); + default: + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/CodecImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/CodecImpl.java.svn-base new file mode 100644 index 0000000..b6f9d63 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/CodecImpl.java.svn-base @@ -0,0 +1,187 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class CodecImpl extends org.omg.IOP.CodecLocalBase +{ + + private es.tid.TIDorbj.core.TIDORB m_orb; + + private es.tid.TIDorbj.core.comm.giop.GIOPVersion m_version; + + public CodecImpl(es.tid.TIDorbj.core.TIDORB orb, + es.tid.TIDorbj.core.comm.giop.GIOPVersion version) + { + m_orb = orb; + m_version = version; + } + + public byte[] encode(org.omg.CORBA.Any data) + throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDROutputStream out = (CDROutputStream) m_orb.create_output_stream(); + + out.setVersion(m_version); + // write the any into an encapsulation + + out.enterEncapsulation(); + + try { + out.write_any(data); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.InvalidTypeForEncoding(); + } + + out.exitEncapsulation(); + + // read the byte array + + InputStream input = out.create_input_stream(); + + int length = input.read_ulong(); + + byte[] value = new byte[length]; + + input.read_octet_array(value, 0, length); + + return value; + + } + + public org.omg.CORBA.Any decode(byte[] data) + throws org.omg.IOP.CodecPackage.FormatMismatch + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDRInputStream input = new CDRInputStream(m_orb, data); + + input.setByteOrder(input.read_boolean()); + + input.setVersion(m_version); + try { + return input.read_any(); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.FormatMismatch(); + } + } + + public byte[] encode_value(org.omg.CORBA.Any data) + throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDROutputStream out = (CDROutputStream) m_orb.create_output_stream(); + + out.setVersion(m_version); + + // write the any into an encapsulation + out.enterEncapsulation(); + + try { + data.write_value(out); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.InvalidTypeForEncoding(); + } + + out.exitEncapsulation(); + + // read the byte array + + InputStream input = out.create_input_stream(); + + int length = input.read_ulong(); + + byte[] value = new byte[length]; + + input.read_octet_array(value, 0, length); + + return value; + } + + public org.omg.CORBA.Any decode_value(byte[] data, + org.omg.CORBA.TypeCode tc) + throws org.omg.IOP.CodecPackage.FormatMismatch, + org.omg.IOP.CodecPackage.TypeMismatch + { + if ((data == null) || (tc == null)) { + throw new BAD_PARAM(); + } + + CDRInputStream input = new CDRInputStream(m_orb, data); + + input.setVersion(m_version); + + input.setByteOrder(input.read_boolean()); + + org.omg.CORBA.Any any = m_orb.create_any(); + + try { + any.read_value(input, tc); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.TypeMismatch(); + } + catch (org.omg.CORBA.MARSHAL bo) { + throw new org.omg.IOP.CodecPackage.FormatMismatch(); + } + + return any; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ConfORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ConfORB.java.svn-base new file mode 100644 index 0000000..d8b01c7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ConfORB.java.svn-base @@ -0,0 +1,1662 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.applet.Applet; +import java.util.Arrays; +import java.util.Properties; +import java.util.Vector; + +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.PolicyError; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.SystemProperties; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.util.UTC; + +/** + * Configuration set for TIDorb. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ConfORB +{ + + /** + * ORB Policies + */ + + PolicyContext policy_context; + + /** + * Default ORB Policies + */ + + final static PolicyContext st_default_policy_context = + createDefaultPolicies(); + + /** + * TIDorb ORB Identifier: 666. This value must be registered in OMG. + */ + + public final static es.tid.TIDorbj.core.iop.ORBComponent ORB_TYPE = + new es.tid.TIDorbj.core.iop.ORBComponent(1414087680); + + /** + * TIDorb ORB_id + */ + + public final static String orb_id_name = "-ORBid"; + + public final static String DEFAULT_ORB_ID = "TIDorbJ"; + + public String orb_id = DEFAULT_ORB_ID; + + /** + * TIDorb Initial References + */ + + public java.util.Vector initial_references = new java.util.Vector(); + + /** + * TIDorb Default Initial References + */ + public final static String init_refs_name = "-ORBInitRef"; + + /** + * TIDorb Default Initial References + */ + + public String default_initial_reference = null; + + public final static String def_init_ref_name = "-ORBDefaultInitRef"; + + /** + * NamingService Property name. + */ + + public final static String naming_service_name = + "es.tid.TIDorbj.naming_service"; + + /** + * Default chunk size for CDR buffers. Default value: 256. + */ + + public final static int DEFAULT_BLOCK_SIZE = 256; + + /** + * Chunk size for CDR buffers. + *

+ * Values must be > 256 and multiple of 8 + */ + + public int block_size = DEFAULT_BLOCK_SIZE; + + /** + * Block_size Property name. + */ + + public final static String block_size_name = "es.tid.TIDorbj.block_size"; + + /** + * Default exhaustive TypeCode matching. + */ + public final static boolean DEFAULT_EXHAUSTIVE_EQUAL = false; + + /** + * Make or not an exhaustive TypeCode matching: + *

+ * Values must be "true" or "false". + */ + + public boolean exhaustive_equal = DEFAULT_EXHAUSTIVE_EQUAL; + + /** + * Exhaustive equal Property name. + */ + + public final static String exhaustive_equal_name = + "es.tid.TIDorbj.exhaustive_equal"; + + + /** + * Maximun time, in miliseconds, waiting a request reply. + *

+ * Values must be greater or equal than 0. Default value: 5000. + */ + + public final static long DEFAULT_MAX_BLOCKED_TIME = 5000; + + /** + * max_blocked_time Property name. + */ + + public final static String max_blocked_time_name = + "es.tid.TIDorbj.max_blocked_time"; + + + + public long max_blocked_time = DEFAULT_MAX_BLOCKED_TIME; + + /** + * Default TypeCode Cache Size. Default value: 0, no cache. + */ + + public final static int DEFAULT_TYPECODE_CACHE_SIZE = 0; + + /** + * Maximum of TypeCodes stored in the TypeCodeCache. + *

+ * Values must be greater or equal than 0. + */ + + public int typecode_cache_size = DEFAULT_TYPECODE_CACHE_SIZE; + + /** + * typecode_cache_size Property name. + */ + + public final static String typecode_cache_size_name = + "es.tid.TIDorbj.typecode_cache_size"; + + + /** + * Comma separated list of CommunicationLayer implementatios to be loaded at + * ORB's startup. By default, only IIOP comm layer will be loaded. + */ + public final static String DEFAULT_COMM_LAYER = + "es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer"; + + public String comm_layers = DEFAULT_COMM_LAYER; + + public final static String comm_layers_name = + "es.tid.TIDorbj.comm_layers"; + + + /** + * BidirectionalPolicy used. Values allowed NORMAL or BOTH + */ + public final static short DEFAULT_BIDIRECTIONAL = + org.omg.BiDirPolicy.NORMAL.value; + /** + * BIDIRECTIONAL Property name. + */ + public final static String bidirectional_name = + "es.tid.TIDorbj.bidirectional"; + + + /** + * Default ORB's maximum threads number per POAManager. + *

+ * Default value: 20. + */ + + public final static int DEFAULT_POA_MAX_THREADS = 20; + + /** + * ORB's maximum threads number per POAManager. + *

+ * Values must be greater than 0. + */ + + public int poa_max_threads = DEFAULT_POA_MAX_THREADS; + + /** + * max_threads Property name. + */ + + public final static String poa_max_threads_name = + "es.tid.TIDorbj.poa.max_threads"; + + /** + * Default ORB's minimum threads number per POAManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_POA_MIN_THREADS = 1; + + /** + * ORB's minimum threads number per POAManager. + *

+ * Values must be greater or equal than 0. + */ + + public int poa_min_threads = DEFAULT_POA_MIN_THREADS; + + /** + * min_threads Property name. + */ + + public final static String poa_min_threads_name = + "es.tid.TIDorbj.poa.min_threads"; + + /** + * Default ORB's queued requests number per POAManager. + *

+ * Default value: 1000. + */ + + public final static int DEFAULT_POA_MAX_QUEUED_REQUESTS = 1000; + + /** + * ORB's maximum queued requests number per POAManager. + *

+ * Values must be greater or equal than 0. + */ + + public int poa_max_queued_requests = DEFAULT_POA_MAX_QUEUED_REQUESTS; + + /** + * max_queued_requests Property name. + */ + + public final static String poa_max_queued_requests_name = + "es.tid.TIDorbj.poa.max_queued_requests"; + + /** + * Default thread's maximum idle time per POAManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_POA_STARVING_TIME = 0; + + /** + * Thread's maximum idle time per per POAManager. + *

+ * If it is 0, a thread can be idle forever. + */ + + public int poa_starving_time = DEFAULT_POA_STARVING_TIME; + + /** + * max_queued_requests Property name. + */ + + public final static String poa_starving_time_name = + "es.tid.TIDorbj.poa.starving_time"; + + + + /** + * Default AMIManager's maximum threads number + *

+ * Default value: 20. + */ + + public final static int DEFAULT_AMI_MAX_THREADS = 20; + + /** + * AMIManager's maximum threads number + *

+ * Values must be greater than 0. + */ + + public int ami_max_threads = DEFAULT_AMI_MAX_THREADS; + + /** + * max_threads Property name. + */ + + public final static String ami_max_threads_name = + "es.tid.TIDorbj.ami.max_threads"; + + /** + * Default AMIManager's minimum threads number. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_AMI_MIN_THREADS = 1; + + /** + * AMIManager's minimum threads number. + *

+ * Values must be greater or equal than 0. + */ + + public int ami_min_threads = DEFAULT_AMI_MIN_THREADS; + + /** + * ami_threads Property name. + */ + + public final static String ami_min_threads_name = + "es.tid.TIDorbj.ami.min_threads"; + + /** + * Default AMIManager's queued handled requests number . + *

+ * Default value: 1000. + */ + + public final static int DEFAULT_AMI_MAX_QUEUED_HANDLED_REQUESTS = 1000; + + /** + * AMIManager's maximum queued handled requests number . + *

+ * Values must be greater or equal than 0. + */ + + public int ami_max_queued_handled_requests = DEFAULT_AMI_MAX_QUEUED_HANDLED_REQUESTS; + + /** + * max_queued_requests Property name. + */ + + public final static String ami_max_queued_handled_requests_name = + "es.tid.TIDorbj.ami.max_queued_handled_requests"; + + /** + * Default thread's maximum idle time at AMIManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_AMI_STARVING_TIME = 0; + + /** + * Thread's maximum idle time per at AMIManager. + *

+ * If it is 0, a thread can be idle forever. + */ + + public int ami_starving_time = DEFAULT_AMI_STARVING_TIME; + + /** + * max_queued_requests Property name. + */ + + public final static String ami_starving_time_name = + "es.tid.TIDorbj.ami.starving_time"; + + /** + * Default Maximun blocket time waiting for the shutdown completion. Default + * value: 5000. + */ + + public final static int DEFAULT_MAX_TIME_IN_SHUTDOWN = 5000; + + /** + * Maximun time, in miliseconds, waiting for the shutdown completion. + *

+ * Values must be greater or equal than 0. + */ + + public int max_time_in_shutdown = DEFAULT_MAX_TIME_IN_SHUTDOWN; + + /** + * max_time_in_shutdown Property name. + */ + + public final static String max_time_in_shutdown_name = + "es.tid.TIDorbj.max_time_in_shutdown"; + + /** + * Default Trace Level. Default value: Traces.NONE. + */ + + public final static int DEFAULT_TRACE_LEVEL = Trace.NONE; + + /** + * Trace Level. Values must be between 0 and 4. + */ + + public int trace_level = DEFAULT_TRACE_LEVEL; + + /** + * Trace Level Property name. + */ + + public final static String trace_level_name = + "es.tid.TIDorbj.trace.level"; + + /** + * Trace file name. + */ + + public String trace_file = null; + + /** + * Trace file property name. + */ + + public final static String trace_file_name = + "es.tid.TIDorbj.trace.file"; + + /** + * Default Trace file size. Default value: 10 K. + */ + public final static long DEFAULT_FILE_SIZE = 10240; + + /** + * Trace list files size + */ + public long trace_file_size = DEFAULT_FILE_SIZE; + + /** + * Trace list files size property name + */ + public final static String trace_file_size_name = + "es.tid.TIDorbj.trace.file_size"; + + /** + * Default Trace files list length. Default value: 1 file. + */ + public final static int DEFAULT_NUM_FILES = 1; + + /** + * Trace files list length + */ + public int trace_num_files = DEFAULT_NUM_FILES; + + /** + * Trace files list length property name + */ + public final static String trace_num_files_name = + "es.tid.TIDorbj.trace.num_files"; + + + /** + * Default qos. + */ + public final static boolean DEFAULT_QOS_ENABLED = true; + + /** + * Enable QoS policies for client and server side. + *

    + *
  • If true enabled QoS policies + *
  • If false disabled QoS policies. + *
+ * Values must be "true" or "false". + */ + + public boolean qos_enabled = DEFAULT_QOS_ENABLED; + + /** + * Exhaustive equal Property name. + */ + + public final static String qos_enabled_name = + "es.tid.TIDorbj.qos_enabled"; + + + + + /** + * Default ORB's ZIOP internal chunk size. + *

+ * Default value: 32768. + */ + + public final static int DEFAULT_ZIOP_CHUNK_SIZE = 32768; + + /** + * ORB's ZIOP internal chunk size. + *

+ * Values must be greater or equal than 0. + */ + + public int ziop_chunk_size = DEFAULT_ZIOP_CHUNK_SIZE; + + /** + * ziop_chunk_size Property name. + */ + + public final static String ziop_chunk_size_name = + "es.tid.TIDorbj.ziop_chunk_size"; + + + /** + * Default assume ziop at server side. + */ + public final static boolean DEFAULT_ASSUME_ZIOP_SERVER = false; + + /** + * Assume ZIOP policies enabled at server side. Useful to connect through + * corbaloc or Unicast/Multicast + *

    + *
  • If true server has ZIOP policies defined and known by client + *
  • If false server has not ZIOP policies. + *
+ * Values must be "true" or "false". + */ + + public boolean assume_ziop_server = DEFAULT_ASSUME_ZIOP_SERVER; + + /** + * Exhaustive equal Property name. + */ + + public final static String assume_ziop_server_name = + "es.tid.TIDorbj.assume_ziop_server"; + + + + private Applet parameters; + private Properties properties; + private Vector arguments; + + + protected static PolicyContext createDefaultPolicies() + { + PolicyContext context = new PolicyContext(null); + + try { + context.setPolicy( + new RelativeRoundtripTimeoutPolicyImpl( + UTC.toTimeT(DEFAULT_MAX_BLOCKED_TIME))); + context.setPolicy( + new BidirectionalPolicyImpl(DEFAULT_BIDIRECTIONAL)); + } + catch (PolicyError pe) {} + + return context; + } + + public ConfORB() + { + policy_context = new PolicyContext(st_default_policy_context); + } + + public PolicyContext getPolicyContext() + { + return policy_context; + } + + /** + * Initialize the ORB properties. + * + * @param args + * the arguments vector. + * @param props + * the properties. + */ + public void init(String[] args, java.util.Properties props) + { + parse_system_properties(); + + if (props != null) + init(props); + + if (args != null) + init(args); + } + + /** + * Initialize the ORB properties with the Applet arguments. + * + * @param app + * the applet that has created the ORB. + * @param props + * the properties. + */ + public void init(java.applet.Applet app, java.util.Properties props) + { + // parse_system_properties(); + + if (props != null) + init(props); + + if (app != null) + init(app); + + } + + /** + * Initialize the ORB properties with the arguments vector. + * + * @param app + * the applet that has created the ORB. + */ + + public void init(String[] args) + { + if ( this.arguments == null ){ + this.arguments = new Vector( args.length ); + } + this.arguments.addAll( Arrays.asList( args ) ); + + + int i = 0; + String name; + + while (i < args.length - 1) { + if ((args[i] == null) || (args[i].length() == 0)) { + i++; + } else { + if ( args[i].equals(comm_layers_name) ) + parse_comm_layers( args[++i] ); + if (args[i].equals(def_init_ref_name)) + default_initial_reference = args[++i]; + if (args[i].equals(orb_id_name)) + orb_id = args[++i]; + else if (args[i].equals(init_refs_name)) + parse_init_ref(args[++i]); + else if (args[i].equals(naming_service_name)) + parse_naming_service(args[++i]); + else if (args[i].equals(block_size_name)) + parse_block_size(args[++i]); + else if (args[i].equals(exhaustive_equal_name)) + parse_exhaustive_equal(args[++i]); + else if (args[i].equals(typecode_cache_size_name)) + parse_typecode_cache_size(args[++i]); + else if (args[i].equals(bidirectional_name)) + parse_bidirectional(args[++i]); + else if (args[i].equals(max_blocked_time_name)) + parse_max_blocked_time(args[++i]); + else if (args[i].equals(poa_max_threads_name)) + parse_poa_max_threads(args[++i]); + else if (args[i].equals(poa_min_threads_name)) + parse_poa_min_threads(args[++i]); + else if (args[i].equals(poa_max_queued_requests_name)) + parse_poa_max_queued_requests(args[++i]); + else if (args[i].equals(poa_starving_time_name)) + parse_poa_starving_time(args[++i]); + else if (args[i].equals(max_time_in_shutdown_name)) + parse_max_time_in_shutdown(args[++i]); + else if (args[i].equals(ami_max_threads_name)) + parse_ami_max_threads(args[++i]); + else if (args[i].equals(ami_min_threads_name)) + parse_ami_min_threads(args[++i]); + else if (args[i].equals(ami_max_queued_handled_requests_name)) + parse_ami_max_queued_handled_requests(args[++i]); + else if (args[i].equals(ami_starving_time_name)) + parse_ami_starving_time(args[++i]); + else if (args[i].equals(trace_file_name)) + trace_file = args[++i]; + else if (args[i].equals(trace_level_name)) + parse_trace_level(args[++i]); + else if (args[i].equals(trace_file_size_name)) + parse_trace_file_size(args[++i]); + else if (args[i].equals(trace_num_files_name)) + parse_trace_num_files(args[++i]); + else if (args[i].equals(qos_enabled_name)) + parse_qos_enabled(args[++i]); + else if (args[i].equals(ziop_chunk_size_name)) + parse_ziop_chunk_size(args[++i]); + else if (args[i].equals(assume_ziop_server_name)) + parse_assume_ziop_server(args[++i]); + else + i++; + } + } + + } + + + + /** + * Initialize the ORB properties with the Applet arguments. + * + * @param app + * the applet that has created the ORB. + */ + + public void init(Applet app) + { + this.parameters = app; + + parse_init_ref(app.getParameter(init_refs_name)); + + String aux_initial = app.getParameter(def_init_ref_name); + + if (aux_initial != null) + default_initial_reference = aux_initial; + + String id = app.getParameter(orb_id_name); + if (id != null) + orb_id = id; + + parse_comm_layers( app.getParameter(comm_layers_name)); + parse_naming_service(app.getParameter(naming_service_name)); + parse_block_size(app.getParameter(block_size_name)); + parse_exhaustive_equal(app.getParameter(exhaustive_equal_name)); + parse_typecode_cache_size(app.getParameter(typecode_cache_size_name)); + parse_bidirectional(app.getParameter(bidirectional_name)); + parse_max_blocked_time(app.getParameter(max_blocked_time_name)); + parse_poa_max_threads(app.getParameter(poa_max_threads_name)); + parse_poa_min_threads(app.getParameter(poa_min_threads_name)); + parse_poa_max_queued_requests( + app.getParameter(poa_max_queued_requests_name)); + parse_poa_starving_time(app.getParameter(poa_starving_time_name)); + parse_max_time_in_shutdown(app.getParameter(max_time_in_shutdown_name)); + + parse_ami_max_threads(app.getParameter(ami_max_threads_name)); + parse_ami_min_threads(app.getParameter(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + app.getParameter(ami_max_queued_handled_requests_name)); + parse_ami_starving_time(app.getParameter(poa_starving_time_name)); + + String aux_trace = app.getParameter(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(app.getParameter(trace_level_name)); + parse_trace_file_size(app.getParameter(trace_file_size_name)); + parse_trace_num_files(app.getParameter(trace_num_files_name)); + + parse_qos_enabled(app.getParameter(qos_enabled_name)); + parse_ziop_chunk_size(app.getParameter(ziop_chunk_size_name)); + parse_assume_ziop_server(app.getParameter(assume_ziop_server_name)); + } + + /** + * Initialize the ORB properties with the Properties object. + * + * @param props + * the properties. + */ + + public void init(java.util.Properties props) + { + if ( this.properties == null ){ + this.properties = new Properties(); + } + this.properties.putAll( props ); + + parse_comm_layers(props.getProperty(comm_layers_name)); + parse_naming_service(props.getProperty(naming_service_name)); + parse_block_size(props.getProperty(block_size_name)); + parse_exhaustive_equal(props.getProperty(exhaustive_equal_name)); + parse_typecode_cache_size(props.getProperty(typecode_cache_size_name)); + parse_bidirectional(props.getProperty(bidirectional_name)); + parse_max_blocked_time(props.getProperty(max_blocked_time_name)); + parse_poa_max_threads(props.getProperty(poa_max_threads_name)); + parse_poa_min_threads(props.getProperty(poa_min_threads_name)); + parse_poa_max_queued_requests( + props.getProperty(poa_max_queued_requests_name)); + parse_poa_starving_time(props.getProperty(poa_starving_time_name)); + parse_max_time_in_shutdown(props.getProperty(max_time_in_shutdown_name)); + + parse_ami_max_threads(props.getProperty(ami_max_threads_name)); + parse_ami_min_threads(props.getProperty(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + props.getProperty(ami_max_queued_handled_requests_name)); + parse_ami_starving_time(props.getProperty(ami_starving_time_name)); + + String aux_trace = props.getProperty(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(props.getProperty(trace_level_name)); + parse_trace_file_size(props.getProperty(trace_file_size_name)); + parse_trace_num_files(props.getProperty(trace_num_files_name)); + + parse_qos_enabled(props.getProperty(qos_enabled_name)); + parse_ziop_chunk_size(props.getProperty(ziop_chunk_size_name)); + parse_assume_ziop_server(props.getProperty(assume_ziop_server_name)); + } + + /** + * Search the ORB properties in the SystemProperties. + */ + + public void parse_system_properties() + { + parse_comm_layers( SystemProperties.findProperty(comm_layers_name) ); + parse_naming_service( + SystemProperties.findProperty(naming_service_name)); + parse_block_size(SystemProperties.findProperty(block_size_name)); + parse_exhaustive_equal( + SystemProperties.findProperty(exhaustive_equal_name)); + parse_max_blocked_time( + SystemProperties.findProperty(max_blocked_time_name)); + parse_poa_max_threads( + SystemProperties.findProperty(poa_max_threads_name)); + parse_poa_min_threads( + SystemProperties.findProperty(poa_min_threads_name)); + parse_poa_max_queued_requests( + SystemProperties.findProperty(poa_max_queued_requests_name)); + parse_poa_starving_time( + SystemProperties.findProperty(poa_starving_time_name)); + parse_max_time_in_shutdown( + SystemProperties.findProperty(max_time_in_shutdown_name)); + + parse_ami_max_threads( + SystemProperties.findProperty(ami_max_threads_name)); + parse_ami_min_threads( + SystemProperties.findProperty(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + SystemProperties.findProperty(ami_max_queued_handled_requests_name)); + parse_ami_starving_time( + SystemProperties.findProperty(ami_starving_time_name)); + + String aux_trace = SystemProperties.findProperty(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(SystemProperties.findProperty(trace_level_name)); + parse_trace_file_size( + SystemProperties.findProperty(trace_file_size_name)); + parse_trace_num_files( + SystemProperties.findProperty(trace_num_files_name)); + + parse_qos_enabled( + SystemProperties.findProperty(qos_enabled_name)); + parse_ziop_chunk_size( + SystemProperties.findProperty(ziop_chunk_size_name)); + parse_assume_ziop_server( + SystemProperties.findProperty(assume_ziop_server_name)); + } + + /********************************************************************/ + /* COMPATIBILIDAD CON VERSIONES ANTIGUAS */ + /********************************************************************/ + public void fillPropertyInfoOldValues( PropertyInfo pi ){ + if ( pi != null ){ + + boolean old_property_name_founded = false; + String old_property_name = ""; + String new_property_name = pi.getName(); + + if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.PORT)){ + old_property_name = "es.tid.TIDorbj.iiop.orb_port"; + old_property_name_founded = true; + } else if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS)){ + old_property_name = "es.tid.TIDorbj.iiop.ip_address"; + old_property_name_founded = true; + } else if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY)){ + old_property_name = "es.tid.TIDorbj.reliable_oneway"; + old_property_name_founded = true; + } + + if (old_property_name_founded){ + boolean found = false; + if ( !found && this.parameters != null ){ + String value; + value = this.parameters.getParameter(old_property_name ); + found = value != null; + if ( found ) { + pi.setValue( value ); + } + } + if ( !found && this.arguments != null ){ + int index; + index = this.arguments.indexOf( old_property_name ); + found = index > -1; + if ( found ){ + pi.setValue( (String)this.arguments.elementAt( ++index ) ); + } + } + if ( !found && this.properties != null ){ + String value; + value = this.properties.getProperty( old_property_name ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + if ( !found ){ + String value; + value = SystemProperties.findProperty( old_property_name ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + } + } + }//fillPropertyInfoOldValues + + /********************************************************************/ + + + public void fillPropertyInfo( PropertyInfo pi ){ + if ( pi != null ){ + fillPropertyInfoOldValues(pi); + boolean found = false; + if ( !found && this.parameters != null ){ + String value; + value = this.parameters.getParameter( pi.getName() ); + found = value != null; + if ( found ) { + pi.setValue( value ); + } + } + if ( !found && this.arguments != null ){ + int index; + index = this.arguments.indexOf( pi.getName() ); + found = index > -1; + if ( found ){ + pi.setValue( (String)this.arguments.elementAt( ++index ) ); + } + } + if ( !found && this.properties != null ){ + String value; + value = this.properties.getProperty( pi.getName() ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + if ( !found ){ + String value; + value = SystemProperties.findProperty( pi.getName() ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + } + } + + public void fillPropertyInfo( PropertyInfo[] pis ){ + if ( pis != null ){ + PropertyInfo pi; + for ( int i=0; i < pis.length; i++ ) { + this.fillPropertyInfo( pis[ i ] ); + } + } + } + + public void parse_init_ref(String str) + { + if (str == null) + return; + + InitialReference init_ref = new InitialReference(); + + init_ref.parse(str); + + initial_references.addElement(init_ref); + } + + public void parse_naming_service(String str) + { + if (str == null) + return; + InitialReference init_ref = new InitialReference("NameService", str); + + initial_references.addElement(init_ref); + } + + /** + * Parse the communications layer instances that should be passed to the + * CommunicationManager to be initialized. + * This method will check for the existence of the default communication + * layer (DEFAULT_COMM_LAYER)... which will represent both the IIOP and the + * local comm layers... + * @param str + */ + public void parse_comm_layers( String str ){ + if ( str != null ){ + if ( (str.indexOf( DEFAULT_COMM_LAYER ) == -1 && + str.indexOf( "es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer" ) == -1 )&& + str.trim().length() > 0 ) { + //must include default comm layer + comm_layers = DEFAULT_COMM_LAYER + ":" + str; + } else { + //default comm layer already present, + comm_layers = str; + } + } + } + + + /** + * Parse the block_size value. + * + * @param str + * the value digits. + * @pre Values must be > 256 and multiple of 8. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_block_size(String str) + { + if (str == null) + return; + + int value = parse_int(block_size_name, str); + + if ((value < 256) || (value % CDR.LONG_SIZE != 0)) + throw new INITIALIZE(block_size_name + ":invalid value " + value + + " (minimum fragment size: 256)"); + + block_size = value; + } + + /** + * Parse the exhaustive_equal boolean value. + * + * @param str + * the value representation. + * @pre Values must be "true" or "false". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_exhaustive_equal(String str) + { + if (str == null) + return; + + exhaustive_equal = parse_boolean(exhaustive_equal_name, str); + } + + /** + * Parse the typecode_cache_size value. + * + * @param str + * the value digits. + * @pre Value must be > 1024 and multiple of 8. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_typecode_cache_size(String str) + { + if (str == null) + return; + + int value = parse_int(typecode_cache_size_name, str); + + if (value < 0) + throw new INITIALIZE(typecode_cache_size_name + ": invalid value " + + value + " (fragment size must be > 0)"); + + typecode_cache_size = value; + + } + + /** + * Parse the ORB nominal Bidirectional Policy. + * + * @param str + * the policy value. + * @pre Values must be "NORMAL", "BOTH". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + //TODO: remove iiop, this is por ORB's policy manager... + public void parse_bidirectional(String str) + { + if (str == null) + return; + + short value = 0; + + if (str.equals("NORMAL")) { + return; + } else if (str.equals("BOTH")) { + try { + policy_context.setPolicy( + new BidirectionalPolicyImpl(org.omg.BiDirPolicy.BOTH.value)); + } + catch (PolicyError pe) {} + } else { + throw new org.omg.CORBA.INITIALIZE("Invalid value" + + bidirectional_name + + "=" + str); + } + } + + /** + * Parse the max_blocked_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_max_blocked_time(String str) + { + if (str == null) + return; + + long value = parse_long(max_blocked_time_name, str); + + if (value < 0) + throw new INITIALIZE(max_blocked_time_name + ":invalid value " + + value + " (minimum blocked 0)"); + + if (value != DEFAULT_MAX_BLOCKED_TIME) { + // converts to TimeT (from ms to units of 100 ns) + value = UTC.toTimeT(value); + try { + policy_context.setPolicy( + new RelativeRoundtripTimeoutPolicyImpl(value)); + } + catch (PolicyError pe) {} + max_blocked_time = value; + } + + } + + /** + * Parse the poa_max_threads value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_max_threads(String str) + { + if (str == null) + return; + + int value = parse_int(poa_max_threads_name, str); + + if (value < 1) + throw new INITIALIZE(poa_max_threads_name + ":invalid value " + + value + " (minimum 1)"); + + poa_max_threads = value; + + } + + /** + * Parse the poa_min_threads value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_min_threads(String str) + { + if (str == null) + return; + + int value = parse_int(poa_min_threads_name, str); + + if (value < 1) + throw new INITIALIZE(poa_min_threads_name + ":invalid value " + + value + " (minimum 1)"); + + poa_min_threads = value; + + } + + /** + * Parse the poa_max_queued_requests value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_max_queued_requests(String str) + { + if (str == null) + return; + + int value = parse_int(poa_max_queued_requests_name, str); + + if (value < 1) + throw new INITIALIZE(poa_max_queued_requests_name + + ":invalid value " + value + " (minimum 1)"); + + poa_max_queued_requests = value; + + } + + /** + * Parse the poa_starving_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_starving_time(String str) + { + if (str == null) + return; + + int value = parse_int(poa_starving_time_name, str); + + if (value < 0) + throw new INITIALIZE(poa_starving_time_name + ":invalid value " + + value + " (minimum 0)"); + + poa_starving_time = value; + + } + + /** + * Parse the ami_max_threads value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_max_threads(String str) + { + if (str == null) + return; + + int value = parse_int(ami_max_threads_name, str); + + if (value < 1) + throw new INITIALIZE(ami_max_threads_name + ":invalid value " + + value + " (minimum 1)"); + + ami_max_threads = value; + + } + + /** + * Parse the ami_min_threads value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_min_threads(String str) + { + if (str == null) + return; + + int value = parse_int(ami_min_threads_name, str); + + if (value < 1) + throw new INITIALIZE(ami_min_threads_name + ":invalid value " + + value + " (minimum 1)"); + + ami_min_threads = value; + + } + + /** + * Parse the ami_max_queued_requests value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_max_queued_handled_requests(String str) + { + if (str == null) + return; + + int value = parse_int(ami_max_queued_handled_requests_name, str); + + if (value < 1) + throw new INITIALIZE(ami_max_queued_handled_requests_name + + ":invalid value " + value + " (minimum 1)"); + + ami_max_queued_handled_requests = value; + + } + + /** + * Parse the ami_starving_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_starving_time(String str) + { + if (str == null) + return; + + int value = parse_int(ami_starving_time_name, str); + + if (value < 0) + throw new INITIALIZE(ami_starving_time_name + ":invalid value " + + value + " (minimum 0)"); + + ami_starving_time = value; + + } + + + + + /** + * Parse the max_time_in_shutdown value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_max_time_in_shutdown(String str) + { + if (str == null) + return; + + int value = parse_int(max_time_in_shutdown_name, str); + + if (value < 0) + throw new INITIALIZE(max_time_in_shutdown_name + ":invalid value " + + value + " (minimum blocked 0)"); + + max_time_in_shutdown = value; + + } + + + /** + * Parse the trace_level value. + * + * @param str + * the value digits. + * @pre Values must be between 0 and 4. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_trace_level(String str) + { + if (str == null) + return; + + int value = parse_int(trace_level_name, str); + + if ((value < Trace.NONE) || (value > Trace.DUMP)) + throw new INITIALIZE(trace_level_name + ":invalid value " + value + + " (valid value between 0 and 5)"); + + trace_level = value; + + } + + public void parse_trace_file_size(String size) + { + if (size == null) + return; + + long value = parse_long(trace_file_size_name, size); + + if (value < 1024L) + throw new INITIALIZE(trace_file_size_name + ": invalid value " + + value + " (valid value greater than 1024)"); + trace_file_size = value; + } + + public void parse_trace_num_files(String length) + { + if (length == null) + return; + + int value = parse_int(trace_num_files_name, length); + + if ((value < 1) || (value > 10)) + throw new INITIALIZE(trace_num_files_name + ": invalid value " + + value + " (valid value between 1 and 10)"); + + trace_num_files = value; + } + + + + + /** + * Parse the qos_enabled value. + * + * @param str + * the value digits. + * @pre Values must be true or false + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_qos_enabled(String str) + { + if (str == null) + return; + + qos_enabled = parse_boolean(qos_enabled_name, str); + + } + + /** + * Parse the ziop_chunk_size value. + * + * @param str + * the value digits. + * @pre Values must be > 0 + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ziop_chunk_size(String str) + { + if (str == null) + return; + + int value = parse_int(ziop_chunk_size_name, str); + + if (value > 0) + throw new INITIALIZE(ziop_chunk_size_name + ":invalid value " + value + + " (value must be > 0)"); + + ziop_chunk_size = value; + } + + + + /** + * Parse the assume_ziop_server value. + * + * @param str + * the value digits. + * @pre Values must be true or false + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_assume_ziop_server(String str) + { + if (str == null) + return; + + assume_ziop_server = parse_boolean(assume_ziop_server_name, str); + + } + + + + /** + * Parse the an int value. + * + * @param str + * the value digits. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid number. + */ + protected static int parse_int(String prop_name, String str) + { + try { + return Integer.parseInt(str); + } + catch (NumberFormatException num) { + throw new INITIALIZE(prop_name + ": int value expected."); + } + } + + /** + * Parse an long value + * + * @param str + * the value digits + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid number + */ + protected static long parse_long(String prop_name, String str) + { + try { + return Long.parseLong(str); + } + catch (NumberFormatException num) { + throw new INITIALIZE(prop_name + ": long value expected"); + } + } + + /** + * Parse the a boolean value. + * + * @param str + * the value representation: "true" or "false". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + protected static boolean parse_boolean(String prop_name, String str) + { + if (str.equals("true")) + return true; + else if (str.equals("false")) + return false; + else + throw new INITIALIZE(prop_name + ": boolean value expected."); + } + + public void dump(java.io.PrintWriter writer) + { + //TODO: complete dump with CommLayers stuff + writer.println("TIDorb properties:"); + + writer.print('\t'); + writer.print(block_size_name); + writer.print('='); + writer.println(block_size); + writer.print('\t'); + writer.print(exhaustive_equal_name); + writer.print('='); + writer.println(exhaustive_equal); + writer.print('\t'); + + writer.print(typecode_cache_size_name); + writer.print('='); + writer.println(typecode_cache_size); + + writer.println(); + + writer.print('\t'); + writer.print(poa_max_threads_name); + writer.print('='); + writer.println(poa_max_threads); + writer.print('\t'); + writer.print(poa_min_threads_name); + writer.print('='); + writer.println(poa_min_threads); + writer.print('\t'); + writer.print(poa_max_queued_requests_name); + writer.print('='); + writer.println(poa_max_queued_requests); + writer.print('\t'); + writer.print(poa_starving_time_name); + writer.print('='); + writer.println(poa_starving_time); + + writer.print('\t'); + writer.print(ami_max_threads_name); + writer.print('='); + writer.println(ami_max_threads); + writer.print('\t'); + writer.print(ami_min_threads_name); + writer.print('='); + writer.println(ami_min_threads); + writer.print('\t'); + writer.print(ami_max_queued_handled_requests_name); + writer.print('='); + writer.println(ami_max_queued_handled_requests); + writer.print('\t'); + writer.print(ami_starving_time_name); + writer.print('='); + writer.println(ami_starving_time); + + + writer.print('\t'); + writer.print(max_time_in_shutdown_name); + writer.print('='); + writer.println(max_time_in_shutdown); + writer.println(); + writer.print('\t'); + writer.print(trace_level_name); + writer.print('='); + writer.println(trace_level); + + if (trace_file != null) { + writer.print('\t'); + writer.print(trace_file_name); + writer.print('='); + writer.println(trace_file); + + writer.print('\t'); + writer.print(trace_file_size_name); + writer.print('='); + writer.println(trace_file_size); + + writer.print('\t'); + writer.print(trace_num_files_name); + writer.print('='); + writer.println(trace_num_files); + } + + writer.print("Default Policies:"); + st_default_policy_context.dump(writer); + writer.print('\n'); + writer.print("User Policies:"); + policy_context.dump(writer); + writer.print('\n'); + + writer.flush(); + } +} + diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ContextImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ContextImpl.java.svn-base new file mode 100644 index 0000000..8c31210 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ContextImpl.java.svn-base @@ -0,0 +1,325 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CTX_RESTRICT_SCOPE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Context; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA.TCKind; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * TIDorb ContextImpl pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ContextImpl extends org.omg.CORBA.Context +{ + + public ContextImpl(TIDORB orb, String name) + { + this(orb, name, null); + } + + public ContextImpl(TIDORB orb, String name, Context parent) + { + m_orb = orb; + m_name = name; + m_parent = parent; + m_values = null; + m_childs = null; + } + + public String context_name() + { + return m_name; + } + + public org.omg.CORBA.Context parent() + { + return m_parent; + } + + public org.omg.CORBA.Context create_child(String child_context_name) + { + if (child_context_name == null) { + + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + ContextImpl child = new ContextImpl(m_orb, child_context_name, this); + + if (m_childs == null) { + m_childs = new java.util.Vector(); + } + m_childs.addElement(child); + return child; + } + + public void set_one_value(String prop_name, org.omg.CORBA.Any value) + { + if ((prop_name == null) || (value == null)) { + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (m_values == null) { + m_values = new NVListImpl(m_orb); + } + + if (value.type().kind().value() != TCKind._tk_string) { + throw new BAD_PARAM("Value must have a string TypeCode."); + } + // new value + m_values.add_value(prop_name, value, 0); + } + + public void set_values(org.omg.CORBA.NVList values) + { + if (values == null) { + throw new BAD_PARAM("Null NVList reference", 0, + CompletionStatus.COMPLETED_NO); + } + + m_values = new NVListImpl(m_orb); + + int list_size = values.count(); + try { + for (int i = 0; i < list_size; i++) { + set_one_value(values.item(i).name(), values.item(i).value()); + } + } + catch (Bounds bds) {} + } + + public void delete_values(String prop_name) + { + if (prop_name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_values != null) { + int list_size = m_values.count(); + try { + for (int i = 0; i < list_size; i++) { + if (prop_name.equals(m_values.item(i).name())) { + m_values.remove(i); + } + } + } + catch (Bounds bds) {} + } + } + + public org.omg.CORBA.NVList get_values(String start_scope, int op_flags, + String pattern) + { + if ((start_scope == null) || (pattern == null)) { + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + NVListImpl list = new NVListImpl(m_orb); + + if (start_scope.equals(m_name)) { + int list_size = m_values.count(); + + try { + for (int i = 0; i < list_size; i++) { + + if (matchPattern(m_values.item(i).name(), pattern)) { + + list.add_value(m_values.item(i).name(), m_values + .item(i).value(), 0); + } + } + } + catch (Bounds bds) {}; + } + + if ((m_childs != null) && (op_flags != CTX_RESTRICT_SCOPE.value)) { + int child_size = m_childs.size(); + try { + NVList aux_list; + int list_size; + + for (int i = 0; i < child_size; i++) { + aux_list = ((Context) m_childs.elementAt(i)) + .get_values(start_scope, op_flags, pattern); + list_size = aux_list.count(); + + for (int j = 0; j < list_size; j++) { + list.add_value(aux_list.item(i).name(), aux_list + .item(i).value(), 0); + } + } + } + catch (Bounds bds) {} + + } + + return list; + } + + public String item(int i) + throws org.omg.CORBA.Bounds + { + return (m_values.item(i)).value().extract_string(); + } + + protected boolean matchPattern(String name, String pattern) + { + if (pattern.equals("*")) { + return true; + } + + int position = pattern.indexOf("*", 0); + if (position == -1) { + return name.equals(pattern); + } + if (position > name.length()) { + return false; + } + + String sub1 = pattern.substring(0, position); + String sub2 = name.substring(0, position); + return sub1.equals(sub2); + + } + + public static ContextImpl read(CDRInputStream input) + { + int pair_count = input.read_ulong(); + + if (pair_count == 0) { + return null; + } + + if ((pair_count < 1) || (pair_count % 2 != 0)) { + throw new MARSHAL("Malformed context name-value pairs", 0, + CompletionStatus.COMPLETED_NO); + } + + int num_values = pair_count / 2; + + ContextImpl context = new ContextImpl((TIDORB) input.orb(), ""); + + String name; + Any value; + + for (int i = 0; i < num_values; i++) { + name = input.read_string(); + value = input.orb().create_any(); + + value.insert_string(input.read_string()); + + context.set_one_value(name, value); + } + + return context; + } + + public static void write(CDROutputStream output, org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) + { + int contexts_count = contexts.count(); + + if (contexts_count == 0) { + //no context + output.write_ulong(0); + return; + } + + java.util.Vector nv_context = new java.util.Vector(); + + try { + NVList aux_list = null; + NamedValue nam_val = null; + int aux_list_size = 0; + + for (int i = 0; i < contexts_count; i++) { + aux_list = ctx.get_values("", 0, contexts.item(i)); + aux_list_size = aux_list.count(); + for (int j = 0; j < aux_list_size; j++) { + nam_val = aux_list.item(j); + nv_context.addElement(nam_val.name()); + nv_context.addElement(nam_val.value().extract_string()); + } + + } + } + catch (Bounds bds) {} + + int total_ctx_size = nv_context.size(); + + output.write_ulong(total_ctx_size); + + for (int i = 0; i < total_ctx_size; i++) { + output.write_string((String) nv_context.elementAt(i)); + } + } + + // members + + protected TIDORB m_orb; + + protected String m_name; + + protected Context m_parent; + + protected NVList m_values; + + protected java.util.Vector m_childs; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ContextListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ContextListImpl.java.svn-base new file mode 100644 index 0000000..485fa6c --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ContextListImpl.java.svn-base @@ -0,0 +1,90 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * TIDorb ContextList pseudobject implementation. + * + * @autor Juan A. Ca´ceres + * @version 0.1 + */ + +public class ContextListImpl extends org.omg.CORBA.ContextList +{ + + public ContextListImpl() + { + m_elements = new java.util.Vector(); + } + + public int count() + { + return m_elements.size(); + } + + public void add(String ctx) + { + m_elements.addElement(ctx); + } + + public String item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_elements.size()) { + throw new org.omg.CORBA.Bounds(); + } + + return (String) m_elements.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_elements.size()) { + throw new org.omg.CORBA.Bounds(); + } + m_elements.removeElementAt(index); + } + + protected java.util.Vector m_elements; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/EnvironmentImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/EnvironmentImpl.java.svn-base new file mode 100644 index 0000000..1bcc5de --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/EnvironmentImpl.java.svn-base @@ -0,0 +1,76 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * TIDorb Environment pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class EnvironmentImpl extends org.omg.CORBA.Environment +{ + + protected java.lang.Exception m_exception; + + public EnvironmentImpl() + { + m_exception = null; + } + + public void exception(java.lang.Exception exception) + { + m_exception = exception; + } + + public java.lang.Exception exception() + { + return m_exception; + } + + public void clear() + { + m_exception = null; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ExceptionListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ExceptionListImpl.java.svn-base new file mode 100644 index 0000000..563f684 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ExceptionListImpl.java.svn-base @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TCKind; + +/** + * TIDorb ExceptionList pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ExceptionListImpl extends org.omg.CORBA.ExceptionList +{ + + java.util.Vector m_exceptions; + + public ExceptionListImpl() + { + m_exceptions = new java.util.Vector(); + } + + public int count() + { + return m_exceptions.size(); + } + + public void add(org.omg.CORBA.TypeCode exc) + { + if (exc == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + if (exc.kind().value() != TCKind._tk_except) + throw new BAD_PARAM("Exception TypeCode expected", 0, + CompletionStatus.COMPLETED_NO); + + m_exceptions.addElement(exc); + } + + public org.omg.CORBA.TypeCode item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_exceptions.size()) + throw new org.omg.CORBA.Bounds(); + return (org.omg.CORBA.TypeCode) m_exceptions.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_exceptions.size()) + throw new org.omg.CORBA.Bounds(); + m_exceptions.removeElementAt(index); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ForwardRequest.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ForwardRequest.java.svn-base new file mode 100644 index 0000000..640ad01 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ForwardRequest.java.svn-base @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.iop.IOR; + +public class ForwardRequest extends java.lang.Exception +{ + public IOR m_reference; + + public ForwardRequest(IOR ref) + { + m_reference = ref; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/NVListImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/NVListImpl.java.svn-base new file mode 100644 index 0000000..5646c63 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/NVListImpl.java.svn-base @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.CORBA_2_3.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class NVListImpl extends org.omg.CORBA.NVList +{ + TIDORB m_orb; + + protected java.util.Vector m_components; + + public NVListImpl(TIDORB orb) + { + m_orb = orb; + m_components = new java.util.Vector(); + } + + public NVListImpl(TIDORB orb, int count) + { + m_components = new java.util.Vector(count); + } + + public int count() + { + return m_components.size(); + } + + public org.omg.CORBA.NamedValue add(int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, "", + m_orb.create_any()); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue add_item(String item_name, int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, item_name, + m_orb.create_any()); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue add_value(String name, + org.omg.CORBA.Any value, + int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, name, value); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_components.size()) + throw new Bounds(); + + return (org.omg.CORBA.NamedValue) m_components.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_components.size()) + throw new Bounds(); + m_components.removeElementAt(index); + } + + // TIDorb Operations + + public static void destroy(NVList list) + { + try { + int size = list.count(); + for (int i = 0; i < size; i++) + list.remove(i); + } + catch (org.omg.CORBA.Bounds b) {} + } + + public static void assignOutArguments(NVList from_list, NVList to_list) + { + assignOutArguments(from_list, to_list, false); + } + + public static void assignOutArguments(NVList from_list, NVList to_list, + boolean wrap_anys) + { + int length = to_list.count(); + + if (length < from_list.count()) + throw new MARSHAL("Invalid number of out arguments.", 0, + CompletionStatus.COMPLETED_NO); + + NamedValue to_nam_val = null; + + try { + for (int i = 0; i < length; i++) { + to_nam_val = to_list.item(i); + if (to_nam_val.flags() != ARG_IN.value) + AnyImpl.assignValue(from_list.item(i).value(), + to_nam_val.value(), wrap_anys); + } + + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + public static void assignInArguments(NVList from_list, NVList to_list) + { + assignInArguments(from_list, to_list, false); + } + + public static void assignInArguments(NVList from_list, NVList to_list, + boolean wrap_anys) + { + int length = to_list.count(); + + if (length < from_list.count()) + throw new MARSHAL("Invalid number of out arguments.", 0, + CompletionStatus.COMPLETED_NO); + + NamedValue to_nam_val = null; + + try { + for (int i = 0; i < length; i++) { + to_nam_val = to_list.item(i); + if (to_nam_val.flags() != ARG_OUT.value) + AnyImpl.assignValue(from_list.item(i).value(), + to_nam_val.value(), wrap_anys); + } + + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void readOutParams(NVList list, InputStream input) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) + nam_val.value().read_value(input, nam_val.value().type()); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void writeOutParams(NVList list, OutputStream output) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) + nam_val.value().write_value(output); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void readInParams(NVList list, InputStream input) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_OUT.value) + nam_val.value().read_value(input, nam_val.value().type()); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + public static void writeInParams(NVList list, OutputStream output) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_OUT.value) + nam_val.value().write_value(output); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + // AMI operations + + public static void setOutParamsAsIn(NVList list, RequestImpl replyHandlerRequest) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) { + org.omg.CORBA.Any $arg = replyHandlerRequest.add_named_in_arg(nam_val.name()); + $arg.type(nam_val.value().type()); + } + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + + public NVList removeInParams() { + NVList listWithoutIn = new NVListImpl(m_orb); + int length = m_components.size(); + + NamedValue nam_val = null; + for (int i = 0; i < length; i++) { + nam_val = (NamedValue) m_components.elementAt(i); + if (nam_val.flags() != ARG_IN.value) + listWithoutIn.add_value(nam_val.name(), nam_val.value(), nam_val.flags()); + } + + return listWithoutIn; + } + + public NVList removeOutParams() { + NVList listWithoutOut = new NVListImpl(m_orb); + int length = m_components.size(); + + NamedValue nam_val = null; + for (int i = 0; i < length; i++) { + nam_val = (NamedValue) m_components.elementAt(i); + if (nam_val.flags() != ARG_OUT.value) + listWithoutOut.add_value(nam_val.name(), nam_val.value(), nam_val.flags()); + } + + return listWithoutOut; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/NamedValueImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/NamedValueImpl.java.svn-base new file mode 100644 index 0000000..284770c --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/NamedValueImpl.java.svn-base @@ -0,0 +1,109 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_INOUT; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; + +/** + * TIDorb NameValueImpl pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class NamedValueImpl extends org.omg.CORBA.NamedValue +{ + + protected java.lang.String m_name; + + protected org.omg.CORBA.Any m_value; + + protected int m_flags; + + protected NamedValueImpl() + {} + + public static NamedValueImpl from_int(int flags, java.lang.String name, + org.omg.CORBA.Any value) + throws org.omg.CORBA.BAD_PARAM + { + if ((name == null) || (value == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + verifyFlags(flags); + NamedValueImpl named = new NamedValueImpl(); + named.m_name = name; + named.m_value = value; + named.m_flags = flags; + return named; + + } + + private static void verifyFlags(int flags) + { + if ((flags != ARG_IN.value) && (flags != ARG_INOUT.value) + && (flags != ARG_OUT.value)) + throw new BAD_PARAM("Invalid flag argument", 0, + CompletionStatus.COMPLETED_NO); + } + + public String name() + { + return m_name; + } + + public org.omg.CORBA.Any value() + { + return m_value; + } + + public int flags() + { + return m_flags; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ORBComponent.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ORBComponent.java.svn-base new file mode 100644 index 0000000..13122a8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ORBComponent.java.svn-base @@ -0,0 +1,71 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * Base class for TIDorb Components. It defines the basic methods for accessing + * the ORB. + *

+ * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class ORBComponent extends Object +{ + + /** + * The ORB. + */ + protected TIDORB m_orb; + + public ORBComponent(TIDORB orb) + { + m_orb = orb; + } + + public TIDORB orb() + { + return m_orb; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ORBServices.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ORBServices.java.svn-base new file mode 100644 index 0000000..2cefbfe --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ORBServices.java.svn-base @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; + +class ORBServices +{ + public final static String ROOT_POA_ID = "RootPOA"; + + public final static int ROOT_POA = 0; + + public final static String POA_CURRENT_ID = "POACurrent"; + + public final static int POA_CURRENT = 1; + + public final static String INTERFACE_REPOSITORY_ID = "InterfaceRepository"; + + public final static int INTERFACE_REPOSITORY = 2; + + public final static String NAME_SERVICE_ID = "NameService"; + + public final static int NAME_SERVICE = 3; + + public final static String TRADING_SERVICE_ID = "TradingService"; + + public final static int TRADING_SERVICE = 4; + + public final static String SECURITY_CURRENT_ID = "SecurityCurrent"; + + public final static int SECURITY_CURRENT = 5; + + public final static String TRANSACTION_CURRENT_ID = "TransactionCurrent"; + + public final static int TRANSACTION_CURRENT = 6; + + public final static String DYN_ANY_FACTORY_ID = "DynAnyFactory"; + + public final static int DYN_ANY_FACTORY = 7; + + public final static String ORB_POLICY_MANAGER_ID = "ORBPolicyManager"; + + public final static int ORB_POLICY_MANAGER = 8; + + public final static String POLICY_CURRENT_ID = "PolicyCurrent"; + + public final static int POLICY_CURRENT = 9; + + public final static String NOTIFICATION_SERVICE_ID = "NotificationService"; + + public final static int NOTIFICATION_SERVICE = 10; + + public final static String TYPED_NOTIFICATION_SERVICE_ID = + "TypedNotificationService"; + + public final static int TYPED_NOTIFICATION_SERVICE = 11; + + public final static String CODEC_FACTORY_ID = "CodecFactory"; + + public final static int CODEC_FACTORY = 12; + + public final static String PI_CURRENT_ID = "PICurrent"; + + public final static int PI_CURRENT = 13; + + public final static String RT_ORB_ID = "RTORB"; + + public final static int RT_ORB = 14; + + public final static String COMPRESSION_MANAGER_ID = "CompressionManager"; + + public final static int COMPRESSION_MANAGER = 15; + + + + private TIDORB m_orb; + + private java.util.Hashtable m_corba_services_ids; + + private java.util.Hashtable m_service_table; + + private final static Integer NULL_SERVICE = new Integer(0); + + public ORBServices(TIDORB orb) + { + m_orb = orb; + + m_corba_services_ids = new java.util.Hashtable(); + + m_corba_services_ids.put(ROOT_POA_ID, new Integer(ROOT_POA)); + m_corba_services_ids.put(POA_CURRENT_ID, new Integer(POA_CURRENT)); + m_corba_services_ids.put(INTERFACE_REPOSITORY_ID, + new Integer(INTERFACE_REPOSITORY)); + m_corba_services_ids.put(NAME_SERVICE_ID, new Integer(NAME_SERVICE)); + m_corba_services_ids.put(TRADING_SERVICE_ID, + new Integer(TRADING_SERVICE)); + m_corba_services_ids.put(SECURITY_CURRENT_ID, + new Integer(SECURITY_CURRENT)); + m_corba_services_ids.put(TRANSACTION_CURRENT_ID, + new Integer(TRANSACTION_CURRENT)); + m_corba_services_ids.put(DYN_ANY_FACTORY_ID, + new Integer(DYN_ANY_FACTORY)); + m_corba_services_ids.put(ORB_POLICY_MANAGER_ID, + new Integer(ORB_POLICY_MANAGER)); + m_corba_services_ids.put(POLICY_CURRENT_ID, + new Integer(POLICY_CURRENT)); + m_corba_services_ids.put(NOTIFICATION_SERVICE_ID, + new Integer(NOTIFICATION_SERVICE)); + m_corba_services_ids.put(TYPED_NOTIFICATION_SERVICE_ID, + new Integer(TYPED_NOTIFICATION_SERVICE)); + m_corba_services_ids.put(CODEC_FACTORY_ID, new Integer(CODEC_FACTORY)); + m_corba_services_ids.put(PI_CURRENT_ID, new Integer(PI_CURRENT)); + m_corba_services_ids.put(RT_ORB_ID, new Integer(RT_ORB)); + m_corba_services_ids.put(COMPRESSION_MANAGER_ID, new Integer(COMPRESSION_MANAGER)); + + m_service_table = new java.util.Hashtable(); + + m_service_table.put(ROOT_POA_ID, NULL_SERVICE); + m_service_table.put(POA_CURRENT_ID, NULL_SERVICE); + m_service_table.put(INTERFACE_REPOSITORY_ID, NULL_SERVICE); + m_service_table.put(NAME_SERVICE_ID, NULL_SERVICE); + m_service_table.put(TRADING_SERVICE_ID, NULL_SERVICE); + m_service_table.put(SECURITY_CURRENT_ID, NULL_SERVICE); + m_service_table.put(TRANSACTION_CURRENT_ID, NULL_SERVICE); + m_service_table.put(DYN_ANY_FACTORY_ID, NULL_SERVICE); + m_service_table.put(ORB_POLICY_MANAGER_ID, NULL_SERVICE); + m_service_table.put(POLICY_CURRENT_ID, NULL_SERVICE); + m_service_table.put(NOTIFICATION_SERVICE_ID, NULL_SERVICE); + m_service_table.put(TYPED_NOTIFICATION_SERVICE_ID, NULL_SERVICE); + m_service_table.put(CODEC_FACTORY_ID, NULL_SERVICE); + m_service_table.put(PI_CURRENT_ID, NULL_SERVICE); + m_service_table.put(RT_ORB_ID, NULL_SERVICE); + m_service_table.put(COMPRESSION_MANAGER_ID, NULL_SERVICE); + + } + + public synchronized void destroy() + { + m_service_table.clear(); + m_service_table = null; + + m_corba_services_ids.clear(); + m_corba_services_ids = null; + } + + public synchronized org.omg.CORBA.Object resolveService(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + java.lang.Object table_value = m_service_table.get(object_name); + + if (table_value == null) { + if (m_orb.m_conf.default_initial_reference == null) + throw new org.omg.CORBA.BAD_PARAM(object_name); + + return m_orb.string_to_object( + m_orb.m_conf.default_initial_reference + + object_name); + } + + org.omg.CORBA.Object obj = null; + + if (table_value instanceof org.omg.CORBA.Object) + return (org.omg.CORBA.Object) table_value; + + if ((table_value instanceof Integer) + && (((Integer) table_value) != NULL_SERVICE)) { + //TODO: recomment this + //known services are registered as NULL_SERVICE to + //mark them as known initially, and instantiated when + //requested... if a service is registered with neither + //its ior nor the null service, will be an error + throw new org.omg.CORBA.INTERNAL(); + } + + Integer orb_service_val = + (Integer) m_corba_services_ids.get(object_name); + + switch (orb_service_val.intValue()) + { + case ROOT_POA: + obj = m_orb.initPOA(); + m_service_table.put(ROOT_POA_ID, obj); + return obj; + case POA_CURRENT: + obj = m_orb.initPOACurrent(); + m_service_table.put(POA_CURRENT_ID, obj); + return obj; + case DYN_ANY_FACTORY: + obj = m_orb.initDynAnyFactory(); + m_service_table.put(DYN_ANY_FACTORY_ID, obj); + + return obj; + case CODEC_FACTORY: + obj = m_orb.initCodecFactory(); + m_service_table.put(CODEC_FACTORY_ID, obj); + return obj; + case ORB_POLICY_MANAGER: + obj = m_orb.initPolicyManager(); + m_service_table.put(ORB_POLICY_MANAGER_ID, obj); + return obj; + case POLICY_CURRENT: + obj = m_orb.initPolicyCurrent(); + m_service_table.put(POLICY_CURRENT_ID, obj); + return obj; + case COMPRESSION_MANAGER: + obj = m_orb.initCompressionManager(); + m_service_table.put(COMPRESSION_MANAGER_ID, obj); + return obj; + case RT_ORB: + case INTERFACE_REPOSITORY: + case NAME_SERVICE: + case TRADING_SERVICE: + case SECURITY_CURRENT: + case TRANSACTION_CURRENT: + case NOTIFICATION_SERVICE: + case TYPED_NOTIFICATION_SERVICE: + case PI_CURRENT: + throw new org.omg.CORBA.BAD_OPERATION("Service not available"); + default: + throw new org.omg.CORBA.INTERNAL(); + } + } + + public synchronized void registerInitialReference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + if (object_name == null) + throw new BAD_PARAM("Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + if (obj == null) + throw new BAD_PARAM("Null Object reference", + 24, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + if (m_corba_services_ids.containsKey(object_name)) + throw new org.omg.CORBA.ORBPackage.InvalidName(object_name); + + m_service_table.put(object_name, obj); + } + + public synchronized String[] listInitialServices() + { + java.util.Vector list = new java.util.Vector(); + + java.util.Enumeration e = m_service_table.keys(); + + while (e.hasMoreElements()) { + list.addElement(e.nextElement()); + } + + int ids_size = list.size(); + + String[] ids = new String[ids_size]; + + for (int i = 0; i < ids_size; i++) + ids[i] = (String) list.elementAt(i); + + return ids; + } + + protected synchronized void setService(String object_name, + org.omg.CORBA.Object obj) + { + if (object_name == null) + throw new BAD_PARAM( "Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + if (obj == null) + throw new BAD_PARAM("Null Object reference", + 24, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + m_service_table.put(object_name, obj); + } + + protected synchronized void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (object_name == null) + throw new BAD_PARAM("Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + if (m_service_table.containsKey(object_name)) + m_service_table.remove(object_name); + else + throw new org.omg.CORBA.ORBPackage.InvalidName(object_name); + } +} diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ObjectImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ObjectImpl.java.svn-base new file mode 100644 index 0000000..e4cb57c --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ObjectImpl.java.svn-base @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.comm.CommunicationException; + +public class ObjectImpl extends org.omg.CORBA_2_3.portable.ObjectImpl +{ + + protected final static String[] __ids = { "IDL:omg.org/CORBA/Object:1.0" }; + + public ObjectImpl() + {} + + public static ObjectImpl fromIOR(es.tid.TIDorbj.core.TIDORB orb, + es.tid.TIDorbj.core.iop.IOR ior) + { + ObjectImpl obj = new ObjectImpl(); + try { + obj._set_delegate( + orb.getCommunicationManager().createDelegate( ior ) + ); + } catch (CommunicationException ce ){ + //TODO: ¿? + } + return obj; + } + + public String[] _ids() + { + return __ids; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ObjectKey.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ObjectKey.java.svn-base new file mode 100644 index 0000000..4e07356 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ObjectKey.java.svn-base @@ -0,0 +1,135 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.util.Base64Codec; + +/** + * ObjectKey data structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ObjectKey +{ + private String str; + + Encapsulation m_marshaled_key; + + public ObjectKey(){ + } + + public ObjectKey(Encapsulation key) { + this.m_marshaled_key = key; + } + + public boolean equal(ObjectKey other) + { + return ( m_marshaled_key == null && m_marshaled_key == other.m_marshaled_key ) || + ( m_marshaled_key.equal( other.m_marshaled_key ) ); + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_marshaled_key = input.readEncapsulation(); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_marshaled_key != null) { + output.writeEncapsulation(m_marshaled_key); + } else { + throw new org.omg.CORBA.INTERNAL("Malformed Objectkey"); + } + } + + public void setMarshaledKey( Encapsulation marshaled_key ) { + this.m_marshaled_key = marshaled_key; + } + + public Encapsulation getMarshaledKey() { + return m_marshaled_key; + } + + //TODO: tryToGetURLKey should be removed, and also the one in IIOPCorbaLoc + public String getURL() { + //TODO: check if this should be stored locally for further invocations + String url; + try { + int size = this.m_marshaled_key.getLength(); + int offset = this.m_marshaled_key.getOffset(); + + CDRInputStream input = new CDRInputStream( + this.m_marshaled_key.getORB(), + this.m_marshaled_key.getOctetSequence() + ); + + if (offset > 0) { + input.skip(offset); + } + + char[] url_key = new char[size]; + + input.read_char_array(url_key, 0, size); + + + + url = new String(url_key); + } catch ( Throwable th ){ + th.printStackTrace(); + url = null; + } + return url; + }//getURL + + public synchronized String toString() + { + if(str == null) { + str = Base64Codec.encode(m_marshaled_key.getOctetSequence()); + } + + return str; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ProcessingState.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ProcessingState.java.svn-base new file mode 100644 index 0000000..1f52a20 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ProcessingState.java.svn-base @@ -0,0 +1,133 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +class ProcessingState +{ + + final static short CLIENT = 0; + + final static short RUNNING = 1; + + final static short SHUTDOWNING = 2; + + final static short SHUTDOWNED = 3; + + short m_state; + + TIDORB m_orb; + + public ProcessingState(TIDORB orb) + { + this.m_orb = orb; + m_state = CLIENT; + } + + public short state() + { + return m_state; + } + + public synchronized void running() + { + if (m_state == CLIENT) { + m_state = RUNNING; + } + } + + public boolean isShutdowned() + { + return m_state == SHUTDOWNED; + } + + public synchronized void shutdown() + { + if (m_state == RUNNING) { + m_state = SHUTDOWNING; + ShutdownThread thread = new ShutdownThread(m_orb); + thread.start(); + } + } + + public synchronized void shutdowned() + { + if (m_state == SHUTDOWNING) { + m_state = SHUTDOWNED; + notifyAll(); + } + } + + public synchronized void waitForShutdown() + { + if (m_state == SHUTDOWNING) { + try { + wait(m_orb.m_conf.max_time_in_shutdown); + } + catch (InterruptedException ie) {} + } else if (m_state == RUNNING) { + try { + wait(); + } + catch (InterruptedException ie) {} + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public synchronized boolean waitForShutdown(long millis) + { + if ((m_state == RUNNING) || (m_state == CLIENT)) { + try { + wait(millis); + } + catch (InterruptedException ie) {} + } + + return (m_state == RUNNING) ? false : true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/PseudoObject.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/PseudoObject.java.svn-base new file mode 100644 index 0000000..25d1e12 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/PseudoObject.java.svn-base @@ -0,0 +1,187 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.OBJECT_NOT_EXIST; + +/** + * Base class for all TIDorb's pseudobjects. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public abstract class PseudoObject + implements org.omg.CORBA.Object +{ + + /** + * If true the Object has been destroyed and it will throw a + * org.omg.CORBA.OBJECT_NOT_EXIST exception. + * Many Objects has the destroy method, this method will change + * this attribute. + */ + + protected boolean m_destroyed; + + /** + * Object hashcode. + */ + + protected int m_hash_code; + + protected PseudoObject() + { + m_destroyed = false; + m_hash_code = -1; + } + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + return repositoryIdentifier.equals("IDL:omg.org/CORBA/Object:1.0"); + } + + public boolean _non_existent() + { + return m_destroyed; + } + + public int _hash(int maximum) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (m_hash_code == -1) { + m_hash_code = hashCode(); + while (m_hash_code > maximum) + m_hash_code %= maximum; + } + + return m_hash_code; + } + + public boolean _is_equivalent(org.omg.CORBA.Object other) + { + if (other == null) + throw new BAD_PARAM("Null Object reference"); + + return (this == other); + } + + public org.omg.CORBA.Object _duplicate() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return this; + } + + public void _release() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + } + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + + public org.omg.CORBA.InterfaceDef _get_interface() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object _get_interface_def() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request _request(java.lang.String operation) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Request + _create_request(org.omg.CORBA.Context ctx, + java.lang.String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Request + _create_request(org.omg.CORBA.Context ctx, + java.lang.String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Policy _get_policy(int policy_type) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.DomainManager[] _get_domain_managers() + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Object + _set_policy_override(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/RequestCounter.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/RequestCounter.java.svn-base new file mode 100644 index 0000000..27fdeb9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/RequestCounter.java.svn-base @@ -0,0 +1,18 @@ +package es.tid.TIDorbj.core; + + +public class RequestCounter +{ + private long m_serial; + + public RequestCounter() + { + m_serial = 0L; + } + + public synchronized long next() + { + return m_serial++; + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/RequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/RequestImpl.java.svn-base new file mode 100644 index 0000000..67bd5ee --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/RequestImpl.java.svn-base @@ -0,0 +1,559 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_INOUT; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging.ReplyHandlerOperations; +import org.omg.Messaging.ReplyHandlerPOA; +import org.omg.Messaging._ReplyHandlerStub; + +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb DII Request implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class RequestImpl extends org.omg.CORBA.Request +{ + /** + * The orb. + */ + TIDORB m_orb; + + /** + * Target CORBA object. + */ + org.omg.CORBA.portable.ObjectImpl m_target; + + /** + * operation name. + */ + String m_operation_name; + + /** + * Request identifier. + */ + RequestId m_request_id; + + /** + * Needs response. + */ + boolean m_with_response = false; + + /** + * Reliable oneway request that needs response. + */ + boolean m_reliable_oneway = false; + + /** + * Completion status needed in exception throwing. Initialy, the status is + * COMPLETED_NO + */ + CompletionStatus m_completed; + + /** + * Request context + */ + org.omg.CORBA.Context m_context; + + /** + * Request arguments + */ + org.omg.CORBA.NVList m_arguments; + + /** + * Request result value + */ + org.omg.CORBA.NamedValue m_result; + + /** + * Request exception list + */ + org.omg.CORBA.ExceptionList m_exceptions; + + /** + * Request context list + */ + org.omg.CORBA.ContextList m_contextlist; + + /** + * Request environment + */ + EnvironmentImpl m_environment; + + /** + * Request Policy Context + */ + PolicyContext m_policy_context; + + /** + * ReplyHandler object reference for AMI callback model + */ + Object m_handler; + + + public RequestImpl(org.omg.CORBA.Object target, org.omg.CORBA.Context ctx, + String operation, org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist) + { + m_completed = CompletionStatus.COMPLETED_NO; + + m_target = (org.omg.CORBA.portable.ObjectImpl) target; + + org.omg.CORBA.ORB obj_orb = m_target._orb(); + + if ((obj_orb != null) && (obj_orb instanceof TIDORB)) + m_orb = (TIDORB) obj_orb; + else + throw new BAD_PARAM("Invalid ORB"); + + m_request_id = null; + + m_operation_name = operation; + m_context = ctx; + m_arguments = arg_list; + m_result = result; + m_exceptions = exclist; + m_contextlist = ctxlist; + m_environment = new EnvironmentImpl(); + m_policy_context = null; + m_handler = null; + } + + /** + * Set the completion status to COMPLETED_MAYBE + */ + public void setCompletedMaybe() + { + m_completed = CompletionStatus.COMPLETED_MAYBE; + } + + /** + * Set the completion status to COMPLETED_YES + */ + public void setCompletedYes() + { + m_completed = CompletionStatus.COMPLETED_YES; + } + + /** + * @return the current completion status + */ + public CompletionStatus getCompleted() + { + return m_completed; + } + + public org.omg.CORBA.Object target() + { + return m_target; + } + + public String operation() + { + return m_operation_name; + } + + public org.omg.CORBA.NVList arguments() + { + return m_arguments; + } + + public org.omg.CORBA.NamedValue result() + { + return m_result; + } + + public org.omg.CORBA.Environment env() + { + return m_environment; + } + + public void setUserException(Any exc) + { + m_environment.exception(new UnknownUserException(exc)); + } + + public void setSystemException(org.omg.CORBA.SystemException exc) + { + m_environment.exception(exc); + } + + public org.omg.CORBA.ExceptionList exceptions() + { + return m_exceptions; + } + + public org.omg.CORBA.ContextList contexts() + { + return m_contextlist; + } + + public void ctx(org.omg.CORBA.Context ctx) + { + if (ctx == null) + throw new BAD_PARAM("Null Context reference", 0, + CompletionStatus.COMPLETED_NO); + + m_context = ctx; + } + + public org.omg.CORBA.Context ctx() + { + return m_context; + } + + public org.omg.CORBA.Any add_in_arg() + { + return addArg(ARG_IN.value); + } + + public org.omg.CORBA.Any add_named_in_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_IN.value); + } + + public org.omg.CORBA.Any add_inout_arg() + { + return addArg(ARG_INOUT.value); + } + + public org.omg.CORBA.Any add_named_inout_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_INOUT.value); + } + + public org.omg.CORBA.Any add_out_arg() + { + return addArg(ARG_OUT.value); + } + + public org.omg.CORBA.Any add_named_out_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_OUT.value); + } + + public void set_return_type(org.omg.CORBA.TypeCode tc) + { + if (tc == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + Any result_any = m_orb.create_any(); + result_any.type(tc); + m_result = NamedValueImpl.from_int(ARG_OUT.value, "", result_any); + } + + public org.omg.CORBA.Any return_value() + { + if (m_result != null) + return m_result.value(); + else + throw new BAD_OPERATION("No result defined."); + } + + public void readResult(InputStream input) + { + if (m_result != null) + m_result.value().read_value(input, m_result.value().type()); + } + + public void invoke() + { + try { + m_with_response = true; + + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + + delegate.invoke(this); + + } + catch (org.omg.CORBA.SystemException se) { + setSystemException(se); + if (m_orb.m_trace != null) { + m_orb.m_trace.printStackTrace(Trace.DEEP_DEBUG, + "RequestImpl.invoke():" + + " system exception", + se); + } + } + catch (Throwable th) { + org.omg.CORBA.SystemException se = new org.omg.CORBA.UNKNOWN(); + setSystemException(se); + if (m_orb.m_trace != null) { + m_orb.m_trace.printStackTrace(Trace.ERROR, + "RequestImpl.invoke():" + + " Unexpected exception", + th); + } + } + + Exception e = m_environment.exception(); + + if ((e != null) && (e instanceof org.omg.CORBA.SystemException)) + throw (org.omg.CORBA.SystemException) e; + } + + public void send_oneway() + { + + try { + m_with_response = false; + + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + + delegate.onewayRequest(this); + + } + catch (org.omg.CORBA.SystemException se) { + se.completed = m_completed; + throw se; + } + + } + + public void send_deferred () { + throw new org.omg.CORBA.NO_IMPLEMENT(); + + + /*try { + m_handler = m_arguments.item(0).value().extract_Object(); + m_arguments.remove(0); + } catch (BAD_OPERATION e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Bounds e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + m_with_response = true; + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + delegate.asyncRequest(this);*/ + } + + public void get_response() + throws org.omg.CORBA.WrongTransaction + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_response() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +// BUG [#956] Invalid call to org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI +// //Additional Messaging Operations +// public void sendc(org.omg.CORBA.Object handler) { +// m_handler = handler; + +// try { +// m_with_response = true; +// CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); +// //delegate.asyncRequest(this); +// delegate.asyncRequest(this, m_handler); +// } +// catch (org.omg.CORBA.SystemException se) { +// setSystemException(se); +// if (m_orb.m_trace != null) { +// m_orb.m_trace.printStackTrace(Trace.DEEP_DEBUG, +// "RequestImpl.send_deferred():" + +// " system exception", +// se); +// } +// } +// catch (Throwable th) { +// org.omg.CORBA.SystemException se = new org.omg.CORBA.UNKNOWN(); +// setSystemException(se); +// if (m_orb.m_trace != null) { +// m_orb.m_trace.printStackTrace(Trace.ERROR, +// "RequestImpl.send_deferred():" + +// " Unexpected exception", +// th); +// } +// } + +// Exception e = m_environment.exception(); + +// if ((e != null) && (e instanceof org.omg.CORBA.SystemException)) +// throw (org.omg.CORBA.SystemException) e; +// } + + public Object sendp() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void prepare(Object p) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // TIDOrb operations + + public TIDORB orb() + { + return m_orb; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public void reliableOneway(boolean value) + { + m_reliable_oneway = value; + } + + public boolean reliableOneway() + { + return m_reliable_oneway; + } + + public void withResponse(boolean value) + { + m_with_response = value; + } + + public boolean withResponse() + { + return m_with_response; + } + + private org.omg.CORBA.Any addArg(String name, int flag_value) + { + if (m_arguments == null) + m_arguments = new NVListImpl(m_orb); + + NamedValueImpl arg; + arg = (NamedValueImpl) m_arguments.add_item(name, flag_value); + return arg.value(); + } + + private org.omg.CORBA.Any addArg(int flag_value) + { + if (m_arguments == null) + m_arguments = new NVListImpl(m_orb); + + NamedValueImpl arg; + arg = (NamedValueImpl) m_arguments.add(flag_value); + return arg.value(); + } + + public void writeInParams(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_arguments != null) + NVListImpl.writeInParams(m_arguments, output); + } + + public void setPolicyContext(PolicyContext context) + { + m_policy_context = context; + } + + public PolicyContext getPolicyContext() + { + if (m_policy_context == null) { + + CommunicationDelegate delegate = + (CommunicationDelegate) m_target._get_delegate(); + + + m_policy_context = delegate.createRequestPolicyContext(); + } + + return m_policy_context; + } + + public void set_ami_handler(Object handler) + { + m_handler = handler; + } + + public Object get_ami_handler() + { + return m_handler; + } + + public void setOperationName (String operName) { + m_operation_name = operName; + } +} diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ServerRequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ServerRequestImpl.java.svn-base new file mode 100644 index 0000000..6a7704a --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ServerRequestImpl.java.svn-base @@ -0,0 +1,279 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TCKind; +import org.omg.Compression.CompressorIdLevel; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +//TODO: make TargetAddress generic and move it to giop package +/** + * TIDorb DSI ServerRequest implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ServerRequestImpl extends org.omg.CORBA.ServerRequest +{ + + private final static int NO_ARGUMENTS_FIXED = 0; + + private final static int ARGUMENTS_FIXED = 1; + + private final static int RESULT_FIXED = 2; + + public final static int NO_EXCEPTION = 0; + + public final static int USER_EXCEPTION = 1; + + public final static int SYSTEM_EXCEPTION = 2; + + public final static int LOCATION_FORWARD = 3; + + private int m_completion_state; + + private int m_return_state; + + RequestId m_request_id; + + boolean m_with_response = false; + + String m_operation_name; + + TargetAddress m_target; + + GIOPVersion m_version; + + org.omg.CORBA.Context m_context; + + org.omg.CORBA.NVList m_server_parameters; + + Any m_result; + + Any m_exception; + + SystemException m_system_exception; + + org.omg.CORBA.Object m_forward_obj; + + CDRInputStream m_marshaled_parameters; + + CompressorIdLevel m_compressor; + + public ServerRequestImpl(GIOPVersion ver, + RequestId id, + String operation, + CDRInputStream cdr_parameters, + TargetAddress target) + { + m_completion_state = NO_ARGUMENTS_FIXED; + m_return_state = NO_EXCEPTION; + + m_version = ver; + m_request_id = id; + m_operation_name = operation; + m_context = null; + m_server_parameters = null; + m_marshaled_parameters = cdr_parameters; + m_target = target; + m_forward_obj = null; + m_compressor = new CompressorIdLevel((short)0,(short)0); + } + + public String operation() + { + return m_operation_name; + } + + public org.omg.CORBA.Context ctx() + { + if (m_completion_state != ARGUMENTS_FIXED) + throw new BAD_INV_ORDER( + "ctx() called after arguments() or set_result()."); + + return m_context; + } + + public void arguments(org.omg.CORBA.NVList nv) + { + if (m_completion_state != NO_ARGUMENTS_FIXED) + throw new BAD_INV_ORDER("arguments() called again."); + + m_completion_state = ARGUMENTS_FIXED; + + m_server_parameters = nv; + NVListImpl.readInParams(m_server_parameters, m_marshaled_parameters); + try { + m_context = (ContextImpl) m_marshaled_parameters.read_Context(); + } + catch (org.omg.CORBA.MARSHAL me) {} + } + + public void set_result(org.omg.CORBA.Any result) + { + if (m_completion_state != ARGUMENTS_FIXED) + throw new BAD_INV_ORDER("arguments() called again."); + + m_completion_state = RESULT_FIXED; + + m_return_state = NO_EXCEPTION; + + this.m_result = result; + } + + public void set_exception(org.omg.CORBA.Any except) + { + if (except.type().kind().value() != TCKind._tk_except) + throw new BAD_PARAM("Any value must be a user exception."); + + m_completion_state = RESULT_FIXED; + m_return_state = USER_EXCEPTION; + + m_exception = except; + } + + // TIDorb operations + + public void setSystemException(org.omg.CORBA.SystemException except) + { + m_completion_state = RESULT_FIXED; + m_return_state = SYSTEM_EXCEPTION; + + m_system_exception = except; + } + + public void setForward(org.omg.CORBA.Object obj) + { + m_completion_state = RESULT_FIXED; + m_return_state = LOCATION_FORWARD; + + m_forward_obj = obj; + } + + public TargetAddress getTarget() + { + return m_target; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public void withResponse(boolean value) + { + m_with_response = value; + } + + public boolean withResponse() + { + return m_with_response; + } + + public int getReturnState() + { + return m_return_state; + + } + + public Any getResult() + { + return m_result; + } + + public Any getException() + { + return m_exception; + } + + public SystemException getSystemException() + { + return m_system_exception; + } + + public org.omg.CORBA.NVList getParameters() + { + return m_server_parameters; + } + + public org.omg.CORBA.Object getForward() + { + return m_forward_obj; + } + + public GIOPVersion getVersion() + { + return m_version; + } + + public void destroy() + { + NVListImpl.destroy(m_server_parameters); + } + + public CompressorIdLevel get_compressor() + { + return m_compressor; + } + + public void set_compressor(CompressorIdLevel compressor) + { + m_compressor = compressor; + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/ShutdownThread.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/ShutdownThread.java.svn-base new file mode 100644 index 0000000..97e047d --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/ShutdownThread.java.svn-base @@ -0,0 +1,60 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +class ShutdownThread extends Thread +{ + + TIDORB m_orb; + + public ShutdownThread(TIDORB orb) + { + this.m_orb = orb; + } + + public void run() + { + m_orb.doCompleteShutdown(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/SingletonORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/SingletonORB.java.svn-base new file mode 100644 index 0000000..42d2340 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/SingletonORB.java.svn-base @@ -0,0 +1,420 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; + +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; + +/** + * TIDorb Version 2.3 CORBA ORB Singleton. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SingletonORB extends org.omg.CORBA_2_3.ORB +{ + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * ORB singleton static reference: only a instance will be for all orb. + * This rerefence will be returned by init() method. + */ + + protected static SingletonORB st_orb = null; + + public SingletonORB() + { + m_conf = new ConfORB(); + } + + public static org.omg.CORBA.ORB init() + { + if (st_orb == null) + st_orb = new SingletonORB(); + + return st_orb; + } + + public static org.omg.CORBA.ORB init(String[] args, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public static org.omg.CORBA.ORB init(java.applet.Applet app, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + protected void set_parameters(String[] args, java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void connect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void disconnect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public String[] list_initial_services() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object string_to_object(String str) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NVList create_list(int count) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ContextList create_context_list() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Context get_default_context() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Environment create_environment() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference"); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc(String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_alias_tc(String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference"); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.TypeCode + create_exception_tc(java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc(int bound, + org.omg.CORBA.TypeCode element_type) + { + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode + create_recursive_sequence_tc(int bound,int offset) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode + create_array_tc(int length, org.omg.CORBA.TypeCode element_type) + { + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference"); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference"); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference"); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.Any create_any() + { + return new es.tid.TIDorbj.core.AnyImpl(null); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void unregister_value_factory(String id) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_delegate(java.lang.Object wrapper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/StreamRequestImpl.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/StreamRequestImpl.java.svn-base new file mode 100644 index 0000000..0a46e8a --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/StreamRequestImpl.java.svn-base @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.CompletionStatus; + +import es.tid.TIDorbj.core.comm.giop.RequestId; + +public class StreamRequestImpl +{ + /** + * The orb. + */ + TIDORB m_orb; + + /** + * Target CORBA object. + */ + org.omg.CORBA.portable.ObjectImpl m_target; + + /** + * operation name. + */ + String m_operation_name; + + /** + * Request identifier. + */ + RequestId m_request_id = null; + + /** + * Needs response. + */ + boolean m_with_response = false; + + es.tid.TIDorbj.core.cdr.CDRInputStream m_response = null; + + es.tid.TIDorbj.core.cdr.CDROutputStream m_request = null; + + /** + * Completion status needed in exception throwing. Initialy, the status is + * COMPLETED_NO + */ + CompletionStatus m_completed; + + public StreamRequestImpl(TIDORB orb, + org.omg.CORBA.portable.ObjectImpl target, + String operation, boolean response) + { + m_orb = orb; + m_target = target; + m_operation_name = operation; + m_with_response = response; + } + + public TIDORB orb() + { + return m_orb; + } + + public void setInputStream(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_response = input; + } + + public es.tid.TIDorbj.core.cdr.CDRInputStream getInputStream() + { + return m_response; + } + + public void setOutputStream(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + m_request = output; + } + + public es.tid.TIDorbj.core.cdr.CDROutputStream getOutputStream() + { + return m_request; + } + + public org.omg.CORBA.portable.ObjectImpl getTarget() + { + return m_target; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public boolean withResponse() + { + return m_with_response; + } + + public String operation() + { + return m_operation_name; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/.svn/text-base/TIDORB.java.svn-base b/source/es/tid/TIDorbj/core/.svn/text-base/TIDORB.java.svn-base new file mode 100644 index 0000000..15f4fbd --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/text-base/TIDORB.java.svn-base @@ -0,0 +1,1653 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.io.IOException; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServiceInformationHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CORBA.portable.Delegate; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMIManager; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.typecode.AbstractInterfaceTypeCode; +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.core.util.Corbaname; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.CircularTraceFile; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb GIOPVersion 2.6 CORBA ORB. + *

+ * + * @autor Juan A. Cáceres + * @version 2.0 + */ +public class TIDORB extends org.omg.CORBA_2_5.ORB +{ + + /** + * ORB GIOPVersion + */ + + public final static String st_version = "6.5.0rc1"; + + /** + * @return the ORB Singleton instance. + */ + public static org.omg.CORBA.ORB init() + { + return SingletonORB.init(); + } + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * Local POAManagers. + */ + public java.util.Vector m_POAManagers; + + /** + * TraceService reference. + */ + public es.tid.TIDorbj.util.Trace m_trace; + + /** + * Local Codec factory. + */ + private CodecFactoryImpl m_codec_factory; + + /** TODO: remove me + * ORB Communication layer, drives request to the local layer or the + * external layer. + + private es.tid.TIDorbj.core.comm.iiop.CommLayer m_comm_layer;*/ + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + private CommunicationManager communicationManager; + + + /** + * Local CurrentImpl. + */ + private es.tid.TIDorbj.core.poa.CurrentImpl m_current; + + /** + * The ORB has been destroyed. + */ + + private boolean m_destroyed; + + /** + * Local DynAny factory. + */ + private es.tid.TIDorbj.dynAny.DynAnyFactoryImpl m_dyn_factory; + + /** + * ORB PolicyManager. + */ + private es.tid.TIDorbj.core.policy.PolicyManagerImpl m_orb_policy_manager; + + /** + * ORB Services + */ + + private ORBServices m_orb_services; + + /** + * Thread Policy Current. + */ + private es.tid.TIDorbj.core.policy.PolicyCurrentImpl m_policy_current; + + + /** + * Compression Manager. + */ + private es.tid.TIDorbj.core.compression.CompressionManagerImpl m_compression_manager; + + + /** + * Local rootPOA. + */ + private es.tid.TIDorbj.core.poa.POAImpl m_root_POA; + + /** + * Processing state: controls the ORB shutdown. + */ + + private ProcessingState m_state; + + /** + * Thread Policy Context Manager. + */ + private es.tid.TIDorbj.core.policy.PolicyContextManager + m_thread_policy_context_manager; + + /** + * Maintains the order which the request was created + */ + private RequestCounter requestCounter; + + /** + * TypeCode Cache. + */ + + private es.tid.TIDorbj.core.typecode.TypeCodeCache m_typecode_cache; + + /** + * ORB ValueFactoryList + */ + + private java.util.Hashtable m_value_factories; + + /** + * ORB Name + */ + + String m_orb_name; + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + + + /** + * Constructor. The orb must be initialized using the set_parameters(). + */ + public TIDORB() + { + m_conf = null; + m_state = new ProcessingState(this); + m_destroyed = false; + + this.communicationManager = null; + this.requestCounter = new RequestCounter(); + + m_dyn_factory = null; + m_root_POA = null; + m_trace = null; + m_current = null; + m_typecode_cache = null; + m_ami_manager = null; + } + + public void connect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + + public TypeCode create_abstract_interface_tc(String id, String name) + { + return new AbstractInterfaceTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode + create_alias_tc( String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.Any create_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.AnyImpl(this); + } + + public org.omg.CORBA.TypeCode + create_array_tc( int length, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.ContextList create_context_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ContextListImpl(); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.Environment create_environment() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.EnvironmentImpl(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ExceptionListImpl(); + } + + public org.omg.CORBA.TypeCode + create_exception_tc( java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_list(int count) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (count < 0) + throw new BAD_PARAM("Count < 0", 0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.NVListImpl(this, count); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((s == null) || (any == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return es.tid.TIDorbj.core.NamedValueImpl.from_int(flags, s, any); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new CDROutputStream(this, m_conf.block_size); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (val == null) + throw new BAD_PARAM("Null any reference"); + + return es.tid.TIDorbj.core.policy.PolicyFactory.createPolicy(type, val); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, + int offset) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc( int bound, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc( String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (concrete_base == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + /** + * Free all the ORB resources: connections and threads. + */ + + synchronized public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + // The thread is serving a request? + + if (initPOACurrent().inContext()) { // yes, it is in the serving request + // context + + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.shutdown(); + + m_state.waitForShutdown(); + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + * m_comm_layer.destroy(); + */ + this.communicationManager.destroy(); + this.communicationManager = null; + + + if (m_trace != null) { + try { + printTrace(Trace.USER, "Closing ORB Session."); + m_trace.close(); + } + catch (Throwable th) {} + + m_trace = null; + } + + if (m_value_factories != null) + m_value_factories.clear(); + + m_value_factories = null; + + if (m_codec_factory != null) { + m_codec_factory.destroy(); + m_codec_factory = null; + } + + if (m_dyn_factory != null) { + m_dyn_factory.destroy(); + m_dyn_factory = null; + } + + m_orb_services.destroy(); + m_orb_services = null; + + m_root_POA = null; + + if (m_current != null) { + m_current.destroy(); + m_current = null; + } + + m_destroyed = true; + } + + public boolean destroyed() + { + return m_destroyed; + } + + public void disconnect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated + */ + public org.omg.CORBA.Current get_current() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + return m_current; + } + + public org.omg.CORBA.Context get_default_context() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference", 0, + CompletionStatus.COMPLETED_NO); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public boolean + get_service_information( short service_type, + ServiceInformationHolder service_info) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + public CommunicationManager getCommunicationManager(){ + if ( m_destroyed ){ + throw new OBJECT_NOT_EXIST(); + } + return this.communicationManager; + } + + + + public es.tid.TIDorbj.core.policy.PolicyContextManager + getPolicyContextManager() + { + return m_thread_policy_context_manager; + } + + public es.tid.TIDorbj.core.policy.PolicyManagerImpl getPolicyManager() + { + return initPolicyManager(); + } + + public es.tid.TIDorbj.core.compression.CompressionManagerImpl getCompressionManager() + { + return initCompressionManager(); + } + + public es.tid.TIDorbj.core.typecode.TypeCodeCache getTypeCodeCache() + { + return m_typecode_cache; + } + + public RequestCounter getRequestCounter() + { + return this.requestCounter; + } + + + // CORBA 2.5 + public String id() + { + return m_conf.orb_id; + } + + // ORB Services + + public es.tid.TIDorbj.core.poa.POAImpl initPOA() { + synchronized (this) { + if (m_root_POA == null) { + m_root_POA = + es.tid.TIDorbj.core.poa.POAImpl.createRootPOA(this); + + + // init the orb listening points (usually one for each layer) + try { + this.communicationManager.setServerModeEnabled( true ); + } catch ( CommunicationException ce ) { + throw new INITIALIZE( "Unable to activate server mode: " + ce.getMessage() ); + } + + m_state.running(); + } + } + + return m_root_POA; + } + + public es.tid.TIDorbj.core.poa.CurrentImpl initPOACurrent() + { + synchronized (this) { + if (m_current == null) { + m_current = new es.tid.TIDorbj.core.poa.CurrentImpl(this); + } + } + + return m_current; + } + + public String[] list_initial_services() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_orb_services.listInitialServices(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + return (org.omg.CORBA.portable.ValueFactory) m_value_factories.get(id); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return IOR.nullIOR().toString(); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj) + ._get_delegate(); + + if (obj instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, + CompletionStatus.COMPLETED_NO); + + if (delegate instanceof CommunicationDelegate) + return ((CommunicationDelegate) delegate).toString(); + else + throw new BAD_PARAM("This Object has not been create by TIDorb", + 0, + CompletionStatus.COMPLETED_NO); + } + + public String objectToURL(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return Corbaloc.toURL(IOR.nullIOR()); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + //TODO: refactor URL/String IOR stuff + return ((CommunicationDelegate) delegate).getReference().toURL(); + } else + throw new BAD_PARAM("This Object has not been create by TIDorb", 0, + CompletionStatus.COMPLETED_NO); + } + + public void perform_work() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void printTrace(int level, String message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printTrace(int level, String message, Throwable e) + { + if (m_trace != null) + m_trace.printStackTrace(level, message, e); + } + + public void printTrace(int level, String[] message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printDump(int level, byte[] message, int length) + { + if (m_trace != null) + m_trace.dump(level, message, length); + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.registerInitialReference(object_name, obj); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + synchronized (m_value_factories) { + if (m_value_factories.containsKey(id)) + return null; + m_value_factories.put(id, factory); + } + + return factory; + } + + public void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.removeInitialReference(object_name); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (object_name == null) + throw new BAD_PARAM("Null String reference", 24, + CompletionStatus.COMPLETED_NO); + + return m_orb_services.resolveService(object_name); + } + + public void run() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (m_root_POA == null) { + throw new org.omg.CORBA.INTERNAL("RootPOA has not been created."); + } + + m_state.waitForShutdown(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < req.length; i++) + req[i].send_oneway(); + } + + public void set_delegate(java.lang.Object wrapper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (wrapper instanceof org.omg.PortableServer.Servant) { + org.omg.PortableServer.Servant servant = + (org.omg.PortableServer.Servant) wrapper; + + if (m_root_POA == null) { + initPOA(); + } + + try { + org.omg.CORBA.ORB servantOrb = servant._orb(); + if ( servantOrb != this ) { + throw new + BAD_PARAM("Servant is already active in another ORB"); + } + } + catch (org.omg.CORBA.BAD_INV_ORDER e) { + try { + m_root_POA.activate_object(servant); + + // Exceptions should never be thrown + } catch (org.omg.PortableServer.POAPackage.WrongPolicy wp) + { + } + catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive s) + { + } + } + } else + throw new BAD_PARAM("Servant expected"); + + } + + public void shutdown(boolean wait_for_completion) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + m_state.shutdown(); + + if (wait_for_completion) { + if (initPOACurrent().inContext()) { + // yes, it is in the serving request context + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.waitForShutdown(); + } + } + + public org.omg.CORBA.Object string_to_object(String str) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (str == null) { + throw new BAD_PARAM("Null String reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (str.startsWith("corbaname:")) + return corbanameUrlToObject(str); + + if (str.startsWith("file://")) + return fileUrlToObject(str); + + if (str.startsWith("corbaloc:rir:")) + return rirUrlToObject(str); + + if (str.startsWith("corbaloc:tidorbj:")) + return tidorbjUrlToObject(str); + + + Delegate delegate; + try { + delegate = this.communicationManager.createDelegate( str ); + } catch ( CommunicationException ce){ + delegate = null; + } + if ( delegate != null ){ + ObjectImpl o = new ObjectImpl(); + o._set_delegate( delegate ); + return o; + } else { + throw new BAD_PARAM( + "UNKNOWN String reference", 0, CompletionStatus.COMPLETED_NO + ); + } + /* + return iorToObject(str); + */ + } + + /* + * PRIVATE METHODS + * */ + public POAKey resolvePOAKey( ObjectKey objectKey ) + throws ForwardRequest + { + if( objectKey != null ){ + //not initialized to check every condition against compiler :) + POAKey key; + try { + /* + * Usually successfull for local requests, because objectKey + * comes directly from an IOR. We shouldn't know this right here + */ + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } catch (Throwable th) { + key = null; + } + + if(key != null) { + return key; + } + + + /* + * If objectKey comes from a remote request, it must be resolved + * through the ORB. + * First: try to get the URL, and after that, resolve it against + * registered initial references + */ + String urlKey = objectKey.getURL(); + org.omg.CORBA.Object reference = null; + + if ( urlKey != null ) { + + if ( urlKey != null ) { + + String initialReference; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + /* + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve url reference: ", + urlKey, " ", ce.getMessage() + } + ); + } + */ + initialReference = null; + }//initialReference retrieval + + if(initialReference == null) { + initialReference = urlKey; + } + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( Throwable th ){ + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve initial reference reference: ", + initialReference, " ", th.getMessage() + } + ); + } + reference = null; + } + if ( reference != null ) { + if ( reference instanceof IOR ){ + objectKey = (( IOR )reference ).getObjectKey(); + } else { + org.omg.CORBA.portable.ObjectImpl ref = + (org.omg.CORBA.portable.ObjectImpl)reference; + CommunicationDelegate delegate = + ( CommunicationDelegate ) ref._get_delegate(); + objectKey = delegate.getReference().getObjectKey(); + } + if ( objectKey != null ) { + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } else { + throw new INTERNAL(); + } + } else { + key = null; + }//reference = null + }//generic url, delegate in communication layers + // URL resolution: object key = service url + // it must throw a ForwardRequest + if ( key != null ){ + return key; + } else { + throw new ForwardRequest(resolveGenericURL(urlKey)); + } + + } else { //unable to get url from objectKey + throw new INV_OBJREF( "Invalid Object Key" ); + } + } else { + throw new INV_OBJREF( "ObjectKey cannot be null" ); + } + }//resolvePOAKey + + + /** + * Generic URL resolution + * @throws ForwardRequest + */ + protected org.omg.CORBA.Object resolveGenericURL(String urlKey) + { + POAKey key; + + + String initialReference = null; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + throw new OBJECT_NOT_EXIST("Invalid object key: " + urlKey); + }//initialReference retrieval + + + org.omg.CORBA.Object reference = null; + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( InvalidName th ){ + StringBuffer msg = new StringBuffer(); + msg.append("Unable to resolve initial reference reference: "); + msg.append(initialReference); + msg.append(" from "); + msg.append(urlKey); + throw new OBJECT_NOT_EXIST(msg.toString()); + } + + return reference; + } + + + + public String toString() + { + if (m_orb_name == null) { + + java.util.Date date; + + date = new java.util.Date(System.currentTimeMillis()); + + StringBuffer name = new StringBuffer(); + name.append("TIDorbj "); + name.append(st_version); + name.append(" (id=\""); + name.append(m_conf.orb_id); + name.append("\") ["); + + name.append( this.communicationManager.toString() ); + + name.append("] created at "); + name.append(date.toString()); + + m_orb_name = name.toString(); + } + + return m_orb_name; + + } + + public void unregister_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + synchronized (m_value_factories) { + if (m_value_factories.remove(id) == null) + throw new BAD_PARAM(); + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public boolean waitShutdown(long millis) + { + return m_state.waitForShutdown(millis); + } + + public boolean work_pending() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + //PRE: str starts with corbaname: + + protected org.omg.CORBA.Object corbanameUrlToObject(String str) + { + try { + return Corbaname.toObject(this, str); + } + catch (Exception e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void doCompleteShutdown() + { + java.lang.Object[] mgrs = new java.lang.Object[m_POAManagers.size()]; + + m_POAManagers.copyInto(mgrs); + + for (int i = 0; i < mgrs.length; i++) { + org.omg.PortableServer.POAManager mgr = + (org.omg.PortableServer.POAManager) mgrs[i]; + try { + mgr.deactivate(true /* etherealize objects */, + true /* wait_for_completion */); + } + catch (Exception e) {} + } + + try { + if (m_root_POA != null) + m_root_POA.destroy(false, true); + } + catch (Exception e) {} + + try { + if ( this.communicationManager != null ){ + this.communicationManager.shutdown( true ); + } + } + catch (Exception e) {} + + m_state.shutdowned(); + } + + // PRE str starts with file: + + protected org.omg.CORBA.Object fileUrlToObject(String str) + { + String file_str = str.substring(7); + String file_url = null; + + if (file_str.length() == 0) + throw new BAD_PARAM(file_str); + try { + java.io.FileReader file_r = new java.io.FileReader(file_str); + java.io.BufferedReader url_r = new java.io.BufferedReader(file_r); + + file_url = url_r.readLine(); + url_r.close(); + + } catch (java.io.FileNotFoundException fnf) { + throw new BAD_PARAM("Invalid file url"); + } catch (SecurityException se) { + throw new NO_PERMISSION( + se.getMessage(), 0, CompletionStatus.COMPLETED_NO + ); + } catch (Throwable th) { + throw new UNKNOWN( + th.toString(), 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( file_url != null && !file_url.startsWith("file:") ) { + return string_to_object( file_url ); + } else { + throw new BAD_PARAM( "No file url allowed in a file" ); + } + } + + /** + * Destructor. + */ + + protected void finalize() + { + if (!m_destroyed) + destroy(); + } + + // PRE str starts with corbaloc:iiop: or corbaloc:: + + //TODO: this should come from the communications layers + protected org.omg.CORBA.Object iiopUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + CommunicationDelegate delegate = null; + + try { + ior = IIOPCorbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + //TODO: should the communicationsManager (or the related layer) store + //a cache of delegates for each IOR? + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + protected es.tid.TIDorbj.core.CodecFactoryImpl initCodecFactory() + { + synchronized (this) { + if (m_codec_factory == null) + m_codec_factory = new CodecFactoryImpl(this); + } + return m_codec_factory; + } + + protected es.tid.TIDorbj.dynAny.DynAnyFactoryImpl initDynAnyFactory() + { + synchronized (this) { + if (m_dyn_factory == null) { + try { + m_dyn_factory = + new es.tid.TIDorbj.dynAny.DynAnyFactoryImpl(); + m_dyn_factory.set_orb(this); + } + catch (Throwable th) { + throw new INITIALIZE("Cannot Initialize DynAnyFactory", 0, + CompletionStatus.COMPLETED_NO); + } + } + } + return m_dyn_factory; + } + + /** + * ORB initialization. This method will be invoked by + * set_parametres(). + */ + + protected void initOrb() + { + try { + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + this.communicationManager = CommunicationManager.getInstance( this ); + + m_POAManagers = new java.util.Vector(); + + m_value_factories = new java.util.Hashtable(); + + m_orb_services = new ORBServices(this); + + m_thread_policy_context_manager = + new es.tid.TIDorbj.core.policy.PolicyContextManager(this); + + setupInitialReferences(); + + if (m_conf.typecode_cache_size > 0) + m_typecode_cache = + new es.tid.TIDorbj.core.typecode.TypeCodeCache( + m_conf.typecode_cache_size); + + if (m_conf.trace_level != Trace.NONE) { + m_trace = getTrace(); + + + m_trace.print(Trace.ERROR, "ORB initialization OK!"); + + m_conf.dump(m_trace.getLog()); + m_trace.flush(); + } + + } + catch (Throwable e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + public synchronized Trace getTrace() + throws IOException + { + if (m_trace == null) { + if (m_conf.trace_file != null) { + if (m_conf.trace_num_files > 1) { + + CircularTraceFile ctf = + new CircularTraceFile(m_conf.trace_num_files, + m_conf.trace_file_size, + m_conf.trace_file); + m_trace = Trace.createTrace(ctf, toString(), + m_conf.trace_level); + } else { + m_trace = Trace.createTrace(m_conf.trace_file, toString(), + m_conf.trace_level); + } + + } else { + m_trace = Trace.createTrace(toString(), m_conf.trace_level); + } + } + + return m_trace; + } + + protected es.tid.TIDorbj.core.policy.PolicyCurrentImpl initPolicyCurrent() + { + synchronized (this) { + if (m_policy_current == null) + m_policy_current = + new es.tid.TIDorbj.core.policy.PolicyCurrentImpl + (m_thread_policy_context_manager); + } + return m_policy_current; + } + + protected es.tid.TIDorbj.core.compression.CompressionManagerImpl initCompressionManager() + { + synchronized (this) { + if (m_compression_manager == null) + m_compression_manager = + new es.tid.TIDorbj.core.compression.CompressionManagerImpl + (this); + } + return m_compression_manager; + } + + protected es.tid.TIDorbj.core.messaging.AMIManager initAMIManager() + { + synchronized (this) { + if (m_ami_manager == null) + m_ami_manager = + new es.tid.TIDorbj.core.messaging.AMIManager(this); + } + return m_ami_manager; + } + + protected es.tid.TIDorbj.core.policy.PolicyManagerImpl initPolicyManager() + { + synchronized (this) { + if (m_orb_policy_manager == null) + m_orb_policy_manager = + new es.tid.TIDorbj.core.policy.PolicyManagerImpl(this); + } + return m_orb_policy_manager; + } + + //PRE: str starts with corbaloc:rir: + + protected org.omg.CORBA.Object rirUrlToObject(String str) + { + if (!str.startsWith("corbaloc:rir:/")) + throw new BAD_PARAM(str); + try { + return resolve_initial_references(str.substring(14)); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(app, props); + initOrb(); + } + + // CORBA ORB standard methods + + protected void set_parameters(String[] args, java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(args, props); + initOrb(); + } + + protected void setupInitialReferences() + { + int references = m_conf.initial_references.size(); + + InitialReference ref = null; + + for (int i = 0; i < references; i++) { + ref = (InitialReference) m_conf.initial_references.elementAt(i); + m_orb_services.setService(ref.getName(), + string_to_object(ref.getURL())); + } + + } + + //PRE: str starts with corbaloc:tidorbj: + protected org.omg.CORBA.Object tidorbjUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + Delegate delegate = null; + + try { + ior = Corbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } + + public void setORBservice(String object_name, + org.omg.CORBA.Object obj) { + m_orb_services.setService(object_name, obj); + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/tmp/TIDORB.java.tmp b/source/es/tid/TIDorbj/core/.svn/tmp/TIDORB.java.tmp new file mode 100644 index 0000000..e0e322a --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/tmp/TIDORB.java.tmp @@ -0,0 +1,1690 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.io.IOException; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServiceInformationHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CORBA.portable.Delegate; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMIManager; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.typecode.AbstractInterfaceTypeCode; +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.core.util.Corbaname; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.CircularTraceFile; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb GIOPVersion 2.6 CORBA ORB. + *

+ * + * @autor Juan A. Cáceres + * @version 2.0 + */ +public class TIDORB extends org.omg.CORBA_2_5.ORB +{ + + /** + * ORB GIOPVersion + */ + +<<<<<<< .mine +<<<<<<< .working +<<<<<<< .working + public final static String st_version = "6.3.3"; +======= + public final static String st_version = "6.3.5"; +>>>>>>> .r454 +======= + public final static String st_version = "6.3.2"; +======= + public final static String st_version = "6.3.3"; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + + /** + * @return the ORB Singleton instance. + */ + public static org.omg.CORBA.ORB init() + { + return SingletonORB.init(); + } + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * Local POAManagers. + */ + public java.util.Vector m_POAManagers; + + /** + * TraceService reference. + */ + public es.tid.TIDorbj.util.Trace m_trace; + + /** + * Local Codec factory. + */ + private CodecFactoryImpl m_codec_factory; + + /** TODO: remove me + * ORB Communication layer, drives request to the local layer or the + * external layer. + + private es.tid.TIDorbj.core.comm.iiop.CommLayer m_comm_layer;*/ + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + private CommunicationManager communicationManager; + + + /** + * Local CurrentImpl. + */ + private es.tid.TIDorbj.core.poa.CurrentImpl m_current; + + /** + * The ORB has been destroyed. + */ + + private boolean m_destroyed; + + /** + * Local DynAny factory. + */ + private es.tid.TIDorbj.dynAny.DynAnyFactoryImpl m_dyn_factory; + + /** + * ORB PolicyManager. + */ + private es.tid.TIDorbj.core.policy.PolicyManagerImpl m_orb_policy_manager; + + /** + * ORB Services + */ + + private ORBServices m_orb_services; + + /** + * Thread Policy Current. + */ + private es.tid.TIDorbj.core.policy.PolicyCurrentImpl m_policy_current; + + + /** + * Compression Manager. + */ + private es.tid.TIDorbj.core.compression.CompressionManagerImpl m_compression_manager; + + + /** + * Local rootPOA. + */ + private es.tid.TIDorbj.core.poa.POAImpl m_root_POA; + + /** + * Processing state: controls the ORB shutdown. + */ + + private ProcessingState m_state; + + /** + * Thread Policy Context Manager. + */ + private es.tid.TIDorbj.core.policy.PolicyContextManager + m_thread_policy_context_manager; + + /** + * Maintains the order which the request was created + */ + private RequestCounter requestCounter; + + /** + * TypeCode Cache. + */ + + private es.tid.TIDorbj.core.typecode.TypeCodeCache m_typecode_cache; + + /** + * ORB ValueFactoryList + */ + + private java.util.Hashtable m_value_factories; + + /** + * ORB Name + */ + + String m_orb_name; +<<<<<<< .working + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +======= + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +>>>>>>> .merge-right.r354 + + /** + * Constructor. The orb must be initialized using the set_parameters(). + */ + public TIDORB() + { + m_conf = null; + m_state = new ProcessingState(this); + m_destroyed = false; + + this.communicationManager = null; + this.requestCounter = new RequestCounter(); + + m_dyn_factory = null; + m_root_POA = null; + m_trace = null; + m_current = null; + m_typecode_cache = null; +<<<<<<< .working +<<<<<<< .working + m_ami_manager = null; +======= + m_ami_manager = new AMIManager(this); +======= + m_ami_manager = null; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + } + + public void connect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + + public TypeCode create_abstract_interface_tc(String id, String name) + { + return new AbstractInterfaceTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode + create_alias_tc( String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.Any create_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.AnyImpl(this); + } + + public org.omg.CORBA.TypeCode + create_array_tc( int length, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.ContextList create_context_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ContextListImpl(); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.Environment create_environment() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.EnvironmentImpl(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ExceptionListImpl(); + } + + public org.omg.CORBA.TypeCode + create_exception_tc( java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_list(int count) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (count < 0) + throw new BAD_PARAM("Count < 0", 0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.NVListImpl(this, count); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((s == null) || (any == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return es.tid.TIDorbj.core.NamedValueImpl.from_int(flags, s, any); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new CDROutputStream(this, m_conf.block_size); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (val == null) + throw new BAD_PARAM("Null any reference"); + + return es.tid.TIDorbj.core.policy.PolicyFactory.createPolicy(type, val); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, + int offset) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc( int bound, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc( String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (concrete_base == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + /** + * Free all the ORB resources: connections and threads. + */ + + synchronized public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + // The thread is serving a request? + + if (initPOACurrent().inContext()) { // yes, it is in the serving request + // context + + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.shutdown(); + + m_state.waitForShutdown(); + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + * m_comm_layer.destroy(); + */ + this.communicationManager.destroy(); + this.communicationManager = null; + + + if (m_trace != null) { + try { + printTrace(Trace.USER, "Closing ORB Session."); + m_trace.close(); + } + catch (Throwable th) {} + + m_trace = null; + } + + if (m_value_factories != null) + m_value_factories.clear(); + + m_value_factories = null; + + if (m_codec_factory != null) { + m_codec_factory.destroy(); + m_codec_factory = null; + } + + if (m_dyn_factory != null) { + m_dyn_factory.destroy(); + m_dyn_factory = null; + } + + m_orb_services.destroy(); + m_orb_services = null; + + m_root_POA = null; + + if (m_current != null) { + m_current.destroy(); + m_current = null; + } + + m_destroyed = true; + } + + public boolean destroyed() + { + return m_destroyed; + } + + public void disconnect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated + */ + public org.omg.CORBA.Current get_current() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + return m_current; + } + + public org.omg.CORBA.Context get_default_context() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference", 0, + CompletionStatus.COMPLETED_NO); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public boolean + get_service_information( short service_type, + ServiceInformationHolder service_info) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + public CommunicationManager getCommunicationManager(){ + if ( m_destroyed ){ + throw new OBJECT_NOT_EXIST(); + } + return this.communicationManager; + } + + + + public es.tid.TIDorbj.core.policy.PolicyContextManager + getPolicyContextManager() + { + return m_thread_policy_context_manager; + } + + public es.tid.TIDorbj.core.policy.PolicyManagerImpl getPolicyManager() + { + return initPolicyManager(); + } + + public es.tid.TIDorbj.core.compression.CompressionManagerImpl getCompressionManager() + { + return initCompressionManager(); + } + + public es.tid.TIDorbj.core.typecode.TypeCodeCache getTypeCodeCache() + { + return m_typecode_cache; + } + + public RequestCounter getRequestCounter() + { + return this.requestCounter; + } + + + // CORBA 2.5 + public String id() + { + return m_conf.orb_id; + } + + // ORB Services + + public es.tid.TIDorbj.core.poa.POAImpl initPOA() { + synchronized (this) { + if (m_root_POA == null) { + m_root_POA = + es.tid.TIDorbj.core.poa.POAImpl.createRootPOA(this); + + + // init the orb listening points (usually one for each layer) + try { + this.communicationManager.setServerModeEnabled( true ); + } catch ( CommunicationException ce ) { + throw new INITIALIZE( "Unable to activate server mode: " + ce.getMessage() ); + } + + m_state.running(); + } + } + + return m_root_POA; + } + + public es.tid.TIDorbj.core.poa.CurrentImpl initPOACurrent() + { + synchronized (this) { + if (m_current == null) { + m_current = new es.tid.TIDorbj.core.poa.CurrentImpl(this); + } + } + + return m_current; + } + + public String[] list_initial_services() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_orb_services.listInitialServices(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + return (org.omg.CORBA.portable.ValueFactory) m_value_factories.get(id); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return IOR.nullIOR().toString(); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj) + ._get_delegate(); + + if (obj instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, + CompletionStatus.COMPLETED_NO); + + if (delegate instanceof CommunicationDelegate) + return ((CommunicationDelegate) delegate).toString(); + else + throw new BAD_PARAM("This Object has not been create by TIDorb", + 0, + CompletionStatus.COMPLETED_NO); + } + + public String objectToURL(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return Corbaloc.toURL(IOR.nullIOR()); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + //TODO: refactor URL/String IOR stuff + return ((CommunicationDelegate) delegate).getReference().toURL(); + } else + throw new BAD_PARAM("This Object has not been create by TIDorb", 0, + CompletionStatus.COMPLETED_NO); + } + + public void perform_work() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void printTrace(int level, String message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printTrace(int level, String message, Throwable e) + { + if (m_trace != null) + m_trace.printStackTrace(level, message, e); + } + + public void printTrace(int level, String[] message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printDump(int level, byte[] message, int length) + { + if (m_trace != null) + m_trace.dump(level, message, length); + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.registerInitialReference(object_name, obj); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + synchronized (m_value_factories) { + if (m_value_factories.containsKey(id)) + return null; + m_value_factories.put(id, factory); + } + + return factory; + } + + public void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.removeInitialReference(object_name); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (object_name == null) + throw new BAD_PARAM("Null String reference", 24, + CompletionStatus.COMPLETED_NO); + + return m_orb_services.resolveService(object_name); + } + + public void run() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (m_root_POA == null) { + throw new org.omg.CORBA.INTERNAL("RootPOA has not been created."); + } + + m_state.waitForShutdown(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < req.length; i++) + req[i].send_oneway(); + } + + public void set_delegate(java.lang.Object wrapper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (wrapper instanceof org.omg.PortableServer.Servant) { + org.omg.PortableServer.Servant servant = + (org.omg.PortableServer.Servant) wrapper; + + if (m_root_POA == null) { + initPOA(); + } + + try { + org.omg.CORBA.ORB servantOrb = servant._orb(); + if ( servantOrb != this ) { + throw new + BAD_PARAM("Servant is already active in another ORB"); + } + } + catch (org.omg.CORBA.BAD_INV_ORDER e) { + try { + m_root_POA.activate_object(servant); + + // Exceptions should never be thrown + } catch (org.omg.PortableServer.POAPackage.WrongPolicy wp) + { + } + catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive s) + { + } + } + } else + throw new BAD_PARAM("Servant expected"); + + } + + public void shutdown(boolean wait_for_completion) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + m_state.shutdown(); + + if (wait_for_completion) { + if (initPOACurrent().inContext()) { + // yes, it is in the serving request context + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.waitForShutdown(); + } + } + + public org.omg.CORBA.Object string_to_object(String str) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (str == null) { + throw new BAD_PARAM("Null String reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (str.startsWith("corbaname:")) + return corbanameUrlToObject(str); + + if (str.startsWith("file://")) + return fileUrlToObject(str); + + if (str.startsWith("corbaloc:rir:")) + return rirUrlToObject(str); + + if (str.startsWith("corbaloc:tidorbj:")) + return tidorbjUrlToObject(str); + + + Delegate delegate; + try { + delegate = this.communicationManager.createDelegate( str ); + } catch ( CommunicationException ce){ + delegate = null; + } + if ( delegate != null ){ + ObjectImpl o = new ObjectImpl(); + o._set_delegate( delegate ); + return o; + } else { + throw new BAD_PARAM( + "UNKNOWN String reference", 0, CompletionStatus.COMPLETED_NO + ); + } + /* + return iorToObject(str); + */ + } + + /* + * PRIVATE METHODS + * */ + public POAKey resolvePOAKey( ObjectKey objectKey ) + throws ForwardRequest + { + if( objectKey != null ){ + //not initialized to check every condition against compiler :) + POAKey key; + try { + /* + * Usually successfull for local requests, because objectKey + * comes directly from an IOR. We shouldn't know this right here + */ + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } catch (Throwable th) { + key = null; + } + + if(key != null) { + return key; + } + + + /* + * If objectKey comes from a remote request, it must be resolved + * through the ORB. + * First: try to get the URL, and after that, resolve it against + * registered initial references + */ + String urlKey = objectKey.getURL(); + org.omg.CORBA.Object reference = null; + + if ( urlKey != null ) { + + if ( urlKey != null ) { + + String initialReference; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + /* + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve url reference: ", + urlKey, " ", ce.getMessage() + } + ); + } + */ + initialReference = null; + }//initialReference retrieval + + if(initialReference == null) { + initialReference = urlKey; + } + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( Throwable th ){ + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve initial reference reference: ", + initialReference, " ", th.getMessage() + } + ); + } + reference = null; + } + if ( reference != null ) { + if ( reference instanceof IOR ){ + objectKey = (( IOR )reference ).getObjectKey(); + } else { + org.omg.CORBA.portable.ObjectImpl ref = + (org.omg.CORBA.portable.ObjectImpl)reference; + CommunicationDelegate delegate = + ( CommunicationDelegate ) ref._get_delegate(); + objectKey = delegate.getReference().getObjectKey(); + } + if ( objectKey != null ) { + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } else { + throw new INTERNAL(); + } + } else { + key = null; + }//reference = null + }//generic url, delegate in communication layers + // URL resolution: object key = service url + // it must throw a ForwardRequest + if ( key != null ){ + return key; + } else { + throw new ForwardRequest(resolveGenericURL(urlKey)); + } + + } else { //unable to get url from objectKey + throw new INV_OBJREF( "Invalid Object Key" ); + } + } else { + throw new INV_OBJREF( "ObjectKey cannot be null" ); + } + }//resolvePOAKey + + + /** + * Generic URL resolution + * @throws ForwardRequest + */ + protected org.omg.CORBA.Object resolveGenericURL(String urlKey) + { + POAKey key; + + + String initialReference = null; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + throw new OBJECT_NOT_EXIST("Invalid object key: " + urlKey); + }//initialReference retrieval + + + org.omg.CORBA.Object reference = null; + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( InvalidName th ){ + StringBuffer msg = new StringBuffer(); + msg.append("Unable to resolve initial reference reference: "); + msg.append(initialReference); + msg.append(" from "); + msg.append(urlKey); + throw new OBJECT_NOT_EXIST(msg.toString()); + } + + return reference; + } + + + + public String toString() + { + if (m_orb_name == null) { + + java.util.Date date; + + date = new java.util.Date(System.currentTimeMillis()); + + StringBuffer name = new StringBuffer(); + name.append("TIDorbj "); + name.append(st_version); + name.append(" (id=\""); + name.append(m_conf.orb_id); + name.append("\") ["); + + name.append( this.communicationManager.toString() ); + + name.append("] created at "); + name.append(date.toString()); + + m_orb_name = name.toString(); + } + + return m_orb_name; + + } + + public void unregister_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + synchronized (m_value_factories) { + if (m_value_factories.remove(id) == null) + throw new BAD_PARAM(); + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public boolean waitShutdown(long millis) + { + return m_state.waitForShutdown(millis); + } + + public boolean work_pending() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + //PRE: str starts with corbaname: + + protected org.omg.CORBA.Object corbanameUrlToObject(String str) + { + try { + return Corbaname.toObject(this, str); + } + catch (Exception e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void doCompleteShutdown() + { + java.lang.Object[] mgrs = new java.lang.Object[m_POAManagers.size()]; + + m_POAManagers.copyInto(mgrs); + + for (int i = 0; i < mgrs.length; i++) { + org.omg.PortableServer.POAManager mgr = + (org.omg.PortableServer.POAManager) mgrs[i]; + try { + mgr.deactivate(true /* etherealize objects */, + true /* wait_for_completion */); + } + catch (Exception e) {} + } + + try { + if (m_root_POA != null) + m_root_POA.destroy(false, true); + } + catch (Exception e) {} + + try { + if ( this.communicationManager != null ){ + this.communicationManager.shutdown( true ); + } + } + catch (Exception e) {} + + m_state.shutdowned(); + } + + // PRE str starts with file: + + protected org.omg.CORBA.Object fileUrlToObject(String str) + { + String file_str = str.substring(7); + String file_url = null; + + if (file_str.length() == 0) + throw new BAD_PARAM(file_str); + try { + java.io.FileReader file_r = new java.io.FileReader(file_str); + java.io.BufferedReader url_r = new java.io.BufferedReader(file_r); + + file_url = url_r.readLine(); + url_r.close(); + + } catch (java.io.FileNotFoundException fnf) { + throw new BAD_PARAM("Invalid file url"); + } catch (SecurityException se) { + throw new NO_PERMISSION( + se.getMessage(), 0, CompletionStatus.COMPLETED_NO + ); + } catch (Throwable th) { + throw new UNKNOWN( + th.toString(), 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( file_url != null && !file_url.startsWith("file:") ) { + return string_to_object( file_url ); + } else { + throw new BAD_PARAM( "No file url allowed in a file" ); + } + } + + /** + * Destructor. + */ + + protected void finalize() + { + if (!m_destroyed) + destroy(); + } + + // PRE str starts with corbaloc:iiop: or corbaloc:: + + //TODO: this should come from the communications layers + protected org.omg.CORBA.Object iiopUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + CommunicationDelegate delegate = null; + + try { + ior = IIOPCorbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + //TODO: should the communicationsManager (or the related layer) store + //a cache of delegates for each IOR? + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + protected es.tid.TIDorbj.core.CodecFactoryImpl initCodecFactory() + { + synchronized (this) { + if (m_codec_factory == null) + m_codec_factory = new CodecFactoryImpl(this); + } + return m_codec_factory; + } + + protected es.tid.TIDorbj.dynAny.DynAnyFactoryImpl initDynAnyFactory() + { + synchronized (this) { + if (m_dyn_factory == null) { + try { + m_dyn_factory = + new es.tid.TIDorbj.dynAny.DynAnyFactoryImpl(); + m_dyn_factory.set_orb(this); + } + catch (Throwable th) { + throw new INITIALIZE("Cannot Initialize DynAnyFactory", 0, + CompletionStatus.COMPLETED_NO); + } + } + } + return m_dyn_factory; + } + + /** + * ORB initialization. This method will be invoked by + * set_parametres(). + */ + + protected void initOrb() + { + try { + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + this.communicationManager = CommunicationManager.getInstance( this ); + + m_POAManagers = new java.util.Vector(); + + m_value_factories = new java.util.Hashtable(); + + m_orb_services = new ORBServices(this); + + m_thread_policy_context_manager = + new es.tid.TIDorbj.core.policy.PolicyContextManager(this); + + setupInitialReferences(); + + if (m_conf.typecode_cache_size > 0) + m_typecode_cache = + new es.tid.TIDorbj.core.typecode.TypeCodeCache( + m_conf.typecode_cache_size); + + if (m_conf.trace_level != Trace.NONE) { + m_trace = getTrace(); + + + m_trace.print(Trace.ERROR, "ORB initialization OK!"); + + m_conf.dump(m_trace.getLog()); + m_trace.flush(); + } + + } + catch (Throwable e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + public synchronized Trace getTrace() + throws IOException + { + if (m_trace == null) { + if (m_conf.trace_file != null) { + if (m_conf.trace_num_files > 1) { + + CircularTraceFile ctf = + new CircularTraceFile(m_conf.trace_num_files, + m_conf.trace_file_size, + m_conf.trace_file); + m_trace = Trace.createTrace(ctf, toString(), + m_conf.trace_level); + } else { + m_trace = Trace.createTrace(m_conf.trace_file, toString(), + m_conf.trace_level); + } + + } else { + m_trace = Trace.createTrace(toString(), m_conf.trace_level); + } + } + + return m_trace; + } + + protected es.tid.TIDorbj.core.policy.PolicyCurrentImpl initPolicyCurrent() + { + synchronized (this) { + if (m_policy_current == null) + m_policy_current = + new es.tid.TIDorbj.core.policy.PolicyCurrentImpl + (m_thread_policy_context_manager); + } + return m_policy_current; + } + + protected es.tid.TIDorbj.core.compression.CompressionManagerImpl initCompressionManager() + { + synchronized (this) { + if (m_compression_manager == null) + m_compression_manager = + new es.tid.TIDorbj.core.compression.CompressionManagerImpl + (this); + } + return m_compression_manager; + } + + protected es.tid.TIDorbj.core.messaging.AMIManager initAMIManager() + { + synchronized (this) { + if (m_ami_manager == null) + m_ami_manager = + new es.tid.TIDorbj.core.messaging.AMIManager(this); + } + return m_ami_manager; + } + + protected es.tid.TIDorbj.core.policy.PolicyManagerImpl initPolicyManager() + { + synchronized (this) { + if (m_orb_policy_manager == null) + m_orb_policy_manager = + new es.tid.TIDorbj.core.policy.PolicyManagerImpl(this); + } + return m_orb_policy_manager; + } + + //PRE: str starts with corbaloc:rir: + + protected org.omg.CORBA.Object rirUrlToObject(String str) + { + if (!str.startsWith("corbaloc:rir:/")) + throw new BAD_PARAM(str); + try { + return resolve_initial_references(str.substring(14)); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(app, props); + initOrb(); + } + + // CORBA ORB standard methods + + protected void set_parameters(String[] args, java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(args, props); + initOrb(); + } + + protected void setupInitialReferences() + { + int references = m_conf.initial_references.size(); + + InitialReference ref = null; + + for (int i = 0; i < references; i++) { + ref = (InitialReference) m_conf.initial_references.elementAt(i); + m_orb_services.setService(ref.getName(), + string_to_object(ref.getURL())); + } + + } + + //PRE: str starts with corbaloc:tidorbj: + protected org.omg.CORBA.Object tidorbjUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + Delegate delegate = null; + + try { + ior = Corbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } +<<<<<<< .working + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +======= + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +>>>>>>> .merge-right.r354 + + public void setORBservice(String object_name, + org.omg.CORBA.Object obj) { + m_orb_services.setService(object_name, obj); + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.2.tmp b/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.2.tmp new file mode 100644 index 0000000..91c5062 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.2.tmp @@ -0,0 +1,1684 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.io.IOException; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServiceInformationHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CORBA.portable.Delegate; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMIManager; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.typecode.AbstractInterfaceTypeCode; +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.core.util.Corbaname; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.CircularTraceFile; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb GIOPVersion 2.6 CORBA ORB. + *

+ * + * @autor Juan A. Cáceres + * @version 2.0 + */ +public class TIDORB extends org.omg.CORBA_2_5.ORB +{ + + /** + * ORB GIOPVersion + */ + +<<<<<<< .working +<<<<<<< .working + public final static String st_version = "6.3.3"; +======= + public final static String st_version = "6.3.2"; +======= + public final static String st_version = "6.3.3"; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + + /** + * @return the ORB Singleton instance. + */ + public static org.omg.CORBA.ORB init() + { + return SingletonORB.init(); + } + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * Local POAManagers. + */ + public java.util.Vector m_POAManagers; + + /** + * TraceService reference. + */ + public es.tid.TIDorbj.util.Trace m_trace; + + /** + * Local Codec factory. + */ + private CodecFactoryImpl m_codec_factory; + + /** TODO: remove me + * ORB Communication layer, drives request to the local layer or the + * external layer. + + private es.tid.TIDorbj.core.comm.iiop.CommLayer m_comm_layer;*/ + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + private CommunicationManager communicationManager; + + + /** + * Local CurrentImpl. + */ + private es.tid.TIDorbj.core.poa.CurrentImpl m_current; + + /** + * The ORB has been destroyed. + */ + + private boolean m_destroyed; + + /** + * Local DynAny factory. + */ + private es.tid.TIDorbj.dynAny.DynAnyFactoryImpl m_dyn_factory; + + /** + * ORB PolicyManager. + */ + private es.tid.TIDorbj.core.policy.PolicyManagerImpl m_orb_policy_manager; + + /** + * ORB Services + */ + + private ORBServices m_orb_services; + + /** + * Thread Policy Current. + */ + private es.tid.TIDorbj.core.policy.PolicyCurrentImpl m_policy_current; + + /** + * Compression Manager. + */ + private es.tid.TIDorbj.core.compression.CompressionManagerImpl m_compression_manager; + + /** + * Local rootPOA. + */ + private es.tid.TIDorbj.core.poa.POAImpl m_root_POA; + + /** + * Processing state: controls the ORB shutdown. + */ + + private ProcessingState m_state; + + /** + * Thread Policy Context Manager. + */ + private es.tid.TIDorbj.core.policy.PolicyContextManager + m_thread_policy_context_manager; + + /** + * Maintains the order which the request was created + */ + private RequestCounter requestCounter; + + /** + * TypeCode Cache. + */ + + private es.tid.TIDorbj.core.typecode.TypeCodeCache m_typecode_cache; + + /** + * ORB ValueFactoryList + */ + + private java.util.Hashtable m_value_factories; + + /** + * ORB Name + */ + + String m_orb_name; +<<<<<<< .working + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +======= + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +>>>>>>> .merge-right.r354 + + /** + * Constructor. The orb must be initialized using the set_parameters(). + */ + public TIDORB() + { + m_conf = null; + m_state = new ProcessingState(this); + m_destroyed = false; + + this.communicationManager = null; + this.requestCounter = new RequestCounter(); + + m_dyn_factory = null; + m_root_POA = null; + m_trace = null; + m_current = null; + m_typecode_cache = null; +<<<<<<< .working +<<<<<<< .working + m_ami_manager = null; +======= + m_ami_manager = new AMIManager(this); +======= + m_ami_manager = null; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + } + + public void connect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + + public TypeCode create_abstract_interface_tc(String id, String name) + { + return new AbstractInterfaceTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode + create_alias_tc( String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.Any create_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.AnyImpl(this); + } + + public org.omg.CORBA.TypeCode + create_array_tc( int length, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.ContextList create_context_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ContextListImpl(); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.Environment create_environment() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.EnvironmentImpl(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ExceptionListImpl(); + } + + public org.omg.CORBA.TypeCode + create_exception_tc( java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_list(int count) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (count < 0) + throw new BAD_PARAM("Count < 0", 0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.NVListImpl(this, count); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((s == null) || (any == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return es.tid.TIDorbj.core.NamedValueImpl.from_int(flags, s, any); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new CDROutputStream(this, m_conf.block_size); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (val == null) + throw new BAD_PARAM("Null any reference"); + + return es.tid.TIDorbj.core.policy.PolicyFactory.createPolicy(type, val); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, + int offset) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc( int bound, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc( String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (concrete_base == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + /** + * Free all the ORB resources: connections and threads. + */ + + synchronized public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + // The thread is serving a request? + + if (initPOACurrent().inContext()) { // yes, it is in the serving request + // context + + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.shutdown(); + + m_state.waitForShutdown(); + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + * m_comm_layer.destroy(); + */ + this.communicationManager.destroy(); + this.communicationManager = null; + + + if (m_trace != null) { + try { + printTrace(Trace.USER, "Closing ORB Session."); + m_trace.close(); + } + catch (Throwable th) {} + + m_trace = null; + } + + if (m_value_factories != null) + m_value_factories.clear(); + + m_value_factories = null; + + if (m_codec_factory != null) { + m_codec_factory.destroy(); + m_codec_factory = null; + } + + if (m_dyn_factory != null) { + m_dyn_factory.destroy(); + m_dyn_factory = null; + } + + m_orb_services.destroy(); + m_orb_services = null; + + m_root_POA = null; + + if (m_current != null) { + m_current.destroy(); + m_current = null; + } + + m_destroyed = true; + } + + public boolean destroyed() + { + return m_destroyed; + } + + public void disconnect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated + */ + public org.omg.CORBA.Current get_current() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + return m_current; + } + + public org.omg.CORBA.Context get_default_context() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference", 0, + CompletionStatus.COMPLETED_NO); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public boolean + get_service_information( short service_type, + ServiceInformationHolder service_info) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + public CommunicationManager getCommunicationManager(){ + if ( m_destroyed ){ + throw new OBJECT_NOT_EXIST(); + } + return this.communicationManager; + } + + + + public es.tid.TIDorbj.core.policy.PolicyContextManager + getPolicyContextManager() + { + return m_thread_policy_context_manager; + } + + public es.tid.TIDorbj.core.policy.PolicyManagerImpl getPolicyManager() + { + return initPolicyManager(); + } + + public es.tid.TIDorbj.core.compression.CompressionManagerImpl getCompressionManager() + { + return initCompressionManager(); + } + + public es.tid.TIDorbj.core.typecode.TypeCodeCache getTypeCodeCache() + { + return m_typecode_cache; + } + + public RequestCounter getRequestCounter() + { + return this.requestCounter; + } + + + // CORBA 2.5 + public String id() + { + return m_conf.orb_id; + } + + // ORB Services + + public es.tid.TIDorbj.core.poa.POAImpl initPOA() { + synchronized (this) { + if (m_root_POA == null) { + m_root_POA = + es.tid.TIDorbj.core.poa.POAImpl.createRootPOA(this); + + + // init the orb listening points (usually one for each layer) + try { + this.communicationManager.setServerModeEnabled( true ); + } catch ( CommunicationException ce ) { + throw new INITIALIZE( "Unable to activate server mode: " + ce.getMessage() ); + } + + m_state.running(); + } + } + + return m_root_POA; + } + + public es.tid.TIDorbj.core.poa.CurrentImpl initPOACurrent() + { + synchronized (this) { + if (m_current == null) { + m_current = new es.tid.TIDorbj.core.poa.CurrentImpl(this); + } + } + + return m_current; + } + + public String[] list_initial_services() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_orb_services.listInitialServices(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + return (org.omg.CORBA.portable.ValueFactory) m_value_factories.get(id); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return IOR.nullIOR().toString(); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj) + ._get_delegate(); + + if (obj instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, + CompletionStatus.COMPLETED_NO); + + if (delegate instanceof CommunicationDelegate) + return ((CommunicationDelegate) delegate).toString(); + else + throw new BAD_PARAM("This Object has not been create by TIDorb", + 0, + CompletionStatus.COMPLETED_NO); + } + + public String objectToURL(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return Corbaloc.toURL(IOR.nullIOR()); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + //TODO: refactor URL/String IOR stuff + return ((CommunicationDelegate) delegate).getReference().toURL(); + } else + throw new BAD_PARAM("This Object has not been create by TIDorb", 0, + CompletionStatus.COMPLETED_NO); + } + + public void perform_work() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void printTrace(int level, String message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printTrace(int level, String message, Throwable e) + { + if (m_trace != null) + m_trace.printStackTrace(level, message, e); + } + + public void printTrace(int level, String[] message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printDump(int level, byte[] message, int length) + { + if (m_trace != null) + m_trace.dump(level, message, length); + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.registerInitialReference(object_name, obj); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + synchronized (m_value_factories) { + if (m_value_factories.containsKey(id)) + return null; + m_value_factories.put(id, factory); + } + + return factory; + } + + public void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.removeInitialReference(object_name); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (object_name == null) + throw new BAD_PARAM("Null String reference", 24, + CompletionStatus.COMPLETED_NO); + + return m_orb_services.resolveService(object_name); + } + + public void run() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (m_root_POA == null) { + throw new org.omg.CORBA.INTERNAL("RootPOA has not been created."); + } + + m_state.waitForShutdown(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < req.length; i++) + req[i].send_oneway(); + } + + public void set_delegate(java.lang.Object wrapper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (wrapper instanceof org.omg.PortableServer.Servant) { + org.omg.PortableServer.Servant servant = + (org.omg.PortableServer.Servant) wrapper; + + if (m_root_POA == null) { + initPOA(); + } + + try { + org.omg.CORBA.ORB servantOrb = servant._orb(); + if ( servantOrb != this ) { + throw new + BAD_PARAM("Servant is already active in another ORB"); + } + } + catch (org.omg.CORBA.BAD_INV_ORDER e) { + try { + m_root_POA.activate_object(servant); + + // Exceptions should never be thrown + } catch (org.omg.PortableServer.POAPackage.WrongPolicy wp) + { + } + catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive s) + { + } + } + } else + throw new BAD_PARAM("Servant expected"); + + } + + public void shutdown(boolean wait_for_completion) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + m_state.shutdown(); + + if (wait_for_completion) { + if (initPOACurrent().inContext()) { + // yes, it is in the serving request context + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.waitForShutdown(); + } + } + + public org.omg.CORBA.Object string_to_object(String str) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (str == null) { + throw new BAD_PARAM("Null String reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (str.startsWith("corbaname:")) + return corbanameUrlToObject(str); + + if (str.startsWith("file://")) + return fileUrlToObject(str); + + if (str.startsWith("corbaloc:rir:")) + return rirUrlToObject(str); + + if (str.startsWith("corbaloc:tidorbj:")) + return tidorbjUrlToObject(str); + + + Delegate delegate; + try { + delegate = this.communicationManager.createDelegate( str ); + } catch ( CommunicationException ce){ + delegate = null; + } + if ( delegate != null ){ + ObjectImpl o = new ObjectImpl(); + o._set_delegate( delegate ); + return o; + } else { + throw new BAD_PARAM( + "UNKNOWN String reference", 0, CompletionStatus.COMPLETED_NO + ); + } + /* + return iorToObject(str); + */ + } + + /* + * PRIVATE METHODS + * */ + public POAKey resolvePOAKey( ObjectKey objectKey ) + throws ForwardRequest + { + if( objectKey != null ){ + //not initialized to check every condition against compiler :) + POAKey key; + try { + /* + * Usually successfull for local requests, because objectKey + * comes directly from an IOR. We shouldn't know this right here + */ + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } catch (Throwable th) { + key = null; + } + + if(key != null) { + return key; + } + + + /* + * If objectKey comes from a remote request, it must be resolved + * through the ORB. + * First: try to get the URL, and after that, resolve it against + * registered initial references + */ + String urlKey = objectKey.getURL(); + org.omg.CORBA.Object reference = null; + + if ( urlKey != null ) { + + if ( urlKey != null ) { + + String initialReference; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + /* + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve url reference: ", + urlKey, " ", ce.getMessage() + } + ); + } + */ + initialReference = null; + }//initialReference retrieval + + if(initialReference == null) { + initialReference = urlKey; + } + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( Throwable th ){ + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve initial reference reference: ", + initialReference, " ", th.getMessage() + } + ); + } + reference = null; + } + if ( reference != null ) { + if ( reference instanceof IOR ){ + objectKey = (( IOR )reference ).getObjectKey(); + } else { + org.omg.CORBA.portable.ObjectImpl ref = + (org.omg.CORBA.portable.ObjectImpl)reference; + CommunicationDelegate delegate = + ( CommunicationDelegate ) ref._get_delegate(); + objectKey = delegate.getReference().getObjectKey(); + } + if ( objectKey != null ) { + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } else { + throw new INTERNAL(); + } + } else { + key = null; + }//reference = null + }//generic url, delegate in communication layers + // URL resolution: object key = service url + // it must throw a ForwardRequest + if ( key != null ){ + return key; + } else { + throw new ForwardRequest(resolveGenericURL(urlKey)); + } + + } else { //unable to get url from objectKey + throw new INV_OBJREF( "Invalid Object Key" ); + } + } else { + throw new INV_OBJREF( "ObjectKey cannot be null" ); + } + }//resolvePOAKey + + + /** + * Generic URL resolution + * @throws ForwardRequest + */ + protected org.omg.CORBA.Object resolveGenericURL(String urlKey) + { + POAKey key; + + + String initialReference = null; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + throw new OBJECT_NOT_EXIST("Invalid object key: " + urlKey); + }//initialReference retrieval + + + org.omg.CORBA.Object reference = null; + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( InvalidName th ){ + StringBuffer msg = new StringBuffer(); + msg.append("Unable to resolve initial reference reference: "); + msg.append(initialReference); + msg.append(" from "); + msg.append(urlKey); + throw new OBJECT_NOT_EXIST(msg.toString()); + } + + return reference; + } + + + + public String toString() + { + if (m_orb_name == null) { + + java.util.Date date; + + date = new java.util.Date(System.currentTimeMillis()); + + StringBuffer name = new StringBuffer(); + name.append("TIDorbj "); + name.append(st_version); + name.append(" (id=\""); + name.append(m_conf.orb_id); + name.append("\") ["); + + name.append( this.communicationManager.toString() ); + + name.append("] created at "); + name.append(date.toString()); + + m_orb_name = name.toString(); + } + + return m_orb_name; + + } + + public void unregister_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + synchronized (m_value_factories) { + if (m_value_factories.remove(id) == null) + throw new BAD_PARAM(); + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public boolean waitShutdown(long millis) + { + return m_state.waitForShutdown(millis); + } + + public boolean work_pending() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + //PRE: str starts with corbaname: + + protected org.omg.CORBA.Object corbanameUrlToObject(String str) + { + try { + return Corbaname.toObject(this, str); + } + catch (Exception e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void doCompleteShutdown() + { + java.lang.Object[] mgrs = new java.lang.Object[m_POAManagers.size()]; + + m_POAManagers.copyInto(mgrs); + + for (int i = 0; i < mgrs.length; i++) { + org.omg.PortableServer.POAManager mgr = + (org.omg.PortableServer.POAManager) mgrs[i]; + try { + mgr.deactivate(true /* etherealize objects */, + true /* wait_for_completion */); + } + catch (Exception e) {} + } + + try { + if (m_root_POA != null) + m_root_POA.destroy(false, true); + } + catch (Exception e) {} + + try { + if ( this.communicationManager != null ){ + this.communicationManager.shutdown( true ); + } + } + catch (Exception e) {} + + m_state.shutdowned(); + } + + // PRE str starts with file: + + protected org.omg.CORBA.Object fileUrlToObject(String str) + { + String file_str = str.substring(7); + String file_url = null; + + if (file_str.length() == 0) + throw new BAD_PARAM(file_str); + try { + java.io.FileReader file_r = new java.io.FileReader(file_str); + java.io.BufferedReader url_r = new java.io.BufferedReader(file_r); + + file_url = url_r.readLine(); + url_r.close(); + + } catch (java.io.FileNotFoundException fnf) { + throw new BAD_PARAM("Invalid file url"); + } catch (SecurityException se) { + throw new NO_PERMISSION( + se.getMessage(), 0, CompletionStatus.COMPLETED_NO + ); + } catch (Throwable th) { + throw new UNKNOWN( + th.toString(), 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( file_url != null && !file_url.startsWith("file:") ) { + return string_to_object( file_url ); + } else { + throw new BAD_PARAM( "No file url allowed in a file" ); + } + } + + /** + * Destructor. + */ + + protected void finalize() + { + if (!m_destroyed) + destroy(); + } + + // PRE str starts with corbaloc:iiop: or corbaloc:: + + //TODO: this should come from the communications layers + protected org.omg.CORBA.Object iiopUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + CommunicationDelegate delegate = null; + + try { + ior = IIOPCorbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + //TODO: should the communicationsManager (or the related layer) store + //a cache of delegates for each IOR? + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + protected es.tid.TIDorbj.core.CodecFactoryImpl initCodecFactory() + { + synchronized (this) { + if (m_codec_factory == null) + m_codec_factory = new CodecFactoryImpl(this); + } + return m_codec_factory; + } + + protected es.tid.TIDorbj.dynAny.DynAnyFactoryImpl initDynAnyFactory() + { + synchronized (this) { + if (m_dyn_factory == null) { + try { + m_dyn_factory = + new es.tid.TIDorbj.dynAny.DynAnyFactoryImpl(); + m_dyn_factory.set_orb(this); + } + catch (Throwable th) { + throw new INITIALIZE("Cannot Initialize DynAnyFactory", 0, + CompletionStatus.COMPLETED_NO); + } + } + } + return m_dyn_factory; + } + + /** + * ORB initialization. This method will be invoked by + * set_parametres(). + */ + + protected void initOrb() + { + try { + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + this.communicationManager = CommunicationManager.getInstance( this ); + + m_POAManagers = new java.util.Vector(); + + m_value_factories = new java.util.Hashtable(); + + m_orb_services = new ORBServices(this); + + m_thread_policy_context_manager = + new es.tid.TIDorbj.core.policy.PolicyContextManager(this); + + setupInitialReferences(); + + if (m_conf.typecode_cache_size > 0) + m_typecode_cache = + new es.tid.TIDorbj.core.typecode.TypeCodeCache( + m_conf.typecode_cache_size); + + if (m_conf.trace_level != Trace.NONE) { + m_trace = getTrace(); + + + m_trace.print(Trace.ERROR, "ORB initialization OK!"); + + m_conf.dump(m_trace.getLog()); + m_trace.flush(); + } + + } + catch (Throwable e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + public synchronized Trace getTrace() + throws IOException + { + if (m_trace == null) { + if (m_conf.trace_file != null) { + if (m_conf.trace_num_files > 1) { + + CircularTraceFile ctf = + new CircularTraceFile(m_conf.trace_num_files, + m_conf.trace_file_size, + m_conf.trace_file); + m_trace = Trace.createTrace(ctf, toString(), + m_conf.trace_level); + } else { + m_trace = Trace.createTrace(m_conf.trace_file, toString(), + m_conf.trace_level); + } + + } else { + m_trace = Trace.createTrace(toString(), m_conf.trace_level); + } + } + + return m_trace; + } + + protected es.tid.TIDorbj.core.policy.PolicyCurrentImpl initPolicyCurrent() + { + synchronized (this) { + if (m_policy_current == null) + m_policy_current = + new es.tid.TIDorbj.core.policy.PolicyCurrentImpl + (m_thread_policy_context_manager); + } + return m_policy_current; + } + + protected es.tid.TIDorbj.core.compression.CompressionManagerImpl initCompressionManager() + { + synchronized (this) { + if (m_compression_manager == null) + m_compression_manager = + new es.tid.TIDorbj.core.compression.CompressionManagerImpl + (this); + } + return m_compression_manager; + } + + protected es.tid.TIDorbj.core.messaging.AMIManager initAMIManager() + { + synchronized (this) { + if (m_ami_manager == null) + m_ami_manager = + new es.tid.TIDorbj.core.messaging.AMIManager(this); + } + return m_ami_manager; + } + + protected es.tid.TIDorbj.core.policy.PolicyManagerImpl initPolicyManager() + { + synchronized (this) { + if (m_orb_policy_manager == null) + m_orb_policy_manager = + new es.tid.TIDorbj.core.policy.PolicyManagerImpl(this); + } + return m_orb_policy_manager; + } + + //PRE: str starts with corbaloc:rir: + + protected org.omg.CORBA.Object rirUrlToObject(String str) + { + if (!str.startsWith("corbaloc:rir:/")) + throw new BAD_PARAM(str); + try { + return resolve_initial_references(str.substring(14)); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(app, props); + initOrb(); + } + + // CORBA ORB standard methods + + protected void set_parameters(String[] args, java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(args, props); + initOrb(); + } + + protected void setupInitialReferences() + { + int references = m_conf.initial_references.size(); + + InitialReference ref = null; + + for (int i = 0; i < references; i++) { + ref = (InitialReference) m_conf.initial_references.elementAt(i); + m_orb_services.setService(ref.getName(), + string_to_object(ref.getURL())); + } + + } + + //PRE: str starts with corbaloc:tidorbj: + protected org.omg.CORBA.Object tidorbjUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + Delegate delegate = null; + + try { + ior = Corbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } +<<<<<<< .working + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +======= + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +>>>>>>> .merge-right.r354 + + public void setORBservice(String object_name, + org.omg.CORBA.Object obj) { + m_orb_services.setService(object_name, obj); + } + +} diff --git a/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.tmp b/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.tmp new file mode 100644 index 0000000..91c5062 --- /dev/null +++ b/source/es/tid/TIDorbj/core/.svn/tmp/tempfile.tmp @@ -0,0 +1,1684 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.io.IOException; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServiceInformationHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CORBA.portable.Delegate; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMIManager; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.typecode.AbstractInterfaceTypeCode; +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.core.util.Corbaname; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.CircularTraceFile; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb GIOPVersion 2.6 CORBA ORB. + *

+ * + * @autor Juan A. Cáceres + * @version 2.0 + */ +public class TIDORB extends org.omg.CORBA_2_5.ORB +{ + + /** + * ORB GIOPVersion + */ + +<<<<<<< .working +<<<<<<< .working + public final static String st_version = "6.3.3"; +======= + public final static String st_version = "6.3.2"; +======= + public final static String st_version = "6.3.3"; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + + /** + * @return the ORB Singleton instance. + */ + public static org.omg.CORBA.ORB init() + { + return SingletonORB.init(); + } + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * Local POAManagers. + */ + public java.util.Vector m_POAManagers; + + /** + * TraceService reference. + */ + public es.tid.TIDorbj.util.Trace m_trace; + + /** + * Local Codec factory. + */ + private CodecFactoryImpl m_codec_factory; + + /** TODO: remove me + * ORB Communication layer, drives request to the local layer or the + * external layer. + + private es.tid.TIDorbj.core.comm.iiop.CommLayer m_comm_layer;*/ + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + private CommunicationManager communicationManager; + + + /** + * Local CurrentImpl. + */ + private es.tid.TIDorbj.core.poa.CurrentImpl m_current; + + /** + * The ORB has been destroyed. + */ + + private boolean m_destroyed; + + /** + * Local DynAny factory. + */ + private es.tid.TIDorbj.dynAny.DynAnyFactoryImpl m_dyn_factory; + + /** + * ORB PolicyManager. + */ + private es.tid.TIDorbj.core.policy.PolicyManagerImpl m_orb_policy_manager; + + /** + * ORB Services + */ + + private ORBServices m_orb_services; + + /** + * Thread Policy Current. + */ + private es.tid.TIDorbj.core.policy.PolicyCurrentImpl m_policy_current; + + /** + * Compression Manager. + */ + private es.tid.TIDorbj.core.compression.CompressionManagerImpl m_compression_manager; + + /** + * Local rootPOA. + */ + private es.tid.TIDorbj.core.poa.POAImpl m_root_POA; + + /** + * Processing state: controls the ORB shutdown. + */ + + private ProcessingState m_state; + + /** + * Thread Policy Context Manager. + */ + private es.tid.TIDorbj.core.policy.PolicyContextManager + m_thread_policy_context_manager; + + /** + * Maintains the order which the request was created + */ + private RequestCounter requestCounter; + + /** + * TypeCode Cache. + */ + + private es.tid.TIDorbj.core.typecode.TypeCodeCache m_typecode_cache; + + /** + * ORB ValueFactoryList + */ + + private java.util.Hashtable m_value_factories; + + /** + * ORB Name + */ + + String m_orb_name; +<<<<<<< .working + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +======= + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + +>>>>>>> .merge-right.r354 + + /** + * Constructor. The orb must be initialized using the set_parameters(). + */ + public TIDORB() + { + m_conf = null; + m_state = new ProcessingState(this); + m_destroyed = false; + + this.communicationManager = null; + this.requestCounter = new RequestCounter(); + + m_dyn_factory = null; + m_root_POA = null; + m_trace = null; + m_current = null; + m_typecode_cache = null; +<<<<<<< .working +<<<<<<< .working + m_ami_manager = null; +======= + m_ami_manager = new AMIManager(this); +======= + m_ami_manager = null; +>>>>>>> .merge-right.r452 +>>>>>>> .merge-right.r354 + } + + public void connect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + + public TypeCode create_abstract_interface_tc(String id, String name) + { + return new AbstractInterfaceTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode + create_alias_tc( String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.Any create_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.AnyImpl(this); + } + + public org.omg.CORBA.TypeCode + create_array_tc( int length, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.ContextList create_context_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ContextListImpl(); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.Environment create_environment() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.EnvironmentImpl(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ExceptionListImpl(); + } + + public org.omg.CORBA.TypeCode + create_exception_tc( java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_list(int count) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (count < 0) + throw new BAD_PARAM("Count < 0", 0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.NVListImpl(this, count); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((s == null) || (any == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return es.tid.TIDorbj.core.NamedValueImpl.from_int(flags, s, any); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new CDROutputStream(this, m_conf.block_size); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (val == null) + throw new BAD_PARAM("Null any reference"); + + return es.tid.TIDorbj.core.policy.PolicyFactory.createPolicy(type, val); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, + int offset) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc( int bound, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc( String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (concrete_base == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + /** + * Free all the ORB resources: connections and threads. + */ + + synchronized public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + // The thread is serving a request? + + if (initPOACurrent().inContext()) { // yes, it is in the serving request + // context + + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.shutdown(); + + m_state.waitForShutdown(); + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + * m_comm_layer.destroy(); + */ + this.communicationManager.destroy(); + this.communicationManager = null; + + + if (m_trace != null) { + try { + printTrace(Trace.USER, "Closing ORB Session."); + m_trace.close(); + } + catch (Throwable th) {} + + m_trace = null; + } + + if (m_value_factories != null) + m_value_factories.clear(); + + m_value_factories = null; + + if (m_codec_factory != null) { + m_codec_factory.destroy(); + m_codec_factory = null; + } + + if (m_dyn_factory != null) { + m_dyn_factory.destroy(); + m_dyn_factory = null; + } + + m_orb_services.destroy(); + m_orb_services = null; + + m_root_POA = null; + + if (m_current != null) { + m_current.destroy(); + m_current = null; + } + + m_destroyed = true; + } + + public boolean destroyed() + { + return m_destroyed; + } + + public void disconnect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated + */ + public org.omg.CORBA.Current get_current() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + return m_current; + } + + public org.omg.CORBA.Context get_default_context() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference", 0, + CompletionStatus.COMPLETED_NO); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public boolean + get_service_information( short service_type, + ServiceInformationHolder service_info) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + public CommunicationManager getCommunicationManager(){ + if ( m_destroyed ){ + throw new OBJECT_NOT_EXIST(); + } + return this.communicationManager; + } + + + + public es.tid.TIDorbj.core.policy.PolicyContextManager + getPolicyContextManager() + { + return m_thread_policy_context_manager; + } + + public es.tid.TIDorbj.core.policy.PolicyManagerImpl getPolicyManager() + { + return initPolicyManager(); + } + + public es.tid.TIDorbj.core.compression.CompressionManagerImpl getCompressionManager() + { + return initCompressionManager(); + } + + public es.tid.TIDorbj.core.typecode.TypeCodeCache getTypeCodeCache() + { + return m_typecode_cache; + } + + public RequestCounter getRequestCounter() + { + return this.requestCounter; + } + + + // CORBA 2.5 + public String id() + { + return m_conf.orb_id; + } + + // ORB Services + + public es.tid.TIDorbj.core.poa.POAImpl initPOA() { + synchronized (this) { + if (m_root_POA == null) { + m_root_POA = + es.tid.TIDorbj.core.poa.POAImpl.createRootPOA(this); + + + // init the orb listening points (usually one for each layer) + try { + this.communicationManager.setServerModeEnabled( true ); + } catch ( CommunicationException ce ) { + throw new INITIALIZE( "Unable to activate server mode: " + ce.getMessage() ); + } + + m_state.running(); + } + } + + return m_root_POA; + } + + public es.tid.TIDorbj.core.poa.CurrentImpl initPOACurrent() + { + synchronized (this) { + if (m_current == null) { + m_current = new es.tid.TIDorbj.core.poa.CurrentImpl(this); + } + } + + return m_current; + } + + public String[] list_initial_services() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_orb_services.listInitialServices(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + return (org.omg.CORBA.portable.ValueFactory) m_value_factories.get(id); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return IOR.nullIOR().toString(); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj) + ._get_delegate(); + + if (obj instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, + CompletionStatus.COMPLETED_NO); + + if (delegate instanceof CommunicationDelegate) + return ((CommunicationDelegate) delegate).toString(); + else + throw new BAD_PARAM("This Object has not been create by TIDorb", + 0, + CompletionStatus.COMPLETED_NO); + } + + public String objectToURL(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return Corbaloc.toURL(IOR.nullIOR()); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + //TODO: refactor URL/String IOR stuff + return ((CommunicationDelegate) delegate).getReference().toURL(); + } else + throw new BAD_PARAM("This Object has not been create by TIDorb", 0, + CompletionStatus.COMPLETED_NO); + } + + public void perform_work() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void printTrace(int level, String message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printTrace(int level, String message, Throwable e) + { + if (m_trace != null) + m_trace.printStackTrace(level, message, e); + } + + public void printTrace(int level, String[] message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printDump(int level, byte[] message, int length) + { + if (m_trace != null) + m_trace.dump(level, message, length); + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.registerInitialReference(object_name, obj); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + synchronized (m_value_factories) { + if (m_value_factories.containsKey(id)) + return null; + m_value_factories.put(id, factory); + } + + return factory; + } + + public void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.removeInitialReference(object_name); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (object_name == null) + throw new BAD_PARAM("Null String reference", 24, + CompletionStatus.COMPLETED_NO); + + return m_orb_services.resolveService(object_name); + } + + public void run() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (m_root_POA == null) { + throw new org.omg.CORBA.INTERNAL("RootPOA has not been created."); + } + + m_state.waitForShutdown(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < req.length; i++) + req[i].send_oneway(); + } + + public void set_delegate(java.lang.Object wrapper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (wrapper instanceof org.omg.PortableServer.Servant) { + org.omg.PortableServer.Servant servant = + (org.omg.PortableServer.Servant) wrapper; + + if (m_root_POA == null) { + initPOA(); + } + + try { + org.omg.CORBA.ORB servantOrb = servant._orb(); + if ( servantOrb != this ) { + throw new + BAD_PARAM("Servant is already active in another ORB"); + } + } + catch (org.omg.CORBA.BAD_INV_ORDER e) { + try { + m_root_POA.activate_object(servant); + + // Exceptions should never be thrown + } catch (org.omg.PortableServer.POAPackage.WrongPolicy wp) + { + } + catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive s) + { + } + } + } else + throw new BAD_PARAM("Servant expected"); + + } + + public void shutdown(boolean wait_for_completion) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + m_state.shutdown(); + + if (wait_for_completion) { + if (initPOACurrent().inContext()) { + // yes, it is in the serving request context + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.waitForShutdown(); + } + } + + public org.omg.CORBA.Object string_to_object(String str) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (str == null) { + throw new BAD_PARAM("Null String reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (str.startsWith("corbaname:")) + return corbanameUrlToObject(str); + + if (str.startsWith("file://")) + return fileUrlToObject(str); + + if (str.startsWith("corbaloc:rir:")) + return rirUrlToObject(str); + + if (str.startsWith("corbaloc:tidorbj:")) + return tidorbjUrlToObject(str); + + + Delegate delegate; + try { + delegate = this.communicationManager.createDelegate( str ); + } catch ( CommunicationException ce){ + delegate = null; + } + if ( delegate != null ){ + ObjectImpl o = new ObjectImpl(); + o._set_delegate( delegate ); + return o; + } else { + throw new BAD_PARAM( + "UNKNOWN String reference", 0, CompletionStatus.COMPLETED_NO + ); + } + /* + return iorToObject(str); + */ + } + + /* + * PRIVATE METHODS + * */ + public POAKey resolvePOAKey( ObjectKey objectKey ) + throws ForwardRequest + { + if( objectKey != null ){ + //not initialized to check every condition against compiler :) + POAKey key; + try { + /* + * Usually successfull for local requests, because objectKey + * comes directly from an IOR. We shouldn't know this right here + */ + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } catch (Throwable th) { + key = null; + } + + if(key != null) { + return key; + } + + + /* + * If objectKey comes from a remote request, it must be resolved + * through the ORB. + * First: try to get the URL, and after that, resolve it against + * registered initial references + */ + String urlKey = objectKey.getURL(); + org.omg.CORBA.Object reference = null; + + if ( urlKey != null ) { + + if ( urlKey != null ) { + + String initialReference; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + /* + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve url reference: ", + urlKey, " ", ce.getMessage() + } + ); + } + */ + initialReference = null; + }//initialReference retrieval + + if(initialReference == null) { + initialReference = urlKey; + } + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( Throwable th ){ + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve initial reference reference: ", + initialReference, " ", th.getMessage() + } + ); + } + reference = null; + } + if ( reference != null ) { + if ( reference instanceof IOR ){ + objectKey = (( IOR )reference ).getObjectKey(); + } else { + org.omg.CORBA.portable.ObjectImpl ref = + (org.omg.CORBA.portable.ObjectImpl)reference; + CommunicationDelegate delegate = + ( CommunicationDelegate ) ref._get_delegate(); + objectKey = delegate.getReference().getObjectKey(); + } + if ( objectKey != null ) { + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } else { + throw new INTERNAL(); + } + } else { + key = null; + }//reference = null + }//generic url, delegate in communication layers + // URL resolution: object key = service url + // it must throw a ForwardRequest + if ( key != null ){ + return key; + } else { + throw new ForwardRequest(resolveGenericURL(urlKey)); + } + + } else { //unable to get url from objectKey + throw new INV_OBJREF( "Invalid Object Key" ); + } + } else { + throw new INV_OBJREF( "ObjectKey cannot be null" ); + } + }//resolvePOAKey + + + /** + * Generic URL resolution + * @throws ForwardRequest + */ + protected org.omg.CORBA.Object resolveGenericURL(String urlKey) + { + POAKey key; + + + String initialReference = null; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + throw new OBJECT_NOT_EXIST("Invalid object key: " + urlKey); + }//initialReference retrieval + + + org.omg.CORBA.Object reference = null; + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( InvalidName th ){ + StringBuffer msg = new StringBuffer(); + msg.append("Unable to resolve initial reference reference: "); + msg.append(initialReference); + msg.append(" from "); + msg.append(urlKey); + throw new OBJECT_NOT_EXIST(msg.toString()); + } + + return reference; + } + + + + public String toString() + { + if (m_orb_name == null) { + + java.util.Date date; + + date = new java.util.Date(System.currentTimeMillis()); + + StringBuffer name = new StringBuffer(); + name.append("TIDorbj "); + name.append(st_version); + name.append(" (id=\""); + name.append(m_conf.orb_id); + name.append("\") ["); + + name.append( this.communicationManager.toString() ); + + name.append("] created at "); + name.append(date.toString()); + + m_orb_name = name.toString(); + } + + return m_orb_name; + + } + + public void unregister_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + synchronized (m_value_factories) { + if (m_value_factories.remove(id) == null) + throw new BAD_PARAM(); + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public boolean waitShutdown(long millis) + { + return m_state.waitForShutdown(millis); + } + + public boolean work_pending() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + //PRE: str starts with corbaname: + + protected org.omg.CORBA.Object corbanameUrlToObject(String str) + { + try { + return Corbaname.toObject(this, str); + } + catch (Exception e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void doCompleteShutdown() + { + java.lang.Object[] mgrs = new java.lang.Object[m_POAManagers.size()]; + + m_POAManagers.copyInto(mgrs); + + for (int i = 0; i < mgrs.length; i++) { + org.omg.PortableServer.POAManager mgr = + (org.omg.PortableServer.POAManager) mgrs[i]; + try { + mgr.deactivate(true /* etherealize objects */, + true /* wait_for_completion */); + } + catch (Exception e) {} + } + + try { + if (m_root_POA != null) + m_root_POA.destroy(false, true); + } + catch (Exception e) {} + + try { + if ( this.communicationManager != null ){ + this.communicationManager.shutdown( true ); + } + } + catch (Exception e) {} + + m_state.shutdowned(); + } + + // PRE str starts with file: + + protected org.omg.CORBA.Object fileUrlToObject(String str) + { + String file_str = str.substring(7); + String file_url = null; + + if (file_str.length() == 0) + throw new BAD_PARAM(file_str); + try { + java.io.FileReader file_r = new java.io.FileReader(file_str); + java.io.BufferedReader url_r = new java.io.BufferedReader(file_r); + + file_url = url_r.readLine(); + url_r.close(); + + } catch (java.io.FileNotFoundException fnf) { + throw new BAD_PARAM("Invalid file url"); + } catch (SecurityException se) { + throw new NO_PERMISSION( + se.getMessage(), 0, CompletionStatus.COMPLETED_NO + ); + } catch (Throwable th) { + throw new UNKNOWN( + th.toString(), 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( file_url != null && !file_url.startsWith("file:") ) { + return string_to_object( file_url ); + } else { + throw new BAD_PARAM( "No file url allowed in a file" ); + } + } + + /** + * Destructor. + */ + + protected void finalize() + { + if (!m_destroyed) + destroy(); + } + + // PRE str starts with corbaloc:iiop: or corbaloc:: + + //TODO: this should come from the communications layers + protected org.omg.CORBA.Object iiopUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + CommunicationDelegate delegate = null; + + try { + ior = IIOPCorbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + //TODO: should the communicationsManager (or the related layer) store + //a cache of delegates for each IOR? + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + protected es.tid.TIDorbj.core.CodecFactoryImpl initCodecFactory() + { + synchronized (this) { + if (m_codec_factory == null) + m_codec_factory = new CodecFactoryImpl(this); + } + return m_codec_factory; + } + + protected es.tid.TIDorbj.dynAny.DynAnyFactoryImpl initDynAnyFactory() + { + synchronized (this) { + if (m_dyn_factory == null) { + try { + m_dyn_factory = + new es.tid.TIDorbj.dynAny.DynAnyFactoryImpl(); + m_dyn_factory.set_orb(this); + } + catch (Throwable th) { + throw new INITIALIZE("Cannot Initialize DynAnyFactory", 0, + CompletionStatus.COMPLETED_NO); + } + } + } + return m_dyn_factory; + } + + /** + * ORB initialization. This method will be invoked by + * set_parametres(). + */ + + protected void initOrb() + { + try { + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + this.communicationManager = CommunicationManager.getInstance( this ); + + m_POAManagers = new java.util.Vector(); + + m_value_factories = new java.util.Hashtable(); + + m_orb_services = new ORBServices(this); + + m_thread_policy_context_manager = + new es.tid.TIDorbj.core.policy.PolicyContextManager(this); + + setupInitialReferences(); + + if (m_conf.typecode_cache_size > 0) + m_typecode_cache = + new es.tid.TIDorbj.core.typecode.TypeCodeCache( + m_conf.typecode_cache_size); + + if (m_conf.trace_level != Trace.NONE) { + m_trace = getTrace(); + + + m_trace.print(Trace.ERROR, "ORB initialization OK!"); + + m_conf.dump(m_trace.getLog()); + m_trace.flush(); + } + + } + catch (Throwable e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + public synchronized Trace getTrace() + throws IOException + { + if (m_trace == null) { + if (m_conf.trace_file != null) { + if (m_conf.trace_num_files > 1) { + + CircularTraceFile ctf = + new CircularTraceFile(m_conf.trace_num_files, + m_conf.trace_file_size, + m_conf.trace_file); + m_trace = Trace.createTrace(ctf, toString(), + m_conf.trace_level); + } else { + m_trace = Trace.createTrace(m_conf.trace_file, toString(), + m_conf.trace_level); + } + + } else { + m_trace = Trace.createTrace(toString(), m_conf.trace_level); + } + } + + return m_trace; + } + + protected es.tid.TIDorbj.core.policy.PolicyCurrentImpl initPolicyCurrent() + { + synchronized (this) { + if (m_policy_current == null) + m_policy_current = + new es.tid.TIDorbj.core.policy.PolicyCurrentImpl + (m_thread_policy_context_manager); + } + return m_policy_current; + } + + protected es.tid.TIDorbj.core.compression.CompressionManagerImpl initCompressionManager() + { + synchronized (this) { + if (m_compression_manager == null) + m_compression_manager = + new es.tid.TIDorbj.core.compression.CompressionManagerImpl + (this); + } + return m_compression_manager; + } + + protected es.tid.TIDorbj.core.messaging.AMIManager initAMIManager() + { + synchronized (this) { + if (m_ami_manager == null) + m_ami_manager = + new es.tid.TIDorbj.core.messaging.AMIManager(this); + } + return m_ami_manager; + } + + protected es.tid.TIDorbj.core.policy.PolicyManagerImpl initPolicyManager() + { + synchronized (this) { + if (m_orb_policy_manager == null) + m_orb_policy_manager = + new es.tid.TIDorbj.core.policy.PolicyManagerImpl(this); + } + return m_orb_policy_manager; + } + + //PRE: str starts with corbaloc:rir: + + protected org.omg.CORBA.Object rirUrlToObject(String str) + { + if (!str.startsWith("corbaloc:rir:/")) + throw new BAD_PARAM(str); + try { + return resolve_initial_references(str.substring(14)); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(app, props); + initOrb(); + } + + // CORBA ORB standard methods + + protected void set_parameters(String[] args, java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(args, props); + initOrb(); + } + + protected void setupInitialReferences() + { + int references = m_conf.initial_references.size(); + + InitialReference ref = null; + + for (int i = 0; i < references; i++) { + ref = (InitialReference) m_conf.initial_references.elementAt(i); + m_orb_services.setService(ref.getName(), + string_to_object(ref.getURL())); + } + + } + + //PRE: str starts with corbaloc:tidorbj: + protected org.omg.CORBA.Object tidorbjUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + Delegate delegate = null; + + try { + ior = Corbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } +<<<<<<< .working + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +======= + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } +>>>>>>> .merge-right.r354 + + public void setORBservice(String object_name, + org.omg.CORBA.Object obj) { + m_orb_services.setService(object_name, obj); + } + +} diff --git a/source/es/tid/TIDorbj/core/AnyImpl.java b/source/es/tid/TIDorbj/core/AnyImpl.java new file mode 100644 index 0000000..1b643ac --- /dev/null +++ b/source/es/tid/TIDorbj/core/AnyImpl.java @@ -0,0 +1,1282 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeDumper; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; +import es.tid.TIDorbj.core.util.AbstractInterfaceHolder; +import es.tid.TIDorbj.core.util.FixedHolder; +import es.tid.TIDorbj.core.util.StringHolder; +import es.tid.TIDorbj.core.util.ULongHolder; +import es.tid.TIDorbj.core.util.ULongLongHolder; +import es.tid.TIDorbj.core.util.UShortHolder; +import es.tid.TIDorbj.core.util.ValueHolder; +import es.tid.TIDorbj.core.util.WCharHolder; +import es.tid.TIDorbj.core.util.WStringHolder; + +/** + * TIDorb Any pseudobject implementation. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class AnyImpl extends es.tid.CORBA.Any +{ + + /** + * ORB where the any has been created. If null is a ORB + * singleton. + */ + + TIDORB m_orb; + + protected TypeCode m_type; + + protected CDRInputStream m_marshaled_value; + + protected org.omg.CORBA.portable.Streamable m_value; + + protected org.omg.CORBA.Any m_wrapped_any; + + /** + * The Streamable value has been inserted by the user with + * insert_Streamable() + */ + protected boolean m_user_value; + + public AnyImpl(TIDORB orb) + { + m_orb = orb; + m_type = TypeCodeFactory.tc_null; + if ((m_orb != null) && (m_orb.m_conf.exhaustive_equal)) { + ((es.tid.TIDorbj.core.typecode.TypeCodeImpl)m_type).setExhaustiveEqual(m_orb.m_conf.exhaustive_equal); + } + m_marshaled_value = null; + m_value = null; + m_user_value = false; + m_wrapped_any = null; + } + + private synchronized void reset_value() + { + m_value = null; + m_marshaled_value = null; + m_user_value = false; + m_wrapped_any = null; + } + + protected boolean hasStreamable() + { + return m_value != null; + } + + // asigns the new vaule and reads from the _marshaled value. + private void initValue(org.omg.CORBA.portable.Streamable holder) + { + if (m_marshaled_value != null) { + m_marshaled_value.rewind(); + m_value = holder; + m_value._read(m_marshaled_value); + } else { + throw new BAD_OPERATION("Any without value.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized boolean equal(org.omg.CORBA.Any a) + { + if (a == null) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + if (m_wrapped_any != null) { + return m_wrapped_any.equal(a); + } + + if (!m_type.equal(a.type())) { + return false; + } + + switch (m_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + return true; + case TCKind._tk_short: + return extract_short() == a.extract_short(); + case TCKind._tk_long: + return extract_long() == a.extract_long(); + case TCKind._tk_longlong: + return extract_longlong() == a.extract_longlong(); + case TCKind._tk_ushort: + return extract_ushort() == a.extract_ushort(); + case TCKind._tk_ulong: + return extract_ulong() == a.extract_ulong(); + case TCKind._tk_ulonglong: + return extract_longlong() == a.extract_longlong(); + case TCKind._tk_float: + return extract_float() == a.extract_float(); + case TCKind._tk_double: + return extract_double() == a.extract_double(); + case TCKind._tk_boolean: + return extract_boolean() == a.extract_boolean(); + case TCKind._tk_char: + return extract_char() == a.extract_char(); + case TCKind._tk_wchar: + return extract_wchar() == a.extract_wchar(); + case TCKind._tk_octet: + return extract_octet() == a.extract_octet(); + case TCKind._tk_any: + return extract_any().equal(a.extract_any()); + case TCKind._tk_objref: + { + org.omg.CORBA.Object obj_ref, obj_ref_a; + obj_ref = extract_Object(); + obj_ref_a = a.extract_Object(); + if (obj_ref == null) { + if (obj_ref_a == null) { + return true; + } else { + return false; + } + } else { + return obj_ref._is_equivalent(obj_ref_a); + } + } + case TCKind._tk_string: + try { + if (m_type.length() == 0) { //unbounded string + return extract_string().equals(a.extract_string()); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_wstring: + try { + if (m_type.length() == 0) { //unbounded string + return extract_wstring().equals(a.extract_wstring()); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_TypeCode: + return extract_TypeCode().equal(a.extract_TypeCode()); + case TCKind._tk_fixed: + return extract_fixed().equals(a.extract_fixed()); + } + + return TypeCodeMarshaler.valuesEqual(m_type, create_input_stream(), + a.create_input_stream()); + } + + protected synchronized void wrapValue(org.omg.CORBA.Any a) + { + reset_value(); + m_wrapped_any = a; + } + + public static void assign(org.omg.CORBA.Any from, org.omg.CORBA.Any to) + { + assign(from, to, false); + } + + public static void assign(org.omg.CORBA.Any from, org.omg.CORBA.Any to, + boolean wrap) + { + if ((from == null) || (to == null)) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + TypeCode type = from.type(); + + switch (type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + to.type(type); + return; + case TCKind._tk_short: + to.insert_short(from.extract_short()); + return; + case TCKind._tk_long: + to.insert_long(from.extract_long()); + return; + case TCKind._tk_longlong: + to.insert_longlong(from.extract_longlong()); + return; + case TCKind._tk_ushort: + to.insert_ushort(from.extract_ushort()); + return; + case TCKind._tk_ulong: + to.insert_ulong(from.extract_ulong()); + return; + case TCKind._tk_ulonglong: + to.insert_ulonglong(from.extract_ulonglong()); + return; + case TCKind._tk_float: + to.insert_float(from.extract_float()); + return; + case TCKind._tk_double: + to.insert_double(from.extract_double()); + return; + case TCKind._tk_boolean: + to.insert_boolean(from.extract_boolean()); + return; + case TCKind._tk_char: + to.insert_char(from.extract_char()); + return; + case TCKind._tk_wchar: + to.insert_wchar(from.extract_wchar()); + return; + case TCKind._tk_octet: + to.insert_octet(from.extract_octet()); + return; + case TCKind._tk_any: + to.insert_any(from.extract_any()); + return; + case TCKind._tk_objref: + to.insert_Object(from.extract_Object()); + return; + case TCKind._tk_value: + to.insert_Value(from.extract_Value(), from.type()); + return; + + case TCKind._tk_string: + try { + if (type.length() == 0) { //unbounded string + to.insert_string(from.extract_string()); + return; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_wstring: + try { + if (type.length() == 0) { //unbounded string + to.insert_wstring(from.extract_wstring()); + return; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + // bounded string + break; + case TCKind._tk_TypeCode: + to.insert_TypeCode(from.extract_TypeCode()); + return; + case TCKind._tk_fixed: + to.insert_fixed(from.extract_fixed(), type); + return; + } + + // while JDKs API Any had no extract_Streamable() + if (from instanceof AnyImpl) { + AnyImpl tidorb_from = (AnyImpl) from; + if (tidorb_from.hasStreamable()) { + to.insert_Streamable(tidorb_from.extract_Streamable()); + return; + } + } + + // Only wraps complex types + + if (wrap && (to instanceof AnyImpl)) { + ((AnyImpl) to).wrapValue(from); + return; + } + + to.read_value(from.create_input_stream(), type); + } + + public static void assignValue(org.omg.CORBA.Any from, org.omg.CORBA.Any to) + { + assignValue(from, to, false); + } + + public static void assignValue(org.omg.CORBA.Any from, + org.omg.CORBA.Any to, boolean wrap) + { + if ((from == null) || (to == null)) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + if (!to.type().equivalent(from.type())) + throw new BAD_OPERATION("No Equivalent types.", 0, + CompletionStatus.COMPLETED_NO); + + assign(from, to, wrap); + } + + public org.omg.CORBA.TypeCode type() + { + return m_type; + } + + /** + * Changes the any typecode, is needed to minizimie overhead in any creation + * of alias types: first create the any, and then change the typecode. + */ + + public synchronized void setEquivalentType(TypeCode type) + { + if (!m_type.equivalent(type)) { + throw new BAD_OPERATION("Types are not equivalent.", 0, + CompletionStatus.COMPLETED_NO); + } else { + m_type = type; + } + } + + public synchronized void type(org.omg.CORBA.TypeCode type) + { + if (type == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + m_type = type; + reset_value(); + } + + public synchronized void read_value(org.omg.CORBA.portable.InputStream is, + org.omg.CORBA.TypeCode type) + { + if ((is == null) || (type == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + // basic types are read directly from the stream + + switch (type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + this.type(type); + return; + case TCKind._tk_short: + insert_short(is.read_short()); + return; + case TCKind._tk_long: + insert_long(is.read_long()); + return; + case TCKind._tk_longlong: + insert_longlong(is.read_longlong()); + return; + case TCKind._tk_ushort: + insert_ushort(is.read_ushort()); + return; + case TCKind._tk_ulong: + insert_ulong(is.read_ulong()); + return; + case TCKind._tk_ulonglong: + insert_ulonglong(is.read_ulonglong()); + return; + case TCKind._tk_float: + insert_float(is.read_float()); + return; + case TCKind._tk_double: + insert_double(is.read_double()); + return; + case TCKind._tk_boolean: + insert_boolean(is.read_boolean()); + return; + case TCKind._tk_char: + insert_char(is.read_char()); + return; + case TCKind._tk_wchar: + insert_wchar(is.read_wchar()); + return; + case TCKind._tk_octet: + insert_octet(is.read_octet()); + return; + case TCKind._tk_any: + insert_any(is.read_any()); + return; + case TCKind._tk_fixed: //special case: fixed values + { + FixedHolder fixed_holder = new FixedHolder(m_type); + fixed_holder._read(is); + insert_Streamable(fixed_holder); + return; + } + case TCKind._tk_value: + case TCKind._tk_value_box: + { + ValueHolder value_holder = new ValueHolder(m_type); + value_holder._read(is); + insert_Streamable(value_holder); + return; + } + case TCKind._tk_abstract_interface: + { + + AbstractInterfaceHolder interface_holder = + new AbstractInterfaceHolder(m_type); + interface_holder._read(is); + insert_Streamable(interface_holder); + return; + } + } + + this.type(type); + + if (is instanceof CDRInputStream) { + // the value is not a streamable value + m_marshaled_value = ((CDRInputStream) is).copy(); + + // saves the actual position + m_marshaled_value.fixStarting(); + + // set the input stream to the end of the value + TypeCodeMarshaler.skipValue(m_type, (CDRInputStream) is); + } else { + // I only can remarshal the value in my own buffer + CDROutputStream out = null; + + if (m_orb != null) { // orbsingleton + out = (CDROutputStream) m_orb.create_output_stream(); + } else { + out = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } + + TypeCodeMarshaler.remarshalValue(m_type, is, out); + m_marshaled_value = (CDRInputStream) out.create_input_stream(); + } + } + + public synchronized void write_value(org.omg.CORBA.portable.OutputStream os) + { + if (os == null) { + throw new BAD_PARAM("Null OutputStream reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + if (m_wrapped_any != null) { + m_wrapped_any.write_value(os); + return; + } + + int kind = m_type.kind().value(); + + if ((kind == TCKind._tk_null) || (kind == TCKind._tk_void)) { + return; + } else if (m_value != null) { + m_value._write(os); + } else if (m_marshaled_value != null) { + CDRInputStream _marshaled_value_copy = m_marshaled_value.copy(); + _marshaled_value_copy.rewind(); + TypeCodeMarshaler.remarshalValue(m_type, _marshaled_value_copy, os); + } else { + throw new BAD_OPERATION("Uncompleted Any.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized org.omg.CORBA.portable.OutputStream create_output_stream() + { + org.omg.CORBA.portable.OutputStream out = null; + + if (m_orb == null) { + out = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } else { + out = m_orb.create_output_stream(); + } + m_marshaled_value = (CDRInputStream) out.create_input_stream(); + + return out; + } + + public synchronized org.omg.CORBA.portable.InputStream create_input_stream() + { + if (m_wrapped_any != null) { + return m_wrapped_any.create_input_stream(); + } + + if (m_marshaled_value == null) { + createMarshaledValue(); + } + + CDRInputStream new_stream = m_marshaled_value.copy(); + new_stream.rewind(); + return new_stream; + } + + protected void createMarshaledValue() + { + if (m_marshaled_value != null) + return; + + int kind = m_type.kind().value(); + + if ((kind == TCKind._tk_null) || (kind == TCKind._tk_void)) { + m_marshaled_value = new CDRInputStream(m_orb, new byte[0]); + return; + } + + if (m_value != null) { + CDROutputStream output; + + if (m_orb == null) { + output = new CDROutputStream(null, ConfORB.DEFAULT_BLOCK_SIZE); + } else { + output = (CDROutputStream) m_orb.create_output_stream(); + } + m_value._write(output); + m_marshaled_value = (CDRInputStream) output.create_input_stream(); + } else { + throw new BAD_OPERATION("Any without value.", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized short extract_short() + { + if (m_type.kind().value() != TCKind._tk_short) { + throw new BAD_OPERATION("No short in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + try { + return ((org.omg.CORBA.ShortHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_short(); + } + } + + public synchronized void insert_short(short s) + { + m_value = new org.omg.CORBA.ShortHolder(s); + m_type = m_value._type(); + } + + public synchronized int extract_long() + { + if (m_type.kind().value() != TCKind._tk_long) { + throw new BAD_OPERATION("No long in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) { + initValue(new org.omg.CORBA.IntHolder()); + } + + try { + return ((org.omg.CORBA.IntHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_long(); + } + } + + public synchronized void insert_long(int i) + { + reset_value(); + m_value = new org.omg.CORBA.IntHolder(i); + m_type = m_value._type(); + } + + public synchronized long extract_longlong() + { + if (m_type.kind().value() != TCKind._tk_longlong) { + throw new BAD_OPERATION("No longlong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + if (m_value == null) { + initValue(new org.omg.CORBA.LongHolder()); + } + + try { + return ((org.omg.CORBA.LongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_longlong(); + } + } + + public synchronized void insert_longlong(long l) + { + reset_value(); + m_value = new org.omg.CORBA.LongHolder(l); + m_type = m_value._type(); + } + + public synchronized short extract_ushort() + { + if (m_type.kind().value() != TCKind._tk_ushort) { + throw new BAD_OPERATION("No ushort in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + if (m_value == null) + initValue(new UShortHolder()); + + try { + return ((UShortHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ushort(); + } + } + + public synchronized void insert_ushort(short s) + { + reset_value(); + m_value = new UShortHolder(s); + m_type = TypeCodeFactory.tc_ushort; + } + + public synchronized int extract_ulong() + { + if (m_type.kind().value() != TCKind._tk_ulong) { + throw new BAD_OPERATION("No ulong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new ULongHolder()); + + try { + return ((ULongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ulong(); + } + } + + public synchronized void insert_ulong(int i) + { + reset_value(); + m_value = new ULongHolder(i); + m_type = TypeCodeFactory.tc_ulong; + } + + public synchronized long extract_ulonglong() + { + if (m_type.kind().value() != TCKind._tk_ulonglong) { + throw new BAD_OPERATION("No ulonglong in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new ULongLongHolder()); + try { + return ((ULongLongHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_ulonglong(); + } + + } + + public synchronized void insert_ulonglong(long l) + { + reset_value(); + m_value = new ULongLongHolder(l); + m_type = TypeCodeFactory.tc_ulonglong; + } + + public synchronized float extract_float() + { + if (m_type.kind().value() != TCKind._tk_float) { + throw new BAD_OPERATION("No float in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.FloatHolder()); + try { + return ((org.omg.CORBA.FloatHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_float(); + } + } + + public synchronized void insert_float(float f) + { + reset_value(); + m_value = new org.omg.CORBA.FloatHolder(f); + m_type = m_value._type(); + } + + public synchronized double extract_double() + { + if (m_type.kind().value() != TCKind._tk_double) + throw new BAD_OPERATION("No float in Any.", 0, + CompletionStatus.COMPLETED_NO); + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.DoubleHolder()); + + try { + return ((org.omg.CORBA.DoubleHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_double(); + } + } + + public synchronized void insert_double(double d) + { + reset_value(); + m_value = new org.omg.CORBA.DoubleHolder(d); + m_type = m_value._type(); + } + + public synchronized boolean extract_boolean() + { + if (m_type.kind().value() != TCKind._tk_boolean) { + throw new BAD_OPERATION("No boolean in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.BooleanHolder()); + + try { + return ((org.omg.CORBA.BooleanHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_boolean(); + } + } + + public synchronized void insert_boolean(boolean b) + { + reset_value(); + m_value = new org.omg.CORBA.BooleanHolder(b); + m_type = m_value._type(); + } + + public synchronized char extract_char() + { + if (m_type.kind().value() != TCKind._tk_char) { + throw new BAD_OPERATION("No char in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.CharHolder()); + + try { + return ((org.omg.CORBA.CharHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_char(); + } + + } + + public synchronized void insert_char(char c) + { + reset_value(); + m_value = new org.omg.CORBA.CharHolder(c); + m_type = m_value._type(); + } + + public synchronized char extract_wchar() + { + if (m_type.kind().value() != TCKind._tk_wchar) { + throw new BAD_OPERATION("No wchar in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new WCharHolder()); + try { + return ((WCharHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_wchar(); + } + } + + public synchronized void insert_wchar(char c) + { + reset_value(); + m_value = new WCharHolder(c); + m_type = m_value._type(); + } + + public synchronized byte extract_octet() + { + if (m_type.kind().value() != TCKind._tk_octet) { + throw new BAD_OPERATION("No octet in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.ByteHolder()); + + try { + return ((org.omg.CORBA.ByteHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_octet(); + } + + } + + public synchronized void insert_octet(byte b) + { + reset_value(); + m_value = new org.omg.CORBA.ByteHolder(b); + m_type = m_value._type(); + } + + public synchronized org.omg.CORBA.Any extract_any() + { + if (m_type.kind().value() != TCKind._tk_any) { + throw new BAD_OPERATION("No any in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.AnyHolder()); + + try { + return ((org.omg.CORBA.AnyHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_any(); + } + } + + public synchronized void insert_any(org.omg.CORBA.Any a) + { + if (a == null) { + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.AnyHolder(a); + m_type = TypeCodeFactory.tc_any; + } + + public synchronized org.omg.CORBA.TypeCode extract_TypeCode() + { + if (m_type.kind().value() != TCKind._tk_TypeCode) { + throw new BAD_OPERATION("No TypeCode in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.TypeCodeHolder()); + + try { + return ((org.omg.CORBA.TypeCodeHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_TypeCode(); + } + } + + public synchronized void insert_TypeCode(org.omg.CORBA.TypeCode t) + { + if (t == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new org.omg.CORBA.TypeCodeHolder(t); + m_type = m_value._type(); + } + + public synchronized String extract_string() + { + try { + if ((m_type.kind().value() != TCKind._tk_string) + || (m_type.length() != 0)) { + throw new BAD_OPERATION("No unbounded string in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new StringHolder(m_type)); + + try { + + return ((StringHolder) m_value).value; + + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_string(); + } + } + + public synchronized void insert_string(String s) + { + if (s == null) { + throw new BAD_PARAM("Null String reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.StringHolder(s); + m_type = m_value._type(); + } + + public synchronized String extract_wstring() + { + if (m_type.kind().value() != TCKind._tk_wstring) { + throw new BAD_OPERATION("No wstring in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new WStringHolder(m_type)); + + try { + return ((WStringHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_wstring(); + } + } + + public synchronized void insert_wstring(String s) + { + if (s == null) { + throw new BAD_PARAM("Null String reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new WStringHolder(s); + m_type = m_value._type(); + } + + public synchronized java.math.BigDecimal extract_fixed() + { + if (m_type.kind().value() != TCKind._tk_fixed) { + throw new BAD_OPERATION("No fixed in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new FixedHolder(m_type)); + + try { + return ((FixedHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + throw new BAD_OPERATION("Can not obtain fixed", 0, + CompletionStatus.COMPLETED_NO); + } + } + + public synchronized void insert_fixed(java.math.BigDecimal f, + org.omg.CORBA.TypeCode t) + throws BAD_INV_ORDER + { + if ((f == null) || (t == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new FixedHolder(t, f); + m_type = t; + } + + /** + * @ deprecated + */ + public org.omg.CORBA.Principal extract_Principal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @ deprecated + */ + public void insert_Principal(org.omg.CORBA.Principal p) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public synchronized org.omg.CORBA.portable.Streamable extract_Streamable() + { + //if(!m_type.equivalent(m_value._type())) + // System.out.println("AnyImpl.extract_Streamable no equivalente"); + if (m_user_value) { + if (m_value != null) { + return m_value; + } else { + throw new org.omg.CORBA.INTERNAL("No Streamable in Any."); + } + } else { + throw new BAD_INV_ORDER("No Streamable in Any."); + } + } + + public synchronized void + insert_Streamable(org.omg.CORBA.portable.Streamable s) + { + if (s == null) { + throw new BAD_PARAM("Null Streamable reference.", 0, + CompletionStatus.COMPLETED_NO); + } + //if(!m_type.equivalent(s._type())) + // System.out.println("AnyImpl.insert_Streamable no equivalente"); + reset_value(); + m_user_value = true; + m_value = s; + m_type = m_value._type(); + } + + public synchronized org.omg.CORBA.Object extract_Object() + { + if (m_type.kind().value() != TCKind._tk_objref) { + throw new BAD_OPERATION("No Object in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + + // the value is marshaled in the inputstream + + if (m_value == null) + initValue(new org.omg.CORBA.ObjectHolder()); + + try { + return ((org.omg.CORBA.ObjectHolder) m_value).value; + } + catch (ClassCastException cce) { // there is another holder + createMarshaledValue(); + m_marshaled_value.rewind(); + return m_marshaled_value.read_Object(); + } + } + + public synchronized void insert_Object(org.omg.CORBA.Object obj) + { + if (obj instanceof org.omg.CORBA.LocalObject) { + throw new MARSHAL("Impossible to marshall a local object.", 4, + CompletionStatus.COMPLETED_NO); + } + + reset_value(); + m_value = new org.omg.CORBA.ObjectHolder(obj); + m_type = m_value._type(); + } + + public synchronized void insert_Object(org.omg.CORBA.Object obj, + org.omg.CORBA.TypeCode type) + { + if (type == null) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + reset_value(); + m_value = new org.omg.CORBA.ObjectHolder(obj); + m_type = type; + } + + public synchronized java.io.Serializable extract_Value() + { + int kind = m_type.kind().value(); + + if ((kind != TCKind._tk_value) && (kind != TCKind._tk_value_box)) { + throw new BAD_OPERATION("No Value in Any.", 0, + CompletionStatus.COMPLETED_NO); + } + // the value is marshaled in the inputstream + + if (m_value != null) { + if (m_value instanceof ValueHolder) { + + java.io.Serializable js = ((ValueHolder) m_value).value; + + return js; + } else { // there is another holder + createMarshaledValue(); + } + } + + if (m_marshaled_value != null) { + m_marshaled_value.rewind(); + return m_marshaled_value.read_value(); + } + + throw new BAD_OPERATION("Any without value"); + } + + public synchronized void insert_Value(java.io.Serializable v) + { + reset_value(); + + if (v instanceof org.omg.CORBA.portable.StreamableValue) { + org.omg.CORBA.portable.StreamableValue val = + (org.omg.CORBA.portable.StreamableValue) v; + + insert_Streamable(new ValueHolder(val._type(), val)); + m_type = val._type(); + return; + } else { + throw new BAD_PARAM("It is not StreamableValue"); + } + } + + public synchronized void insert_Value(java.io.Serializable v, + org.omg.CORBA.TypeCode t) + { + if (t == null) { + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + int kind = t.kind().value(); + + if ((kind == TCKind._tk_value) || (kind == TCKind._tk_value_box)) { + insert_Streamable(new ValueHolder(t, v)); + m_type = t; + } else { + throw new BAD_OPERATION(); + } + } + + public static boolean dump(org.omg.CORBA.Any any, + java.io.PrintWriter output) + throws java.io.IOException + { + if ((any == null) || (output == null)) { + throw new BAD_PARAM("Null reference.", 0, + CompletionStatus.COMPLETED_NO); + } + + output.print("[ANY]"); + TypeCodeDumper.dump(any.type(), output); + + org.omg.CORBA.portable.InputStream input = any.create_input_stream(); + + return TypeCodeDumper.dumpValue(any.type(), input, output); + } + +} diff --git a/source/es/tid/TIDorbj/core/BidirectionalPolicyImpl.java b/source/es/tid/TIDorbj/core/BidirectionalPolicyImpl.java new file mode 100644 index 0000000..cc78dc5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/BidirectionalPolicyImpl.java @@ -0,0 +1,170 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 82 $ +* Date: $Date: 2007-07-05 07:42:09 +0200 (Thu, 05 Jul 2007) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.BiDirPolicy.BOTH; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.BidirectionalPolicyHelper; +import org.omg.BiDirPolicy.BidirectionalPolicyValueHelper; +import org.omg.BiDirPolicy.NORMAL; +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * Implementation of BidirectionalPolicy + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class BidirectionalPolicyImpl extends PseudoObject + implements org.omg.BiDirPolicy.BidirectionalPolicy +{ + /** + * The policy value: BidirPolicy::BOTH or BiDirPolicy::NORMAL + */ + private short m_value; + + public BidirectionalPolicyImpl(short value) + { + m_value = value; + } + + public short value() + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST(); + } + + return m_value; + } + + public int policy_type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return new BidirectionalPolicyImpl(m_value); + } + + public void destroy() + { + m_destroyed = true; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST("Policy destroyed."); + } + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals( + "IDL:omg.org/BiDirPolicy/BidirectionalPolicy:1.0")) { + return true; + } + + return super._is_a(repositoryIdentifier); + + } + + public static Policy read(CDRInputStream input) + { + short value = input.read_short(); + + if(value != BOTH.value && value != NORMAL.value) { + throw new MARSHAL(); + } + + return new BidirectionalPolicyImpl(value); + } + + /** + * @param output + */ + public static void write(CDROutputStream output, Policy policy) + { + BidirectionalPolicy bidir_policy = + BidirectionalPolicyHelper.narrow(policy); + + output.write_ushort(bidir_policy.value()); + + } + + public static BidirectionalPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + short policy_value = BidirectionalPolicyValueHelper.extract(val); + + if ((policy_value != org.omg.BiDirPolicy.BOTH.value) + && (policy_value != org.omg.BiDirPolicy.NORMAL.value)) + throw new PolicyError(BAD_POLICY_VALUE.value); + + return new BidirectionalPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/CodecFactoryImpl.java b/source/es/tid/TIDorbj/core/CodecFactoryImpl.java new file mode 100644 index 0000000..1ea3366 --- /dev/null +++ b/source/es/tid/TIDorbj/core/CodecFactoryImpl.java @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.OBJECT_NOT_EXIST; + +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +public class CodecFactoryImpl extends org.omg.IOP.CodecFactoryLocalBase +{ + + private boolean m_destroyed; + + private es.tid.TIDorbj.core.TIDORB m_orb; + + public CodecFactoryImpl(es.tid.TIDorbj.core.TIDORB orb) + { + m_destroyed = false; + this.m_orb = orb; + } + + public synchronized void destroy() + { + m_destroyed = true; + m_orb = null; + } + + public synchronized org.omg.IOP.Codec create_codec(org.omg.IOP.Encoding enc) + throws org.omg.IOP.CodecFactoryPackage.UnknownEncoding + { + if (m_destroyed) { + throw new OBJECT_NOT_EXIST(); + } + + if (enc == null) { + throw new BAD_PARAM("Null Object reference"); + } + + if (enc.format != org.omg.IOP.ENCODING_CDR_ENCAPS.value) { + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + if (enc.major_version != 1) { + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + switch (enc.minor_version) + { + case 0: + return new + CodecImpl(m_orb,GIOPVersion.VERSION_1_0); + case 1: + return new CodecImpl(m_orb,GIOPVersion.VERSION_1_1); + case 2: + return new CodecImpl(m_orb,GIOPVersion.VERSION_1_2); + default: + throw new org.omg.IOP.CodecFactoryPackage.UnknownEncoding(); + } + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/CodecImpl.java b/source/es/tid/TIDorbj/core/CodecImpl.java new file mode 100644 index 0000000..1c50067 --- /dev/null +++ b/source/es/tid/TIDorbj/core/CodecImpl.java @@ -0,0 +1,187 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class CodecImpl extends org.omg.IOP.CodecLocalBase +{ + + private es.tid.TIDorbj.core.TIDORB m_orb; + + private es.tid.TIDorbj.core.comm.giop.GIOPVersion m_version; + + public CodecImpl(es.tid.TIDorbj.core.TIDORB orb, + es.tid.TIDorbj.core.comm.giop.GIOPVersion version) + { + m_orb = orb; + m_version = version; + } + + public byte[] encode(org.omg.CORBA.Any data) + throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDROutputStream out = (CDROutputStream) m_orb.create_output_stream(); + + out.setVersion(m_version); + // write the any into an encapsulation + + out.enterEncapsulation(); + + try { + out.write_any(data); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.InvalidTypeForEncoding(); + } + + out.exitEncapsulation(); + + // read the byte array + + InputStream input = out.create_input_stream(); + + int length = input.read_ulong(); + + byte[] value = new byte[length]; + + input.read_octet_array(value, 0, length); + + return value; + + } + + public org.omg.CORBA.Any decode(byte[] data) + throws org.omg.IOP.CodecPackage.FormatMismatch + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDRInputStream input = new CDRInputStream(m_orb, data); + + input.setByteOrder(input.read_boolean()); + + input.setVersion(m_version); + try { + return input.read_any(); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.FormatMismatch(); + } + } + + public byte[] encode_value(org.omg.CORBA.Any data) + throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding + { + if (data == null) { + throw new BAD_PARAM(); + } + + CDROutputStream out = (CDROutputStream) m_orb.create_output_stream(); + + out.setVersion(m_version); + + // write the any into an encapsulation + out.enterEncapsulation(); + + try { + data.write_value(out); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.InvalidTypeForEncoding(); + } + + out.exitEncapsulation(); + + // read the byte array + + InputStream input = out.create_input_stream(); + + int length = input.read_ulong(); + + byte[] value = new byte[length]; + + input.read_octet_array(value, 0, length); + + return value; + } + + public org.omg.CORBA.Any decode_value(byte[] data, + org.omg.CORBA.TypeCode tc) + throws org.omg.IOP.CodecPackage.FormatMismatch, + org.omg.IOP.CodecPackage.TypeMismatch + { + if ((data == null) || (tc == null)) { + throw new BAD_PARAM(); + } + + CDRInputStream input = new CDRInputStream(m_orb, data); + + input.setVersion(m_version); + + input.setByteOrder(input.read_boolean()); + + org.omg.CORBA.Any any = m_orb.create_any(); + + try { + any.read_value(input, tc); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new org.omg.IOP.CodecPackage.TypeMismatch(); + } + catch (org.omg.CORBA.MARSHAL bo) { + throw new org.omg.IOP.CodecPackage.FormatMismatch(); + } + + return any; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ConfORB.java b/source/es/tid/TIDorbj/core/ConfORB.java new file mode 100644 index 0000000..dc3617b --- /dev/null +++ b/source/es/tid/TIDorbj/core/ConfORB.java @@ -0,0 +1,1662 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.applet.Applet; +import java.util.Arrays; +import java.util.Properties; +import java.util.Vector; + +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.PolicyError; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.SystemProperties; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.util.UTC; + +/** + * Configuration set for TIDorb. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ConfORB +{ + + /** + * ORB Policies + */ + + PolicyContext policy_context; + + /** + * Default ORB Policies + */ + + final static PolicyContext st_default_policy_context = + createDefaultPolicies(); + + /** + * TIDorb ORB Identifier: 666. This value must be registered in OMG. + */ + + public final static es.tid.TIDorbj.core.iop.ORBComponent ORB_TYPE = + new es.tid.TIDorbj.core.iop.ORBComponent(1414087680); + + /** + * TIDorb ORB_id + */ + + public final static String orb_id_name = "-ORBid"; + + public final static String DEFAULT_ORB_ID = "TIDorbJ"; + + public String orb_id = DEFAULT_ORB_ID; + + /** + * TIDorb Initial References + */ + + public java.util.Vector initial_references = new java.util.Vector(); + + /** + * TIDorb Default Initial References + */ + public final static String init_refs_name = "-ORBInitRef"; + + /** + * TIDorb Default Initial References + */ + + public String default_initial_reference = null; + + public final static String def_init_ref_name = "-ORBDefaultInitRef"; + + /** + * NamingService Property name. + */ + + public final static String naming_service_name = + "es.tid.TIDorbj.naming_service"; + + /** + * Default chunk size for CDR buffers. Default value: 256. + */ + + public final static int DEFAULT_BLOCK_SIZE = 256; + + /** + * Chunk size for CDR buffers. + *

+ * Values must be > 256 and multiple of 8 + */ + + public int block_size = DEFAULT_BLOCK_SIZE; + + /** + * Block_size Property name. + */ + + public final static String block_size_name = "es.tid.TIDorbj.block_size"; + + /** + * Default exhaustive TypeCode matching. + */ + public final static boolean DEFAULT_EXHAUSTIVE_EQUAL = false; + + /** + * Make or not an exhaustive TypeCode matching: + *

    + *
  • If true two TypeCodes equals each other if its + * RepositoryId and member names and TypeCodes equals. + *
  • If false only RepositoryIds are compared. + *
+ * Values must be "true" or "false". + */ + + public boolean exhaustive_equal = DEFAULT_EXHAUSTIVE_EQUAL; + + /** + * Exhaustive equal Property name. + */ + + public final static String exhaustive_equal_name = + "es.tid.TIDorbj.exhaustive_equal"; + + + /** + * Maximun time, in miliseconds, waiting a request reply. + *

+ * Values must be greater or equal than 0. Default value: 5000. + */ + + public final static long DEFAULT_MAX_BLOCKED_TIME = 5000; + + /** + * max_blocked_time Property name. + */ + + public final static String max_blocked_time_name = + "es.tid.TIDorbj.max_blocked_time"; + + + + public long max_blocked_time = DEFAULT_MAX_BLOCKED_TIME; + + /** + * Default TypeCode Cache Size. Default value: 0, no cache. + */ + + public final static int DEFAULT_TYPECODE_CACHE_SIZE = 0; + + /** + * Maximum of TypeCodes stored in the TypeCodeCache. + *

+ * Values must be greater or equal than 0. + */ + + public int typecode_cache_size = DEFAULT_TYPECODE_CACHE_SIZE; + + /** + * typecode_cache_size Property name. + */ + + public final static String typecode_cache_size_name = + "es.tid.TIDorbj.typecode_cache_size"; + + + /** + * Comma separated list of CommunicationLayer implementatios to be loaded at + * ORB's startup. By default, only IIOP comm layer will be loaded. + */ + public final static String DEFAULT_COMM_LAYER = + "es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer"; + + public String comm_layers = DEFAULT_COMM_LAYER; + + public final static String comm_layers_name = + "es.tid.TIDorbj.comm_layers"; + + + /** + * BidirectionalPolicy used. Values allowed NORMAL or BOTH + */ + public final static short DEFAULT_BIDIRECTIONAL = + org.omg.BiDirPolicy.NORMAL.value; + /** + * BIDIRECTIONAL Property name. + */ + public final static String bidirectional_name = + "es.tid.TIDorbj.bidirectional"; + + + /** + * Default ORB's maximum threads number per POAManager. + *

+ * Default value: 20. + */ + + public final static int DEFAULT_POA_MAX_THREADS = 20; + + /** + * ORB's maximum threads number per POAManager. + *

+ * Values must be greater than 0. + */ + + public int poa_max_threads = DEFAULT_POA_MAX_THREADS; + + /** + * max_threads Property name. + */ + + public final static String poa_max_threads_name = + "es.tid.TIDorbj.poa.max_threads"; + + /** + * Default ORB's minimum threads number per POAManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_POA_MIN_THREADS = 1; + + /** + * ORB's minimum threads number per POAManager. + *

+ * Values must be greater or equal than 0. + */ + + public int poa_min_threads = DEFAULT_POA_MIN_THREADS; + + /** + * min_threads Property name. + */ + + public final static String poa_min_threads_name = + "es.tid.TIDorbj.poa.min_threads"; + + /** + * Default ORB's queued requests number per POAManager. + *

+ * Default value: 1000. + */ + + public final static int DEFAULT_POA_MAX_QUEUED_REQUESTS = 1000; + + /** + * ORB's maximum queued requests number per POAManager. + *

+ * Values must be greater or equal than 0. + */ + + public int poa_max_queued_requests = DEFAULT_POA_MAX_QUEUED_REQUESTS; + + /** + * max_queued_requests Property name. + */ + + public final static String poa_max_queued_requests_name = + "es.tid.TIDorbj.poa.max_queued_requests"; + + /** + * Default thread's maximum idle time per POAManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_POA_STARVING_TIME = 0; + + /** + * Thread's maximum idle time per per POAManager. + *

+ * If it is 0, a thread can be idle forever. + */ + + public int poa_starving_time = DEFAULT_POA_STARVING_TIME; + + /** + * max_queued_requests Property name. + */ + + public final static String poa_starving_time_name = + "es.tid.TIDorbj.poa.starving_time"; + + + + /** + * Default AMIManager's maximum threads number + *

+ * Default value: 20. + */ + + public final static int DEFAULT_AMI_MAX_THREADS = 20; + + /** + * AMIManager's maximum threads number + *

+ * Values must be greater than 0. + */ + + public int ami_max_threads = DEFAULT_AMI_MAX_THREADS; + + /** + * max_threads Property name. + */ + + public final static String ami_max_threads_name = + "es.tid.TIDorbj.ami.max_threads"; + + /** + * Default AMIManager's minimum threads number. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_AMI_MIN_THREADS = 1; + + /** + * AMIManager's minimum threads number. + *

+ * Values must be greater or equal than 0. + */ + + public int ami_min_threads = DEFAULT_AMI_MIN_THREADS; + + /** + * ami_threads Property name. + */ + + public final static String ami_min_threads_name = + "es.tid.TIDorbj.ami.min_threads"; + + /** + * Default AMIManager's queued handled requests number . + *

+ * Default value: 1000. + */ + + public final static int DEFAULT_AMI_MAX_QUEUED_HANDLED_REQUESTS = 1000; + + /** + * AMIManager's maximum queued handled requests number . + *

+ * Values must be greater or equal than 0. + */ + + public int ami_max_queued_handled_requests = DEFAULT_AMI_MAX_QUEUED_HANDLED_REQUESTS; + + /** + * max_queued_requests Property name. + */ + + public final static String ami_max_queued_handled_requests_name = + "es.tid.TIDorbj.ami.max_queued_handled_requests"; + + /** + * Default thread's maximum idle time at AMIManager. + *

+ * Default value: 0. + */ + + public final static int DEFAULT_AMI_STARVING_TIME = 0; + + /** + * Thread's maximum idle time per at AMIManager. + *

+ * If it is 0, a thread can be idle forever. + */ + + public int ami_starving_time = DEFAULT_AMI_STARVING_TIME; + + /** + * max_queued_requests Property name. + */ + + public final static String ami_starving_time_name = + "es.tid.TIDorbj.ami.starving_time"; + + /** + * Default Maximun blocket time waiting for the shutdown completion. Default + * value: 5000. + */ + + public final static int DEFAULT_MAX_TIME_IN_SHUTDOWN = 5000; + + /** + * Maximun time, in miliseconds, waiting for the shutdown completion. + *

+ * Values must be greater or equal than 0. + */ + + public int max_time_in_shutdown = DEFAULT_MAX_TIME_IN_SHUTDOWN; + + /** + * max_time_in_shutdown Property name. + */ + + public final static String max_time_in_shutdown_name = + "es.tid.TIDorbj.max_time_in_shutdown"; + + /** + * Default Trace Level. Default value: Traces.NONE. + */ + + public final static int DEFAULT_TRACE_LEVEL = Trace.NONE; + + /** + * Trace Level. Values must be between 0 and 4. + */ + + public int trace_level = DEFAULT_TRACE_LEVEL; + + /** + * Trace Level Property name. + */ + + public final static String trace_level_name = + "es.tid.TIDorbj.trace.level"; + + /** + * Trace file name. + */ + + public String trace_file = null; + + /** + * Trace file property name. + */ + + public final static String trace_file_name = + "es.tid.TIDorbj.trace.file"; + + /** + * Default Trace file size. Default value: 10 K. + */ + public final static long DEFAULT_FILE_SIZE = 10240; + + /** + * Trace list files size + */ + public long trace_file_size = DEFAULT_FILE_SIZE; + + /** + * Trace list files size property name + */ + public final static String trace_file_size_name = + "es.tid.TIDorbj.trace.file_size"; + + /** + * Default Trace files list length. Default value: 1 file. + */ + public final static int DEFAULT_NUM_FILES = 1; + + /** + * Trace files list length + */ + public int trace_num_files = DEFAULT_NUM_FILES; + + /** + * Trace files list length property name + */ + public final static String trace_num_files_name = + "es.tid.TIDorbj.trace.num_files"; + + + /** + * Default qos. + */ + public final static boolean DEFAULT_QOS_ENABLED = true; + + /** + * Enable QoS policies for client and server side. + *

    + *
  • If true enabled QoS policies + *
  • If false disabled QoS policies. + *
+ * Values must be "true" or "false". + */ + + public boolean qos_enabled = DEFAULT_QOS_ENABLED; + + /** + * Exhaustive equal Property name. + */ + + public final static String qos_enabled_name = + "es.tid.TIDorbj.qos_enabled"; + + + + + /** + * Default ORB's ZIOP internal chunk size. + *

+ * Default value: 32768. + */ + + public final static int DEFAULT_ZIOP_CHUNK_SIZE = 32768; + + /** + * ORB's ZIOP internal chunk size. + *

+ * Values must be greater or equal than 0. + */ + + public int ziop_chunk_size = DEFAULT_ZIOP_CHUNK_SIZE; + + /** + * ziop_chunk_size Property name. + */ + + public final static String ziop_chunk_size_name = + "es.tid.TIDorbj.ziop_chunk_size"; + + + /** + * Default assume ziop at server side. + */ + public final static boolean DEFAULT_ASSUME_ZIOP_SERVER = false; + + /** + * Assume ZIOP policies enabled at server side. Useful to connect through + * corbaloc or Unicast/Multicast + *

    + *
  • If true server has ZIOP policies defined and known by client + *
  • If false server has not ZIOP policies. + *
+ * Values must be "true" or "false". + */ + + public boolean assume_ziop_server = DEFAULT_ASSUME_ZIOP_SERVER; + + /** + * Exhaustive equal Property name. + */ + + public final static String assume_ziop_server_name = + "es.tid.TIDorbj.assume_ziop_server"; + + + + private Applet parameters; + private Properties properties; + private Vector arguments; + + + protected static PolicyContext createDefaultPolicies() + { + PolicyContext context = new PolicyContext(null); + + try { + context.setPolicy( + new RelativeRoundtripTimeoutPolicyImpl( + UTC.toTimeT(DEFAULT_MAX_BLOCKED_TIME))); + context.setPolicy( + new BidirectionalPolicyImpl(DEFAULT_BIDIRECTIONAL)); + } + catch (PolicyError pe) {} + + return context; + } + + public ConfORB() + { + policy_context = new PolicyContext(st_default_policy_context); + } + + public PolicyContext getPolicyContext() + { + return policy_context; + } + + /** + * Initialize the ORB properties. + * + * @param args + * the arguments vector. + * @param props + * the properties. + */ + public void init(String[] args, java.util.Properties props) + { + parse_system_properties(); + + if (props != null) + init(props); + + if (args != null) + init(args); + } + + /** + * Initialize the ORB properties with the Applet arguments. + * + * @param app + * the applet that has created the ORB. + * @param props + * the properties. + */ + public void init(java.applet.Applet app, java.util.Properties props) + { + // parse_system_properties(); + + if (props != null) + init(props); + + if (app != null) + init(app); + + } + + /** + * Initialize the ORB properties with the arguments vector. + * + * @param app + * the applet that has created the ORB. + */ + + public void init(String[] args) + { + if ( this.arguments == null ){ + this.arguments = new Vector( args.length ); + } + this.arguments.addAll( Arrays.asList( args ) ); + + + int i = 0; + String name; + + while (i < args.length - 1) { + if ((args[i] == null) || (args[i].length() == 0)) { + i++; + } else { + if ( args[i].equals(comm_layers_name) ) + parse_comm_layers( args[++i] ); + if (args[i].equals(def_init_ref_name)) + default_initial_reference = args[++i]; + if (args[i].equals(orb_id_name)) + orb_id = args[++i]; + else if (args[i].equals(init_refs_name)) + parse_init_ref(args[++i]); + else if (args[i].equals(naming_service_name)) + parse_naming_service(args[++i]); + else if (args[i].equals(block_size_name)) + parse_block_size(args[++i]); + else if (args[i].equals(exhaustive_equal_name)) + parse_exhaustive_equal(args[++i]); + else if (args[i].equals(typecode_cache_size_name)) + parse_typecode_cache_size(args[++i]); + else if (args[i].equals(bidirectional_name)) + parse_bidirectional(args[++i]); + else if (args[i].equals(max_blocked_time_name)) + parse_max_blocked_time(args[++i]); + else if (args[i].equals(poa_max_threads_name)) + parse_poa_max_threads(args[++i]); + else if (args[i].equals(poa_min_threads_name)) + parse_poa_min_threads(args[++i]); + else if (args[i].equals(poa_max_queued_requests_name)) + parse_poa_max_queued_requests(args[++i]); + else if (args[i].equals(poa_starving_time_name)) + parse_poa_starving_time(args[++i]); + else if (args[i].equals(max_time_in_shutdown_name)) + parse_max_time_in_shutdown(args[++i]); + else if (args[i].equals(ami_max_threads_name)) + parse_ami_max_threads(args[++i]); + else if (args[i].equals(ami_min_threads_name)) + parse_ami_min_threads(args[++i]); + else if (args[i].equals(ami_max_queued_handled_requests_name)) + parse_ami_max_queued_handled_requests(args[++i]); + else if (args[i].equals(ami_starving_time_name)) + parse_ami_starving_time(args[++i]); + else if (args[i].equals(trace_file_name)) + trace_file = args[++i]; + else if (args[i].equals(trace_level_name)) + parse_trace_level(args[++i]); + else if (args[i].equals(trace_file_size_name)) + parse_trace_file_size(args[++i]); + else if (args[i].equals(trace_num_files_name)) + parse_trace_num_files(args[++i]); + else if (args[i].equals(qos_enabled_name)) + parse_qos_enabled(args[++i]); + else if (args[i].equals(ziop_chunk_size_name)) + parse_ziop_chunk_size(args[++i]); + else if (args[i].equals(assume_ziop_server_name)) + parse_assume_ziop_server(args[++i]); + else + i++; + } + } + + } + + + + /** + * Initialize the ORB properties with the Applet arguments. + * + * @param app + * the applet that has created the ORB. + */ + + public void init(Applet app) + { + this.parameters = app; + + parse_init_ref(app.getParameter(init_refs_name)); + + String aux_initial = app.getParameter(def_init_ref_name); + + if (aux_initial != null) + default_initial_reference = aux_initial; + + String id = app.getParameter(orb_id_name); + if (id != null) + orb_id = id; + + parse_comm_layers( app.getParameter(comm_layers_name)); + parse_naming_service(app.getParameter(naming_service_name)); + parse_block_size(app.getParameter(block_size_name)); + parse_exhaustive_equal(app.getParameter(exhaustive_equal_name)); + parse_typecode_cache_size(app.getParameter(typecode_cache_size_name)); + parse_bidirectional(app.getParameter(bidirectional_name)); + parse_max_blocked_time(app.getParameter(max_blocked_time_name)); + parse_poa_max_threads(app.getParameter(poa_max_threads_name)); + parse_poa_min_threads(app.getParameter(poa_min_threads_name)); + parse_poa_max_queued_requests( + app.getParameter(poa_max_queued_requests_name)); + parse_poa_starving_time(app.getParameter(poa_starving_time_name)); + parse_max_time_in_shutdown(app.getParameter(max_time_in_shutdown_name)); + + parse_ami_max_threads(app.getParameter(ami_max_threads_name)); + parse_ami_min_threads(app.getParameter(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + app.getParameter(ami_max_queued_handled_requests_name)); + parse_ami_starving_time(app.getParameter(poa_starving_time_name)); + + String aux_trace = app.getParameter(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(app.getParameter(trace_level_name)); + parse_trace_file_size(app.getParameter(trace_file_size_name)); + parse_trace_num_files(app.getParameter(trace_num_files_name)); + + parse_qos_enabled(app.getParameter(qos_enabled_name)); + parse_ziop_chunk_size(app.getParameter(ziop_chunk_size_name)); + parse_assume_ziop_server(app.getParameter(assume_ziop_server_name)); + } + + /** + * Initialize the ORB properties with the Properties object. + * + * @param props + * the properties. + */ + + public void init(java.util.Properties props) + { + if ( this.properties == null ){ + this.properties = new Properties(); + } + this.properties.putAll( props ); + + parse_comm_layers(props.getProperty(comm_layers_name)); + parse_naming_service(props.getProperty(naming_service_name)); + parse_block_size(props.getProperty(block_size_name)); + parse_exhaustive_equal(props.getProperty(exhaustive_equal_name)); + parse_typecode_cache_size(props.getProperty(typecode_cache_size_name)); + parse_bidirectional(props.getProperty(bidirectional_name)); + parse_max_blocked_time(props.getProperty(max_blocked_time_name)); + parse_poa_max_threads(props.getProperty(poa_max_threads_name)); + parse_poa_min_threads(props.getProperty(poa_min_threads_name)); + parse_poa_max_queued_requests( + props.getProperty(poa_max_queued_requests_name)); + parse_poa_starving_time(props.getProperty(poa_starving_time_name)); + parse_max_time_in_shutdown(props.getProperty(max_time_in_shutdown_name)); + + parse_ami_max_threads(props.getProperty(ami_max_threads_name)); + parse_ami_min_threads(props.getProperty(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + props.getProperty(ami_max_queued_handled_requests_name)); + parse_ami_starving_time(props.getProperty(ami_starving_time_name)); + + String aux_trace = props.getProperty(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(props.getProperty(trace_level_name)); + parse_trace_file_size(props.getProperty(trace_file_size_name)); + parse_trace_num_files(props.getProperty(trace_num_files_name)); + + parse_qos_enabled(props.getProperty(qos_enabled_name)); + parse_ziop_chunk_size(props.getProperty(ziop_chunk_size_name)); + parse_assume_ziop_server(props.getProperty(assume_ziop_server_name)); + } + + /** + * Search the ORB properties in the SystemProperties. + */ + + public void parse_system_properties() + { + parse_comm_layers( SystemProperties.findProperty(comm_layers_name) ); + parse_naming_service( + SystemProperties.findProperty(naming_service_name)); + parse_block_size(SystemProperties.findProperty(block_size_name)); + parse_exhaustive_equal( + SystemProperties.findProperty(exhaustive_equal_name)); + parse_max_blocked_time( + SystemProperties.findProperty(max_blocked_time_name)); + parse_poa_max_threads( + SystemProperties.findProperty(poa_max_threads_name)); + parse_poa_min_threads( + SystemProperties.findProperty(poa_min_threads_name)); + parse_poa_max_queued_requests( + SystemProperties.findProperty(poa_max_queued_requests_name)); + parse_poa_starving_time( + SystemProperties.findProperty(poa_starving_time_name)); + parse_max_time_in_shutdown( + SystemProperties.findProperty(max_time_in_shutdown_name)); + + parse_ami_max_threads( + SystemProperties.findProperty(ami_max_threads_name)); + parse_ami_min_threads( + SystemProperties.findProperty(ami_min_threads_name)); + parse_ami_max_queued_handled_requests( + SystemProperties.findProperty(ami_max_queued_handled_requests_name)); + parse_ami_starving_time( + SystemProperties.findProperty(ami_starving_time_name)); + + String aux_trace = SystemProperties.findProperty(trace_file_name); + if (aux_trace != null) + trace_file = aux_trace; + + parse_trace_level(SystemProperties.findProperty(trace_level_name)); + parse_trace_file_size( + SystemProperties.findProperty(trace_file_size_name)); + parse_trace_num_files( + SystemProperties.findProperty(trace_num_files_name)); + + parse_qos_enabled( + SystemProperties.findProperty(qos_enabled_name)); + parse_ziop_chunk_size( + SystemProperties.findProperty(ziop_chunk_size_name)); + parse_assume_ziop_server( + SystemProperties.findProperty(assume_ziop_server_name)); + } + + /********************************************************************/ + /* COMPATIBILIDAD CON VERSIONES ANTIGUAS */ + /********************************************************************/ + public void fillPropertyInfoOldValues( PropertyInfo pi ){ + if ( pi != null ){ + + boolean old_property_name_founded = false; + String old_property_name = ""; + String new_property_name = pi.getName(); + + if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.PORT)){ + old_property_name = "es.tid.TIDorbj.iiop.orb_port"; + old_property_name_founded = true; + } else if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS)){ + old_property_name = "es.tid.TIDorbj.iiop.ip_address"; + old_property_name_founded = true; + } else if (new_property_name.equals(IIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY)){ + old_property_name = "es.tid.TIDorbj.reliable_oneway"; + old_property_name_founded = true; + } + + if (old_property_name_founded){ + boolean found = false; + if ( !found && this.parameters != null ){ + String value; + value = this.parameters.getParameter(old_property_name ); + found = value != null; + if ( found ) { + pi.setValue( value ); + } + } + if ( !found && this.arguments != null ){ + int index; + index = this.arguments.indexOf( old_property_name ); + found = index > -1; + if ( found ){ + pi.setValue( (String)this.arguments.elementAt( ++index ) ); + } + } + if ( !found && this.properties != null ){ + String value; + value = this.properties.getProperty( old_property_name ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + if ( !found ){ + String value; + value = SystemProperties.findProperty( old_property_name ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + } + } + }//fillPropertyInfoOldValues + + /********************************************************************/ + + + public void fillPropertyInfo( PropertyInfo pi ){ + if ( pi != null ){ + fillPropertyInfoOldValues(pi); + boolean found = false; + if ( !found && this.parameters != null ){ + String value; + value = this.parameters.getParameter( pi.getName() ); + found = value != null; + if ( found ) { + pi.setValue( value ); + } + } + if ( !found && this.arguments != null ){ + int index; + index = this.arguments.indexOf( pi.getName() ); + found = index > -1; + if ( found ){ + pi.setValue( (String)this.arguments.elementAt( ++index ) ); + } + } + if ( !found && this.properties != null ){ + String value; + value = this.properties.getProperty( pi.getName() ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + if ( !found ){ + String value; + value = SystemProperties.findProperty( pi.getName() ); + found = value != null; + if ( found ){ + pi.setValue( value ); + } + } + } + } + + public void fillPropertyInfo( PropertyInfo[] pis ){ + if ( pis != null ){ + PropertyInfo pi; + for ( int i=0; i < pis.length; i++ ) { + this.fillPropertyInfo( pis[ i ] ); + } + } + } + + public void parse_init_ref(String str) + { + if (str == null) + return; + + InitialReference init_ref = new InitialReference(); + + init_ref.parse(str); + + initial_references.addElement(init_ref); + } + + public void parse_naming_service(String str) + { + if (str == null) + return; + InitialReference init_ref = new InitialReference("NameService", str); + + initial_references.addElement(init_ref); + } + + /** + * Parse the communications layer instances that should be passed to the + * CommunicationManager to be initialized. + * This method will check for the existence of the default communication + * layer (DEFAULT_COMM_LAYER)... which will represent both the IIOP and the + * local comm layers... + * @param str + */ + public void parse_comm_layers( String str ){ + if ( str != null ){ + if ( (str.indexOf( DEFAULT_COMM_LAYER ) == -1 && + str.indexOf( "es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer" ) == -1 )&& + str.trim().length() > 0 ) { + //must include default comm layer + comm_layers = DEFAULT_COMM_LAYER + ":" + str; + } else { + //default comm layer already present, + comm_layers = str; + } + } + } + + + /** + * Parse the block_size value. + * + * @param str + * the value digits. + * @pre Values must be > 256 and multiple of 8. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_block_size(String str) + { + if (str == null) + return; + + int value = parse_int(block_size_name, str); + + if ((value < 256) || (value % CDR.LONG_SIZE != 0)) + throw new INITIALIZE(block_size_name + ":invalid value " + value + + " (minimum fragment size: 256)"); + + block_size = value; + } + + /** + * Parse the exhaustive_equal boolean value. + * + * @param str + * the value representation. + * @pre Values must be "true" or "false". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_exhaustive_equal(String str) + { + if (str == null) + return; + + exhaustive_equal = parse_boolean(exhaustive_equal_name, str); + } + + /** + * Parse the typecode_cache_size value. + * + * @param str + * the value digits. + * @pre Value must be > 1024 and multiple of 8. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_typecode_cache_size(String str) + { + if (str == null) + return; + + int value = parse_int(typecode_cache_size_name, str); + + if (value < 0) + throw new INITIALIZE(typecode_cache_size_name + ": invalid value " + + value + " (fragment size must be > 0)"); + + typecode_cache_size = value; + + } + + /** + * Parse the ORB nominal Bidirectional Policy. + * + * @param str + * the policy value. + * @pre Values must be "NORMAL", "BOTH". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + //TODO: remove iiop, this is por ORB's policy manager... + public void parse_bidirectional(String str) + { + if (str == null) + return; + + short value = 0; + + if (str.equals("NORMAL")) { + return; + } else if (str.equals("BOTH")) { + try { + policy_context.setPolicy( + new BidirectionalPolicyImpl(org.omg.BiDirPolicy.BOTH.value)); + } + catch (PolicyError pe) {} + } else { + throw new org.omg.CORBA.INITIALIZE("Invalid value" + + bidirectional_name + + "=" + str); + } + } + + /** + * Parse the max_blocked_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_max_blocked_time(String str) + { + if (str == null) + return; + + long value = parse_long(max_blocked_time_name, str); + + if (value < 0) + throw new INITIALIZE(max_blocked_time_name + ":invalid value " + + value + " (minimum blocked 0)"); + + if (value != DEFAULT_MAX_BLOCKED_TIME) { + // converts to TimeT (from ms to units of 100 ns) + value = UTC.toTimeT(value); + try { + policy_context.setPolicy( + new RelativeRoundtripTimeoutPolicyImpl(value)); + } + catch (PolicyError pe) {} + max_blocked_time = value; + } + + } + + /** + * Parse the poa_max_threads value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_max_threads(String str) + { + if (str == null) + return; + + int value = parse_int(poa_max_threads_name, str); + + if (value < 1) + throw new INITIALIZE(poa_max_threads_name + ":invalid value " + + value + " (minimum 1)"); + + poa_max_threads = value; + + } + + /** + * Parse the poa_min_threads value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_min_threads(String str) + { + if (str == null) + return; + + int value = parse_int(poa_min_threads_name, str); + + if (value < 1) + throw new INITIALIZE(poa_min_threads_name + ":invalid value " + + value + " (minimum 1)"); + + poa_min_threads = value; + + } + + /** + * Parse the poa_max_queued_requests value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_max_queued_requests(String str) + { + if (str == null) + return; + + int value = parse_int(poa_max_queued_requests_name, str); + + if (value < 1) + throw new INITIALIZE(poa_max_queued_requests_name + + ":invalid value " + value + " (minimum 1)"); + + poa_max_queued_requests = value; + + } + + /** + * Parse the poa_starving_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_poa_starving_time(String str) + { + if (str == null) + return; + + int value = parse_int(poa_starving_time_name, str); + + if (value < 0) + throw new INITIALIZE(poa_starving_time_name + ":invalid value " + + value + " (minimum 0)"); + + poa_starving_time = value; + + } + + /** + * Parse the ami_max_threads value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_max_threads(String str) + { + if (str == null) + return; + + int value = parse_int(ami_max_threads_name, str); + + if (value < 1) + throw new INITIALIZE(ami_max_threads_name + ":invalid value " + + value + " (minimum 1)"); + + ami_max_threads = value; + + } + + /** + * Parse the ami_min_threads value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_min_threads(String str) + { + if (str == null) + return; + + int value = parse_int(ami_min_threads_name, str); + + if (value < 1) + throw new INITIALIZE(ami_min_threads_name + ":invalid value " + + value + " (minimum 1)"); + + ami_min_threads = value; + + } + + /** + * Parse the ami_max_queued_requests value. + * + * @param str + * the value digits. + * @pre Values must be > 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_max_queued_handled_requests(String str) + { + if (str == null) + return; + + int value = parse_int(ami_max_queued_handled_requests_name, str); + + if (value < 1) + throw new INITIALIZE(ami_max_queued_handled_requests_name + + ":invalid value " + value + " (minimum 1)"); + + ami_max_queued_handled_requests = value; + + } + + /** + * Parse the ami_starving_time value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ami_starving_time(String str) + { + if (str == null) + return; + + int value = parse_int(ami_starving_time_name, str); + + if (value < 0) + throw new INITIALIZE(ami_starving_time_name + ":invalid value " + + value + " (minimum 0)"); + + ami_starving_time = value; + + } + + + + + /** + * Parse the max_time_in_shutdown value. + * + * @param str + * the value digits. + * @pre Values must be >= 0. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_max_time_in_shutdown(String str) + { + if (str == null) + return; + + int value = parse_int(max_time_in_shutdown_name, str); + + if (value < 0) + throw new INITIALIZE(max_time_in_shutdown_name + ":invalid value " + + value + " (minimum blocked 0)"); + + max_time_in_shutdown = value; + + } + + + /** + * Parse the trace_level value. + * + * @param str + * the value digits. + * @pre Values must be between 0 and 4. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_trace_level(String str) + { + if (str == null) + return; + + int value = parse_int(trace_level_name, str); + + if ((value < Trace.NONE) || (value > Trace.DUMP)) + throw new INITIALIZE(trace_level_name + ":invalid value " + value + + " (valid value between 0 and 5)"); + + trace_level = value; + + } + + public void parse_trace_file_size(String size) + { + if (size == null) + return; + + long value = parse_long(trace_file_size_name, size); + + if (value < 1024L) + throw new INITIALIZE(trace_file_size_name + ": invalid value " + + value + " (valid value greater than 1024)"); + trace_file_size = value; + } + + public void parse_trace_num_files(String length) + { + if (length == null) + return; + + int value = parse_int(trace_num_files_name, length); + + if ((value < 1) || (value > 10)) + throw new INITIALIZE(trace_num_files_name + ": invalid value " + + value + " (valid value between 1 and 10)"); + + trace_num_files = value; + } + + + + + /** + * Parse the qos_enabled value. + * + * @param str + * the value digits. + * @pre Values must be true or false + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_qos_enabled(String str) + { + if (str == null) + return; + + qos_enabled = parse_boolean(qos_enabled_name, str); + + } + + /** + * Parse the ziop_chunk_size value. + * + * @param str + * the value digits. + * @pre Values must be > 0 + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_ziop_chunk_size(String str) + { + if (str == null) + return; + + int value = parse_int(ziop_chunk_size_name, str); + + if (value > 0) + throw new INITIALIZE(ziop_chunk_size_name + ":invalid value " + value + + " (value must be > 0)"); + + ziop_chunk_size = value; + } + + + + /** + * Parse the assume_ziop_server value. + * + * @param str + * the value digits. + * @pre Values must be true or false + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + public void parse_assume_ziop_server(String str) + { + if (str == null) + return; + + assume_ziop_server = parse_boolean(assume_ziop_server_name, str); + + } + + + + /** + * Parse the an int value. + * + * @param str + * the value digits. + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid number. + */ + protected static int parse_int(String prop_name, String str) + { + try { + return Integer.parseInt(str); + } + catch (NumberFormatException num) { + throw new INITIALIZE(prop_name + ": int value expected."); + } + } + + /** + * Parse an long value + * + * @param str + * the value digits + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid number + */ + protected static long parse_long(String prop_name, String str) + { + try { + return Long.parseLong(str); + } + catch (NumberFormatException num) { + throw new INITIALIZE(prop_name + ": long value expected"); + } + } + + /** + * Parse the a boolean value. + * + * @param str + * the value representation: "true" or "false". + * @exception org.omg.CORBA.INITIALIZE + * if the string does not contains a valid value. + */ + protected static boolean parse_boolean(String prop_name, String str) + { + if (str.equals("true")) + return true; + else if (str.equals("false")) + return false; + else + throw new INITIALIZE(prop_name + ": boolean value expected."); + } + + public void dump(java.io.PrintWriter writer) + { + //TODO: complete dump with CommLayers stuff + writer.println("TIDorb properties:"); + + writer.print('\t'); + writer.print(block_size_name); + writer.print('='); + writer.println(block_size); + writer.print('\t'); + writer.print(exhaustive_equal_name); + writer.print('='); + writer.println(exhaustive_equal); + writer.print('\t'); + + writer.print(typecode_cache_size_name); + writer.print('='); + writer.println(typecode_cache_size); + + writer.println(); + + writer.print('\t'); + writer.print(poa_max_threads_name); + writer.print('='); + writer.println(poa_max_threads); + writer.print('\t'); + writer.print(poa_min_threads_name); + writer.print('='); + writer.println(poa_min_threads); + writer.print('\t'); + writer.print(poa_max_queued_requests_name); + writer.print('='); + writer.println(poa_max_queued_requests); + writer.print('\t'); + writer.print(poa_starving_time_name); + writer.print('='); + writer.println(poa_starving_time); + + writer.print('\t'); + writer.print(ami_max_threads_name); + writer.print('='); + writer.println(ami_max_threads); + writer.print('\t'); + writer.print(ami_min_threads_name); + writer.print('='); + writer.println(ami_min_threads); + writer.print('\t'); + writer.print(ami_max_queued_handled_requests_name); + writer.print('='); + writer.println(ami_max_queued_handled_requests); + writer.print('\t'); + writer.print(ami_starving_time_name); + writer.print('='); + writer.println(ami_starving_time); + + + writer.print('\t'); + writer.print(max_time_in_shutdown_name); + writer.print('='); + writer.println(max_time_in_shutdown); + writer.println(); + writer.print('\t'); + writer.print(trace_level_name); + writer.print('='); + writer.println(trace_level); + + if (trace_file != null) { + writer.print('\t'); + writer.print(trace_file_name); + writer.print('='); + writer.println(trace_file); + + writer.print('\t'); + writer.print(trace_file_size_name); + writer.print('='); + writer.println(trace_file_size); + + writer.print('\t'); + writer.print(trace_num_files_name); + writer.print('='); + writer.println(trace_num_files); + } + + writer.print("Default Policies:"); + st_default_policy_context.dump(writer); + writer.print('\n'); + writer.print("User Policies:"); + policy_context.dump(writer); + writer.print('\n'); + + writer.flush(); + } +} + diff --git a/source/es/tid/TIDorbj/core/ContextImpl.java b/source/es/tid/TIDorbj/core/ContextImpl.java new file mode 100644 index 0000000..e12f926 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ContextImpl.java @@ -0,0 +1,325 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CTX_RESTRICT_SCOPE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Context; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA.TCKind; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * TIDorb ContextImpl pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ContextImpl extends org.omg.CORBA.Context +{ + + public ContextImpl(TIDORB orb, String name) + { + this(orb, name, null); + } + + public ContextImpl(TIDORB orb, String name, Context parent) + { + m_orb = orb; + m_name = name; + m_parent = parent; + m_values = null; + m_childs = null; + } + + public String context_name() + { + return m_name; + } + + public org.omg.CORBA.Context parent() + { + return m_parent; + } + + public org.omg.CORBA.Context create_child(String child_context_name) + { + if (child_context_name == null) { + + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + ContextImpl child = new ContextImpl(m_orb, child_context_name, this); + + if (m_childs == null) { + m_childs = new java.util.Vector(); + } + m_childs.addElement(child); + return child; + } + + public void set_one_value(String prop_name, org.omg.CORBA.Any value) + { + if ((prop_name == null) || (value == null)) { + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (m_values == null) { + m_values = new NVListImpl(m_orb); + } + + if (value.type().kind().value() != TCKind._tk_string) { + throw new BAD_PARAM("Value must have a string TypeCode."); + } + // new value + m_values.add_value(prop_name, value, 0); + } + + public void set_values(org.omg.CORBA.NVList values) + { + if (values == null) { + throw new BAD_PARAM("Null NVList reference", 0, + CompletionStatus.COMPLETED_NO); + } + + m_values = new NVListImpl(m_orb); + + int list_size = values.count(); + try { + for (int i = 0; i < list_size; i++) { + set_one_value(values.item(i).name(), values.item(i).value()); + } + } + catch (Bounds bds) {} + } + + public void delete_values(String prop_name) + { + if (prop_name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_values != null) { + int list_size = m_values.count(); + try { + for (int i = 0; i < list_size; i++) { + if (prop_name.equals(m_values.item(i).name())) { + m_values.remove(i); + } + } + } + catch (Bounds bds) {} + } + } + + public org.omg.CORBA.NVList get_values(String start_scope, int op_flags, + String pattern) + { + if ((start_scope == null) || (pattern == null)) { + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + NVListImpl list = new NVListImpl(m_orb); + + if (start_scope.equals(m_name)) { + int list_size = m_values.count(); + + try { + for (int i = 0; i < list_size; i++) { + + if (matchPattern(m_values.item(i).name(), pattern)) { + + list.add_value(m_values.item(i).name(), m_values + .item(i).value(), 0); + } + } + } + catch (Bounds bds) {}; + } + + if ((m_childs != null) && (op_flags != CTX_RESTRICT_SCOPE.value)) { + int child_size = m_childs.size(); + try { + NVList aux_list; + int list_size; + + for (int i = 0; i < child_size; i++) { + aux_list = ((Context) m_childs.elementAt(i)) + .get_values(start_scope, op_flags, pattern); + list_size = aux_list.count(); + + for (int j = 0; j < list_size; j++) { + list.add_value(aux_list.item(i).name(), aux_list + .item(i).value(), 0); + } + } + } + catch (Bounds bds) {} + + } + + return list; + } + + public String item(int i) + throws org.omg.CORBA.Bounds + { + return (m_values.item(i)).value().extract_string(); + } + + protected boolean matchPattern(String name, String pattern) + { + if (pattern.equals("*")) { + return true; + } + + int position = pattern.indexOf("*", 0); + if (position == -1) { + return name.equals(pattern); + } + if (position > name.length()) { + return false; + } + + String sub1 = pattern.substring(0, position); + String sub2 = name.substring(0, position); + return sub1.equals(sub2); + + } + + public static ContextImpl read(CDRInputStream input) + { + int pair_count = input.read_ulong(); + + if (pair_count == 0) { + return null; + } + + if ((pair_count < 1) || (pair_count % 2 != 0)) { + throw new MARSHAL("Malformed context name-value pairs", 0, + CompletionStatus.COMPLETED_NO); + } + + int num_values = pair_count / 2; + + ContextImpl context = new ContextImpl((TIDORB) input.orb(), ""); + + String name; + Any value; + + for (int i = 0; i < num_values; i++) { + name = input.read_string(); + value = input.orb().create_any(); + + value.insert_string(input.read_string()); + + context.set_one_value(name, value); + } + + return context; + } + + public static void write(CDROutputStream output, org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) + { + int contexts_count = contexts.count(); + + if (contexts_count == 0) { + //no context + output.write_ulong(0); + return; + } + + java.util.Vector nv_context = new java.util.Vector(); + + try { + NVList aux_list = null; + NamedValue nam_val = null; + int aux_list_size = 0; + + for (int i = 0; i < contexts_count; i++) { + aux_list = ctx.get_values("", 0, contexts.item(i)); + aux_list_size = aux_list.count(); + for (int j = 0; j < aux_list_size; j++) { + nam_val = aux_list.item(j); + nv_context.addElement(nam_val.name()); + nv_context.addElement(nam_val.value().extract_string()); + } + + } + } + catch (Bounds bds) {} + + int total_ctx_size = nv_context.size(); + + output.write_ulong(total_ctx_size); + + for (int i = 0; i < total_ctx_size; i++) { + output.write_string((String) nv_context.elementAt(i)); + } + } + + // members + + protected TIDORB m_orb; + + protected String m_name; + + protected Context m_parent; + + protected NVList m_values; + + protected java.util.Vector m_childs; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ContextListImpl.java b/source/es/tid/TIDorbj/core/ContextListImpl.java new file mode 100644 index 0000000..4eaf9d1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ContextListImpl.java @@ -0,0 +1,90 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * TIDorb ContextList pseudobject implementation. + * + * @autor Juan A. Ca´ceres + * @version 0.1 + */ + +public class ContextListImpl extends org.omg.CORBA.ContextList +{ + + public ContextListImpl() + { + m_elements = new java.util.Vector(); + } + + public int count() + { + return m_elements.size(); + } + + public void add(String ctx) + { + m_elements.addElement(ctx); + } + + public String item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_elements.size()) { + throw new org.omg.CORBA.Bounds(); + } + + return (String) m_elements.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_elements.size()) { + throw new org.omg.CORBA.Bounds(); + } + m_elements.removeElementAt(index); + } + + protected java.util.Vector m_elements; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/EnvironmentImpl.java b/source/es/tid/TIDorbj/core/EnvironmentImpl.java new file mode 100644 index 0000000..4659b07 --- /dev/null +++ b/source/es/tid/TIDorbj/core/EnvironmentImpl.java @@ -0,0 +1,76 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * TIDorb Environment pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class EnvironmentImpl extends org.omg.CORBA.Environment +{ + + protected java.lang.Exception m_exception; + + public EnvironmentImpl() + { + m_exception = null; + } + + public void exception(java.lang.Exception exception) + { + m_exception = exception; + } + + public java.lang.Exception exception() + { + return m_exception; + } + + public void clear() + { + m_exception = null; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ExceptionListImpl.java b/source/es/tid/TIDorbj/core/ExceptionListImpl.java new file mode 100644 index 0000000..700b7ce --- /dev/null +++ b/source/es/tid/TIDorbj/core/ExceptionListImpl.java @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TCKind; + +/** + * TIDorb ExceptionList pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ExceptionListImpl extends org.omg.CORBA.ExceptionList +{ + + java.util.Vector m_exceptions; + + public ExceptionListImpl() + { + m_exceptions = new java.util.Vector(); + } + + public int count() + { + return m_exceptions.size(); + } + + public void add(org.omg.CORBA.TypeCode exc) + { + if (exc == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + if (exc.kind().value() != TCKind._tk_except) + throw new BAD_PARAM("Exception TypeCode expected", 0, + CompletionStatus.COMPLETED_NO); + + m_exceptions.addElement(exc); + } + + public org.omg.CORBA.TypeCode item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_exceptions.size()) + throw new org.omg.CORBA.Bounds(); + return (org.omg.CORBA.TypeCode) m_exceptions.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_exceptions.size()) + throw new org.omg.CORBA.Bounds(); + m_exceptions.removeElementAt(index); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ForwardRequest.java b/source/es/tid/TIDorbj/core/ForwardRequest.java new file mode 100644 index 0000000..be07b49 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ForwardRequest.java @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.iop.IOR; + +public class ForwardRequest extends java.lang.Exception +{ + public IOR m_reference; + + public ForwardRequest(IOR ref) + { + m_reference = ref; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/NVListImpl.java b/source/es/tid/TIDorbj/core/NVListImpl.java new file mode 100644 index 0000000..6b9e532 --- /dev/null +++ b/source/es/tid/TIDorbj/core/NVListImpl.java @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 14 $ +* Date: $Date: 2006-02-22 13:30:10 +0100 (Wed, 22 Feb 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.CORBA.NamedValue; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.CORBA_2_3.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class NVListImpl extends org.omg.CORBA.NVList +{ + TIDORB m_orb; + + protected java.util.Vector m_components; + + public NVListImpl(TIDORB orb) + { + m_orb = orb; + m_components = new java.util.Vector(); + } + + public NVListImpl(TIDORB orb, int count) + { + m_components = new java.util.Vector(count); + } + + public int count() + { + return m_components.size(); + } + + public org.omg.CORBA.NamedValue add(int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, "", + m_orb.create_any()); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue add_item(String item_name, int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, item_name, + m_orb.create_any()); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue add_value(String name, + org.omg.CORBA.Any value, + int flags) + { + NamedValueImpl n_value = NamedValueImpl.from_int(flags, name, value); + m_components.addElement(n_value); + return n_value; + } + + public org.omg.CORBA.NamedValue item(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_components.size()) + throw new Bounds(); + + return (org.omg.CORBA.NamedValue) m_components.elementAt(index); + } + + public void remove(int index) + throws org.omg.CORBA.Bounds + { + if (index >= m_components.size()) + throw new Bounds(); + m_components.removeElementAt(index); + } + + // TIDorb Operations + + public static void destroy(NVList list) + { + try { + int size = list.count(); + for (int i = 0; i < size; i++) + list.remove(i); + } + catch (org.omg.CORBA.Bounds b) {} + } + + public static void assignOutArguments(NVList from_list, NVList to_list) + { + assignOutArguments(from_list, to_list, false); + } + + public static void assignOutArguments(NVList from_list, NVList to_list, + boolean wrap_anys) + { + int length = to_list.count(); + + if (length < from_list.count()) + throw new MARSHAL("Invalid number of out arguments.", 0, + CompletionStatus.COMPLETED_NO); + + NamedValue to_nam_val = null; + + try { + for (int i = 0; i < length; i++) { + to_nam_val = to_list.item(i); + if (to_nam_val.flags() != ARG_IN.value) + AnyImpl.assignValue(from_list.item(i).value(), + to_nam_val.value(), wrap_anys); + } + + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + public static void assignInArguments(NVList from_list, NVList to_list) + { + assignInArguments(from_list, to_list, false); + } + + public static void assignInArguments(NVList from_list, NVList to_list, + boolean wrap_anys) + { + int length = to_list.count(); + + if (length < from_list.count()) + throw new MARSHAL("Invalid number of out arguments.", 0, + CompletionStatus.COMPLETED_NO); + + NamedValue to_nam_val = null; + + try { + for (int i = 0; i < length; i++) { + to_nam_val = to_list.item(i); + if (to_nam_val.flags() != ARG_OUT.value) + AnyImpl.assignValue(from_list.item(i).value(), + to_nam_val.value(), wrap_anys); + } + + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void readOutParams(NVList list, InputStream input) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) + nam_val.value().read_value(input, nam_val.value().type()); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void writeOutParams(NVList list, OutputStream output) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) + nam_val.value().write_value(output); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + + } + + public static void readInParams(NVList list, InputStream input) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_OUT.value) + nam_val.value().read_value(input, nam_val.value().type()); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + public static void writeInParams(NVList list, OutputStream output) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_OUT.value) + nam_val.value().write_value(output); + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + // AMI operations + + public static void setOutParamsAsIn(NVList list, RequestImpl replyHandlerRequest) + { + if (list == null) + return; + + int length = list.count(); + + NamedValue nam_val = null; + + try { + for (int i = 0; i < length; i++) { + nam_val = list.item(i); + if (nam_val.flags() != ARG_IN.value) { + org.omg.CORBA.Any $arg = replyHandlerRequest.add_named_in_arg(nam_val.name()); + $arg.type(nam_val.value().type()); + } + } + } + catch (Bounds bds) { + throw new BAD_PARAM("Bad NVList"); + } + } + + + public NVList removeInParams() { + NVList listWithoutIn = new NVListImpl(m_orb); + int length = m_components.size(); + + NamedValue nam_val = null; + for (int i = 0; i < length; i++) { + nam_val = (NamedValue) m_components.elementAt(i); + if (nam_val.flags() != ARG_IN.value) + listWithoutIn.add_value(nam_val.name(), nam_val.value(), nam_val.flags()); + } + + return listWithoutIn; + } + + public NVList removeOutParams() { + NVList listWithoutOut = new NVListImpl(m_orb); + int length = m_components.size(); + + NamedValue nam_val = null; + for (int i = 0; i < length; i++) { + nam_val = (NamedValue) m_components.elementAt(i); + if (nam_val.flags() != ARG_OUT.value) + listWithoutOut.add_value(nam_val.name(), nam_val.value(), nam_val.flags()); + } + + return listWithoutOut; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/NamedValueImpl.java b/source/es/tid/TIDorbj/core/NamedValueImpl.java new file mode 100644 index 0000000..af3e99a --- /dev/null +++ b/source/es/tid/TIDorbj/core/NamedValueImpl.java @@ -0,0 +1,109 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_INOUT; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; + +/** + * TIDorb NameValueImpl pseudobject implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class NamedValueImpl extends org.omg.CORBA.NamedValue +{ + + protected java.lang.String m_name; + + protected org.omg.CORBA.Any m_value; + + protected int m_flags; + + protected NamedValueImpl() + {} + + public static NamedValueImpl from_int(int flags, java.lang.String name, + org.omg.CORBA.Any value) + throws org.omg.CORBA.BAD_PARAM + { + if ((name == null) || (value == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + verifyFlags(flags); + NamedValueImpl named = new NamedValueImpl(); + named.m_name = name; + named.m_value = value; + named.m_flags = flags; + return named; + + } + + private static void verifyFlags(int flags) + { + if ((flags != ARG_IN.value) && (flags != ARG_INOUT.value) + && (flags != ARG_OUT.value)) + throw new BAD_PARAM("Invalid flag argument", 0, + CompletionStatus.COMPLETED_NO); + } + + public String name() + { + return m_name; + } + + public org.omg.CORBA.Any value() + { + return m_value; + } + + public int flags() + { + return m_flags; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ORBComponent.java b/source/es/tid/TIDorbj/core/ORBComponent.java new file mode 100644 index 0000000..c9aa138 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ORBComponent.java @@ -0,0 +1,71 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +/** + * Base class for TIDorb Components. It defines the basic methods for accessing + * the ORB. + *

+ * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class ORBComponent extends Object +{ + + /** + * The ORB. + */ + protected TIDORB m_orb; + + public ORBComponent(TIDORB orb) + { + m_orb = orb; + } + + public TIDORB orb() + { + return m_orb; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ORBServices.java b/source/es/tid/TIDorbj/core/ORBServices.java new file mode 100644 index 0000000..08708b7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ORBServices.java @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; + +class ORBServices +{ + public final static String ROOT_POA_ID = "RootPOA"; + + public final static int ROOT_POA = 0; + + public final static String POA_CURRENT_ID = "POACurrent"; + + public final static int POA_CURRENT = 1; + + public final static String INTERFACE_REPOSITORY_ID = "InterfaceRepository"; + + public final static int INTERFACE_REPOSITORY = 2; + + public final static String NAME_SERVICE_ID = "NameService"; + + public final static int NAME_SERVICE = 3; + + public final static String TRADING_SERVICE_ID = "TradingService"; + + public final static int TRADING_SERVICE = 4; + + public final static String SECURITY_CURRENT_ID = "SecurityCurrent"; + + public final static int SECURITY_CURRENT = 5; + + public final static String TRANSACTION_CURRENT_ID = "TransactionCurrent"; + + public final static int TRANSACTION_CURRENT = 6; + + public final static String DYN_ANY_FACTORY_ID = "DynAnyFactory"; + + public final static int DYN_ANY_FACTORY = 7; + + public final static String ORB_POLICY_MANAGER_ID = "ORBPolicyManager"; + + public final static int ORB_POLICY_MANAGER = 8; + + public final static String POLICY_CURRENT_ID = "PolicyCurrent"; + + public final static int POLICY_CURRENT = 9; + + public final static String NOTIFICATION_SERVICE_ID = "NotificationService"; + + public final static int NOTIFICATION_SERVICE = 10; + + public final static String TYPED_NOTIFICATION_SERVICE_ID = + "TypedNotificationService"; + + public final static int TYPED_NOTIFICATION_SERVICE = 11; + + public final static String CODEC_FACTORY_ID = "CodecFactory"; + + public final static int CODEC_FACTORY = 12; + + public final static String PI_CURRENT_ID = "PICurrent"; + + public final static int PI_CURRENT = 13; + + public final static String RT_ORB_ID = "RTORB"; + + public final static int RT_ORB = 14; + + public final static String COMPRESSION_MANAGER_ID = "CompressionManager"; + + public final static int COMPRESSION_MANAGER = 15; + + + + private TIDORB m_orb; + + private java.util.Hashtable m_corba_services_ids; + + private java.util.Hashtable m_service_table; + + private final static Integer NULL_SERVICE = new Integer(0); + + public ORBServices(TIDORB orb) + { + m_orb = orb; + + m_corba_services_ids = new java.util.Hashtable(); + + m_corba_services_ids.put(ROOT_POA_ID, new Integer(ROOT_POA)); + m_corba_services_ids.put(POA_CURRENT_ID, new Integer(POA_CURRENT)); + m_corba_services_ids.put(INTERFACE_REPOSITORY_ID, + new Integer(INTERFACE_REPOSITORY)); + m_corba_services_ids.put(NAME_SERVICE_ID, new Integer(NAME_SERVICE)); + m_corba_services_ids.put(TRADING_SERVICE_ID, + new Integer(TRADING_SERVICE)); + m_corba_services_ids.put(SECURITY_CURRENT_ID, + new Integer(SECURITY_CURRENT)); + m_corba_services_ids.put(TRANSACTION_CURRENT_ID, + new Integer(TRANSACTION_CURRENT)); + m_corba_services_ids.put(DYN_ANY_FACTORY_ID, + new Integer(DYN_ANY_FACTORY)); + m_corba_services_ids.put(ORB_POLICY_MANAGER_ID, + new Integer(ORB_POLICY_MANAGER)); + m_corba_services_ids.put(POLICY_CURRENT_ID, + new Integer(POLICY_CURRENT)); + m_corba_services_ids.put(NOTIFICATION_SERVICE_ID, + new Integer(NOTIFICATION_SERVICE)); + m_corba_services_ids.put(TYPED_NOTIFICATION_SERVICE_ID, + new Integer(TYPED_NOTIFICATION_SERVICE)); + m_corba_services_ids.put(CODEC_FACTORY_ID, new Integer(CODEC_FACTORY)); + m_corba_services_ids.put(PI_CURRENT_ID, new Integer(PI_CURRENT)); + m_corba_services_ids.put(RT_ORB_ID, new Integer(RT_ORB)); + m_corba_services_ids.put(COMPRESSION_MANAGER_ID, new Integer(COMPRESSION_MANAGER)); + + m_service_table = new java.util.Hashtable(); + + m_service_table.put(ROOT_POA_ID, NULL_SERVICE); + m_service_table.put(POA_CURRENT_ID, NULL_SERVICE); + m_service_table.put(INTERFACE_REPOSITORY_ID, NULL_SERVICE); + m_service_table.put(NAME_SERVICE_ID, NULL_SERVICE); + m_service_table.put(TRADING_SERVICE_ID, NULL_SERVICE); + m_service_table.put(SECURITY_CURRENT_ID, NULL_SERVICE); + m_service_table.put(TRANSACTION_CURRENT_ID, NULL_SERVICE); + m_service_table.put(DYN_ANY_FACTORY_ID, NULL_SERVICE); + m_service_table.put(ORB_POLICY_MANAGER_ID, NULL_SERVICE); + m_service_table.put(POLICY_CURRENT_ID, NULL_SERVICE); + m_service_table.put(NOTIFICATION_SERVICE_ID, NULL_SERVICE); + m_service_table.put(TYPED_NOTIFICATION_SERVICE_ID, NULL_SERVICE); + m_service_table.put(CODEC_FACTORY_ID, NULL_SERVICE); + m_service_table.put(PI_CURRENT_ID, NULL_SERVICE); + m_service_table.put(RT_ORB_ID, NULL_SERVICE); + m_service_table.put(COMPRESSION_MANAGER_ID, NULL_SERVICE); + + } + + public synchronized void destroy() + { + m_service_table.clear(); + m_service_table = null; + + m_corba_services_ids.clear(); + m_corba_services_ids = null; + } + + public synchronized org.omg.CORBA.Object resolveService(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + java.lang.Object table_value = m_service_table.get(object_name); + + if (table_value == null) { + if (m_orb.m_conf.default_initial_reference == null) + throw new org.omg.CORBA.BAD_PARAM(object_name); + + return m_orb.string_to_object( + m_orb.m_conf.default_initial_reference + + object_name); + } + + org.omg.CORBA.Object obj = null; + + if (table_value instanceof org.omg.CORBA.Object) + return (org.omg.CORBA.Object) table_value; + + if ((table_value instanceof Integer) + && (((Integer) table_value) != NULL_SERVICE)) { + //TODO: recomment this + //known services are registered as NULL_SERVICE to + //mark them as known initially, and instantiated when + //requested... if a service is registered with neither + //its ior nor the null service, will be an error + throw new org.omg.CORBA.INTERNAL(); + } + + Integer orb_service_val = + (Integer) m_corba_services_ids.get(object_name); + + switch (orb_service_val.intValue()) + { + case ROOT_POA: + obj = m_orb.initPOA(); + m_service_table.put(ROOT_POA_ID, obj); + return obj; + case POA_CURRENT: + obj = m_orb.initPOACurrent(); + m_service_table.put(POA_CURRENT_ID, obj); + return obj; + case DYN_ANY_FACTORY: + obj = m_orb.initDynAnyFactory(); + m_service_table.put(DYN_ANY_FACTORY_ID, obj); + + return obj; + case CODEC_FACTORY: + obj = m_orb.initCodecFactory(); + m_service_table.put(CODEC_FACTORY_ID, obj); + return obj; + case ORB_POLICY_MANAGER: + obj = m_orb.initPolicyManager(); + m_service_table.put(ORB_POLICY_MANAGER_ID, obj); + return obj; + case POLICY_CURRENT: + obj = m_orb.initPolicyCurrent(); + m_service_table.put(POLICY_CURRENT_ID, obj); + return obj; + case COMPRESSION_MANAGER: + obj = m_orb.initCompressionManager(); + m_service_table.put(COMPRESSION_MANAGER_ID, obj); + return obj; + case RT_ORB: + case INTERFACE_REPOSITORY: + case NAME_SERVICE: + case TRADING_SERVICE: + case SECURITY_CURRENT: + case TRANSACTION_CURRENT: + case NOTIFICATION_SERVICE: + case TYPED_NOTIFICATION_SERVICE: + case PI_CURRENT: + throw new org.omg.CORBA.BAD_OPERATION("Service not available"); + default: + throw new org.omg.CORBA.INTERNAL(); + } + } + + public synchronized void registerInitialReference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + if (object_name == null) + throw new BAD_PARAM("Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + if (obj == null) + throw new BAD_PARAM("Null Object reference", + 24, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + if (m_corba_services_ids.containsKey(object_name)) + throw new org.omg.CORBA.ORBPackage.InvalidName(object_name); + + m_service_table.put(object_name, obj); + } + + public synchronized String[] listInitialServices() + { + java.util.Vector list = new java.util.Vector(); + + java.util.Enumeration e = m_service_table.keys(); + + while (e.hasMoreElements()) { + list.addElement(e.nextElement()); + } + + int ids_size = list.size(); + + String[] ids = new String[ids_size]; + + for (int i = 0; i < ids_size; i++) + ids[i] = (String) list.elementAt(i); + + return ids; + } + + protected synchronized void setService(String object_name, + org.omg.CORBA.Object obj) + { + if (object_name == null) + throw new BAD_PARAM( "Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + if (obj == null) + throw new BAD_PARAM("Null Object reference", + 24, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + m_service_table.put(object_name, obj); + } + + protected synchronized void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (object_name == null) + throw new BAD_PARAM("Null String reference", + 0, + org.omg.CORBA.CompletionStatus.COMPLETED_NO); + + if (m_service_table.containsKey(object_name)) + m_service_table.remove(object_name); + else + throw new org.omg.CORBA.ORBPackage.InvalidName(object_name); + } +} diff --git a/source/es/tid/TIDorbj/core/ObjectImpl.java b/source/es/tid/TIDorbj/core/ObjectImpl.java new file mode 100644 index 0000000..1166df1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ObjectImpl.java @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.comm.CommunicationException; + +public class ObjectImpl extends org.omg.CORBA_2_3.portable.ObjectImpl +{ + + protected final static String[] __ids = { "IDL:omg.org/CORBA/Object:1.0" }; + + public ObjectImpl() + {} + + public static ObjectImpl fromIOR(es.tid.TIDorbj.core.TIDORB orb, + es.tid.TIDorbj.core.iop.IOR ior) + { + ObjectImpl obj = new ObjectImpl(); + try { + obj._set_delegate( + orb.getCommunicationManager().createDelegate( ior ) + ); + } catch (CommunicationException ce ){ + //TODO: ¿? + } + return obj; + } + + public String[] _ids() + { + return __ids; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ObjectKey.java b/source/es/tid/TIDorbj/core/ObjectKey.java new file mode 100644 index 0000000..eb561b6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ObjectKey.java @@ -0,0 +1,135 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.util.Base64Codec; + +/** + * ObjectKey data structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ObjectKey +{ + private String str; + + Encapsulation m_marshaled_key; + + public ObjectKey(){ + } + + public ObjectKey(Encapsulation key) { + this.m_marshaled_key = key; + } + + public boolean equal(ObjectKey other) + { + return ( m_marshaled_key == null && m_marshaled_key == other.m_marshaled_key ) || + ( m_marshaled_key.equal( other.m_marshaled_key ) ); + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_marshaled_key = input.readEncapsulation(); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_marshaled_key != null) { + output.writeEncapsulation(m_marshaled_key); + } else { + throw new org.omg.CORBA.INTERNAL("Malformed Objectkey"); + } + } + + public void setMarshaledKey( Encapsulation marshaled_key ) { + this.m_marshaled_key = marshaled_key; + } + + public Encapsulation getMarshaledKey() { + return m_marshaled_key; + } + + //TODO: tryToGetURLKey should be removed, and also the one in IIOPCorbaLoc + public String getURL() { + //TODO: check if this should be stored locally for further invocations + String url; + try { + int size = this.m_marshaled_key.getLength(); + int offset = this.m_marshaled_key.getOffset(); + + CDRInputStream input = new CDRInputStream( + this.m_marshaled_key.getORB(), + this.m_marshaled_key.getOctetSequence() + ); + + if (offset > 0) { + input.skip(offset); + } + + char[] url_key = new char[size]; + + input.read_char_array(url_key, 0, size); + + + + url = new String(url_key); + } catch ( Throwable th ){ + th.printStackTrace(); + url = null; + } + return url; + }//getURL + + public synchronized String toString() + { + if(str == null) { + str = Base64Codec.encode(m_marshaled_key.getOctetSequence()); + } + + return str; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ProcessingState.java b/source/es/tid/TIDorbj/core/ProcessingState.java new file mode 100644 index 0000000..2724ff3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ProcessingState.java @@ -0,0 +1,133 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +class ProcessingState +{ + + final static short CLIENT = 0; + + final static short RUNNING = 1; + + final static short SHUTDOWNING = 2; + + final static short SHUTDOWNED = 3; + + short m_state; + + TIDORB m_orb; + + public ProcessingState(TIDORB orb) + { + this.m_orb = orb; + m_state = CLIENT; + } + + public short state() + { + return m_state; + } + + public synchronized void running() + { + if (m_state == CLIENT) { + m_state = RUNNING; + } + } + + public boolean isShutdowned() + { + return m_state == SHUTDOWNED; + } + + public synchronized void shutdown() + { + if (m_state == RUNNING) { + m_state = SHUTDOWNING; + ShutdownThread thread = new ShutdownThread(m_orb); + thread.start(); + } + } + + public synchronized void shutdowned() + { + if (m_state == SHUTDOWNING) { + m_state = SHUTDOWNED; + notifyAll(); + } + } + + public synchronized void waitForShutdown() + { + if (m_state == SHUTDOWNING) { + try { + wait(m_orb.m_conf.max_time_in_shutdown); + } + catch (InterruptedException ie) {} + } else if (m_state == RUNNING) { + try { + wait(); + } + catch (InterruptedException ie) {} + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public synchronized boolean waitForShutdown(long millis) + { + if ((m_state == RUNNING) || (m_state == CLIENT)) { + try { + wait(millis); + } + catch (InterruptedException ie) {} + } + + return (m_state == RUNNING) ? false : true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/PseudoObject.java b/source/es/tid/TIDorbj/core/PseudoObject.java new file mode 100644 index 0000000..e984e6f --- /dev/null +++ b/source/es/tid/TIDorbj/core/PseudoObject.java @@ -0,0 +1,187 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.OBJECT_NOT_EXIST; + +/** + * Base class for all TIDorb's pseudobjects. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public abstract class PseudoObject + implements org.omg.CORBA.Object +{ + + /** + * If true the Object has been destroyed and it will throw a + * org.omg.CORBA.OBJECT_NOT_EXIST exception. + * Many Objects has the destroy method, this method will change + * this attribute. + */ + + protected boolean m_destroyed; + + /** + * Object hashcode. + */ + + protected int m_hash_code; + + protected PseudoObject() + { + m_destroyed = false; + m_hash_code = -1; + } + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + return repositoryIdentifier.equals("IDL:omg.org/CORBA/Object:1.0"); + } + + public boolean _non_existent() + { + return m_destroyed; + } + + public int _hash(int maximum) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (m_hash_code == -1) { + m_hash_code = hashCode(); + while (m_hash_code > maximum) + m_hash_code %= maximum; + } + + return m_hash_code; + } + + public boolean _is_equivalent(org.omg.CORBA.Object other) + { + if (other == null) + throw new BAD_PARAM("Null Object reference"); + + return (this == other); + } + + public org.omg.CORBA.Object _duplicate() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + return this; + } + + public void _release() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + } + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + + public org.omg.CORBA.InterfaceDef _get_interface() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object _get_interface_def() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request _request(java.lang.String operation) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Request + _create_request(org.omg.CORBA.Context ctx, + java.lang.String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Request + _create_request(org.omg.CORBA.Context ctx, + java.lang.String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Policy _get_policy(int policy_type) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.DomainManager[] _get_domain_managers() + { + throw new org.omg.CORBA.BAD_OPERATION(); + } + + public org.omg.CORBA.Object + _set_policy_override(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + { + throw new org.omg.CORBA.BAD_OPERATION(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/RequestCounter.java b/source/es/tid/TIDorbj/core/RequestCounter.java new file mode 100644 index 0000000..27fdeb9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/RequestCounter.java @@ -0,0 +1,18 @@ +package es.tid.TIDorbj.core; + + +public class RequestCounter +{ + private long m_serial; + + public RequestCounter() + { + m_serial = 0L; + } + + public synchronized long next() + { + return m_serial++; + } + +} diff --git a/source/es/tid/TIDorbj/core/RequestImpl.java b/source/es/tid/TIDorbj/core/RequestImpl.java new file mode 100644 index 0000000..9301dc2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/RequestImpl.java @@ -0,0 +1,559 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.ARG_IN; +import org.omg.CORBA.ARG_INOUT; +import org.omg.CORBA.ARG_OUT; +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging.ReplyHandlerOperations; +import org.omg.Messaging.ReplyHandlerPOA; +import org.omg.Messaging._ReplyHandlerStub; + +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb DII Request implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class RequestImpl extends org.omg.CORBA.Request +{ + /** + * The orb. + */ + TIDORB m_orb; + + /** + * Target CORBA object. + */ + org.omg.CORBA.portable.ObjectImpl m_target; + + /** + * operation name. + */ + String m_operation_name; + + /** + * Request identifier. + */ + RequestId m_request_id; + + /** + * Needs response. + */ + boolean m_with_response = false; + + /** + * Reliable oneway request that needs response. + */ + boolean m_reliable_oneway = false; + + /** + * Completion status needed in exception throwing. Initialy, the status is + * COMPLETED_NO + */ + CompletionStatus m_completed; + + /** + * Request context + */ + org.omg.CORBA.Context m_context; + + /** + * Request arguments + */ + org.omg.CORBA.NVList m_arguments; + + /** + * Request result value + */ + org.omg.CORBA.NamedValue m_result; + + /** + * Request exception list + */ + org.omg.CORBA.ExceptionList m_exceptions; + + /** + * Request context list + */ + org.omg.CORBA.ContextList m_contextlist; + + /** + * Request environment + */ + EnvironmentImpl m_environment; + + /** + * Request Policy Context + */ + PolicyContext m_policy_context; + + /** + * ReplyHandler object reference for AMI callback model + */ + Object m_handler; + + + public RequestImpl(org.omg.CORBA.Object target, org.omg.CORBA.Context ctx, + String operation, org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist) + { + m_completed = CompletionStatus.COMPLETED_NO; + + m_target = (org.omg.CORBA.portable.ObjectImpl) target; + + org.omg.CORBA.ORB obj_orb = m_target._orb(); + + if ((obj_orb != null) && (obj_orb instanceof TIDORB)) + m_orb = (TIDORB) obj_orb; + else + throw new BAD_PARAM("Invalid ORB"); + + m_request_id = null; + + m_operation_name = operation; + m_context = ctx; + m_arguments = arg_list; + m_result = result; + m_exceptions = exclist; + m_contextlist = ctxlist; + m_environment = new EnvironmentImpl(); + m_policy_context = null; + m_handler = null; + } + + /** + * Set the completion status to COMPLETED_MAYBE + */ + public void setCompletedMaybe() + { + m_completed = CompletionStatus.COMPLETED_MAYBE; + } + + /** + * Set the completion status to COMPLETED_YES + */ + public void setCompletedYes() + { + m_completed = CompletionStatus.COMPLETED_YES; + } + + /** + * @return the current completion status + */ + public CompletionStatus getCompleted() + { + return m_completed; + } + + public org.omg.CORBA.Object target() + { + return m_target; + } + + public String operation() + { + return m_operation_name; + } + + public org.omg.CORBA.NVList arguments() + { + return m_arguments; + } + + public org.omg.CORBA.NamedValue result() + { + return m_result; + } + + public org.omg.CORBA.Environment env() + { + return m_environment; + } + + public void setUserException(Any exc) + { + m_environment.exception(new UnknownUserException(exc)); + } + + public void setSystemException(org.omg.CORBA.SystemException exc) + { + m_environment.exception(exc); + } + + public org.omg.CORBA.ExceptionList exceptions() + { + return m_exceptions; + } + + public org.omg.CORBA.ContextList contexts() + { + return m_contextlist; + } + + public void ctx(org.omg.CORBA.Context ctx) + { + if (ctx == null) + throw new BAD_PARAM("Null Context reference", 0, + CompletionStatus.COMPLETED_NO); + + m_context = ctx; + } + + public org.omg.CORBA.Context ctx() + { + return m_context; + } + + public org.omg.CORBA.Any add_in_arg() + { + return addArg(ARG_IN.value); + } + + public org.omg.CORBA.Any add_named_in_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_IN.value); + } + + public org.omg.CORBA.Any add_inout_arg() + { + return addArg(ARG_INOUT.value); + } + + public org.omg.CORBA.Any add_named_inout_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_INOUT.value); + } + + public org.omg.CORBA.Any add_out_arg() + { + return addArg(ARG_OUT.value); + } + + public org.omg.CORBA.Any add_named_out_arg(String name) + { + if (name == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + return addArg(name, ARG_OUT.value); + } + + public void set_return_type(org.omg.CORBA.TypeCode tc) + { + if (tc == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + Any result_any = m_orb.create_any(); + result_any.type(tc); + m_result = NamedValueImpl.from_int(ARG_OUT.value, "", result_any); + } + + public org.omg.CORBA.Any return_value() + { + if (m_result != null) + return m_result.value(); + else + throw new BAD_OPERATION("No result defined."); + } + + public void readResult(InputStream input) + { + if (m_result != null) + m_result.value().read_value(input, m_result.value().type()); + } + + public void invoke() + { + try { + m_with_response = true; + + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + + delegate.invoke(this); + + } + catch (org.omg.CORBA.SystemException se) { + setSystemException(se); + if (m_orb.m_trace != null) { + m_orb.m_trace.printStackTrace(Trace.DEEP_DEBUG, + "RequestImpl.invoke():" + + " system exception", + se); + } + } + catch (Throwable th) { + org.omg.CORBA.SystemException se = new org.omg.CORBA.UNKNOWN(); + setSystemException(se); + if (m_orb.m_trace != null) { + m_orb.m_trace.printStackTrace(Trace.ERROR, + "RequestImpl.invoke():" + + " Unexpected exception", + th); + } + } + + Exception e = m_environment.exception(); + + if ((e != null) && (e instanceof org.omg.CORBA.SystemException)) + throw (org.omg.CORBA.SystemException) e; + } + + public void send_oneway() + { + + try { + m_with_response = false; + + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + + delegate.onewayRequest(this); + + } + catch (org.omg.CORBA.SystemException se) { + se.completed = m_completed; + throw se; + } + + } + + public void send_deferred () { + throw new org.omg.CORBA.NO_IMPLEMENT(); + + + /*try { + m_handler = m_arguments.item(0).value().extract_Object(); + m_arguments.remove(0); + } catch (BAD_OPERATION e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Bounds e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + m_with_response = true; + CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); + delegate.asyncRequest(this);*/ + } + + public void get_response() + throws org.omg.CORBA.WrongTransaction + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_response() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +// BUG [#956] Invalid call to org.omg.CORBA.Request.sendc(org.omg.CORBA.Object) using AMI +// //Additional Messaging Operations +// public void sendc(org.omg.CORBA.Object handler) { +// m_handler = handler; + +// try { +// m_with_response = true; +// CommunicationDelegate delegate = (CommunicationDelegate) m_target._get_delegate(); +// //delegate.asyncRequest(this); +// delegate.asyncRequest(this, m_handler); +// } +// catch (org.omg.CORBA.SystemException se) { +// setSystemException(se); +// if (m_orb.m_trace != null) { +// m_orb.m_trace.printStackTrace(Trace.DEEP_DEBUG, +// "RequestImpl.send_deferred():" + +// " system exception", +// se); +// } +// } +// catch (Throwable th) { +// org.omg.CORBA.SystemException se = new org.omg.CORBA.UNKNOWN(); +// setSystemException(se); +// if (m_orb.m_trace != null) { +// m_orb.m_trace.printStackTrace(Trace.ERROR, +// "RequestImpl.send_deferred():" + +// " Unexpected exception", +// th); +// } +// } + +// Exception e = m_environment.exception(); + +// if ((e != null) && (e instanceof org.omg.CORBA.SystemException)) +// throw (org.omg.CORBA.SystemException) e; +// } + + public Object sendp() { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void prepare(Object p) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // TIDOrb operations + + public TIDORB orb() + { + return m_orb; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public void reliableOneway(boolean value) + { + m_reliable_oneway = value; + } + + public boolean reliableOneway() + { + return m_reliable_oneway; + } + + public void withResponse(boolean value) + { + m_with_response = value; + } + + public boolean withResponse() + { + return m_with_response; + } + + private org.omg.CORBA.Any addArg(String name, int flag_value) + { + if (m_arguments == null) + m_arguments = new NVListImpl(m_orb); + + NamedValueImpl arg; + arg = (NamedValueImpl) m_arguments.add_item(name, flag_value); + return arg.value(); + } + + private org.omg.CORBA.Any addArg(int flag_value) + { + if (m_arguments == null) + m_arguments = new NVListImpl(m_orb); + + NamedValueImpl arg; + arg = (NamedValueImpl) m_arguments.add(flag_value); + return arg.value(); + } + + public void writeInParams(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_arguments != null) + NVListImpl.writeInParams(m_arguments, output); + } + + public void setPolicyContext(PolicyContext context) + { + m_policy_context = context; + } + + public PolicyContext getPolicyContext() + { + if (m_policy_context == null) { + + CommunicationDelegate delegate = + (CommunicationDelegate) m_target._get_delegate(); + + + m_policy_context = delegate.createRequestPolicyContext(); + } + + return m_policy_context; + } + + public void set_ami_handler(Object handler) + { + m_handler = handler; + } + + public Object get_ami_handler() + { + return m_handler; + } + + public void setOperationName (String operName) { + m_operation_name = operName; + } +} diff --git a/source/es/tid/TIDorbj/core/ServerRequestImpl.java b/source/es/tid/TIDorbj/core/ServerRequestImpl.java new file mode 100644 index 0000000..b6355f8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ServerRequestImpl.java @@ -0,0 +1,279 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TCKind; +import org.omg.Compression.CompressorIdLevel; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +//TODO: make TargetAddress generic and move it to giop package +/** + * TIDorb DSI ServerRequest implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ServerRequestImpl extends org.omg.CORBA.ServerRequest +{ + + private final static int NO_ARGUMENTS_FIXED = 0; + + private final static int ARGUMENTS_FIXED = 1; + + private final static int RESULT_FIXED = 2; + + public final static int NO_EXCEPTION = 0; + + public final static int USER_EXCEPTION = 1; + + public final static int SYSTEM_EXCEPTION = 2; + + public final static int LOCATION_FORWARD = 3; + + private int m_completion_state; + + private int m_return_state; + + RequestId m_request_id; + + boolean m_with_response = false; + + String m_operation_name; + + TargetAddress m_target; + + GIOPVersion m_version; + + org.omg.CORBA.Context m_context; + + org.omg.CORBA.NVList m_server_parameters; + + Any m_result; + + Any m_exception; + + SystemException m_system_exception; + + org.omg.CORBA.Object m_forward_obj; + + CDRInputStream m_marshaled_parameters; + + CompressorIdLevel m_compressor; + + public ServerRequestImpl(GIOPVersion ver, + RequestId id, + String operation, + CDRInputStream cdr_parameters, + TargetAddress target) + { + m_completion_state = NO_ARGUMENTS_FIXED; + m_return_state = NO_EXCEPTION; + + m_version = ver; + m_request_id = id; + m_operation_name = operation; + m_context = null; + m_server_parameters = null; + m_marshaled_parameters = cdr_parameters; + m_target = target; + m_forward_obj = null; + m_compressor = new CompressorIdLevel((short)0,(short)0); + } + + public String operation() + { + return m_operation_name; + } + + public org.omg.CORBA.Context ctx() + { + if (m_completion_state != ARGUMENTS_FIXED) + throw new BAD_INV_ORDER( + "ctx() called after arguments() or set_result()."); + + return m_context; + } + + public void arguments(org.omg.CORBA.NVList nv) + { + if (m_completion_state != NO_ARGUMENTS_FIXED) + throw new BAD_INV_ORDER("arguments() called again."); + + m_completion_state = ARGUMENTS_FIXED; + + m_server_parameters = nv; + NVListImpl.readInParams(m_server_parameters, m_marshaled_parameters); + try { + m_context = (ContextImpl) m_marshaled_parameters.read_Context(); + } + catch (org.omg.CORBA.MARSHAL me) {} + } + + public void set_result(org.omg.CORBA.Any result) + { + if (m_completion_state != ARGUMENTS_FIXED) + throw new BAD_INV_ORDER("arguments() called again."); + + m_completion_state = RESULT_FIXED; + + m_return_state = NO_EXCEPTION; + + this.m_result = result; + } + + public void set_exception(org.omg.CORBA.Any except) + { + if (except.type().kind().value() != TCKind._tk_except) + throw new BAD_PARAM("Any value must be a user exception."); + + m_completion_state = RESULT_FIXED; + m_return_state = USER_EXCEPTION; + + m_exception = except; + } + + // TIDorb operations + + public void setSystemException(org.omg.CORBA.SystemException except) + { + m_completion_state = RESULT_FIXED; + m_return_state = SYSTEM_EXCEPTION; + + m_system_exception = except; + } + + public void setForward(org.omg.CORBA.Object obj) + { + m_completion_state = RESULT_FIXED; + m_return_state = LOCATION_FORWARD; + + m_forward_obj = obj; + } + + public TargetAddress getTarget() + { + return m_target; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public void withResponse(boolean value) + { + m_with_response = value; + } + + public boolean withResponse() + { + return m_with_response; + } + + public int getReturnState() + { + return m_return_state; + + } + + public Any getResult() + { + return m_result; + } + + public Any getException() + { + return m_exception; + } + + public SystemException getSystemException() + { + return m_system_exception; + } + + public org.omg.CORBA.NVList getParameters() + { + return m_server_parameters; + } + + public org.omg.CORBA.Object getForward() + { + return m_forward_obj; + } + + public GIOPVersion getVersion() + { + return m_version; + } + + public void destroy() + { + NVListImpl.destroy(m_server_parameters); + } + + public CompressorIdLevel get_compressor() + { + return m_compressor; + } + + public void set_compressor(CompressorIdLevel compressor) + { + m_compressor = compressor; + } + +} diff --git a/source/es/tid/TIDorbj/core/ShutdownThread.java b/source/es/tid/TIDorbj/core/ShutdownThread.java new file mode 100644 index 0000000..f1a4504 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ShutdownThread.java @@ -0,0 +1,60 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +class ShutdownThread extends Thread +{ + + TIDORB m_orb; + + public ShutdownThread(TIDORB orb) + { + this.m_orb = orb; + } + + public void run() + { + m_orb.doCompleteShutdown(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/SingletonORB.java b/source/es/tid/TIDorbj/core/SingletonORB.java new file mode 100644 index 0000000..06455b1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/SingletonORB.java @@ -0,0 +1,420 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.BAD_PARAM; + +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; + +/** + * TIDorb Version 2.3 CORBA ORB Singleton. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SingletonORB extends org.omg.CORBA_2_3.ORB +{ + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * ORB singleton static reference: only a instance will be for all orb. + * This rerefence will be returned by init() method. + */ + + protected static SingletonORB st_orb = null; + + public SingletonORB() + { + m_conf = new ConfORB(); + } + + public static org.omg.CORBA.ORB init() + { + if (st_orb == null) + st_orb = new SingletonORB(); + + return st_orb; + } + + public static org.omg.CORBA.ORB init(String[] args, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public static org.omg.CORBA.ORB init(java.applet.Applet app, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + protected void set_parameters(String[] args, java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void connect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void disconnect(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public String[] list_initial_services() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object string_to_object(String str) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NVList create_list(int count) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.ContextList create_context_list() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Context get_default_context() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Environment create_environment() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference"); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc(String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_alias_tc(String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference"); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.TypeCode + create_exception_tc(java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc(int bound, + org.omg.CORBA.TypeCode element_type) + { + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode + create_recursive_sequence_tc(int bound,int offset) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode + create_array_tc(int length, org.omg.CORBA.TypeCode element_type) + { + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference"); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference"); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference"); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference"); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.Any create_any() + { + return new es.tid.TIDorbj.core.AnyImpl(null); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void unregister_value_factory(String id) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_delegate(java.lang.Object wrapper) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/StreamRequestImpl.java b/source/es/tid/TIDorbj/core/StreamRequestImpl.java new file mode 100644 index 0000000..62b7486 --- /dev/null +++ b/source/es/tid/TIDorbj/core/StreamRequestImpl.java @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import org.omg.CORBA.CompletionStatus; + +import es.tid.TIDorbj.core.comm.giop.RequestId; + +public class StreamRequestImpl +{ + /** + * The orb. + */ + TIDORB m_orb; + + /** + * Target CORBA object. + */ + org.omg.CORBA.portable.ObjectImpl m_target; + + /** + * operation name. + */ + String m_operation_name; + + /** + * Request identifier. + */ + RequestId m_request_id = null; + + /** + * Needs response. + */ + boolean m_with_response = false; + + es.tid.TIDorbj.core.cdr.CDRInputStream m_response = null; + + es.tid.TIDorbj.core.cdr.CDROutputStream m_request = null; + + /** + * Completion status needed in exception throwing. Initialy, the status is + * COMPLETED_NO + */ + CompletionStatus m_completed; + + public StreamRequestImpl(TIDORB orb, + org.omg.CORBA.portable.ObjectImpl target, + String operation, boolean response) + { + m_orb = orb; + m_target = target; + m_operation_name = operation; + m_with_response = response; + } + + public TIDORB orb() + { + return m_orb; + } + + public void setInputStream(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_response = input; + } + + public es.tid.TIDorbj.core.cdr.CDRInputStream getInputStream() + { + return m_response; + } + + public void setOutputStream(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + m_request = output; + } + + public es.tid.TIDorbj.core.cdr.CDROutputStream getOutputStream() + { + return m_request; + } + + public org.omg.CORBA.portable.ObjectImpl getTarget() + { + return m_target; + } + + public RequestId getId() + { + return m_request_id; + } + + public void setId(RequestId id) + { + m_request_id = id; + } + + public boolean withResponse() + { + return m_with_response; + } + + public String operation() + { + return m_operation_name; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/TIDORB.java b/source/es/tid/TIDorbj/core/TIDORB.java new file mode 100644 index 0000000..35c92f1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/TIDORB.java @@ -0,0 +1,1653 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core; + +import java.io.IOException; + +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServiceInformationHolder; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.ORBPackage.InvalidName; +import org.omg.CORBA.portable.Delegate; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMIManager; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.typecode.AbstractInterfaceTypeCode; +import es.tid.TIDorbj.core.typecode.AliasTypeCode; +import es.tid.TIDorbj.core.typecode.ArrayTypeCode; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.ExceptionTypeCode; +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.core.typecode.NativeTypeCode; +import es.tid.TIDorbj.core.typecode.ObjectRefTypeCode; +import es.tid.TIDorbj.core.typecode.RecursiveTypeCode; +import es.tid.TIDorbj.core.typecode.SequenceTypeCode; +import es.tid.TIDorbj.core.typecode.StringTypeCode; +import es.tid.TIDorbj.core.typecode.StructTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.typecode.ValueBoxTypeCode; +import es.tid.TIDorbj.core.typecode.ValueTypeCode; +import es.tid.TIDorbj.core.typecode.WStringTypeCode; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.core.util.Corbaname; +import es.tid.TIDorbj.core.util.InitialReference; +import es.tid.TIDorbj.util.CircularTraceFile; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb GIOPVersion 2.6 CORBA ORB. + *

+ * + * @autor Juan A. Cáceres + * @version 2.0 + */ +public class TIDORB extends org.omg.CORBA_2_5.ORB +{ + + /** + * ORB GIOPVersion + */ + + public final static String st_version = "6.5.0rc1"; + + /** + * @return the ORB Singleton instance. + */ + public static org.omg.CORBA.ORB init() + { + return SingletonORB.init(); + } + + /** + * ORB configuration. + */ + + public ConfORB m_conf; + + /** + * Local POAManagers. + */ + public java.util.Vector m_POAManagers; + + /** + * TraceService reference. + */ + public es.tid.TIDorbj.util.Trace m_trace; + + /** + * Local Codec factory. + */ + private CodecFactoryImpl m_codec_factory; + + /** TODO: remove me + * ORB Communication layer, drives request to the local layer or the + * external layer. + + private es.tid.TIDorbj.core.comm.iiop.CommLayer m_comm_layer;*/ + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + private CommunicationManager communicationManager; + + + /** + * Local CurrentImpl. + */ + private es.tid.TIDorbj.core.poa.CurrentImpl m_current; + + /** + * The ORB has been destroyed. + */ + + private boolean m_destroyed; + + /** + * Local DynAny factory. + */ + private es.tid.TIDorbj.dynAny.DynAnyFactoryImpl m_dyn_factory; + + /** + * ORB PolicyManager. + */ + private es.tid.TIDorbj.core.policy.PolicyManagerImpl m_orb_policy_manager; + + /** + * ORB Services + */ + + private ORBServices m_orb_services; + + /** + * Thread Policy Current. + */ + private es.tid.TIDorbj.core.policy.PolicyCurrentImpl m_policy_current; + + + /** + * Compression Manager. + */ + private es.tid.TIDorbj.core.compression.CompressionManagerImpl m_compression_manager; + + + /** + * Local rootPOA. + */ + private es.tid.TIDorbj.core.poa.POAImpl m_root_POA; + + /** + * Processing state: controls the ORB shutdown. + */ + + private ProcessingState m_state; + + /** + * Thread Policy Context Manager. + */ + private es.tid.TIDorbj.core.policy.PolicyContextManager + m_thread_policy_context_manager; + + /** + * Maintains the order which the request was created + */ + private RequestCounter requestCounter; + + /** + * TypeCode Cache. + */ + + private es.tid.TIDorbj.core.typecode.TypeCodeCache m_typecode_cache; + + /** + * ORB ValueFactoryList + */ + + private java.util.Hashtable m_value_factories; + + /** + * ORB Name + */ + + String m_orb_name; + + /** + * AMI Manager + */ + + es.tid.TIDorbj.core.messaging.AMIManager m_ami_manager; + + + /** + * Constructor. The orb must be initialized using the set_parameters(). + */ + public TIDORB() + { + m_conf = null; + m_state = new ProcessingState(this); + m_destroyed = false; + + this.communicationManager = null; + this.requestCounter = new RequestCounter(); + + m_dyn_factory = null; + m_root_POA = null; + m_trace = null; + m_current = null; + m_typecode_cache = null; + m_ami_manager = null; + } + + public void connect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + + public TypeCode create_abstract_interface_tc(String id, String name) + { + return new AbstractInterfaceTypeCode(id, name); + } + + public org.omg.CORBA.TypeCode + create_alias_tc( String id, + String name, + org.omg.CORBA.TypeCode original_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (original_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new AliasTypeCode(id, name, original_type); + } + + public org.omg.CORBA.Any create_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.AnyImpl(this); + } + + public org.omg.CORBA.TypeCode + create_array_tc( int length, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("Illegal array length " + length); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new ArrayTypeCode(element_type, length); + } + + public org.omg.CORBA.ContextList create_context_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ContextListImpl(); + } + + public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, + String[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new EnumTypeCode(id, name, members); + } + + public org.omg.CORBA.Environment create_environment() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.EnvironmentImpl(); + } + + public org.omg.CORBA.ExceptionList create_exception_list() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.ExceptionListImpl(); + } + + public org.omg.CORBA.TypeCode + create_exception_tc( java.lang.String id, + java.lang.String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ExceptionTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new FixedTypeCode(digits, scale); + } + + public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ObjectRefTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_list(int count) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (count < 0) + throw new BAD_PARAM("Count < 0", 0, CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.NVListImpl(this, count); + } + + public org.omg.CORBA.NamedValue create_named_value(String s, + org.omg.CORBA.Any any, + int flags) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((s == null) || (any == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return es.tid.TIDorbj.core.NamedValueImpl.from_int(flags, s, any); + } + + public org.omg.CORBA.TypeCode create_native_tc(String id, String name) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new NativeTypeCode(id, name); + } + + public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.portable.OutputStream create_output_stream() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return new CDROutputStream(this, m_conf.block_size); + } + + public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) + throws org.omg.CORBA.PolicyError + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (val == null) + throw new BAD_PARAM("Null any reference"); + + return es.tid.TIDorbj.core.policy.PolicyFactory.createPolicy(type, val); + } + + /** + * @deprecated + */ + public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, + int offset) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode create_recursive_tc(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (id == null) + throw new BAD_PARAM("Null String reference"); + + return new RecursiveTypeCode(id); + } + + public org.omg.CORBA.TypeCode + create_sequence_tc( int bound, + org.omg.CORBA.TypeCode element_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal sequence length " + bound); + + if (element_type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + return new SequenceTypeCode(element_type, bound); + } + + public org.omg.CORBA.TypeCode create_string_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new StringTypeCode(bound); + } + + public org.omg.CORBA.TypeCode + create_struct_tc( String id, + String name, + org.omg.CORBA.StructMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new StructTypeCode(id, name, members); + } + + public org.omg.CORBA.TypeCode + create_union_tc( String id, + String name, + org.omg.CORBA.TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (discriminator_type == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new UnionTypeCode(id, name, discriminator_type, members); + } + + public org.omg.CORBA.TypeCode + create_value_box_tc( String id, + String name, + org.omg.CORBA.TypeCode boxed_type) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (boxed_type == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueBoxTypeCode(id, name, boxed_type); + } + + public org.omg.CORBA.TypeCode + create_value_tc( String id, + String name, + short type_modifier, + org.omg.CORBA.TypeCode concrete_base, + org.omg.CORBA.ValueMember[] members) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (name == null) || (concrete_base == null) + || (members == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new ValueTypeCode(id, name, type_modifier, concrete_base, + members); + } + + public org.omg.CORBA.TypeCode create_wstring_tc(int bound) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (bound < 0) + throw new BAD_PARAM("Illegal string length " + bound); + + return new WStringTypeCode(bound); + } + + /** + * Free all the ORB resources: connections and threads. + */ + + synchronized public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + // The thread is serving a request? + + if (initPOACurrent().inContext()) { // yes, it is in the serving request + // context + + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.shutdown(); + + m_state.waitForShutdown(); + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + * m_comm_layer.destroy(); + */ + this.communicationManager.destroy(); + this.communicationManager = null; + + + if (m_trace != null) { + try { + printTrace(Trace.USER, "Closing ORB Session."); + m_trace.close(); + } + catch (Throwable th) {} + + m_trace = null; + } + + if (m_value_factories != null) + m_value_factories.clear(); + + m_value_factories = null; + + if (m_codec_factory != null) { + m_codec_factory.destroy(); + m_codec_factory = null; + } + + if (m_dyn_factory != null) { + m_dyn_factory.destroy(); + m_dyn_factory = null; + } + + m_orb_services.destroy(); + m_orb_services = null; + + m_root_POA = null; + + if (m_current != null) { + m_current.destroy(); + m_current = null; + } + + m_destroyed = true; + } + + public boolean destroyed() + { + return m_destroyed; + } + + public void disconnect(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated + */ + public org.omg.CORBA.Current get_current() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + return m_current; + } + + public org.omg.CORBA.Context get_default_context() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Request get_next_response() + throws org.omg.CORBA.WrongTransaction + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.TypeCode get_primitive_tc(org.omg.CORBA.TCKind tcKind) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (tcKind == null) + throw new BAD_PARAM("Null TCKind reference", 0, + CompletionStatus.COMPLETED_NO); + + return TypeCodeFactory.getBasicTypeCode(tcKind); + } + + public boolean + get_service_information( short service_type, + ServiceInformationHolder service_info) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + // corba 2.3 operations + + // always return a ValueDef or throw BAD_PARAM if not repid of a value + public org.omg.CORBA.Object get_value_def(String repid) + throws org.omg.CORBA.BAD_PARAM + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + public CommunicationManager getCommunicationManager(){ + if ( m_destroyed ){ + throw new OBJECT_NOT_EXIST(); + } + return this.communicationManager; + } + + + + public es.tid.TIDorbj.core.policy.PolicyContextManager + getPolicyContextManager() + { + return m_thread_policy_context_manager; + } + + public es.tid.TIDorbj.core.policy.PolicyManagerImpl getPolicyManager() + { + return initPolicyManager(); + } + + public es.tid.TIDorbj.core.compression.CompressionManagerImpl getCompressionManager() + { + return initCompressionManager(); + } + + public es.tid.TIDorbj.core.typecode.TypeCodeCache getTypeCodeCache() + { + return m_typecode_cache; + } + + public RequestCounter getRequestCounter() + { + return this.requestCounter; + } + + + // CORBA 2.5 + public String id() + { + return m_conf.orb_id; + } + + // ORB Services + + public es.tid.TIDorbj.core.poa.POAImpl initPOA() { + synchronized (this) { + if (m_root_POA == null) { + m_root_POA = + es.tid.TIDorbj.core.poa.POAImpl.createRootPOA(this); + + + // init the orb listening points (usually one for each layer) + try { + this.communicationManager.setServerModeEnabled( true ); + } catch ( CommunicationException ce ) { + throw new INITIALIZE( "Unable to activate server mode: " + ce.getMessage() ); + } + + m_state.running(); + } + } + + return m_root_POA; + } + + public es.tid.TIDorbj.core.poa.CurrentImpl initPOACurrent() + { + synchronized (this) { + if (m_current == null) { + m_current = new es.tid.TIDorbj.core.poa.CurrentImpl(this); + } + } + + return m_current; + } + + public String[] list_initial_services() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_orb_services.listInitialServices(); + } + + public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + return (org.omg.CORBA.portable.ValueFactory) m_value_factories.get(id); + } + + public String object_to_string(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return IOR.nullIOR().toString(); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj) + ._get_delegate(); + + if (obj instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, + CompletionStatus.COMPLETED_NO); + + if (delegate instanceof CommunicationDelegate) + return ((CommunicationDelegate) delegate).toString(); + else + throw new BAD_PARAM("This Object has not been create by TIDorb", + 0, + CompletionStatus.COMPLETED_NO); + } + + public String objectToURL(org.omg.CORBA.Object obj) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (obj == null) + return Corbaloc.toURL(IOR.nullIOR()); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + //TODO: refactor URL/String IOR stuff + return ((CommunicationDelegate) delegate).getReference().toURL(); + } else + throw new BAD_PARAM("This Object has not been create by TIDorb", 0, + CompletionStatus.COMPLETED_NO); + } + + public void perform_work() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public boolean poll_next_response() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void printTrace(int level, String message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printTrace(int level, String message, Throwable e) + { + if (m_trace != null) + m_trace.printStackTrace(level, message, e); + } + + public void printTrace(int level, String[] message) + { + if (m_trace != null) + m_trace.print(level, message); + } + + public void printDump(int level, byte[] message, int length) + { + if (m_trace != null) + m_trace.dump(level, message, length); + } + + public void register_initial_reference(String object_name, + org.omg.CORBA.Object obj) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.registerInitialReference(object_name, obj); + } + + public org.omg.CORBA.portable.ValueFactory + register_value_factory( String id, + org.omg.CORBA.portable.ValueFactory factory) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + synchronized (m_value_factories) { + if (m_value_factories.containsKey(id)) + return null; + m_value_factories.put(id, factory); + } + + return factory; + } + + public void removeInitialReference(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + m_orb_services.removeInitialReference(object_name); + } + + public org.omg.CORBA.Object resolve_initial_references(String object_name) + throws org.omg.CORBA.ORBPackage.InvalidName + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (object_name == null) + throw new BAD_PARAM("Null String reference", 24, + CompletionStatus.COMPLETED_NO); + + return m_orb_services.resolveService(object_name); + } + + public void run() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (m_root_POA == null) { + throw new org.omg.CORBA.INTERNAL("RootPOA has not been created."); + } + + m_state.waitForShutdown(); + } + + public void send_multiple_requests_deferred(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void send_multiple_requests_oneway(org.omg.CORBA.Request[] req) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < req.length; i++) + req[i].send_oneway(); + } + + public void set_delegate(java.lang.Object wrapper) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + if (wrapper instanceof org.omg.PortableServer.Servant) { + org.omg.PortableServer.Servant servant = + (org.omg.PortableServer.Servant) wrapper; + + if (m_root_POA == null) { + initPOA(); + } + + try { + org.omg.CORBA.ORB servantOrb = servant._orb(); + if ( servantOrb != this ) { + throw new + BAD_PARAM("Servant is already active in another ORB"); + } + } + catch (org.omg.CORBA.BAD_INV_ORDER e) { + try { + m_root_POA.activate_object(servant); + + // Exceptions should never be thrown + } catch (org.omg.PortableServer.POAPackage.WrongPolicy wp) + { + } + catch (org.omg.PortableServer.POAPackage.ServantAlreadyActive s) + { + } + } + } else + throw new BAD_PARAM("Servant expected"); + + } + + public void shutdown(boolean wait_for_completion) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + m_state.shutdown(); + + if (wait_for_completion) { + if (initPOACurrent().inContext()) { + // yes, it is in the serving request context + throw new BAD_INV_ORDER(3, CompletionStatus.COMPLETED_NO); + } + + m_state.waitForShutdown(); + } + } + + public org.omg.CORBA.Object string_to_object(String str) + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (str == null) { + throw new BAD_PARAM("Null String reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (str.startsWith("corbaname:")) + return corbanameUrlToObject(str); + + if (str.startsWith("file://")) + return fileUrlToObject(str); + + if (str.startsWith("corbaloc:rir:")) + return rirUrlToObject(str); + + if (str.startsWith("corbaloc:tidorbj:")) + return tidorbjUrlToObject(str); + + + Delegate delegate; + try { + delegate = this.communicationManager.createDelegate( str ); + } catch ( CommunicationException ce){ + delegate = null; + } + if ( delegate != null ){ + ObjectImpl o = new ObjectImpl(); + o._set_delegate( delegate ); + return o; + } else { + throw new BAD_PARAM( + "UNKNOWN String reference", 0, CompletionStatus.COMPLETED_NO + ); + } + /* + return iorToObject(str); + */ + } + + /* + * PRIVATE METHODS + * */ + public POAKey resolvePOAKey( ObjectKey objectKey ) + throws ForwardRequest + { + if( objectKey != null ){ + //not initialized to check every condition against compiler :) + POAKey key; + try { + /* + * Usually successfull for local requests, because objectKey + * comes directly from an IOR. We shouldn't know this right here + */ + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } catch (Throwable th) { + key = null; + } + + if(key != null) { + return key; + } + + + /* + * If objectKey comes from a remote request, it must be resolved + * through the ORB. + * First: try to get the URL, and after that, resolve it against + * registered initial references + */ + String urlKey = objectKey.getURL(); + org.omg.CORBA.Object reference = null; + + if ( urlKey != null ) { + + if ( urlKey != null ) { + + String initialReference; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + /* + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve url reference: ", + urlKey, " ", ce.getMessage() + } + ); + } + */ + initialReference = null; + }//initialReference retrieval + + if(initialReference == null) { + initialReference = urlKey; + } + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( Throwable th ){ + if ( m_trace != null ){ + m_trace.print( + Trace.ERROR, + new String[]{ + "Unable to resolve initial reference reference: ", + initialReference, " ", th.getMessage() + } + ); + } + reference = null; + } + if ( reference != null ) { + if ( reference instanceof IOR ){ + objectKey = (( IOR )reference ).getObjectKey(); + } else { + org.omg.CORBA.portable.ObjectImpl ref = + (org.omg.CORBA.portable.ObjectImpl)reference; + CommunicationDelegate delegate = + ( CommunicationDelegate ) ref._get_delegate(); + objectKey = delegate.getReference().getObjectKey(); + } + if ( objectKey != null ) { + if ( objectKey instanceof POAKey ){ + key = ( POAKey )objectKey; + } else { + key = POAKey.createKey( objectKey.getMarshaledKey() ); + } + } else { + throw new INTERNAL(); + } + } else { + key = null; + }//reference = null + }//generic url, delegate in communication layers + // URL resolution: object key = service url + // it must throw a ForwardRequest + if ( key != null ){ + return key; + } else { + throw new ForwardRequest(resolveGenericURL(urlKey)); + } + + } else { //unable to get url from objectKey + throw new INV_OBJREF( "Invalid Object Key" ); + } + } else { + throw new INV_OBJREF( "ObjectKey cannot be null" ); + } + }//resolvePOAKey + + + /** + * Generic URL resolution + * @throws ForwardRequest + */ + protected org.omg.CORBA.Object resolveGenericURL(String urlKey) + { + POAKey key; + + + String initialReference = null; + try { + initialReference = + this.communicationManager.getInitialReference( + urlKey + ); + } catch ( CommunicationException ce ){ + throw new OBJECT_NOT_EXIST("Invalid object key: " + urlKey); + }//initialReference retrieval + + + org.omg.CORBA.Object reference = null; + + try { + reference = resolve_initial_references( + initialReference + ); + } catch ( InvalidName th ){ + StringBuffer msg = new StringBuffer(); + msg.append("Unable to resolve initial reference reference: "); + msg.append(initialReference); + msg.append(" from "); + msg.append(urlKey); + throw new OBJECT_NOT_EXIST(msg.toString()); + } + + return reference; + } + + + + public String toString() + { + if (m_orb_name == null) { + + java.util.Date date; + + date = new java.util.Date(System.currentTimeMillis()); + + StringBuffer name = new StringBuffer(); + name.append("TIDorbj "); + name.append(st_version); + name.append(" (id=\""); + name.append(m_conf.orb_id); + name.append("\") ["); + + name.append( this.communicationManager.toString() ); + + name.append("] created at "); + name.append(date.toString()); + + m_orb_name = name.toString(); + } + + return m_orb_name; + + } + + public void unregister_value_factory(String id) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + synchronized (m_value_factories) { + if (m_value_factories.remove(id) == null) + throw new BAD_PARAM(); + } + } + + /** + * Operation called by threads in the ORB that are listening for the ORB + * shutdown + * + * @return true if the ORB is shutdowning, of false if the timeout is over + */ + + public boolean waitShutdown(long millis) + { + return m_state.waitForShutdown(millis); + } + + public boolean work_pending() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_state.isShutdowned()) + throw new BAD_INV_ORDER(4, CompletionStatus.COMPLETED_NO); + + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + //PRE: str starts with corbaname: + + protected org.omg.CORBA.Object corbanameUrlToObject(String str) + { + try { + return Corbaname.toObject(this, str); + } + catch (Exception e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void doCompleteShutdown() + { + java.lang.Object[] mgrs = new java.lang.Object[m_POAManagers.size()]; + + m_POAManagers.copyInto(mgrs); + + for (int i = 0; i < mgrs.length; i++) { + org.omg.PortableServer.POAManager mgr = + (org.omg.PortableServer.POAManager) mgrs[i]; + try { + mgr.deactivate(true /* etherealize objects */, + true /* wait_for_completion */); + } + catch (Exception e) {} + } + + try { + if (m_root_POA != null) + m_root_POA.destroy(false, true); + } + catch (Exception e) {} + + try { + if ( this.communicationManager != null ){ + this.communicationManager.shutdown( true ); + } + } + catch (Exception e) {} + + m_state.shutdowned(); + } + + // PRE str starts with file: + + protected org.omg.CORBA.Object fileUrlToObject(String str) + { + String file_str = str.substring(7); + String file_url = null; + + if (file_str.length() == 0) + throw new BAD_PARAM(file_str); + try { + java.io.FileReader file_r = new java.io.FileReader(file_str); + java.io.BufferedReader url_r = new java.io.BufferedReader(file_r); + + file_url = url_r.readLine(); + url_r.close(); + + } catch (java.io.FileNotFoundException fnf) { + throw new BAD_PARAM("Invalid file url"); + } catch (SecurityException se) { + throw new NO_PERMISSION( + se.getMessage(), 0, CompletionStatus.COMPLETED_NO + ); + } catch (Throwable th) { + throw new UNKNOWN( + th.toString(), 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( file_url != null && !file_url.startsWith("file:") ) { + return string_to_object( file_url ); + } else { + throw new BAD_PARAM( "No file url allowed in a file" ); + } + } + + /** + * Destructor. + */ + + protected void finalize() + { + if (!m_destroyed) + destroy(); + } + + // PRE str starts with corbaloc:iiop: or corbaloc:: + + //TODO: this should come from the communications layers + protected org.omg.CORBA.Object iiopUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + CommunicationDelegate delegate = null; + + try { + ior = IIOPCorbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + //TODO: should the communicationsManager (or the related layer) store + //a cache of delegates for each IOR? + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + protected es.tid.TIDorbj.core.CodecFactoryImpl initCodecFactory() + { + synchronized (this) { + if (m_codec_factory == null) + m_codec_factory = new CodecFactoryImpl(this); + } + return m_codec_factory; + } + + protected es.tid.TIDorbj.dynAny.DynAnyFactoryImpl initDynAnyFactory() + { + synchronized (this) { + if (m_dyn_factory == null) { + try { + m_dyn_factory = + new es.tid.TIDorbj.dynAny.DynAnyFactoryImpl(); + m_dyn_factory.set_orb(this); + } + catch (Throwable th) { + throw new INITIALIZE("Cannot Initialize DynAnyFactory", 0, + CompletionStatus.COMPLETED_NO); + } + } + } + return m_dyn_factory; + } + + /** + * ORB initialization. This method will be invoked by + * set_parametres(). + */ + + protected void initOrb() + { + try { + /** + * TODO: remove CommLayer usage and migrate to CommunicationManager + */ + this.communicationManager = CommunicationManager.getInstance( this ); + + m_POAManagers = new java.util.Vector(); + + m_value_factories = new java.util.Hashtable(); + + m_orb_services = new ORBServices(this); + + m_thread_policy_context_manager = + new es.tid.TIDorbj.core.policy.PolicyContextManager(this); + + setupInitialReferences(); + + if (m_conf.typecode_cache_size > 0) + m_typecode_cache = + new es.tid.TIDorbj.core.typecode.TypeCodeCache( + m_conf.typecode_cache_size); + + if (m_conf.trace_level != Trace.NONE) { + m_trace = getTrace(); + + + m_trace.print(Trace.ERROR, "ORB initialization OK!"); + + m_conf.dump(m_trace.getLog()); + m_trace.flush(); + } + + } + catch (Throwable e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + public synchronized Trace getTrace() + throws IOException + { + if (m_trace == null) { + if (m_conf.trace_file != null) { + if (m_conf.trace_num_files > 1) { + + CircularTraceFile ctf = + new CircularTraceFile(m_conf.trace_num_files, + m_conf.trace_file_size, + m_conf.trace_file); + m_trace = Trace.createTrace(ctf, toString(), + m_conf.trace_level); + } else { + m_trace = Trace.createTrace(m_conf.trace_file, toString(), + m_conf.trace_level); + } + + } else { + m_trace = Trace.createTrace(toString(), m_conf.trace_level); + } + } + + return m_trace; + } + + protected es.tid.TIDorbj.core.policy.PolicyCurrentImpl initPolicyCurrent() + { + synchronized (this) { + if (m_policy_current == null) + m_policy_current = + new es.tid.TIDorbj.core.policy.PolicyCurrentImpl + (m_thread_policy_context_manager); + } + return m_policy_current; + } + + protected es.tid.TIDorbj.core.compression.CompressionManagerImpl initCompressionManager() + { + synchronized (this) { + if (m_compression_manager == null) + m_compression_manager = + new es.tid.TIDorbj.core.compression.CompressionManagerImpl + (this); + } + return m_compression_manager; + } + + protected es.tid.TIDorbj.core.messaging.AMIManager initAMIManager() + { + synchronized (this) { + if (m_ami_manager == null) + m_ami_manager = + new es.tid.TIDorbj.core.messaging.AMIManager(this); + } + return m_ami_manager; + } + + protected es.tid.TIDorbj.core.policy.PolicyManagerImpl initPolicyManager() + { + synchronized (this) { + if (m_orb_policy_manager == null) + m_orb_policy_manager = + new es.tid.TIDorbj.core.policy.PolicyManagerImpl(this); + } + return m_orb_policy_manager; + } + + //PRE: str starts with corbaloc:rir: + + protected org.omg.CORBA.Object rirUrlToObject(String str) + { + if (!str.startsWith("corbaloc:rir:/")) + throw new BAD_PARAM(str); + try { + return resolve_initial_references(str.substring(14)); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void set_parameters(java.applet.Applet app, + java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(app, props); + initOrb(); + } + + // CORBA ORB standard methods + + protected void set_parameters(String[] args, java.util.Properties props) + { + // read params + m_conf = new ConfORB(); + m_conf.init(args, props); + initOrb(); + } + + protected void setupInitialReferences() + { + int references = m_conf.initial_references.size(); + + InitialReference ref = null; + + for (int i = 0; i < references; i++) { + ref = (InitialReference) m_conf.initial_references.elementAt(i); + m_orb_services.setService(ref.getName(), + string_to_object(ref.getURL())); + } + + } + + //PRE: str starts with corbaloc:tidorbj: + protected org.omg.CORBA.Object tidorbjUrlToObject(String str) + { + IOR ior; + ObjectImpl object = null; + Delegate delegate = null; + + try { + ior = Corbaloc.getIOR(str); + } + catch (org.omg.CORBA.ORBPackage.InvalidName e) { + throw new BAD_PARAM(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + + try { + delegate = this.communicationManager.createDelegate( ior ); + } catch ( CommunicationException e ){ + throw new BAD_PARAM( e.getMessage(), 0, CompletionStatus.COMPLETED_NO ); + } + + object = new ObjectImpl(); + object._set_delegate(delegate); + return object; + } + + public es.tid.TIDorbj.core.messaging.AMIManager getAMIManager() { + return initAMIManager(); + } + + public void setORBservice(String object_name, + org.omg.CORBA.Object obj) { + m_orb_services.setService(object_name, obj); + } + +} diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/all-wcprops b/source/es/tid/TIDorbj/core/cdr/.svn/all-wcprops new file mode 100644 index 0000000..1b44ac8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/all-wcprops @@ -0,0 +1,101 @@ +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr +END +PositionsNode.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/PositionsNode.java +END +TypeCodeReader.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/TypeCodeReader.java +END +ChunkCDR.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/ChunkCDR.java +END +MarkCDR.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/MarkCDR.java +END +IteratorCDR.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/IteratorCDR.java +END +ContextCDR.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/ContextCDR.java +END +AbsolutePosition.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/AbsolutePosition.java +END +IndirectionNode.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/IndirectionNode.java +END +CDRInputStream.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/CDRInputStream.java +END +ValueTypeInfo.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/ValueTypeInfo.java +END +AlignmentOffset.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/AlignmentOffset.java +END +Encapsulation.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/Encapsulation.java +END +PointerCDR.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/PointerCDR.java +END +CDROutputStream.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/CDROutputStream.java +END +BufferCDR.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/BufferCDR.java +END +CDR.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr/CDR.java +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/entries b/source/es/tid/TIDorbj/core/cdr/.svn/entries new file mode 100644 index 0000000..eb18cb4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/entries @@ -0,0 +1,572 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/cdr +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2007-12-12T07:57:20.370621Z +153 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TypeCodeReader.java +file + + + + +2009-05-27T12:24:01.000000Z +18d927e9ac1384e9ac3618da0d26b5d8 +2007-12-12T07:57:20.370621Z +153 +avega +has-props + + + + + + + + + + + + + + + + + + + + +7715 + +ChunkCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +167e3fe140882a22a017ccaa51159221 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4120 + +BufferCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +8c9ad57865690abec51a9d71c87446a4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7595 + +AbsolutePosition.java +file + + + + +2009-05-27T12:24:01.000000Z +9bfe403497724b2262ca947995bf0583 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3304 + +CDRInputStream.java +file + + + + +2009-05-27T12:24:01.000000Z +c0585fe0b3a7fa386c80be4b0495b4aa +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +77188 + +Encapsulation.java +file + + + + +2009-05-27T12:24:01.000000Z +027de67f73a1925f3268e45880232a45 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7658 + +CDROutputStream.java +file + + + + +2009-05-27T12:24:01.000000Z +b79a0b6ace0281d0ae0d4d667576cc72 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +58480 + +CDR.java +file + + + + +2009-05-27T12:24:01.000000Z +5ef04c925d6dc94da0e192062c4ff097 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6928 + +PointerCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +19745151eef1cb73696a71f3bc317b57 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3660 + +IndirectionNode.java +file + + + + +2009-05-27T12:24:01.000000Z +4a2f3bcb68ce2017d7bd34f4ab77c012 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3244 + +ContextCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +f5c472eb531173ebd8a2f9d9f46df5c5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7093 + +IteratorCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +42f96d3ba6e8aa745c7a867b2f0f366f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +12051 + +MarkCDR.java +file + + + + +2009-05-27T12:24:01.000000Z +4c1a723b74e7f5d0578b4dfbe13956f7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2187 + +AlignmentOffset.java +file + + + + +2009-05-27T12:24:01.000000Z +f088c7db264911e29e7f6e0e9218081e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3007 + +ValueTypeInfo.java +file + + + + +2009-05-27T12:24:01.000000Z +cb95d05ce81d6ca35dfaff60ca8bfaec +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9946 + +PositionsNode.java +file + + + + +2009-05-27T12:24:01.000000Z +19a2be9517fd6f10eccf2c31f2db90f4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4553 + diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AbsolutePosition.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AbsolutePosition.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AbsolutePosition.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AlignmentOffset.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AlignmentOffset.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/AlignmentOffset.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/BufferCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/BufferCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/BufferCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDRInputStream.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDRInputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDRInputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDROutputStream.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDROutputStream.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/CDROutputStream.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ChunkCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ChunkCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ChunkCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ContextCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ContextCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ContextCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/Encapsulation.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/Encapsulation.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/Encapsulation.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IndirectionNode.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IndirectionNode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IndirectionNode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IteratorCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IteratorCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/IteratorCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/MarkCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/MarkCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/MarkCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PointerCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PointerCDR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PointerCDR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PositionsNode.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PositionsNode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/PositionsNode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/TypeCodeReader.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/TypeCodeReader.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/TypeCodeReader.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ValueTypeInfo.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ValueTypeInfo.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/prop-base/ValueTypeInfo.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AbsolutePosition.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AbsolutePosition.java.svn-base new file mode 100644 index 0000000..74191be --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AbsolutePosition.java.svn-base @@ -0,0 +1,125 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents the absolute position in the CDR buffer of any data. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ +public class AbsolutePosition +{ + + /** + * The absulute position in the buffer; + */ + + private int m_value; + + private AbsolutePosition(int position) + { + m_value = position; + } + + public static AbsolutePosition createAbsolutePosition(int position) + { + if (position < 0) + return null; + return new AbsolutePosition(position); + } + + public int getValue() + { + return m_value; + } + + public int hashCode() + { + return m_value; + } + + public boolean equals(java.lang.Object obj) + { + if (obj instanceof AbsolutePosition) + return m_value == ((AbsolutePosition) obj).m_value; + else + return false; + } + + /** + * Calculates the offset from another Absolute Position. + * + * @return the offset ( <0 if the other position is higher than the actual + * position or >0 otherwise) + */ + + public int offset(AbsolutePosition from) + { + return m_value - from.m_value; + } + + public AbsolutePosition addOffset(int offset) + { + if (m_value + offset < 0) + return null; + else + return new AbsolutePosition(m_value + offset); + } + + /** + * Alings the position for the given type size. The aligment is refered to + * the absolute position. + * + * @param type_size + * the data type size. + */ + + public void align(int type_size) + { + int gap, rest; + rest = m_value % type_size; + gap = (rest == 0) ? 0 : type_size - rest; + m_value += gap; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AlignmentOffset.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AlignmentOffset.java.svn-base new file mode 100644 index 0000000..fa4ea16 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/AlignmentOffset.java.svn-base @@ -0,0 +1,93 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents an correction aligment offset from a position in the buffer of an + * encapsulation. This aligment offset is the number of positions that the + * beginning of the encapsulation needs to be aligned to the maximun data size + * (longlong) representing the 0 position. + *

+ * The offset is calculated by the factory operation + * calculateOffset: + *

+ * The offset value is defined in a range of [0..MAX_ALIGNMENT-1]. + * offset = CDR.MAX_ALIGNMENT- (actual_positon % CDR.MAX_ALIGNMENT) The Aligment + * offet requires the GIOP message size to be multiple of + * CDR.MAX_ALIGNMENT, that is, 8, for allowing fragmentation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class AlignmentOffset +{ + + /** + * The offset value. It must be [0..MAX_ALIGNMENT-1]. + */ + public int m_value; + + /** + * Private constructor. Use calculateOffsetFrom. + */ + private AlignmentOffset(int offset) + { + m_value = offset; + } + + /** + * Object Factory, that calculates the correct offset for a position. + */ + + public static AlignmentOffset calculateOffsetFrom(int position) + { + int offset = (CDR.MAX_ALIGNMENT - (position % CDR.MAX_ALIGNMENT)); + // makes the offset 0 if its the MAX_ALIGNMENT + if (offset == CDR.MAX_ALIGNMENT) + offset = 0; + + return new AlignmentOffset(offset); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/BufferCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/BufferCDR.java.svn-base new file mode 100644 index 0000000..9419f93 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/BufferCDR.java.svn-base @@ -0,0 +1,290 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Vector; + +/** + * represents a marshaled octet IIOP stream thad can be splitted in chunks. + *

+ * This buffer will exentialy used for store chunks received from a conection + * for reading data. Also, the buffer can be used for marshal a octet stream. In + * this case, the buffer can be monochunk or multichunk an growable or not. + *

+ * The buffer can be transformed in a String or byte array for storing IIOP + * data. The String and byte array formats allows regenerate the buffer. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class BufferCDR +{ + + /** + * Header size in the array format. + */ + final static int ARRAY_HEADER_SIZE = 5; + + /** + * Header size in the string format. + */ + public final static int STRING_HEADER_SIZE = 14; + + /** + * Vector that contains the buffer chunks. + */ + protected Vector m_chunks; + + /** + * The size of the new chunks. + */ + + protected int m_chunk_size; + + /** + * Creates a new empty buffer monochunk for marshaling. + */ + + public BufferCDR(int block_size) + { + m_chunks = new Vector(); + m_chunk_size = block_size; + addChunk(new ChunkCDR(m_chunk_size)); + } + + /** + * Creates a buffer monochunk with the array. + */ + + public BufferCDR(byte[] buffer) + { + m_chunks = new Vector(); + m_chunk_size = buffer.length; + addChunk(new ChunkCDR(buffer)); + } + + /** + * Creates a buffer monochunk with the chunk. + */ + + public BufferCDR(ChunkCDR chunk) + { + m_chunks = new Vector(); + m_chunk_size = chunk.m_buffer.length; + addChunk(chunk); + } + + /** + * Returns the number of chunks. + */ + public int getNumChunks() + { + return m_chunks.size(); + } + + /** + * @return true if it has an unique chunk, false + * otherwise. + */ + public boolean isMonoChunk() + { + return (m_chunks.size() == 1); + } + + /** + * @return the chunk associated to de index, or null if not + * exits. + */ + public ChunkCDR getChunk(int index) + { + if (index < m_chunks.size()) + return (ChunkCDR) m_chunks.elementAt(index); + else + return null; + } + + /** + * Prepare the buffer to be reused. + */ + public void recycle() + { + int num_chunks = getNumChunks(); + for (int i = 0; i < num_chunks; i++) + ((ChunkCDR) m_chunks.elementAt(i)).recycle(); + } + + /** + * Insert a new chunk in the buffer. + */ + public boolean addChunk(ChunkCDR chunk) + { + m_chunks.addElement(chunk); + return true; + } + + /** + * Insert a new chunk in the buffer at a position less than the buffer size. + */ + public boolean insertChunk(ChunkCDR chunk, int at) + { + if (at >= m_chunks.size()) + return false; + m_chunks.insertElementAt(chunk, at); + return true; + } + + /** + * Creates and inserts a new chunk ant the end of the buffer. + * + * @return true if OK or false on error; + */ + + public boolean grow() + { + if (m_chunk_size > 0) { + addChunk(new ChunkCDR(m_chunk_size)); + return true; + } else + return false; + } + + public boolean grow_1_0() + { + if (m_chunk_size > 0) { + + if (m_chunks.size() != 1) + return false; + ChunkCDR chunk = getChunk(0); + + byte[] aux_buffer = new byte[chunk.m_buffer.length + m_chunk_size]; + + System.arraycopy(aux_buffer, 0, chunk.m_buffer, 0, + chunk.m_buffer.length); + + chunk.setBuffer(aux_buffer); + + return true; + + } else + return false; + } + + public PointerCDR getPointer(int position) + { + //pre: position < available + + int num_chunk = 0; + int chunk_available = 0; + int available = 0; + while (num_chunk < m_chunks.size()) { + chunk_available = getChunk(num_chunk).getAvailable(); + if (position <= chunk_available + available - 1) + break; // this is the position + available += chunk_available; + num_chunk++; + } + + if (num_chunk >= m_chunks.size()) + return null; + + return new PointerCDR(this, num_chunk, position - available); + } + + public int getAvailable() + { + int available = 0; + int num_chunks = m_chunks.size(); + for (int i = 0; i < num_chunks; i++) + available += getChunk(i).getAvailable(); + + return available; + } + + public int getNumAvailableChunks() + { + int available = 0; + int num_chunks = m_chunks.size(); + for (int i = 0; i < num_chunks; i++) { + if (getChunk(i).getAvailable() > 0) + available++; + else + break; + } + + return available; + } + + /** + * Compares the data of two BufferCDR + * + * @return true if the data contained is equal. + */ + public boolean equal(BufferCDR buff) + { + int available = getAvailable(); + if (available != buff.getAvailable()) + return false; + int num_chunks = getNumAvailableChunks(); + + if (num_chunks != buff.getNumAvailableChunks()) + return false; + + for (int i = 0; i < num_chunks; i++) + if (getChunk(i).getAvailable() != buff.getChunk(i).getAvailable()) + return false; + + byte[] buffer_a, buffer_b; + for (int i = 0; i < num_chunks; i++) { + buffer_a = getChunk(i).getBuffer(); + buffer_b = buff.getChunk(i).getBuffer(); + int size = getChunk(i).getAvailable(); + for (int j = 0; j < size; j++) + if (buffer_a[j] != buffer_b[j]) + return false; + } + + return true; + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDR.java.svn-base new file mode 100644 index 0000000..277d141 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDR.java.svn-base @@ -0,0 +1,151 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Collection of Basic Data type representation sizes in CDR. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDR +{ + + public final static int MAX_ALIGNMENT = 8; + + public final static int OCTET_SIZE = 1; + + public final static int BOOLEAN_SIZE = 1; + + public final static int CHAR_SIZE = 1; + + public final static int WCHAR_SIZE = 2; + + public final static int SHORT_SIZE = 2; + + public final static int USHORT_SIZE = 2; + + public final static int LONG_SIZE = 4; + + public final static int ULONG_SIZE = 4; + + public final static int FLOAT_SIZE = 4; + + public final static int LONGLONG_SIZE = 8; + + public final static int ULONGLONG_SIZE = 8; + + public final static int DOUBLE_SIZE = 8; + + //NOT IMPLEMENTED: + //public final static int LONG_DOUBLE_SIZE = 16; + + public final static boolean BIG_ENDIAN = false; + + public final static boolean LITTLE_ENDIAN = true; + + public final static boolean LOCAL_BYTE_ORDER = BIG_ENDIAN; + + /** + * Helper array to convert bytes to chars: the char is a component of the + * array, indexed by the byte value. + */ + public static final int[] CHAR_MAP = { 256 - 128, 256 - 127, 256 - 126, + 256 - 125, 256 - 124, 256 - 123, + 256 - 122, 256 - 121, 256 - 120, + 256 - 119, 256 - 118, 256 - 117, + 256 - 116, 256 - 115, 256 - 114, + 256 - 113, 256 - 112, 256 - 111, + 256 - 110, 256 - 109, 256 - 108, + 256 - 107, 256 - 106, 256 - 105, + 256 - 104, 256 - 103, 256 - 102, + 256 - 101, 256 - 100, 256 - 99, + 256 - 98, 256 - 97, 256 - 96, + 256 - 95, 256 - 94, 256 - 93, + 256 - 92, 256 - 91, 256 - 90, + 256 - 89, 256 - 88, 256 - 87, + 256 - 86, 256 - 85, 256 - 84, + 256 - 83, 256 - 82, 256 - 81, + 256 - 80, 256 - 79, 256 - 78, + 256 - 77, 256 - 76, 256 - 75, + 256 - 74, 256 - 73, 256 - 72, + 256 - 71, 256 - 70, 256 - 69, + 256 - 68, 256 - 67, 256 - 66, + 256 - 65, 256 - 64, 256 - 63, + 256 - 62, 256 - 61, 256 - 60, + 256 - 59, 256 - 58, 256 - 57, + 256 - 56, 256 - 55, 256 - 54, + 256 - 53, 256 - 52, 256 - 51, + 256 - 50, 256 - 49, 256 - 48, + 256 - 47, 256 - 46, 256 - 45, + 256 - 44, 256 - 43, 256 - 42, + 256 - 41, 256 - 40, 256 - 39, + 256 - 38, 256 - 37, 256 - 36, + 256 - 35, 256 - 34, 256 - 33, + 256 - 32, 256 - 31, 256 - 30, + 256 - 29, 256 - 28, 256 - 27, + 256 - 26, 256 - 25, 256 - 24, + 256 - 23, 256 - 22, 256 - 21, + 256 - 20, 256 - 19, 256 - 18, + 256 - 17, 256 - 16, 256 - 15, + 256 - 14, 256 - 13, 256 - 12, + 256 - 11, 256 - 10, 256 - 9, 256 - 8, + 256 - 7, 256 - 6, 256 - 5, 256 - 4, + 256 - 3, 256 - 2, 256 - 1, 0, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127 }; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDRInputStream.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDRInputStream.java.svn-base new file mode 100644 index 0000000..7dfef07 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDRInputStream.java.svn-base @@ -0,0 +1,2324 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ValueFactory; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; +import es.tid.TIDorbj.core.util.FixedHolder; + +/** + * Portable InputStream for demarshalling. + *

+ * A CDRInputStream has an buffer iterator + * CDRIterator. The iterator maintains the data position and + * correct aligment, and TypeCode marshaling information. + * + * @see es.tid.TIDorbj.core.cdr.CDROutputStream + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDRInputStream extends org.omg.CORBA_2_3.portable.InputStream + implements org.omg.CORBA.DataInputStream +{ + + /** + * ORB instance that created the input stream. + */ + + TIDORB m_orb; + + /** + * GIOPVersion used. + */ + + GIOPVersion m_version; + + /** + * The buffer is a GIOP message. A GIOP Message implies that the GIOP Header + * space will be reserved in the BufferCDR, that is, each ChunkCDR will have + * the header size bytes allocated. + */ + + boolean m_is_message; + + /** + * Buffer iterator. + */ + + protected IteratorCDR m_iterator; + + /** + * Current chunk buffer. + */ + + protected byte[] m_chunk_buffer; + + /** + * Data buffer for Broken data splitted in to chunks in an encapsulations + */ + + protected byte[] m_data_buffer = null; + + protected static javax.rmi.CORBA.ValueHandler st_value_handler = null; + + + public CDRInputStream(TIDORB orb, byte[] buffer) + { + this(orb, new IteratorCDR(new BufferCDR(buffer))); + } + + public CDRInputStream(TIDORB orb, BufferCDR buffer) + { + this(orb, new IteratorCDR(buffer)); + } + + protected CDRInputStream(TIDORB orb, IteratorCDR iterator) { + this.m_orb = orb; + + if ( orb != null ){ + this.m_version = GIOPVersion.fromString ( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + } else { + this.m_version = GIOPVersion.fromString( + IIOPCommunicationLayerPropertiesInfo.DEFAULT_GIOP_VERSION + ); + } + + this.m_is_message = false; + this.m_iterator = iterator; + + m_chunk_buffer = iterator.m_chunk.m_buffer; + m_data_buffer = new byte[CDR.LONGLONG_SIZE]; + } + + // DataInputStream + static String[] st_data_input_ids = + { "IDL:omg.org/CORBA/DataInputStream:1.0" }; + + public String[] _truncatable_ids() + { + return st_data_input_ids; + } + + /** + * @return the GIOP version used to marshal. + */ + public GIOPVersion getVersion() + { + return m_version; + } + + /** + * Sets the GIOP version used to marshal. + */ + public void setVersion(GIOPVersion ver) + { + m_version = ver; + } + + /** + * @return true if the stream is a GIOP message. + */ + public boolean isMessage() + { + return m_is_message; + } + + /** + * Sets if the stream is a GIOP message. + */ + public void setMessage(boolean is) + { + m_is_message = is; + + if ((is) && (m_iterator.m_current_chunk_num == 0) + && (m_iterator.m_position == 0)) + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + } + + public org.omg.CORBA.ORB orb() + { + if (m_orb != null) + return m_orb; + else + return es.tid.TIDorbj.core.TIDORB.init(); + } + + /** + * Sets the stream byte order. + * + * @param byte_order + * if true little-endian, else big-endian + */ + public void setByteOrder(boolean byte_order) + { + m_iterator.setByteOrder(byte_order); + } + + /** + * @return the stream byte order, if true little-endian, else + * big-endian + */ + public boolean getByteOrder() + { + return m_iterator.getByteOrder(); + } + + /** + * @return the stream buffer + */ + public BufferCDR getBuffer() + { + return m_iterator.getBuffer(); + } + + /** + * @return the Encapsulation Context + */ + public ContextCDR getContextCDR() + { + return m_iterator.m_context; + } + + /** + * Creates a new Encapsulation Context with it own aligment an indirections. + */ + public void enterEncapsulation() + { + skipUlong(); // skip encapsulation size + // sets the real encapsulation start point + alignment(CDR.OCTET_SIZE); + m_iterator.enterEncapsulation(); + //sets the byte order + m_iterator.setByteOrder(read_boolean()); + } + + /** + * Close the Encapsulation Context, and restore the father Context. + * + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + public void exitEncapsulation() + { + m_iterator.exitEncapsulation(); + } + + /** + * Extract from the buffer an encapsulation, creating a new bufferCDR + * containing the octect sequence. + * + * @return a new CDRInputStream for reading the encapsulation. + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + public Encapsulation readEncapsulation() + { + return Encapsulation.read(this, m_version); + } + + public void skipEncapsulation() + { + int encapsulation_size = read_ulong(); + skipOctetArray(encapsulation_size); + } + + /** + * Sets the aligment offset in the current Context. + * + * @param pos + * the new offset + * @see es.tid.TIDorbj.core.cdr.AligmentOffset + */ + public void set_alignment_offset(int pos) + { + m_iterator.setAlignmentOffset(pos); + } + + /** + * @return the absolute value in the buffer order of the current position. + */ + public AbsolutePosition getAbsolutePosition() + { + return m_iterator.getPointer().getAbsolutePosition(); + } + + /** + * @return the current position in the buffer. + */ + + public PointerCDR getPointer() + { + return m_iterator.getPointer(); + } + + /** + * Jumps to the absolute position. + * + * @pram position the new position + */ + public void setPosition(AbsolutePosition position) + { + m_iterator.setPosition(position); + } + + /** + * @return a new inputstream pointing the same position. + */ + public CDRInputStream copy() + { + CDRInputStream stream = new CDRInputStream(m_orb, m_iterator.copy()); + stream.setMessage(m_is_message); + stream.setVersion(m_version); + return stream; + } + + public boolean read_boolean() + { + alignment(CDR.BOOLEAN_SIZE); + return ((m_chunk_buffer[m_iterator.m_position++] == 0) ? false : true); + } + + public void skipBoolean() + { + alignment(CDR.BOOLEAN_SIZE); + m_iterator.m_position++; + } + + public char read_char() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + alignment(CDR.CHAR_SIZE); + return (char) (0xff & m_chunk_buffer[m_iterator.m_position++]); + } + + public void skipChar() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + alignment(CDR.CHAR_SIZE); + m_iterator.m_position++; + } + + public char read_wchar() + { + + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + if (m_iterator.m_byte_order) + return (char) ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (char) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.WCHAR_SIZE); + if (m_iterator.m_byte_order) { + return (char) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (char) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipWchar() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + m_iterator.m_position += CDR.WCHAR_SIZE; + } else { + skip(CDR.WCHAR_SIZE); + } + } + + public byte read_octet() + { + alignment(CDR.OCTET_SIZE); + return m_chunk_buffer[m_iterator.m_position++]; + } + + public void skipOctet() + { + alignment(CDR.OCTET_SIZE); + m_iterator.m_position++; + } + + public short read_short() + { + if (alignment(CDR.SHORT_SIZE)) { + if (m_iterator.m_byte_order) + return (short) + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (short) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.SHORT_SIZE); + if (m_iterator.m_byte_order) { + return (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipShort() + { + if (alignment(CDR.SHORT_SIZE)) { + m_iterator.m_position += CDR.SHORT_SIZE; + } else { + skip(CDR.SHORT_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" short = ushort values will be handled by the + * user + */ + public short read_ushort() + { + if (alignment(CDR.SHORT_SIZE)) { + if (m_iterator.m_byte_order) + return (short) ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (short) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.USHORT_SIZE); + if (m_iterator.m_byte_order) { + return (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipUshort() + { + if (alignment(CDR.USHORT_SIZE)) { + m_iterator.m_position += CDR.USHORT_SIZE; + } else { + skip(CDR.USHORT_SIZE); + } + } + + public int read_long() + { + if (alignment(CDR.LONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + (m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24); + } else { + return + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.LONG_SIZE); + if (m_iterator.m_byte_order) { + return (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + return ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + } + } + + public void skipLong() + { + if (alignment(CDR.LONG_SIZE)) { + m_iterator.m_position += CDR.LONG_SIZE; + } else { + skip(CDR.LONG_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" int = positive ulong values will be handled by + * the user + */ + public int read_ulong() + { + if (alignment(CDR.ULONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + (m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24); + } else { + return + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.ULONG_SIZE); + if (m_iterator.m_byte_order) { + return (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + return ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + } + } + + public void skipUlong() + { + if (alignment(CDR.ULONG_SIZE)) { + m_iterator.m_position += CDR.ULONG_SIZE; + } else { + skip(CDR.ULONG_SIZE); + } + } + + public long read_longlong() + { + if (alignment(CDR.LONGLONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 8) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 56); + + } else { + return + (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.LONGLONG_SIZE); + if (m_iterator.m_byte_order) { + return ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + return (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + } + } + + public void skip_longlong() + { + if (alignment(CDR.LONGLONG_SIZE)) { + m_iterator.m_position += CDR.LONGLONG_SIZE; + } else { + skip(CDR.LONGLONG_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" longlong = positive ulonglong values will be + * handled by the user + */ + public long read_ulonglong() + { + if (alignment(CDR.ULONGLONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 8) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 56); + + } else { + return + (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.ULONGLONG_SIZE); + if (m_iterator.m_byte_order) { + return ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + return (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + } + } + + public void skipUlonglong() + { + if (alignment(CDR.ULONGLONG_SIZE)) { + m_iterator.m_position += CDR.ULONGLONG_SIZE; + } else { + skip(CDR.ULONGLONG_SIZE); + } + } + + public float read_float() + { + return java.lang.Float.intBitsToFloat(read_long()); + } + + public void skipFloat() + { + skipLong(); + } + + public double read_double() + { + return java.lang.Double.longBitsToDouble(read_longlong()); + } + + public void skipDouble() + { + skip_longlong(); + } + + public String read_string() + { + // read the string length, including the end of string '\0' character + int length = read_ulong(); + + if (length <= 0) + throw new MARSHAL("read_string: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + if (length == 1) { + skipChar(); //skip the null character + return ""; + } else { + char[] array = new char[length]; + readCharArrayAux(array, 0, length); + //skip the null character + return new String(array, 0, length - 1); + } + } + + public void skipString() + { + // read the string length, including the end of string '\0' character + int length = read_ulong(); + + if (length <= 0) + throw new MARSHAL("skip_string: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + skip(length); + } + + public String read_wstring() + { + // read the string length, in wstring there is a null '\0' character at + // the end + + int length = read_ulong(); + + // the length is the number of bytes in the wide-string + int real_length = 0; + + if (m_version == GIOPVersion.VERSION_1_2) { + real_length = (length / CDR.WCHAR_SIZE) - 1; + + } else if(m_version == GIOPVersion.VERSION_1_1) { + real_length = length - 1; + } else { + throw new MARSHAL("GIOP 1.0 does not supports wstring", + 6, + CompletionStatus.COMPLETED_NO); + } + + if (real_length < 0) + throw new MARSHAL( + "read_wstring: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + if (real_length == 0) { + skipWchar(); + return ""; + } else { + char[] array = new char[real_length]; + read_wchar_array(array, 0, real_length); + skipWchar(); // skiping the '\0' + return new String(array, 0, real_length); + } + } + + public void skipWstring() + { + // read the string length, in bytes, not including the end of string + // '\0' character + int length = read_ulong(); + skipOctetArray(length); + } + + public void read_boolean_array(boolean[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null boolean array reference.", 0, + CompletionStatus.COMPLETED_NO); + + int booleans_can_read = 0; + + // número de octetos que quedan por leer en el chunk actual + + int remain_booleans = length; + + int position = 0; + int stop_at = 0; + + while (remain_booleans > 0) { + + position = m_iterator.m_position; + + booleans_can_read = java.lang.Math.min(remain_booleans, + m_iterator.available()); + + stop_at = position + booleans_can_read; + + while (position < stop_at) { + value[offset++] = (m_chunk_buffer[position++] == 0) ? false + : true; + } + + m_iterator.m_position = stop_at; + remain_booleans -= booleans_can_read; + + if (remain_booleans > 0) { + getNextChunk(); + } + } + } + + public void skipBooleanArray(int length) + { + skip(length); + } + + public void read_char_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + readCharArrayAux(value, offset, length); + } + + public void readCharArrayAux(char[] value, int offset, int length) + { + int chars_can_read = 0; + int remain_chars = length; + int position = 0; + int stop_at = 0; + + while (remain_chars > 0) { + // calculates how many bytes the actual chunk has got. + chars_can_read = java.lang.Math.min(remain_chars, + m_iterator.available()); + + position = m_iterator.m_position; + + stop_at = position + chars_can_read; + + while (position < stop_at) + value[offset++] = (char) (m_chunk_buffer[position++] & 0xff); + + m_iterator.m_position = position; + remain_chars -= chars_can_read; + + if (remain_chars > 0) + getNextChunk(); + } + } + + public void skipCharArray(int length) + { + skip(length); + } + + public void read_wchar_array(char[] value, int offset, int length) + { + + if (value == null) + throw new BAD_PARAM("Null wchar array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos wchar que se pueden leer enteros + int wchars_can_read = 0; + + int position = 0; + + // numero de wchars que quedan + int remain_wchars = length; + + while (remain_wchars > 0) { + + if (!alignment(CDR.WCHAR_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.WCHAR_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (char) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + value[offset++] = (char) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + + remain_wchars--; + + } else { + position = m_iterator.m_position; + + wchars_can_read = java.lang.Math + .min( + remain_wchars, + m_iterator.available() + / CDR.WCHAR_SIZE); + + for (int i = wchars_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (char) ((m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8)); + else + value[offset++] = + (char) (((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_wchars -= wchars_can_read; + m_iterator.m_position = position; + + if (remain_wchars > 0) { + getNextChunk(); + } + } + } + } + + public void skipWcharArray(int length) + { + if (length > 0) { + alignment(CDR.WCHAR_SIZE); + skip(length * CDR.WCHAR_SIZE); + } + } + + public void read_octet_array(byte[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + readOctetArrayAux(value, offset, length); + } + + public void readOctetArrayAux(byte[] value, int offset, int length) + { + int to_read, how_many = length; + + while (how_many > 0) { + + // calculates how many bytes the actual chunk has got. + to_read = java.lang.Math.min(how_many, m_iterator.available()); + + System.arraycopy(m_chunk_buffer, m_iterator.m_position, value, + offset, to_read); + + offset += to_read; + m_iterator.m_position += to_read; + how_many -= to_read; + + if (how_many > 0) + getNextChunk(); + + } + } + + public void skipOctetArray(int length) + { + skip(length); + } + + public void read_short_array(short[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null short array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos short que se pueden leer enteros + int shorts_can_read = 0; + + int position = 0; + + // numero de shorts que quedan + int remain_shorts = length; + + while (remain_shorts > 0) { + + if (!alignment(CDR.SHORT_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.SHORT_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + value[offset++] = (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + + remain_shorts--; + + } else { + position = m_iterator.m_position; + + shorts_can_read = + java.lang.Math.min(remain_shorts, + m_iterator.available() + / CDR.SHORT_SIZE); + + for (int i = shorts_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (short) ((m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8)); + else + value[offset++] = + (short) (((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_shorts -= shorts_can_read; + m_iterator.m_position = position; + + if (remain_shorts > 0) { + getNextChunk(); + } + } + } + } + + public void skipShortArray(int length) + { + skipArray(length, CDR.SHORT_SIZE); + } + + public void read_ushort_array(short[] value, int offset, int length) + { + read_short_array(value, offset, length); + } + + public void skipUshortArray(int length) + { + skipArray(length, CDR.USHORT_SIZE); + } + + public void read_long_array(int[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos int que se pueden leer enteros + int ints_can_read = 0; + + int position = 0; + + // numero de ints que quedan + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.LONG_SIZE)) {// encapsulación, el dato no cabe + // completo + + readOctetArrayAux(m_data_buffer, 0, CDR.LONG_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + value[offset++] = ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + + remain_ints--; + + } else { + position = m_iterator.m_position; + + ints_can_read = java.lang.Math + .min( + remain_ints, + m_iterator.available() + / CDR.LONG_SIZE); + + for (int i = ints_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 24); + else + value[offset++] = + ((m_chunk_buffer[position++] & 0xff) << 24) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff); + } + + remain_ints -= ints_can_read; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } + } + } + } + + public void skipLongArray(int length) + { + skipArray(length, CDR.LONG_SIZE); + } + + public void read_ulong_array(int[] value, int offset, int length) + { + read_long_array(value, offset, length); + } + + public void skipUlongArray(int length) + { + skipArray(length, CDR.ULONG_SIZE); + } + + public void read_longlong_array(long[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos long que se pueden leer enteros + int longs_can_read = 0; + + int position = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.LONGLONG_SIZE)) { // encapsulación, el dato no + // cabe completo + readOctetArrayAux(m_data_buffer, 0, CDR.LONGLONG_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + value[offset++] = + (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + + remain_longs--; + + } else { + position = m_iterator.m_position; + + longs_can_read = java.lang.Math + .min( + remain_longs, + m_iterator.available() + / CDR.LONGLONG_SIZE); + + for (int i = longs_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + ((long) m_chunk_buffer[position++] & 0xffL) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 56); + else + value[offset++] = + (((long) m_chunk_buffer[position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[position++] & 0xffL); + } + + remain_longs -= longs_can_read; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } + } + } + } + + public void skipLonglongArray(int length) + { + skipArray(length, CDR.LONGLONG_SIZE); + } + + public void read_ulonglong_array(long[] value, int offset, int length) + { + read_longlong_array(value, offset, length); + } + + // DataInputStream + public void read_ulonglong_array(org.omg.CORBA.ULongLongSeqHolder seq, + int offset, int length) + { + read_ulonglong_array(seq.value, offset, length); + } + + public void skipUlonglongArray(int length) + { + skipArray(length, CDR.ULONGLONG_SIZE); + } + + public void read_float_array(float[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos int que se pueden leer enteros + int ints_can_read = 0; + + int position = 0; + + // numero de ints que quedan + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.FLOAT_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.FLOAT_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + Float.intBitsToFloat((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24)); + } else { + value[offset++] = + Float.intBitsToFloat(((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff)); + } + + remain_ints--; + + } else { + position = m_iterator.m_position; + + ints_can_read = java.lang.Math + .min( + remain_ints, + m_iterator.available() + / CDR.FLOAT_SIZE); + + for (int i = ints_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + Float.intBitsToFloat( + (m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 24)); + else + value[offset++] = + Float.intBitsToFloat( + ((m_chunk_buffer[position++] & 0xff) << 24) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_ints -= ints_can_read; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } + } + } + } + + public void skipFloatArray(int length) + { + skipArray(length, CDR.FLOAT_SIZE); + } + + public void read_double_array(double[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos long que se pueden leer enteros + int longs_can_read = 0; + + int position = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.DOUBLE_SIZE)) { // encapsulación, el dato no cabe + // completo + + readOctetArrayAux(m_data_buffer, 0, CDR.DOUBLE_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + Double.longBitsToDouble( + ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56)); + } else { + value[offset++] = + Double.longBitsToDouble( + (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL)); + } + + remain_longs--; + + } else { + position = m_iterator.m_position; + + longs_can_read = + java.lang.Math.min(remain_longs, + m_iterator.available() + / CDR.LONGLONG_SIZE); + + for (int i = longs_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + Double.longBitsToDouble( + ((long) m_chunk_buffer[position++] & 0xffL) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 56)); + else + value[offset++] = + Double.longBitsToDouble( + (((long) m_chunk_buffer[position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 8) + | ((long) m_chunk_buffer[position++] & 0xffL)); + } + + remain_longs -= longs_can_read; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } + } + } + } + + public void skipDoubleArray(int length) + { + skipArray(length, CDR.DOUBLE_SIZE); + } + + public org.omg.CORBA.Object read_Object() + { + IOR ior = new DefaultIOR(); + ior.read( this ); + + if (ior.memberCount() == 0) // null reference + return null; + else + return ObjectImpl.fromIOR(m_orb, ior); + } + + public org.omg.CORBA.Object read_Object(java.lang.Class clz) + { + java.lang.Object stub = null; + + try { + stub = clz.newInstance(); + } + catch (InstantiationException ie) { + throw new org.omg.CORBA.BAD_PARAM("Can not instantiate class" + + clz.getName()); + } + catch (IllegalAccessException iae) { + throw new org.omg.CORBA.BAD_PARAM("Can not instantiate class: " + + iae.toString()); + } + + if ((stub != null) + && (stub instanceof org.omg.CORBA.portable.ObjectImpl)) { + org.omg.CORBA.portable.ObjectImpl obj_impl = + (org.omg.CORBA.portable.ObjectImpl) read_Object(); + org.omg.CORBA.portable.ObjectImpl stub_ref = + (org.omg.CORBA.portable.ObjectImpl) stub; + stub_ref._set_delegate(obj_impl._get_delegate()); + return stub_ref; + + } + throw new BAD_PARAM("Invalid Reference Class:" + + " it does not implements org.omg.CORBA.portable.ObjectImpl"); + } + + public void skipObject() + { + IOR.skip(this); + } + + public org.omg.CORBA.TypeCode read_TypeCode() + { + return TypeCodeReader.read(this); + } + + public void skipTypeCode() + { + read_TypeCode(); + //TypeCodeReader.skip(this); + } + + public org.omg.CORBA.Any read_any() + { + TypeCode type = read_TypeCode(); + + AnyImpl any = new AnyImpl(m_orb); + any.type(type); + any.read_value(this, type); + return any; + } + + public void skipAny() + { + TypeCode type = read_TypeCode(); + TypeCodeMarshaler.skipValue(type, this); + } + + public void read_any_array(org.omg.CORBA.Any[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + value[i] = read_any(); + } + + public org.omg.CORBA.Context read_Context() + { + return ContextImpl.read(this); + } + + public void skipContext() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public org.omg.CORBA.Principal read_Principal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + + } + + public void skipPrincipal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.math.BigDecimal read_fixed() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void skipFixed() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void skip_fixed(short digits, short scale) + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + TypeCodeMarshaler.skipValue(fixed_type, this); + } + + public org.omg.CORBA.Any read_fixed(short digits, short scale) + throws org.omg.CORBA.BadFixedValue + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + FixedHolder holder = new FixedHolder(fixed_type); + holder._read(this); + AnyImpl any = (AnyImpl) m_orb.create_any(); + any.insert_Streamable(holder); + return any; + } + + public void skip_fixed_array(int length, short digits, short scale) + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + + for (int i = 0; i < length; i++) + TypeCodeMarshaler.skipValue(fixed_type, this); + + } + + public void read_fixed_array(org.omg.CORBA.AnySeqHolder seq, int offset, + int length, short digits, short scale) + throws org.omg.CORBA.BadFixedValue + { + if ((seq == null) || (seq.value == null)) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (seq.value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + seq.value[i] = read_fixed(digits, scale); + } + + ///////////////////// + // DataInputStream // + ///////////////////// + + public void read_boolean_array(org.omg.CORBA.BooleanSeqHolder seq, + int offset, int length) + { + read_boolean_array(seq.value, offset, length); + } + + public void read_char_array(org.omg.CORBA.CharSeqHolder seq, int offset, + int length) + { + read_char_array(seq.value, offset, length); + } + + public void read_wchar_array(org.omg.CORBA.WCharSeqHolder seq, int offset, + int length) + { + read_wchar_array(seq.value, offset, length); + } + + public void read_octet_array(org.omg.CORBA.OctetSeqHolder seq, int offset, + int length) + { + read_octet_array(seq.value, offset, length); + } + + public void read_short_array(org.omg.CORBA.ShortSeqHolder seq, int offset, + int length) + { + read_short_array(seq.value, offset, length); + } + + public void read_ushort_array(org.omg.CORBA.UShortSeqHolder seq, + int offset, int length) + { + read_ushort_array(seq.value, offset, length); + } + + public void read_long_array(org.omg.CORBA.LongSeqHolder seq, int offset, + int length) + { + read_long_array(seq.value, offset, length); + } + + public void read_ulong_array(org.omg.CORBA.ULongSeqHolder seq, int offset, + int length) + { + read_ulong_array(seq.value, offset, length); + } + + public void read_longlong_array(org.omg.CORBA.LongLongSeqHolder seq, + int offset, int length) + { + read_longlong_array(seq.value, offset, length); + } + + public void read_float_array(org.omg.CORBA.FloatSeqHolder seq, int offset, + int length) + { + read_float_array(seq.value, offset, length); + } + + public void read_double_array(org.omg.CORBA.DoubleSeqHolder seq, + int offset, int length) + { + read_double_array(seq.value, offset, length); + } + + public void read_any_array(org.omg.CORBA.AnySeqHolder seq, int offset, + int length) + { + read_any_array(seq.value, offset, length); + } + + ///////////////// + // InputStream // + ///////////////// + public int available() + { + return m_iterator.bufferAvailable(); + } + + public int read() + { + return (int) read_octet(); + } + + public int read(byte[] value) + { + read_octet_array(value, 0, value.length); + return value.length; + } + + public int read(byte[] value, int offset, int length) + { + read_octet_array(value, offset, length); + return length; + } + + public boolean markSupported() + { + return true; + } + + public void mark(int readlimit) + { + m_iterator.mark(); + } + + public void reset() + throws java.io.IOException + { + m_iterator.reset(); + } + + //corba 2.3 + + protected ValueTypeInfo getIndirectedValue() + { + AbsolutePosition indirected_position = readIndirection(); + + java.lang.Object obj = + getContextCDR().lookupObject(indirected_position); + + if (obj instanceof ValueTypeInfo) + return (ValueTypeInfo) obj; + else + throw new MARSHAL("No Value Indirected"); + } + + public java.io.Serializable read_value() + { + return readValueWithId(null); + } + + public java.io.Serializable read_value(java.lang.String rep_id) + { + if (rep_id == null) + throw new BAD_PARAM("Null rep_id"); + + return readValueWithId(rep_id); + } + + // DataInputStream + public java.io.Serializable read_Value() + { + return read_value(); + } + + protected java.io.Serializable readValueWithId(java.lang.String rep_id) + { + alignment(CDR.LONG_SIZE); + + MarkCDR value_mark = m_iterator.getMark(); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + value_info = getIndirectedValue(); + + if ((rep_id != null) && (!value_info.is_truncable(rep_id))) + throw new BAD_PARAM("Cannot truncate value to: " + rep_id); + + return value_info.get_value(); + } + + String id = value_info.get_id(); + + if (id == null) { + if (rep_id == null) { + throw new MARSHAL("Unknown Repository Id"); + } + + id = rep_id; + } else if ((rep_id != null) && (!value_info.is_truncable(rep_id))) { + throw new BAD_PARAM("Cannot truncate value to: " + rep_id); + } + + java.io.Serializable value = null; + + if (id.equals("IDL:omg.org/CORBA/WStringValue:1.0")) { + // special handling of strings, according to spec + value = read_wstring(); + } else if (id.startsWith("IDL:")) { + ValueFactory factory = m_orb.lookup_value_factory(id); + + if (factory == null) + throw new MARSHAL("Cannot get Value Factory"); + + if (value_info.isFragmented()) { + throw new + NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + m_iterator.goBack(value_mark); + + value = factory.read_value(this); + } else + // RMI + { + // ValueHandler wants class, repository_id, and sending context. + // I wonder why it wants all of these. + // If we settle down on this implementation, compute these + // values more efficiently elsewhere. + + String className = + es.tid.TIDorbj.core.util.RepositoryId.className(id); + + Class c = null; + + try { + c = Thread.currentThread().getContextClassLoader() + .loadClass(className); + } + catch (ClassNotFoundException e) { + throw new RuntimeException("class not found: " + className); + } + + m_iterator.goBack(value_mark); + + initValueHandler(); + + value = + st_value_handler.readValue(this, //InputStream + 0, //offset + c, //value class + id, // repository Id + st_value_handler.getRunTimeCodeBase()); + } + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public java.io.Serializable read_value(java.lang.Class clz) + { + if ((clz == null)) + throw new BAD_PARAM(); + + java.lang.Object obj = null; + + try { + java.lang.reflect.Constructor constructor = + clz.getConstructor(new Class[0]); + + obj = constructor.newInstance(new Object[0]); + + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + + if (obj instanceof java.io.Serializable) + return read_value((java.io.Serializable) obj); + else + throw new + BAD_PARAM("Class does not implements java.io.Serializable"); + } + + public java.io.Serializable + read_value(org.omg.CORBA.portable.BoxedValueHelper factory) + { + alignment(CDR.LONG_SIZE); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + value_info = getIndirectedValue(); + + if (!value_info.get_id().equals(factory.get_id())) + throw new BAD_PARAM("Cannot truncate value"); + + return value_info.get_value(); + } + + es.tid.TIDorbj.core.util.RepositoryId[] ids = + value_info.get_repository_ids(); + + if ((ids == null) || (ids.length == 0)) { + String[] rep_ids = new String[1]; + rep_ids[0] = factory.get_id(); + value_info.set_repository_ids(rep_ids); + } else if (!ids[0].m_value.equals(factory.get_id())) { + throw new + BAD_PARAM("Invalid RepositoryId: value id does not " + + "match valuebox id"); + } + + if (value_info.isFragmented()) { + throw new NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + java.io.Serializable value = factory.read_value(this); + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public java.io.Serializable read_value(java.io.Serializable value) + { + alignment(CDR.LONG_SIZE); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + + value_info = getIndirectedValue(); + + java.io.Serializable value_readed = value_info.get_value(); + + if (!value_readed.getClass().isInstance(value)) + throw new BAD_PARAM("Cannot truncate value"); + + return value_readed; + } + + if (value instanceof org.omg.CORBA.portable.StreamableValue) { + org.omg.CORBA.portable.StreamableValue streamable = + (org.omg.CORBA.portable.StreamableValue) value; + + String value_id = value_info.get_id(); + + try { + if ((value_id != null) + && (!value_id.equals(streamable._type().id()))) + throw new BAD_PARAM("Streamable id is not the same"); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + streamable._read(this); + + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + + org.omg.CORBA.portable.CustomValue custom = + (org.omg.CORBA.portable.CustomValue) value; + + String value_id = value_info.get_id(); + + if (value_id != null) { + String[] custom_ids = custom._truncatable_ids(); + + boolean truncable = false; + + for (int i = 0; i < custom_ids.length; i++) { + if (value_info.is_truncable(custom_ids[i])) { + truncable = true; + break; + } + } + + if (!truncable) + throw new BAD_PARAM("Streamable id is not the same"); + } + + if (value_info.isFragmented()) { + throw new + NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + custom.unmarshal(this); + } else if (value instanceof java.lang.String) { + value = read_wstring(); + } else if (value instanceof java.io.Serializable) { + initValueHandler(); + + value = + st_value_handler.readValue(this, //InputStream + 0, //offset + value.getClass(), //value class + value_info.get_id(), // repository Id + st_value_handler.getRunTimeCodeBase()); + } else { + throw new BAD_PARAM("No Serializable class"); + } + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public void initValueHandler() + { + synchronized (this.getClass()) { + if (st_value_handler == null) + st_value_handler = javax.rmi.CORBA.Util.createValueHandler(); + } + } + + public java.lang.Object read_abstract_interface() + { + boolean is_reference = read_boolean(); + + if (is_reference) + return read_Object(); + else + return read_value(); + } + + //DataInputStream + + public java.lang.Object read_Abstract() + { + return read_abstract_interface(); + } + + public java.lang.Object read_abstract_interface(java.lang.Class clz) + { + boolean is_reference = read_boolean(); + + if (is_reference) + return read_Object(); + else + return read_value(clz); + } + + // tidorb operations + + public void skipIndirection() + { + skipLong(); + } + + public AbsolutePosition readIndirection() + { + // Prevent fragment jumps + + alignment(CDR.LONG_SIZE); + + // calculate the indirection + + AbsolutePosition typecode_indirection = getAbsolutePosition(); + + // read indirection offset + + int offset = read_long(); + + // SELF-INDIRECTINIG not allowed + + if (offset >= -CDR.LONG_SIZE) + throw new MARSHAL("Invalid offset"); + + int headers_length = 0; + + // if message add to offset the message headers + + if ((m_is_message) && (m_iterator.m_current_chunk_num > 0)) { + int fragment_header_size = 0; + + if (getVersion() == GIOPVersion.VERSION_1_2) + fragment_header_size = + GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; + else + fragment_header_size = + GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; + + BufferCDR buffer = getBuffer(); + + // minimun valid offset from the fragment where is the indirection + + int current_fragment = m_iterator.m_current_chunk_num; + + ChunkCDR chunk = buffer.getChunk(current_fragment); + + int offset_from_fragment = 0; + + if (chunk.hasHeader()) + offset_from_fragment = CDR.LONG_SIZE + fragment_header_size + - m_iterator.m_position; + else + offset_from_fragment = CDR.LONG_SIZE - m_iterator.m_position; + + // loop: add to offset fragment header size while the offset was + // less than valid offset from indirection fragment + while ((current_fragment > 0) && (offset < offset_from_fragment)) { + chunk = buffer.getChunk(--current_fragment); + + offset_from_fragment -= chunk.getAvailable(); + + if (chunk.hasHeader()) + offset -= fragment_header_size; + } + } + + AbsolutePosition referenced_position; + + referenced_position = typecode_indirection.addOffset(offset); + + if (referenced_position == null) + throw new MARSHAL("Invalid indirection: offset out of bounds.", 0, + CompletionStatus.COMPLETED_NO); + + // align the position to read the typecode in a aligned position of long + // this position alwais is aligned to long independently of + // encapsulation. + + // referenced_position.align(CDR.LONG_SIZE); + + return referenced_position; + } + + public void fixStarting() + { + m_iterator.fixStarting(); + } + + /** + * Sets the stream to the begining of the buffer. + */ + public void rewind() + { + m_iterator.rewind(); + + if ((m_is_message) && (m_iterator.m_current_chunk_num == 0) + && (m_iterator.m_position == 0)) + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Get the next chunk of the buffer + * + * @throws org.omg.CORBA.MARSHAL + * if the end of the buffer is reached. + * @see es.tid.TIDorbj.core.cdr.ChunkCDR + * @see es.tid.TIDorbj.core.cdr.BufferCDR + */ + public void getNextChunk() + { + if ((m_is_message) && (m_version != GIOPVersion.VERSION_1_0)) { + /* + * if(version == GIOPVersion.VERSION_1_0) throw new MARSHAL("End of + * Buffer: GIOP 1.0 does not allows fragmentation"); + */ + m_iterator.nextChunk(); + + if (m_iterator.m_chunk.hasHeader()) { + skip(GIOPHeader.HEADER_SIZE); + + if (m_version == GIOPVersion.VERSION_1_2) { + GIOPFragmentMessage.skipFragmentHeader1_2(this); + } + } + + } else { + m_iterator.nextChunk(); + } + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Set the stream pointer to the next aligned position of given data type + * + * @param type_size + * the type size in octets + */ + public void goNextAlignedPosition(int type_size) + { + // set the aligned position + + int next_position = m_iterator.alignPosition(type_size); + + if (next_position > m_iterator.m_chunk.m_available) { + if (m_iterator.m_encapsulation) { + // continue the encapsulation aligment in next chunk + int gap = next_position - m_iterator.m_position; + skip(gap); + alignment(CDR.OCTET_SIZE); // prevents next_position == length + } else { + getNextChunk(); + } + } else if (next_position == m_iterator.m_chunk.m_available) { + getNextChunk(); + } else { + m_iterator.m_position = next_position; + } + } + + /** + * Sets the reading pointer in the correct aligmnet for the data type. If + * necessary, gets the next chunk. + *

+ * CORBA 2.3 specification says: A primitive data type of 8 bytes or + * smaller, should never be broken across two fragments.Therefore, if the + * remaining bytes are not sufficient for reading the data next chunk will + * be set for reading. + *

+ * If it is reading a encapsulation and the data is broken into two chunks, + * reads the data compoentes byte per byte. + * + * @param type_size the type size for alignment. + * @return true if can read directly the data or + * false if byte swap is needed because the data is + * splitted in two framgments and is contended in a encapsulation. + * @throws org.omg.CORBA.MARSHAL + * if the end of the buffer is reached. + */ + + public boolean alignment(int type_size) + throws org.omg.CORBA.MARSHAL + { + + goNextAlignedPosition(type_size); + + if (m_iterator.enoughSpace(type_size)) + return true; + + // there is no space for whole data bytes + + if (m_iterator.m_encapsulation) + return false; // marshal byte per byte + + // marshaling in the main buffer, get next chunk + getNextChunk(); + + return true; + } + + private void skipArray(int length, int type_length) + { + if (length < 0) + throw new BAD_PARAM("Invalid array length", 0, + CompletionStatus.COMPLETED_NO); + + // número de octetos pertenecientes a datos que se pueden leer enteros + int octets_can_skip = 0; + + // numero de datos que quedan por saltar + int remain_data = length; + + while (remain_data > 0) { + + if (!alignment(type_length)) { // encapsulación, el dato no cabe + // completo + + skip(type_length); + + remain_data--; + + } else { + octets_can_skip = java.lang.Math.min(remain_data * type_length, + m_iterator.available()); + + remain_data -= octets_can_skip / type_length; + m_iterator.m_position += octets_can_skip; + + if (remain_data > 0) { + getNextChunk(); + } + } + } + } + + public long skip(long n) + { + if (n > 0L) { + int chunk_left = m_iterator.available(); + if (n <= chunk_left) + m_iterator.skip((int) n); + else { + getNextChunk(); + skip(n - chunk_left); + } + return n; + } + return 0; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDROutputStream.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDROutputStream.java.svn-base new file mode 100644 index 0000000..41fc03c --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/CDROutputStream.java.svn-base @@ -0,0 +1,1810 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.DATA_CONVERSION; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.ValueBase; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * Portable OutputStream for demarshalling. + *

+ * A CDROutputStream has an buffer iterator + * CDRIterator. The iterator maintains the data position and + * correct aligment, and TypeCode marshaling information. + * + * @see es.tid.TIDorbj.core.cdr.CDRInputStream + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDROutputStream extends org.omg.CORBA_2_3.portable.OutputStream + implements org.omg.CORBA.DataOutputStream +{ + + /** + * ORB instance that created the output stream. + */ + + TIDORB m_orb; + + /** + * GIOPVersion used. + */ + + GIOPVersion m_version; + + /** + * The buffer is a GIOP message. A GIOP Message implies that the GIOP Header + * space will be reserved in the BufferCDR, that is, each ChunkCDR will have + * the header size bytes allocated. + */ + + boolean m_is_message; + + /** + * Buffer Iterator. + */ + protected IteratorCDR m_iterator; + + /** + * Current chunk buffer. + */ + + protected byte[] m_chunk_buffer; + + /** + * Data buffer for Broken data splitted in to chunks in an encapsulations + */ + + protected byte[] m_data_buffer = null; + + protected static javax.rmi.CORBA.ValueHandler st_value_handler = null; + + // DataOutputStream + static String[] st_data_output_ids = + { "IDL:omg.org/CORBA/DataOutputStream:1.0" }; + + public String[] _truncatable_ids() + { + return st_data_output_ids; + } + + public CDROutputStream(TIDORB orb, byte[] buffer) + { + this(orb, new IteratorCDR(new BufferCDR(buffer))); + } + + public CDROutputStream(TIDORB orb, BufferCDR buffer) + { + this(orb, new IteratorCDR(buffer)); + } + + public CDROutputStream(TIDORB orb, int chunk_size) + { + this(orb, new IteratorCDR(new BufferCDR(chunk_size))); + } + + protected CDROutputStream(TIDORB orb, IteratorCDR iterator) + { + m_orb = orb; + + if ( orb != null ){ + this.m_version = GIOPVersion.fromString ( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + } else { + this.m_version = GIOPVersion.fromString( + IIOPCommunicationLayerPropertiesInfo.DEFAULT_GIOP_VERSION + ); + } + + this.m_is_message = false; + this.m_iterator = iterator; + iterator.m_byte_order = CDR.BIG_ENDIAN; + + m_chunk_buffer = iterator.m_chunk.m_buffer; + m_data_buffer = new byte[CDR.LONGLONG_SIZE]; + } + + /** + * @return the GIOP version used to marshal. + */ + public GIOPVersion getVersion() + { + return m_version; + } + + /** + * Sets the GIOP version used to marshal. + */ + public void setVersion(GIOPVersion ver) + { + m_version = ver; + } + + /** + * @return true if the stream is a GIOP message. + */ + public boolean isMessage() + { + return m_is_message; + } + + /** + * Sets if the stream is a GIOP message. + */ + public void setMessage(boolean is) + { + m_is_message = is; + + if ((is) && (m_iterator.m_position == 0)) { + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + } + } + + /** + * @return the stream byte order, if true little-endian, else + * big-endian + */ + public boolean getByteOrder() + { + return m_iterator.getByteOrder(); + } + + /** + * @return the stream buffer + */ + public BufferCDR getBuffer() + { + return m_iterator.getBuffer(); + } + + /** + * Sets the aligment offset in the current Context. + * + * @param pos + * the new offset + * @see es.tid.TIDorbj.core.cdr.AligmentOffset + */ + public void setAlignmentOffset(int pos) + { + m_iterator.setAlignmentOffset(pos); + } + + /** + * @return pointer to the actual position in the buffer. + */ + public PointerCDR actualPointer() + { + return m_iterator.getPointer(); + } + + /** + * Creates a new Encapsulation Context with it own aligment an indirections. + */ + public void enterEncapsulation() + { + // skip the length + + CDROutputStream length_out = copy(); + + write_ulong(1); + + // get the real start position of encapsulation + + alignment(CDR.OCTET_SIZE); + + m_iterator.enterEncapsulation(); + + //write byte order + write_boolean(m_iterator.getByteOrder()); + + // save the length output stream in the new context + m_iterator.m_context.setLengthOut(length_out); + } + + /** + * Close the Encapsulation Context, write en encapsulation length, and + * restore the father Context. + * + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + + public void exitEncapsulation() + { + + CDROutputStream length_out = m_iterator.m_context.m_length_out; + + if (length_out == null) + throw new org.omg.CORBA.INTERNAL("Null Length out"); + + int headers_length = 0; + + // if message Calculate the headers size to subtract the value to the + // Encapsulation size + /* + * if (message) { int fragments = iterator.current_chunk_num - + * length_out.iterator.current_chunk_num; + * + * + * if(version == GIOPVersion.VERSION_1_2) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; else if (version == + * GIOPVersion.VERSION_1_1) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; else headers_length = + * 0; } + */ + int encapsulation_length = + getAbsolutePosition().getValue() + - m_iterator.m_context.m_starts_at.getAbsolutePosition().getValue(); + // - headers_length; + + length_out.write_ulong(encapsulation_length); + + m_iterator.m_context.deleteLengthOut(); + + m_iterator.exitEncapsulation(); + + } + + /** + * @return an input stream with its beginning at this marshaling position + */ + public CDRInputStream inputStreamAtThisPosition() + { + CDRInputStream input = new CDRInputStream(m_orb, m_iterator.copy()); + input.fixStarting(); + input.setMessage(m_is_message); + input.setVersion(m_version); + return input; + } + + public org.omg.CORBA.ORB orb() + { + if (m_orb != null) + return m_orb; + else + return es.tid.TIDorbj.core.TIDORB.init(); + } + + public org.omg.CORBA.portable.InputStream create_input_stream() + { + CDRInputStream input; + + input = new CDRInputStream(m_orb, m_iterator.copy()); + + input.setMessage(m_is_message); + input.setVersion(m_version); + + input.rewind(); + + return input; + } + + /** + * @return a new inputstream pointing the same position. + */ + public CDROutputStream copy() + { + CDROutputStream stream = new CDROutputStream(m_orb, m_iterator.copy()); + stream.setMessage(m_is_message); + stream.setVersion(m_version); + return stream; + } + + public ContextCDR getContextCDR() + { + return m_iterator.m_context; + } + + /** + * Writes as an encapsulation the buffer. + *

+ * The first octet in the encapsulation must be the byte-order. + * + * @encapsulation a buffer with the encapsulation. + */ + public void writeEncapsulation(Encapsulation encapsulation) + { + encapsulation.write(this); + } + + /** + * @return the absolute value in the buffer order of the current position. + */ + public AbsolutePosition getAbsolutePosition() + { + return m_iterator.getPointer().getAbsolutePosition(); + } + + public PointerCDR getPointer() + { + return m_iterator.getPointer(); + } + + /** + * Jumps to the absolute position. + * + * @pram position the new position + */ + public void setPosition(AbsolutePosition position) + { + m_iterator.setPosition(position); + } + + public void write_boolean(boolean value) + { + alignment(CDR.BOOLEAN_SIZE); + m_chunk_buffer[m_iterator.m_position++] = (value) ? (byte) 1 : (byte) 0; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_char(char value) + { + // WARNING: Java char is 2 bytes long, there is a cast + // from char to byte + if (value > 255) { + throw new DATA_CONVERSION("Char out of range.", + 0, + CompletionStatus.COMPLETED_NO); + } + alignment(CDR.CHAR_SIZE); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_wchar(char value) + { + // Java char is 2 bytes long, there is a cast + + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.WCHAR_SIZE); + } + } + + public void write_octet(byte value) + { + alignment(CDR.OCTET_SIZE); + m_chunk_buffer[m_iterator.m_position++] = value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_short(short value) + { + if (alignment(CDR.SHORT_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.SHORT_SIZE); + } + } + + public void write_ushort(short value) + { + // JAVA MAPPING: "negative" int = positive ulong values + // will be handled by the user + if (alignment(CDR.USHORT_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.USHORT_SIZE); + } + } + + public void write_long(int value) + { + if (alignment(CDR.LONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 24); + m_data_buffer[1] = (byte) (value >>> 16); + m_data_buffer[2] = (byte) (value >>> 8); + m_data_buffer[3] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.LONG_SIZE); + } + } + + public void write_ulong(int value) + { + // JAVA MAPPING: "negative" int = positive ulong values + // will be handled by the user + + if (alignment(CDR.ULONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 24); + m_data_buffer[1] = (byte) (value >>> 16); + m_data_buffer[2] = (byte) (value >>> 8); + m_data_buffer[3] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.ULONG_SIZE); + } + } + + public void write_longlong(long value) + { + if (alignment(CDR.LONGLONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 56); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 48); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 40); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 32); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 56); + m_data_buffer[1] = (byte) (value >>> 48); + m_data_buffer[2] = (byte) (value >>> 40); + m_data_buffer[3] = (byte) (value >>> 32); + m_data_buffer[4] = (byte) (value >>> 24); + m_data_buffer[5] = (byte) (value >>> 16); + m_data_buffer[6] = (byte) (value >>> 8); + m_data_buffer[7] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.LONGLONG_SIZE); + } + } + + public void write_ulonglong(long value) + { + // JAVA MAPPING: "negative" long = positive ulonglong values + // will be handled by the user + + if (alignment(CDR.ULONGLONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 56); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 48); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 40); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 32); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 0); + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 56); + m_data_buffer[1] = (byte) (value >>> 48); + m_data_buffer[2] = (byte) (value >>> 40); + m_data_buffer[3] = (byte) (value >>> 32); + m_data_buffer[4] = (byte) (value >>> 24); + m_data_buffer[5] = (byte) (value >>> 16); + m_data_buffer[6] = (byte) (value >>> 8); + m_data_buffer[7] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.ULONGLONG_SIZE); + } + } + + public void write_float(float value) + { + write_long(java.lang.Float.floatToIntBits(value)); + } + + public void write_double(double value) + { + write_longlong(java.lang.Double.doubleToLongBits(value)); + + } + + public void write_string(String value) + { + if (value == null) + throw new BAD_PARAM("Null string reference.", 0, + CompletionStatus.COMPLETED_NO); + + // write the string and the final of string char '\0' + + int string_length = value.length(); + + int cdr_string_length = string_length + 1; + + char[] char_array = new char[cdr_string_length]; + + value.getChars(0, string_length, char_array, 0); + + char_array[string_length] = '\0'; + + // write length + + write_ulong(cdr_string_length); + + // write value data + + writeCharArrayAux(char_array, 0, cdr_string_length); + } + + public void write_wstring(String value) + { + if (value == null) + throw new BAD_PARAM("Null string reference.", 0, + CompletionStatus.COMPLETED_NO); + + // write the string and the final of string char '\0' + + char[] char_array = value.toCharArray(); + + // write length + + if (m_version == GIOPVersion.VERSION_1_2) { + write_ulong((char_array.length + 1) * CDR.WCHAR_SIZE); + + } else if (m_version == GIOPVersion.VERSION_1_1){ + write_ulong(char_array.length + 1); + } else { + throw new MARSHAL("wstring is not present in GIOP 1.0", + 6, + CompletionStatus.COMPLETED_NO); + } + + // write value data + write_wchar_array(char_array, 0, char_array.length); + + // write string end char + write_wchar('\0'); + } + + public void write_boolean_array(boolean[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null boolean array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int can_write = 0; + + // número de octetos que quedan por escribir + + int remain_booleans = length; + + int position = 0; + int stop_at = 0; + + while (remain_booleans > 0) { + + position = m_iterator.m_position; + + can_write = java.lang.Math.min(remain_booleans, + m_chunk_buffer.length - position); + + stop_at = position + can_write; + + while (position < stop_at) { + m_chunk_buffer[position++] = (byte) ((value[offset++]) ? 1 : 0); + } + + m_iterator.m_position = stop_at; + remain_booleans -= can_write; + + if (remain_booleans > 0) { + getNextChunk(); + } else { + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + } + + public void write_char_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null char array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + writeCharArrayAux(value, offset, length); + } + + public void writeCharArrayAux(char[] value, int offset, int length) + { + int chars_can_write = 0; + + // número de octetos que quedan por escribir + + int remain_chars = length; + + int position = 0; + int stop_at = 0; + + int current_value = 0; + + while (remain_chars > 0) { + + position = m_iterator.m_position; + + chars_can_write = + java.lang.Math.min( remain_chars, + m_chunk_buffer.length - position); + + stop_at = position + chars_can_write; + + for (; position < stop_at;) { + + current_value = value[offset++]; + + // CORBA chars are 1 byte length, value must be < 256 + if (current_value > 255) { + throw new DATA_CONVERSION("Char out of range.", + 0, + CompletionStatus.COMPLETED_NO); + } + + m_chunk_buffer[position++] = (byte) current_value; + } + + m_iterator.m_position = stop_at; + remain_chars -= chars_can_write; + + if (remain_chars > 0) { + getNextChunk(); + } else { + if (m_iterator.m_chunk.m_available < m_iterator.m_position) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + } + + public void write_wchar_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null wchar array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos wchar que se pueden escribir enteros + int wchars_can_write = 0; + + int position = 0; + int wchar_value = 0; + + // numero de wchars que quedan + int remain_wchars = length; + + while (remain_wchars > 0) { + + if (!alignment(CDR.WCHAR_SIZE)) // encapsulación, el dato no cabe + // completo + { + wchar_value = value[offset++]; + m_data_buffer[0] = (byte) (wchar_value >>> 8); + m_data_buffer[1] = (byte) wchar_value; + + write_octet_array(m_data_buffer, 0, CDR.WCHAR_SIZE); + + remain_wchars--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + wchars_can_write = + java.lang.Math.min(remain_wchars, + free_octets / CDR.WCHAR_SIZE); + + for (int i = wchars_can_write; i > 0; i--) { + wchar_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (wchar_value >>> 8); + m_chunk_buffer[position++] = (byte) wchar_value; + } + + remain_wchars -= wchars_can_write; + m_iterator.m_position = position; + + if (remain_wchars > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_octet_array(byte[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir + int remain_bytes = length; + + // bytes que se pueden escribir por vuelta + int bytes_can_write = 0; + int position = 0; + + while (remain_bytes > 0) { + + position = m_iterator.m_position; + + bytes_can_write = java.lang.Math + .min( + remain_bytes, + m_chunk_buffer.length + - position); + + System.arraycopy(value, offset, m_chunk_buffer, position, + bytes_can_write); + + m_iterator.m_position += bytes_can_write; + remain_bytes -= bytes_can_write; + offset += bytes_can_write; + + if (remain_bytes > 0) + getNextChunk(); + else if (m_iterator.m_chunk.m_available < m_iterator.m_position) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + + public void write_short_array(short[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null short array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos short que se pueden escribir enteros + int shorts_can_write = 0; + + int position = 0; + int short_value = 0; + + // numero de shorts que quedan + int remain_shorts = length; + + while (remain_shorts > 0) { + + if (!alignment(CDR.SHORT_SIZE)) // encapsulación, el dato no cabe + // completo + { + short_value = value[offset++]; + m_data_buffer[0] = (byte) (short_value >>> 8); + m_data_buffer[1] = (byte) short_value; + + write_octet_array(m_data_buffer, 0, CDR.SHORT_SIZE); + + remain_shorts--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + shorts_can_write = + java.lang.Math.min(remain_shorts, + free_octets / CDR.SHORT_SIZE); + + for (int i = shorts_can_write; i > 0; i--) { + short_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (short_value >>> 8); + m_chunk_buffer[position++] = (byte) short_value; + } + + remain_shorts -= shorts_can_write; + m_iterator.m_position = position; + + if (remain_shorts > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ushort_array(short[] value, int offset, int length) + { + write_short_array(value, offset, length); + } + + public void write_long_array(int[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos int que se pueden escribir enteros + int ints_can_write = 0; + + int position = 0; + int int_value = 0; + + // numero de ints que quedan por escribir + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.LONG_SIZE)) // encapsulación, el dato no cabe + // completo + { + int_value = value[offset++]; + + m_data_buffer[0] = (byte) (int_value >>> 24); + m_data_buffer[1] = (byte) (int_value >>> 16); + m_data_buffer[2] = (byte) (int_value >>> 8); + m_data_buffer[3] = (byte) int_value; + write_octet_array(m_data_buffer, 0, CDR.LONG_SIZE); + + remain_ints--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + ints_can_write = + java.lang.Math.min(remain_ints, + free_octets / CDR.LONG_SIZE); + + for (int i = ints_can_write; i > 0; i--) { + int_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (int_value >>> 24); + m_chunk_buffer[position++] = (byte) (int_value >>> 16); + m_chunk_buffer[position++] = (byte) (int_value >>> 8); + m_chunk_buffer[position++] = (byte) int_value; + } + + remain_ints -= ints_can_write; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ulong_array(int[] value, int offset, int length) + { + write_long_array(value, offset, length); + } + + public void write_longlong_array(long[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos long que se pueden escribir enteros + int longs_can_write = 0; + + int position = 0; + long long_value = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.LONGLONG_SIZE)) + { + // encapsulation, the data does not fit complete + long_value = value[offset++]; + + m_data_buffer[0] = (byte) (long_value >>> 56); + m_data_buffer[1] = (byte) (long_value >>> 48); + m_data_buffer[2] = (byte) (long_value >>> 40); + m_data_buffer[3] = (byte) (long_value >>> 32); + m_data_buffer[4] = (byte) (long_value >>> 24); + m_data_buffer[5] = (byte) (long_value >>> 16); + m_data_buffer[6] = (byte) (long_value >>> 8); + m_data_buffer[7] = (byte) long_value; + + write_octet_array(m_data_buffer, 0, CDR.LONGLONG_SIZE); + + remain_longs--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + longs_can_write = + java.lang.Math.min(remain_longs, + free_octets / CDR.LONGLONG_SIZE); + + for (int i = longs_can_write; i > 0; i--) { + long_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (long_value >>> 56); + m_chunk_buffer[position++] = (byte) (long_value >>> 48); + m_chunk_buffer[position++] = (byte) (long_value >>> 40); + m_chunk_buffer[position++] = (byte) (long_value >>> 32); + m_chunk_buffer[position++] = (byte) (long_value >>> 24); + m_chunk_buffer[position++] = (byte) (long_value >>> 16); + m_chunk_buffer[position++] = (byte) (long_value >>> 8); + m_chunk_buffer[position++] = (byte) long_value; + } + + remain_longs -= longs_can_write; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ulonglong_array(long[] value, int offset, int length) + { + write_longlong_array(value, offset, length); + } + + public void write_float_array(float[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null float array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos float que se pueden escribir enteros + int ints_can_write = 0; + + int position = 0; + int int_value = 0; + + // numero de floats que quedan que quedan por escribir + int remain_floats = length; + + while (remain_floats > 0) { + + if (!alignment(CDR.FLOAT_SIZE)) // encapsulación, el dato no cabe + // completo + { + int_value = Float.floatToIntBits(value[offset++]); + + m_data_buffer[0] = (byte) (int_value >>> 24); + m_data_buffer[1] = (byte) (int_value >>> 16); + m_data_buffer[2] = (byte) (int_value >>> 8); + m_data_buffer[3] = (byte) int_value; + write_octet_array(m_data_buffer, 0, CDR.FLOAT_SIZE); + + remain_floats--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + ints_can_write = + java.lang.Math.min(remain_floats, + free_octets / CDR.FLOAT_SIZE); + + for (int i = ints_can_write; i > 0; i--) { + int_value = Float.floatToIntBits(value[offset++]); + + m_chunk_buffer[position++] = (byte) (int_value >>> 24); + m_chunk_buffer[position++] = (byte) (int_value >>> 16); + m_chunk_buffer[position++] = (byte) (int_value >>> 8); + m_chunk_buffer[position++] = (byte) int_value; + } + + remain_floats -= ints_can_write; + m_iterator.m_position = position; + + if (remain_floats > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_double_array(double[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new BAD_PARAM( + "value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos double que se pueden escribir enteros + int doubles_can_write = 0; + + int position = 0; + long long_value = 0; + + // numero de doubles que quedan + int remain_doubles = length; + + while (remain_doubles > 0) { + + if (!alignment(CDR.DOUBLE_SIZE)) { + long_value = Double.doubleToLongBits(value[offset++]); + + m_data_buffer[0] = (byte) (long_value >>> 56); + m_data_buffer[1] = (byte) (long_value >>> 48); + m_data_buffer[2] = (byte) (long_value >>> 40); + m_data_buffer[3] = (byte) (long_value >>> 32); + m_data_buffer[4] = (byte) (long_value >>> 24); + m_data_buffer[5] = (byte) (long_value >>> 16); + m_data_buffer[6] = (byte) (long_value >>> 8); + m_data_buffer[7] = (byte) long_value; + + write_octet_array(m_data_buffer, 0, CDR.DOUBLE_SIZE); + + remain_doubles--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + doubles_can_write = + java.lang.Math.min(remain_doubles, + free_octets / CDR.DOUBLE_SIZE); + + for (int i = doubles_can_write; i > 0; i--) { + long_value = Double.doubleToLongBits(value[offset++]); + m_chunk_buffer[position++] = (byte) (long_value >>> 56); + m_chunk_buffer[position++] = (byte) (long_value >>> 48); + m_chunk_buffer[position++] = (byte) (long_value >>> 40); + m_chunk_buffer[position++] = (byte) (long_value >>> 32); + m_chunk_buffer[position++] = (byte) (long_value >>> 24); + m_chunk_buffer[position++] = (byte) (long_value >>> 16); + m_chunk_buffer[position++] = (byte) (long_value >>> 8); + m_chunk_buffer[position++] = (byte) long_value; + } + + remain_doubles -= doubles_can_write; + m_iterator.m_position = position; + + if (remain_doubles > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_Object(org.omg.CORBA.Object value) + { + if (value == null) { + es.tid.TIDorbj.core.iop.IOR.nullIOR().write(this); + return; + } + + if (value instanceof ValueBase) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if (value instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, CompletionStatus.COMPLETED_NO); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) value) + ._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + ((CommunicationDelegate) delegate).getReference().write(this); + } else { // write ior from anothers's ORB Object + IOR ior = + DefaultIOR.fromString(m_orb, + delegate.orb(value).object_to_string(value)); + ior.write(this); + } + } + + public void write_TypeCode(org.omg.CORBA.TypeCode value) + { + if (value == null) + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + + TypeCodeMarshaler.marshal(value, this); + } + + public void write_any(org.omg.CORBA.Any value) + { + if (value == null) + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + + write_TypeCode(value.type()); + value.write_value(this); + } + + //DataOutputStream + public void write_any_array(org.omg.CORBA.Any[] value, int offset, + int length) + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + write_any(value[i]); + } + + public void write_Context(org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) + { + if (ctx == null) + throw new BAD_PARAM("Null context reference.", 0, + CompletionStatus.COMPLETED_NO); + + ContextImpl.write(this, ctx, contexts); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + + public void write_Principal(org.omg.CORBA.Principal value) + { + throw new org.omg.CORBA.NO_IMPLEMENT("Deprecated by CORBA 2.2"); + } + + public void write_fixed(java.math.BigDecimal value) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_fixed(org.omg.CORBA.Any value) + throws org.omg.CORBA.BadFixedValue + { + if ((value == null) + || (value.type().kind().value() != org.omg.CORBA.TCKind._tk_fixed)) + throw new org.omg.CORBA.BadFixedValue(); + + value.write_value(this); + } + + public void write_fixed_array(org.omg.CORBA.Any[] value, int offset, + int length) + throws org.omg.CORBA.BadFixedValue + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + write_fixed(value[i]); + } + + // CORBA 2.3 + + public void write_value(java.io.Serializable value) + { + writeValueWithId(value, null); + } + + public void write_value(java.io.Serializable value, java.lang.String rep_id) + { + writeValueWithId(value, rep_id); + } + + protected void writeValueWithId(java.io.Serializable value, + java.lang.String rep_id) + { + if (writeValueTags(value)) + return; + + if (value instanceof java.lang.String) { + writeWStringValue((String) value); + } else if (value instanceof org.omg.CORBA.portable.StreamableValue) { + writeStreamableValue( + (org.omg.CORBA.portable.StreamableValue) value); + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + writeCustomValue((org.omg.CORBA.portable.CustomValue) value); + } else { + initValueHandler(); + + st_value_handler.writeValue(this, value); + } + } + + public void write_value(java.io.Serializable value, Class clz) + { + if (writeValueTags(value)) + return; + + if (value instanceof java.lang.String) { + writeWStringValue((String) value); + } else if (value instanceof org.omg.CORBA.portable.StreamableValue) { + writeStreamableValue( + (org.omg.CORBA.portable.StreamableValue) value); + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + writeCustomValue((org.omg.CORBA.portable.CustomValue) value); + } else { // boxed value?? + + java.lang.Object obj = null; + + try { + java.lang.reflect.Constructor constructor = + clz.getConstructor(new Class[0]); + + obj = constructor.newInstance(new Object[0]); + + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + + if (obj instanceof org.omg.CORBA.portable.BoxedValueHelper) { + writeBoxedValue(value, + (org.omg.CORBA.portable.BoxedValueHelper) value); + } else { + initValueHandler(); + ValueTypeInfo value_info = new ValueTypeInfo(); + String[] ids = { st_value_handler.getRMIRepositoryID(clz) }; + value_info.set_repository_ids(ids); + value_info.write(this); + st_value_handler.writeValue(this, value); + } + } + } + + public void write_value(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) + { + if (writeValueTags(value)) + return; + + writeBoxedValue(value, factory); + + } + + //DataOutputStream + public void write_Value(java.io.Serializable value) + { + write_value(value); + } + + /** + * Try to write null or an indirection tags + * + * @return true if written or false otherwise + */ + + protected boolean writeValueTags(java.io.Serializable value) + { + // write null + + if (value == null) { + ValueTypeInfo.write_null(this); + return true; + } + + PointerCDR previous_position = getContextCDR().lookupPosition(value); + + if (previous_position != null) { + writeIndirection(previous_position); + return true; + } + + return false; + } + + protected void writeWStringValue(String value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + write_wstring(value); + + getContextCDR().putObject(value, value_position); + } + + protected void + writeStreamableValue(org.omg.CORBA.portable.StreamableValue value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + value_info.set_repository_ids(value._truncatable_ids()); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + value._write(this); + + getContextCDR().putObject(value, value_position); + } + + protected void writeCustomValue(org.omg.CORBA.portable.CustomValue value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + value_info.set_repository_ids(value._truncatable_ids()); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + value.marshal(this); + + getContextCDR().putObject(value, value_position); + } + + protected void + writeBoxedValue(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + String[] ids = { factory.get_id() }; + + value_info.set_repository_ids(ids); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + factory.write_value(this, value); + + getContextCDR().putObject(value, value_position); + } + + public void initValueHandler() + { + synchronized (this.getClass()) { + if (st_value_handler == null) + st_value_handler = javax.rmi.CORBA.Util.createValueHandler(); + } + } + + public void write_abstract_interface(java.lang.Object object) + { + if (object == null) + throw new org.omg.CORBA.BAD_PARAM("Null value reference"); + + if (object instanceof org.omg.CORBA.Object) { + org.omg.CORBA.Object ref = (org.omg.CORBA.Object) object; + + // is an object ref + write_boolean(true); + write_Object(ref); + + } else if (object instanceof java.io.Serializable) { + write_boolean(false); + write_value((java.io.Serializable) object); + } else + throw new + MARSHAL("Cannot marshal value: it does not implements " + + "java.io.Serializable or is not a org.omg.CORBA.Object"); + } + + //DataOutputStream + public void write_Abstract(java.lang.Object value) + { + write_abstract_interface(value); + } + + // TIDORB + + // write_referenceable_string for RepositoryId and URL + + protected void writeReferenceableString(String id) + { + PointerCDR previous_position = getContextCDR().lookupPosition(id); + + if (previous_position != null) { + writeIndirection(previous_position); + return; + } + + // aligns to get the id position + + alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + PointerCDR id_position = getPointer(); + + write_string(id); + + getContextCDR().putObject(id, id_position); + } + + public void writeIndirection(PointerCDR previous_position) + { + write_long(0xFFFFFFFF); + + // prevents that indirection value will be marshaled in the next chunk + + alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + // int headers_length = 0; + + // if message Calculate the headers size to subtract the value to the + // Encapsulation size + /* + * if (get_message()) { int fragments = getCurrentChunkNum() - + * previous_position.getNumChunk(); + * + * if(get_version() == GIOPVersion.VERSION_1_2) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; else if (get_version() == + * GIOPVersion.VERSION_1_1) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; else headers_length = + * 0; } + */ + AbsolutePosition indirection_position; + + indirection_position = getAbsolutePosition(); + + int offset = previous_position.getAbsolutePosition().getValue() + - indirection_position.getValue(); + // + headers_length; + + write_long(offset); + + return; + } + + public int getCurrentChunkNum() + { + return m_iterator.m_current_chunk_num; + } + + /* + * public void getNextFragmentHeader() { if(!message) throw new + * org.omg.CORBA.INTERNAL("Not it a message"); + * + * if(version == GIOPVersion.VERSION_1_0) throw new MARSHAL("End of Buffer: GIOP + * 1.0 does not allows fragmentation"); + * + * iterator.nextChunk(); + * + * chunk_buffer = iterator.chunk.buffer; } + */ + public void getNextChunk() + { + m_iterator.m_chunk.m_available = m_chunk_buffer.length; + /* + * if (message) { if(version == GIOPVersion.VERSION_1_0) { // throw new + * MARSHAL("End of Buffer: GIOP 1.0 does not allows fragmentation"); + * iterator.bufferCDR.grow_1_0(); } else { if(iterator.current_chunk_num == + * (iterator.bufferCDR.getNumChunks() -1)) iterator.bufferCDR.grow(); + * + * iterator.nextChunk(); + * + * skip(GIOPHeader.HEADER_SIZE); + * + * if(version == GIOPVersion.VERSION_1_2) { + * GIOPFragmentMessage.skip_fragment_header_1_2(this); } } } else { + */ + if (m_iterator.m_current_chunk_num + == (m_iterator.m_buffer_cdr.getNumChunks() - 1)) + m_iterator.m_buffer_cdr.grow(); + + m_iterator.nextChunk(); + // } + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Set the stream pointer to the next aligned position of given data type + * + * @param type_size + * the type size in octets + */ + protected void goNextAlignedPosition(int type_size) + { + int next_position = m_iterator.alignPosition(type_size); + + if (next_position < m_chunk_buffer.length) { + m_iterator.m_position = next_position; + return; + } + + /* + * if (message && (version == GIOPVersion.VERSION_1_0)) { getNextChunk(); + * iterator.position = next_position; return; } + */ + + if ((next_position > m_chunk_buffer.length) + && (m_iterator.m_encapsulation)) { + // continue the encapsulation aligment in next chunk + int gap = next_position - m_iterator.m_position; + skip(gap); + alignment(CDR.OCTET_SIZE); // prevents next_position == length + return; + } + + getNextChunk(); + } + + /** + * Set the stream pointer to the next aligned position of given data type + * and sets it as the last available position + * + * @param type_size + * the type size in octets + */ + public void fixNextAlignedPosition(int type_size) + { + goNextAlignedPosition(type_size); + + if (m_iterator.m_position >= m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position + 1; + } + + /** + * Sets the writing pointer in the correct aligmnet for the data type. If + * necessary, gets the next chunk. + *

+ * CORBA 2.3 specification says: A primitive data type of 8 bytes or + * smaller, should never be broken across two fragments.Therefore, if the + * remaining bytes are not sufficient for reading the data next chunk will + * be set for reading. + *

+ * If it is reading a encapsulation and the data is broken into two chunks, + * reads the data compoentes byte per byte. + * + * @param type_size the type size for alignment. + * @return true if can read directly the data or + * false if byte swap is needed because the data is + * splitted in two framgments and is contended in a encapsulation. + */ + + public boolean alignment(int type_size) + { + // set the aligned position + + goNextAlignedPosition(type_size); + + if (m_iterator.enoughSpace(type_size)) + return true; + + // there is no space for whole data bytes + + m_iterator.m_chunk.m_available = m_chunk_buffer.length; + + if (m_iterator.m_encapsulation) + return false; // marshal byte per byte + + // marshaling in the main buffer, get next chunk + getNextChunk(); + + return true; + } + + public void skip(long n) + { + if (n > 0L) { + int chunk_left = m_chunk_buffer.length - m_iterator.m_position; + + if (chunk_left <= 0) { + getNextChunk(); + skip(n); + } else if (n <= chunk_left) { + m_iterator.skip((int) n); + if (m_iterator.m_position >= m_iterator.m_chunk.m_available) { + m_iterator.m_chunk.m_available = m_iterator.m_position + 1; + } + } else { + getNextChunk(); + skip(n - chunk_left); + } + } + } + + /** + * Recycle the buffer pointered by the stream. + * + * @see es.tid.TIDorbj.core.cdr.BufferCDR + */ + public void recycle() + { + m_iterator.rewind(); + m_iterator.m_buffer_cdr.recycle(); + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + m_is_message = false; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ChunkCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ChunkCDR.java.svn-base new file mode 100644 index 0000000..4d0f3f7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ChunkCDR.java.svn-base @@ -0,0 +1,162 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents a segment of a CDR buffer. It controls a marshaling byte buffer + * that can be send or received in a IIOP message. + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ChunkCDR +{ + + /** + * framgments of the chunk. + */ + protected byte[] m_buffer; + + /** + * Represents the amount of data available. Available is equal or lower than + * chunk length. + */ + protected int m_available; + + /** + * The starting of the chunk has an message header + */ + protected boolean m_with_message_header; + + /** + * Constructor, gets the control of the byte array. It will have only a + * fragment and it will not be increaseable. + */ + public ChunkCDR(byte[] byte_array) + { + m_buffer = byte_array; + m_available = m_buffer.length; + m_with_message_header = false; + } + + /** + * Constructor, gets the control of the byte array. It will have only a + * fragment and it will not be increaseable. + */ + public ChunkCDR(int fixed_size) + { + m_buffer = new byte[fixed_size]; + m_available = 0; + m_with_message_header = false; + } + + public boolean hasHeader() + { + return m_with_message_header; + } + + public void setHeader(boolean value) + { + m_with_message_header = value; + } + + /** + * @return the byte array associated to the buffer. + */ + public byte[] getBuffer() + { + return m_buffer; + } + + /** + * Sets the available bytes to 0. It is used to reuse the chunk buffer for + * new data. + */ + public void recycle() + { + m_available = 0; + } + + /** + * Sets the available bytes to the value position. An error + * can appear if the value is higher than the buffer length. + * + * @return true if OK or false on error. + */ + public boolean setAvailable(int value) + { + if (value <= m_buffer.length) { + m_available = value; + return true; + } + return false; + } + + /** + * @return The available bytes. + */ + + public int getAvailable() + { + return m_available; + } + + /** + * @return The lentgh ofthe byte buffer. + */ + + public int getLength() + { + return m_buffer.length; + } + + public void setBuffer(byte[] new_buffer) + { + m_buffer = null; + m_buffer = new_buffer; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ContextCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ContextCDR.java.svn-base new file mode 100644 index 0000000..06850c0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ContextCDR.java.svn-base @@ -0,0 +1,273 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents the contexts of a buffer marshaling across different + * encapsulations. The context is defined by: + *

    + *
  • if it is a encapsulation context + *
  • the alignment offset + *
  • the byte-order + *
  • the father context + *
+ * The context creates a list of encapsulations for navigate in and out of + * encapsulations. The list represented by the context is a + * + * @see TIDorb.corba.cdr.AlignmentOffset + * + * @autor Juan A. Cáceres + * @version 1.1 + */ + +public class ContextCDR +{ + + /** + * big-endian if true or little-endian, otherwise. + */ + protected boolean m_byte_order; + + /** + * The father context. In the root context, the father will be + * null. + */ + + protected ContextCDR m_father; + + /** + * alignment offset of the encapsulation. + * + * @see es.tid.TIDorbj.core.cdr.AlignmentOffset + */ + protected AlignmentOffset m_offset; + + /** + * Where is the beginnig of the encapsulation. + */ + + protected PointerCDR m_starts_at; + + /** + * The indirection node of the buffer. Here are all the typecodes that have + * been readed and can be indirectioned. + */ + + private IndirectionNode m_indirection_node; + + /** + * The TypeCode Position Node of the buffer. Here are all the typecodes that + * have been writed in the buffer and can be indirectioned. + */ + + private PositionsNode m_positions_node; + + /** + * The CDROutputStream that will write the encapsulation length. + */ + + protected CDROutputStream m_length_out; + + /** + * Constructor of the root context. A route of encapsulation contexts will + * end here. + * + * @see es.tid.TIDorbj.core.cdr.AlignmentOffset + */ + + public ContextCDR(PointerCDR start) + { + m_byte_order = CDR.LOCAL_BYTE_ORDER; + m_offset = AlignmentOffset.calculateOffsetFrom(0); + m_father = null; + m_starts_at = start; + m_indirection_node = null; + m_positions_node = null; + } + + public ContextCDR(PointerCDR start, ContextCDR father, + AlignmentOffset offset) + { + m_starts_at = start; + m_byte_order = father.m_byte_order; + this.m_offset = offset; + this.m_father = father; + m_indirection_node = null; + m_positions_node = null; + } + + public ContextCDR getFather() + { + return m_father; + } + + public boolean isRootContext() + { + return m_father == null; + } + + public void setOffset(AlignmentOffset value) + { + m_offset = value; + } + + public AlignmentOffset getOffset() + { + return m_offset; + } + + public void setByteOrder(boolean value) + { + m_byte_order = value; + } + + public boolean getByteOrder() + { + return m_byte_order; + } + + public void setLengthOut(CDROutputStream out) + { + m_length_out = out; + } + + public void deleteLengthOut() + { + m_length_out = null; + } + + public PointerCDR getStartPointer() + { + return m_starts_at; + } + + public synchronized PointerCDR lookupPosition(java.lang.Object id) + { + PositionsNode node = getPositionsNode(); + + PointerCDR position = node.lookup(id); + + if (position != null) + return position; + + if (m_father == null) + return null; + + position = m_father.lookupPosition(id); + + if (position != null) + node.indirection(position.getAbsolutePosition()); + + return position; + + } + + public synchronized void putObject(java.lang.Object obj, + PointerCDR position) + { + getPositionsNode().put(obj, position); + } + + public synchronized Object lookupObject(AbsolutePosition position) + { + IndirectionNode node = getIndirectionNode(); + + Object obj = node.lookup(position); + + if (obj != null) + return obj; + + if (m_father != null) + return m_father.lookupObject(position); + else + return null; + + } + + public synchronized void putPosition(AbsolutePosition position, + java.lang.Object obj) + { + getIndirectionNode().put(position, obj); + } + + private synchronized IndirectionNode getIndirectionNode() + { + if (m_indirection_node == null) { + AbsolutePosition starting = m_starts_at.getAbsolutePosition(); + if (m_father == null) + m_indirection_node = new IndirectionNode(starting); + else + m_indirection_node = + new IndirectionNode(starting, + m_father + .getIndirectionNode() + .getTable()); + } + + return m_indirection_node; + } + + private synchronized PositionsNode getPositionsNode() + { + if (m_positions_node == null) { + m_positions_node = + new PositionsNode(m_starts_at.getAbsolutePosition()); + } + + return m_positions_node; + } + + public boolean inAnEncapsulation() + { + return (m_father != null); + } + + public boolean hasExternalIndirections() + { + return (((m_indirection_node == null) ? false + : m_indirection_node.hasExternalIndirections()) + || ((m_positions_node == null) ? false + : m_positions_node.hasExternalIndirections())); + } +} + diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/Encapsulation.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/Encapsulation.java.svn-base new file mode 100644 index 0000000..8a00ffe --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/Encapsulation.java.svn-base @@ -0,0 +1,302 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.ORB; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +/** + * Represents the content data of an encapsulation (including the byte-order). + * An Encapsulation can be read to copy the content data from an input stream. + *

+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class Encapsulation +{ + + /** + * The empty encapsulation. + */ + + private static Encapsulation st_empty = null; + + /** + * The ORB. + */ + protected TIDORB m_orb; + + /** + * GIOPVersion + */ + protected GIOPVersion m_version; + + /** + * The octet sequence data. + */ + protected byte[] m_data; + + /** + * Start Position of the encapsulation in the byte array. + */ + int m_data_offset; + + /** + * Length of the encapsulation in the byte array. + */ + int m_data_length; + + /** + * Protected Constructor. Creates an empty encapsulation. + */ + protected Encapsulation(TIDORB orb, GIOPVersion ver) + { + this.m_orb = orb; + m_version = ver; + m_data_length = 0; + m_data_offset = 0; + } + + /** + * Protected Constructor. + * + * @param orb + * The ORB. + * @param key_buffer + * The octet sequence data. + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + */ + protected Encapsulation(TIDORB orb, GIOPVersion ver, byte[] key_buffer, + int offset, int length) + { + this.m_orb = orb; + m_version = ver; + m_data = key_buffer; + m_data_offset = offset; + m_data_length = length; + } + + public TIDORB getORB() + { + return m_orb; + } + + /** + * @return the encapsulation length (in octets). + */ + public int getLength() + { + return m_data_length; + } + + /** + * @return the encapsulation start position in the octet sequence. + */ + public int getOffset() + { + return m_data_offset; + } + + /** + * @return the encapsulation octet sequence. + */ + public byte[] getOctetSequence() + { + return m_data; + } + + /** + * Compares two encapsulations. + */ + public boolean equal(Encapsulation other) + { + if (other == null) + return false; + + if (m_data_length != other.m_data_length) + return false; + + int i = m_data_offset; + int j = other.m_data_offset; + + for (int length = 0; length < m_data_length; length++) { + if (m_data[i++] != other.m_data[j++]) + return false; + } + + return true; + } + + /** + * Gets a sub-encapsulation in the octet sequence. + * + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + */ + public Encapsulation getChild(int offset, int length) + { + if ((offset >= m_data_length) + || ((m_data_length - offset - length) < 0)) + return null; + else + return new Encapsulation(m_orb, m_version, m_data, offset, length); + } + + /** + * @return the empty encapsulation. + */ + public static Encapsulation getEmpty() + { + if (st_empty == null) + st_empty = new Encapsulation(null, GIOPVersion.VERSION_1_0); + + return st_empty; + } + + /** + * Static Encapsulation Creator operation. + * + * @param orb + * The ORB. key_buffer The octet sequence data. + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + * @return a new Encapsulation. + */ + + public static Encapsulation create(TIDORB orb, + GIOPVersion ver, + byte[] key_buffer, + int offset, + int length) + { + if (length < 0) + return null; + + if (length == 0) + return getEmpty(); + + if ((key_buffer == null) || (offset < 0) + || (key_buffer.length - offset - length < 0)) + return null; + + return new Encapsulation(orb, ver, key_buffer, offset, length); + } + + /** + * @return an input stream for reading the encapsulation data. + */ + public CDRInputStream createInputStream() + { + if (m_data_length == 0) + return null; + + CDRInputStream input = new CDRInputStream(m_orb, m_data); + + if (m_data_offset > 0) { + input.skip(m_data_offset); + input.fixStarting(); + } + + input.setByteOrder(input.read_boolean()); + input.setVersion(m_version); + + return input; + } + + /** + * Writes the encapsulation data in an output stream. + * + * @param out + * the output stream. + */ + public void write(CDROutputStream out) + { + out.write_ulong(m_data_length); + + if (m_data_length > 0) + out.write_octet_array(m_data, m_data_offset, m_data_length); + } + + /** + * Reads a new encapsulation from an input stream. + * + * @param out + * the output stream. + */ + + public static Encapsulation read(CDRInputStream input, GIOPVersion ver) + { + ORB orb = input.orb(); + + Encapsulation encap = null; + if (orb instanceof TIDORB) + encap = new Encapsulation((TIDORB) orb, ver); + else + encap = new Encapsulation(null, ver); + + encap.doRead(input); + + return encap; + } + + private void doRead(CDRInputStream input) + { + m_data_length = input.read_ulong(); + + if (m_data_length > 0) { + m_data = new byte[m_data_length]; + input.read_octet_array(m_data, 0, m_data_length); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IndirectionNode.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IndirectionNode.java.svn-base new file mode 100644 index 0000000..4028764 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IndirectionNode.java.svn-base @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Hashtable; + +/** + * The Indirection class represents a node in the indirections to + * the typecodes marshaled in the actual Encapsulation. If the node is in an + * inner Encapsulation then it will references to the father encapsulation node. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IndirectionNode +{ + + private java.util.Hashtable m_table; + + /** + * Encapsulation Context. + */ + + private AbsolutePosition m_root_position; + + private AbsolutePosition m_lower_indirection; + + public IndirectionNode(AbsolutePosition start_position) + { + m_table = new Hashtable(); + m_root_position = start_position; + m_lower_indirection = m_root_position; + } + + public IndirectionNode(AbsolutePosition start_position, + java.util.Hashtable table) + { + m_table = table;// new Hashtable(); + m_root_position = start_position; + m_lower_indirection = m_root_position; + } + + /** + * Search an indirected object in the buffer + */ + public synchronized Object lookup(AbsolutePosition position) + { + + if (position.getValue() < m_lower_indirection.getValue()) { + m_lower_indirection = position; + return null; + } + + return m_table.get(position); + } + + public void put(AbsolutePosition position, java.lang.Object obj) + { + m_table.put(position, obj); + } + + public boolean hasExternalIndirections() + { + return m_lower_indirection.getValue() < m_root_position.getValue(); + } + + public java.util.Hashtable getTable() + { + return m_table; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IteratorCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IteratorCDR.java.svn-base new file mode 100644 index 0000000..01c08d0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/IteratorCDR.java.svn-base @@ -0,0 +1,483 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.CompletionStatus; + +/** + * PositionCDR class gets track of byte array covering for marshaling and + * unmarshaling. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class IteratorCDR +{ + + /** + * Byte order of data in stream: big-endian if true, or + * little-endian if false + */ + protected boolean m_byte_order; + + /** + * The buffer controled by the buffer; + */ + + BufferCDR m_buffer_cdr; + + /** + * Actual Chunk Number. + */ + protected int m_current_chunk_num; + + /** + * The chunk covered + */ + protected ChunkCDR m_chunk; + + /** + * The actual position in the chunk + */ + protected int m_position; + + /** + * It is in an encapsulation. + */ + protected boolean m_encapsulation; + + /** + * Actual stream aligment offset. + */ + + protected AlignmentOffset m_alignment_offset; + + /** + * Last alignment calculated. + */ + + protected int m_last_alignment; + + /** + * Encapsulation context list. + */ + + protected ContextCDR m_context; + + /** + * Last mark for reset + */ + protected MarkCDR m_last_reset_mark; + + /** + * Starting mark for rewind + */ + protected MarkCDR m_starting_mark; + + // Constructor + + // Forbides the illegal use of a unitialized iterator. + + private IteratorCDR() + {} + + /** + * Constructor: gets a byte array referencen an places its position to 0 + */ + public IteratorCDR(BufferCDR buffer) + { + // Iterator in the buffer with root context + // generate the root position with root context an initial pointer, + m_buffer_cdr = buffer; + m_current_chunk_num = 0; + m_position = 0; + + PointerCDR initial_pointer = new PointerCDR(m_buffer_cdr, + m_current_chunk_num, + m_position); + + m_context = new ContextCDR(initial_pointer); + + // sets the iterator state ready to start at the beginnig of buffer. + fixStarting(); + + rewind(); + } + + /** + * Gets a byte array referencen an places its to the initial position. + */ + + public IteratorCDR(ContextCDR initial_context) + { + // Initial position values: + + m_context = initial_context; + + // sets the iterator state ready to start at the beginnig of buffer. + fixStarting(); + + rewind(); + } + + /** + * Sets the iterator possition to the starting position. + */ + + public void rewind() + { + goBack(m_starting_mark); + } + + protected MarkCDR getMark() + { + return new MarkCDR(m_context, getPointer()); + } + + protected void goBack(MarkCDR mark) + { + // context values + m_context = mark.getContext(); + + m_byte_order = m_context.getByteOrder(); + m_encapsulation = m_context.inAnEncapsulation(); + m_alignment_offset = m_context.getOffset(); + m_last_alignment = CDR.OCTET_SIZE; + + // pointer values; + PointerCDR initial_pointer = mark.getPointer(); + + m_current_chunk_num = initial_pointer.getNumChunk(); + m_buffer_cdr = initial_pointer.getBuffer(); + m_position = initial_pointer.getPosition(); + + m_chunk = m_buffer_cdr.getChunk(m_current_chunk_num); + + m_last_reset_mark = null; + } + + public void reset() + throws java.io.IOException + { + // state checking + if (m_last_reset_mark == null) + throw new java.io.IOException("Stream has no been marked"); + + goBack(m_last_reset_mark); + } + + public IteratorCDR copy() + { + + IteratorCDR new_iterator = new IteratorCDR(); + + new_iterator.m_context = m_context; + new_iterator.m_byte_order = m_context.getByteOrder(); + new_iterator.m_encapsulation = m_context.inAnEncapsulation(); + new_iterator.m_alignment_offset = m_context.getOffset(); + + // marks + + new_iterator.m_starting_mark = m_starting_mark; + new_iterator.m_last_reset_mark = null; + + new_iterator.m_current_chunk_num = m_current_chunk_num; + new_iterator.m_buffer_cdr = m_buffer_cdr; + new_iterator.m_position = m_position; + + new_iterator.m_chunk = m_chunk; + + return new_iterator; + } + + /** + * Returns the buffer CDR. + */ + public BufferCDR getBuffer() + { + + return m_buffer_cdr; + } + + /** + * @return the chunk pointered. + */ + public ChunkCDR getChunk() + { + + return m_chunk; + } + + /** + * @return true if little-endian or false if + * big-endian + */ + + public boolean getByteOrder() + { + return m_byte_order; + } + + /** + * Sets the byte order. + * + * @param byte_order + * is true if little-endian or false + * if big-endian + */ + + public void setByteOrder(boolean byte_order) + { + this.m_byte_order = byte_order; + m_context.setByteOrder(byte_order); + } + + /** + * @return the remaining bytes of the current chunk. + */ + + public int available() + { + int av = m_chunk.getAvailable() - m_position; + if (av < 0) + return 0; + else + return av; + } + + /** + * @return the remaining bytes of the buffer. + */ + + public int bufferAvailable() + { + int av = available(); + int num_chunks = m_buffer_cdr.getNumAvailableChunks(); + + for (int i = num_chunks - 1; i > m_current_chunk_num; i--) + av = m_buffer_cdr.getChunk(i).getAvailable(); + + return av; + } + + /** + * @return a pointer to actual position in the buffer, + */ + + PointerCDR getPointer() + { + return new PointerCDR(m_buffer_cdr, m_current_chunk_num, m_position); + } + + public void fixStarting() + { + m_starting_mark = getMark(); + } + + public void mark() + { + m_last_reset_mark = getMark(); + } + + /** + * Changes the alignment offset for a new Encapsulation, taking the actual + * position as the 0 positon of the encapsulation. Also, saves the actual + * aligment offset that will be restored when the + * exitEncapsulation were called. + */ + + public void enterEncapsulation() + { + ContextCDR new_context; + + m_encapsulation = true; + AlignmentOffset new_alignment_offset; + + new_alignment_offset = AlignmentOffset.calculateOffsetFrom(m_position); + + new_context = new ContextCDR(getPointer(), m_context, + new_alignment_offset); + m_context = new_context; + m_alignment_offset = new_alignment_offset; + } + + public void setAlignmentOffset(int relative_position) + { + + m_alignment_offset = + AlignmentOffset.calculateOffsetFrom(relative_position); + + m_context.setOffset(m_alignment_offset); + + } + + /** + * Restores the alignment offset for the Encapsulation containing the actual + * Encapsulation that it has been exited. + */ + + public void exitEncapsulation() + { + m_context = m_context.getFather(); + + m_byte_order = m_context.getByteOrder(); + m_alignment_offset = m_context.getOffset(); + m_encapsulation = m_context.inAnEncapsulation(); + } + + /** + * Says if it is in a encapsulation or in the main stream. + * + * @return true if it is in an encapsulation or + * false otherwise + */ + public boolean inAnEncapsulation() + { + return m_encapsulation; + } + + public void nextChunk() + throws org.omg.CORBA.MARSHAL + { + m_current_chunk_num++; + + if (m_current_chunk_num >= m_buffer_cdr.getNumChunks()) + throw new org.omg.CORBA.MARSHAL("END OF BUFFER", 0, + CompletionStatus.COMPLETED_NO); + + m_chunk = m_buffer_cdr.getChunk(m_current_chunk_num); + m_position = 0; + } + + /** + * Sets the covering position. It assumes if the new position is less than + * actual, the position is in a father encapsulation, of if greater is in + * the same encapsulation. + * + * @return true if OK, or false if it is a bad + * position. + */ + + public boolean setPosition(AbsolutePosition new_position) + { + // search the context + + int n = new_position.getValue(); + while (n < m_context.getStartPointer().getAbsolutePosition().getValue()) + exitEncapsulation(); + + // sets the chunk and position + + PointerCDR pointer = m_buffer_cdr.getPointer(n); + + if (pointer != null) { + m_current_chunk_num = pointer.getNumChunk(); + m_position = pointer.getPosition(); + return true; + } + // error bad position + return false; + } + + public void skip(int n) + { + m_position += n; + } + + /** + * Calculates the aligned position for the given type size. The aligment is + * refered at the actual encapsulation beginning. + * + * @param type_size + * the data type size. + */ + protected int alignPosition(int type_size) + { + int gap, rest; + rest = (m_position + m_alignment_offset.m_value) % type_size; + gap = (rest == 0) ? 0 : (type_size - rest); + return (m_position + gap); + } + + /** + * Says if the data must be aligned. + * + * @param type_size + * the data type size + */ + + public boolean mustAlign(int type_size) + { + return (m_position != alignPosition(type_size)); + } + + /** + * Changes aligns the position for the given type size.The aligment is + * refered at the actual encapsulation beginning. + * + * @param type_size + * the data type size. + */ + + public void align(int type_size) + { + m_position = alignPosition(type_size); + } + + /** + * Says if there is enougth space in the actual chunk for writting data from + * a given size. + * + * @param type_size the data type size. + * @return true<\code> if there is enougth space or false<\code> + * otherwise. + */ + + public boolean enoughSpace(int type_size) + { + return ((m_chunk.m_buffer.length - alignPosition(type_size)) + >= type_size); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/MarkCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/MarkCDR.java.svn-base new file mode 100644 index 0000000..eb4dd55 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/MarkCDR.java.svn-base @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Mark stack used for mark and rewind methods in CDRInputStream. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class MarkCDR +{ + + public MarkCDR(ContextCDR context, PointerCDR pointer) + { + m_context = context; + m_pointer = pointer; + } + + public ContextCDR getContext() + { + return m_context; + } + + public PointerCDR getPointer() + { + return m_pointer; + } + + /** + * Initial context for rewind. + */ + + protected ContextCDR m_context; + + /** + * Poiner to a buffer position. . + */ + + protected PointerCDR m_pointer; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PointerCDR.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PointerCDR.java.svn-base new file mode 100644 index 0000000..a2f2ade --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PointerCDR.java.svn-base @@ -0,0 +1,137 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * PointerCDR class points up a buffer position for future marshaling and + * unmarshaling. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class PointerCDR +{ + /** + * Buffer pointered. + */ + private BufferCDR m_buffer; + + /** + * Chunk number of the buffer. + */ + private int m_num_chunk; + + /** + * Position in the chunk + */ + private int m_position; + + /** + * Absolute position in the buffer. + */ + private AbsolutePosition m_absolute_position; + + /** + * Constructor: creates a pointer to position of a chunk in a buffer. + */ + + public PointerCDR(BufferCDR buffer, int num_chunk, int position) + { + this.m_buffer = buffer; + this.m_num_chunk = num_chunk; + this.m_position = position; + m_absolute_position = null; + } + + public BufferCDR getBuffer() + { + return m_buffer; + } + + public int getNumChunk() + { + return m_num_chunk; + } + + public int getPosition() + { + return m_position; + } + + /** + * Calculates the absolute position of a pointer from the begining of the + * buffer. + * + * @return the absulte position from the begining of the buffer. + */ + + public AbsolutePosition getAbsolutePosition() + { + + if (m_absolute_position == null) { + + int total_position = 0; + // add all the precedent chunks sizes + for (int i = 0; i < m_num_chunk; i++) + total_position += m_buffer.getChunk(i).getLength(); + // add the actual chunk position + total_position += m_position; + m_absolute_position = + AbsolutePosition.createAbsolutePosition(total_position); + } + return m_absolute_position; + } + + /** + * calculates the hash code of the pointer for a Hashtable. The hash code is + * the absolute position in the buffer that is a unique value in the buffer. + * + * @return the hash code. + */ + + public int hashCode() + { + return getAbsolutePosition().getValue(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PositionsNode.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PositionsNode.java.svn-base new file mode 100644 index 0000000..38a75e1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/PositionsNode.java.svn-base @@ -0,0 +1,149 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Hashtable; + +/** + * The PositionNode class represents a table with the identifier + * and the position of the objects that has been marshaled in a buffer. + *

+ * The table entries are the Object identifier and the AbsolutePosition of the + * Object. + *

+ * There is a PositionNode per encapsulation, an they are linked + * to the father encausulation node throght the Encapsulation contexts. + * + *

+ * Copyright 2001 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class PositionsNode +{ + + /** + * Hashtable that contains Absolute positions of the TypeCodes. The keys are + * the repository ids. + */ + private Hashtable m_table; + + /** + * Position at the beginning of the encapsulation. + */ + private AbsolutePosition m_root_position; + + /** + * Lower Inidirected in the encapsulation sequence that has been looking up. + */ + private AbsolutePosition m_lower_indirection; + + public PositionsNode(AbsolutePosition type_code_position) + { + m_table = null; + m_root_position = type_code_position; + m_lower_indirection = m_root_position; + } + + /** + * Looks up if an Object has been yet marshaled in a stream. + * If the object has been marshaled in a father encapsulation, the it will + * remark it at the lower_indirection + * + * @param id + * the Object Id of the marshaled Object. + */ + public synchronized PointerCDR lookup(java.lang.Object obj) + { + // search in own table + if (m_table != null) + return (PointerCDR) m_table.get(obj); + + return null; + } + + /** + * notify the node that a indirection has been set thru this node + * + * @return true if the indirection pass through + */ + public synchronized void indirection(AbsolutePosition position) + { + if ((position != null) + && (position.getValue() < m_lower_indirection.getValue())) { + m_lower_indirection = position; + } + } + + /** + * Saves a TypeCode position in the table. + * + * @param id + * the Object Id of the marshaled object + * @param position + * the object position in the buffer + */ + + public synchronized void put(java.lang.Object id, PointerCDR position) + { + if (m_table == null) + m_table = new Hashtable(); + + m_table.put(id, position); + } + + /** + * Used to calculate if an marshaled TypeCode has any indirection out of the + * encapsulation. This means that a TypeCode encapsulation may or not be + * reused. + * + * @return whether or not has any indirection out of the encapsulation. + */ + public boolean hasExternalIndirections() + { + return m_lower_indirection.getValue() < m_root_position.getValue(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/TypeCodeReader.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/TypeCodeReader.java.svn-base new file mode 100644 index 0000000..ec909ec --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/TypeCodeReader.java.svn-base @@ -0,0 +1,267 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.TypeCodeCache; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeImpl; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * TypeCode Demarshaling class. Reads the typecode kind and + * creates a new typecode finishing its remarshaling. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class TypeCodeReader +{ + + /** + * Read a TypeCode from the InputStream. + * + * @param input + * the input stream + */ + public static TypeCode read(CDRInputStream input) + { + + // aligns to get the typeCode position + + input.alignment(CDR.LONG_SIZE); + + // gets the typecode position + + PointerCDR typecode_position = input.getPointer(); + + // read the tc_kind value + int kind = input.read_long(); + + if (kind == -1) // indirection + { + return readIndirection(input); + } + + // typecode kind + TCKind tc_kind = null; + + try { + tc_kind = TCKind.from_int(kind); + } + catch (BAD_PARAM bp) { + throw new BAD_TYPECODE("Invalid kind: " + bp.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + // Typecode readed + TypeCodeImpl type = null; + + if (TypeCodeFactory.isComplex(tc_kind)) { + TypeCode cached_type = findInCache(input); + + if (cached_type != null) { + input.skipEncapsulation(); + input.getContextCDR() + .putPosition(typecode_position.getAbsolutePosition(), + cached_type); + return cached_type; + } + + type = TypeCodeFactory.getComplexTypeCode(tc_kind); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + type.partialUnmarshal(input); + + // it is a complex typecode: insert the typecode in the table and + // unmarshal + + input.getContextCDR() + .putPosition(typecode_position.getAbsolutePosition(), type); + + return putInCache(input, type); + + } else if (TypeCodeFactory.isSemiComplex(tc_kind)) { + + type = TypeCodeFactory.getSemiComplexTypeCode(tc_kind); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + type.partialUnmarshal(input); + + return type; + + } else { // is basic + + type = TypeCodeFactory.getBasicTypeCode(tc_kind); + + if (type == null) + throw new org.omg.CORBA.INTERNAL("Error reading typecode"); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + return type; + } + } + + /** + * Read a TypeCode from the InputStream. + * + * @param input + * the input stream + */ + public static TypeCode readIndirection(CDRInputStream input) + { + AbsolutePosition referenced_position = input.readIndirection(); + + // search in the indirection node + + java.lang.Object obj = input.getContextCDR() + .lookupObject(referenced_position); + + if (obj != null) { + if (obj instanceof TypeCode) { + return (TypeCode) obj; + } else { + throw new MARSHAL("Invalid indirection: no typecode indirected"); + } + } + + // Visibroker makes indirections to basic types, is it one? + + CDRInputStream indirection_input = input.copy(); + + indirection_input.setPosition(referenced_position); + + TCKind tc_kind = TCKind.from_int(indirection_input.read_long()); + + TypeCodeImpl type = TypeCodeFactory.getBasicTypeCode(tc_kind); + + if (type == null) // it is not a basic typeCode: ERROR!!! + throw new MARSHAL("Invalid indirection: no typecode indirected."); + + return type; + } + + public static TypeCode findInCache(CDRInputStream input) + { + TIDORB orb = (TIDORB) input.orb(); + + if (orb == null) + return null; + + TypeCodeCache cache = orb.getTypeCodeCache(); + + if (cache != null) { + + // lectura adelantada del repository id para ver si ya está en la + // cache + + CDRInputStream encap = input.copy(); + + encap.enterEncapsulation(); + + String rep_id = encap.read_string(); + + encap = null; + + return cache.find(rep_id); + } + + return null; + } + + public static TypeCode putInCache(CDRInputStream input, TypeCode tc) + { + TIDORB orb = (TIDORB) input.orb(); + + if (orb == null) + return tc; + + TypeCodeCache cache = orb.getTypeCodeCache(); + + if (cache != null) { + return cache.put(tc); + } + return tc; + } + + public static void skip(CDRInputStream input) + { + + int kind; // typecode kind value + TCKind tc_kind; // typecode kind + TypeCodeImpl type = null; // typecode + + // read the tc_kind value + kind = input.read_long(); + + if (kind == -1) { // indirection + // skip indirection offset + input.skipLong(); + } + + try { + tc_kind = TCKind.from_int(kind); + } + catch (BAD_PARAM bp) { + throw new BAD_TYPECODE("Invalid kind: " + bp.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + TypeCodeMarshaler.skipParams(tc_kind, input); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ValueTypeInfo.java.svn-base b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ValueTypeInfo.java.svn-base new file mode 100644 index 0000000..0848e7e --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/.svn/text-base/ValueTypeInfo.java.svn-base @@ -0,0 +1,342 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.util.CodeBaseURL; +import es.tid.TIDorbj.core.util.RepositoryId; + +public class ValueTypeInfo +{ + + public final static int NULL_TAG = 0; + + /* value tags constants */ + public final static int CODE_BASE_BIT = 0x00000001; + + public final static int SINGLE_REPOSITORY_ID = 0x00000002; + + public final static int REPOSITORY_ID_LIST = 0x00000006; + + public final static int INDIRECTION_TAG = 0xffffffff; + + public final static int FRAGMENTED_BIT = 0x00000008; + + public final static int MIN_VALUE_TAG = 0x7ffff00; + + public final static int MAX_VALUE_TAG = 0x7ffffff; + + public final static int MIN_CHUNK_SIZE = 0; + + public final static int MAX_CHUNK_SIZE = 0x7ffff00; + + private CodeBaseURL m_code_base_url; + + private RepositoryId[] m_repository_ids; + + private int m_value_tag; + + private java.io.Serializable m_value; + + public ValueTypeInfo() + { + m_code_base_url = null; + m_repository_ids = null; + m_value_tag = MIN_VALUE_TAG; + m_value = null; + } + + protected ValueTypeInfo(int value_tag) + { + m_code_base_url = null; + m_repository_ids = null; + m_value_tag = value_tag; + m_value = null; + } + + public boolean isNull() + { + return m_value_tag == NULL_TAG; + } + + public boolean isIndirection() + { + return m_value_tag == INDIRECTION_TAG; + } + + public boolean isFragmented() + { + return ((!isIndirection()) + && ((m_value_tag & FRAGMENTED_BIT) == FRAGMENTED_BIT)); + } + + public boolean is_state() + { + return (m_value_tag != NULL_TAG) && (m_value_tag != INDIRECTION_TAG); + } + + public RepositoryId[] get_repository_ids() + { + return m_repository_ids; + } + + public String get_id() + { + if ((m_repository_ids == null) || (m_repository_ids.length == 0)) + return null; + return m_repository_ids[0].m_value; + } + + public boolean is_truncable(String rep_id) + { + String value_id = null; + + if (m_repository_ids != null) { + for (int i = 0; i < m_repository_ids.length; i++) { + value_id = m_repository_ids[i].m_value; + + if (rep_id.equals(value_id)) { + return true; + } + } + } + return false; + } + + public void set_repository_ids(String[] ids) + { + RepositoryId[] rep_ids = new RepositoryId[ids.length]; + + for (int i = 0; i < ids.length; i++) { + rep_ids[i] = new RepositoryId(ids[i]); + } + set_repository_ids(rep_ids); + } + + public void set_repository_ids(RepositoryId[] ids) + { + m_repository_ids = ids; + + if ((ids == null) || (ids.length == 0)) { + m_value_tag &= ~REPOSITORY_ID_LIST; + } else if (ids.length == 1) { + m_value_tag &= ~REPOSITORY_ID_LIST; + m_value_tag |= SINGLE_REPOSITORY_ID; + } else { + m_value_tag |= REPOSITORY_ID_LIST; + } + } + + public void set_value(java.io.Serializable val) + { + m_value = val; + } + + public java.io.Serializable get_value() + { + return m_value; + } + + public boolean has_code_base_url() + { + return m_code_base_url != null; + } + + public CodeBaseURL get_code_base_url() + { + return m_code_base_url; + } + + public void set_code_base_url(CodeBaseURL url) + { + m_code_base_url = url; + + if (url == null) + m_value_tag &= ~CODE_BASE_BIT; + else + m_value_tag |= CODE_BASE_BIT; + } + + public void set_fragmented(boolean value) + { + if (value) + m_value_tag |= FRAGMENTED_BIT; + else + m_value_tag &= ~FRAGMENTED_BIT; + } + + public static ValueTypeInfo read(CDRInputStream in) + { + int value = in.read_long(); + + ValueTypeInfo info = new ValueTypeInfo(value); + + info.read_info(in); + + return info; + } + + public static void write_null(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(NULL_TAG); + } + + public void write(CDROutputStream out) + { + out.write_long(m_value_tag); + write_code_base_url(out); + write_type_info(out); + } + + protected void read_info(CDRInputStream input) + { + if ((m_value_tag != INDIRECTION_TAG) && (m_value_tag != NULL_TAG)) { + read_code_base_url(input); + read_type_info(input); + } + } + + protected void read_code_base_url(CDRInputStream input) + { + if ((m_value_tag & CODE_BASE_BIT) == 0x0) + return; + + input.alignment(CDR.LONG_SIZE); + + AbsolutePosition this_url_position = input.getAbsolutePosition(); + + int code_base_tag = input.read_long(); + + if (code_base_tag == INDIRECTION_TAG) { + AbsolutePosition url_position = input.readIndirection(); + java.lang.Object obj = input.getContextCDR() + .lookupObject(url_position); + + if ((obj != null) && (obj instanceof CodeBaseURL)) + m_code_base_url = (CodeBaseURL) obj; + else + throw new MARSHAL("Invalid URL indirection"); + } else { // read code_base_url + char[] chars = new char[code_base_tag]; + input.read_char_array(chars, 0, code_base_tag); + m_code_base_url = new CodeBaseURL(new String(chars)); + input.getContextCDR().putPosition(this_url_position, + m_code_base_url); + } + } + + protected void write_code_base_url(CDROutputStream out) + { + if (m_code_base_url != null) + out.write_string(m_code_base_url.m_url); + } + + protected void read_type_info(CDRInputStream input) + { + if ((m_value_tag & REPOSITORY_ID_LIST) == REPOSITORY_ID_LIST) { + // read ids sequence + int length = input.read_long(); + + if (length < 0) + throw new MARSHAL("Invalid RepositoryId seq length < 0"); + + m_repository_ids = new RepositoryId[length]; + + for (int i = 0; i < length; i++) + m_repository_ids[i] = read_repository_id(input); + + } else if ((m_value_tag & SINGLE_REPOSITORY_ID) == SINGLE_REPOSITORY_ID) { + // int length = input.read_long(); + + // if(length != 1) + // throw new MARSHAL("Invalid RepositoryId seq length != 1"); + + m_repository_ids = new RepositoryId[1]; + + m_repository_ids[0] = read_repository_id(input); + } // else there is no type data + } + + protected RepositoryId read_repository_id(CDRInputStream input) + { + input.alignment(CDR.LONG_SIZE); + AbsolutePosition id_position = input.getAbsolutePosition(); + + int repository_id_tag = input.read_long(); + if (repository_id_tag == INDIRECTION_TAG) { + AbsolutePosition url_position = input.readIndirection(); + java.lang.Object obj = input.getContextCDR() + .lookupObject(url_position); + + if ((obj != null) && (obj instanceof RepositoryId)) + return (RepositoryId) obj; + else + throw new MARSHAL("Invalid RepositoryId indirection"); + } else { + char[] chars = new char[repository_id_tag]; + input.read_char_array(chars, 0, repository_id_tag); + RepositoryId id = + new RepositoryId(new String(chars, 0, + repository_id_tag - 1)); + input.getContextCDR().putPosition(id_position, id); + return id; + } + } + + protected void write_type_info(CDROutputStream out) + { + if (m_code_base_url != null) + out.writeReferenceableString(m_code_base_url.m_url); + + if (m_repository_ids != null) { + if ((m_value_tag & REPOSITORY_ID_LIST) == REPOSITORY_ID_LIST) { + out.write_long(m_repository_ids.length); + for (int i = 0; i < m_repository_ids.length; i++) + out.writeReferenceableString(m_repository_ids[i].m_value); + } else { // SINGLE_REPOSITORY_ID + out.writeReferenceableString(m_repository_ids[0].m_value); + } + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/AbsolutePosition.java b/source/es/tid/TIDorbj/core/cdr/AbsolutePosition.java new file mode 100644 index 0000000..2e5d762 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/AbsolutePosition.java @@ -0,0 +1,125 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents the absolute position in the CDR buffer of any data. + *

+ * @autor Juan A. Cáceres + * @version 1.0 + */ +public class AbsolutePosition +{ + + /** + * The absulute position in the buffer; + */ + + private int m_value; + + private AbsolutePosition(int position) + { + m_value = position; + } + + public static AbsolutePosition createAbsolutePosition(int position) + { + if (position < 0) + return null; + return new AbsolutePosition(position); + } + + public int getValue() + { + return m_value; + } + + public int hashCode() + { + return m_value; + } + + public boolean equals(java.lang.Object obj) + { + if (obj instanceof AbsolutePosition) + return m_value == ((AbsolutePosition) obj).m_value; + else + return false; + } + + /** + * Calculates the offset from another Absolute Position. + * + * @return the offset ( <0 if the other position is higher than the actual + * position or >0 otherwise) + */ + + public int offset(AbsolutePosition from) + { + return m_value - from.m_value; + } + + public AbsolutePosition addOffset(int offset) + { + if (m_value + offset < 0) + return null; + else + return new AbsolutePosition(m_value + offset); + } + + /** + * Alings the position for the given type size. The aligment is refered to + * the absolute position. + * + * @param type_size + * the data type size. + */ + + public void align(int type_size) + { + int gap, rest; + rest = m_value % type_size; + gap = (rest == 0) ? 0 : type_size - rest; + m_value += gap; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/AlignmentOffset.java b/source/es/tid/TIDorbj/core/cdr/AlignmentOffset.java new file mode 100644 index 0000000..7234afc --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/AlignmentOffset.java @@ -0,0 +1,93 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents an correction aligment offset from a position in the buffer of an + * encapsulation. This aligment offset is the number of positions that the + * beginning of the encapsulation needs to be aligned to the maximun data size + * (longlong) representing the 0 position. + *

+ * The offset is calculated by the factory operation + * calculateOffset: + *

+ * The offset value is defined in a range of [0..MAX_ALIGNMENT-1]. + * offset = CDR.MAX_ALIGNMENT- (actual_positon % CDR.MAX_ALIGNMENT) The Aligment + * offet requires the GIOP message size to be multiple of + * CDR.MAX_ALIGNMENT, that is, 8, for allowing fragmentation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class AlignmentOffset +{ + + /** + * The offset value. It must be [0..MAX_ALIGNMENT-1]. + */ + public int m_value; + + /** + * Private constructor. Use calculateOffsetFrom. + */ + private AlignmentOffset(int offset) + { + m_value = offset; + } + + /** + * Object Factory, that calculates the correct offset for a position. + */ + + public static AlignmentOffset calculateOffsetFrom(int position) + { + int offset = (CDR.MAX_ALIGNMENT - (position % CDR.MAX_ALIGNMENT)); + // makes the offset 0 if its the MAX_ALIGNMENT + if (offset == CDR.MAX_ALIGNMENT) + offset = 0; + + return new AlignmentOffset(offset); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/BufferCDR.java b/source/es/tid/TIDorbj/core/cdr/BufferCDR.java new file mode 100644 index 0000000..23ef075 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/BufferCDR.java @@ -0,0 +1,290 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Vector; + +/** + * represents a marshaled octet IIOP stream thad can be splitted in chunks. + *

+ * This buffer will exentialy used for store chunks received from a conection + * for reading data. Also, the buffer can be used for marshal a octet stream. In + * this case, the buffer can be monochunk or multichunk an growable or not. + *

+ * The buffer can be transformed in a String or byte array for storing IIOP + * data. The String and byte array formats allows regenerate the buffer. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class BufferCDR +{ + + /** + * Header size in the array format. + */ + final static int ARRAY_HEADER_SIZE = 5; + + /** + * Header size in the string format. + */ + public final static int STRING_HEADER_SIZE = 14; + + /** + * Vector that contains the buffer chunks. + */ + protected Vector m_chunks; + + /** + * The size of the new chunks. + */ + + protected int m_chunk_size; + + /** + * Creates a new empty buffer monochunk for marshaling. + */ + + public BufferCDR(int block_size) + { + m_chunks = new Vector(); + m_chunk_size = block_size; + addChunk(new ChunkCDR(m_chunk_size)); + } + + /** + * Creates a buffer monochunk with the array. + */ + + public BufferCDR(byte[] buffer) + { + m_chunks = new Vector(); + m_chunk_size = buffer.length; + addChunk(new ChunkCDR(buffer)); + } + + /** + * Creates a buffer monochunk with the chunk. + */ + + public BufferCDR(ChunkCDR chunk) + { + m_chunks = new Vector(); + m_chunk_size = chunk.m_buffer.length; + addChunk(chunk); + } + + /** + * Returns the number of chunks. + */ + public int getNumChunks() + { + return m_chunks.size(); + } + + /** + * @return true if it has an unique chunk, false + * otherwise. + */ + public boolean isMonoChunk() + { + return (m_chunks.size() == 1); + } + + /** + * @return the chunk associated to de index, or null if not + * exits. + */ + public ChunkCDR getChunk(int index) + { + if (index < m_chunks.size()) + return (ChunkCDR) m_chunks.elementAt(index); + else + return null; + } + + /** + * Prepare the buffer to be reused. + */ + public void recycle() + { + int num_chunks = getNumChunks(); + for (int i = 0; i < num_chunks; i++) + ((ChunkCDR) m_chunks.elementAt(i)).recycle(); + } + + /** + * Insert a new chunk in the buffer. + */ + public boolean addChunk(ChunkCDR chunk) + { + m_chunks.addElement(chunk); + return true; + } + + /** + * Insert a new chunk in the buffer at a position less than the buffer size. + */ + public boolean insertChunk(ChunkCDR chunk, int at) + { + if (at >= m_chunks.size()) + return false; + m_chunks.insertElementAt(chunk, at); + return true; + } + + /** + * Creates and inserts a new chunk ant the end of the buffer. + * + * @return true if OK or false on error; + */ + + public boolean grow() + { + if (m_chunk_size > 0) { + addChunk(new ChunkCDR(m_chunk_size)); + return true; + } else + return false; + } + + public boolean grow_1_0() + { + if (m_chunk_size > 0) { + + if (m_chunks.size() != 1) + return false; + ChunkCDR chunk = getChunk(0); + + byte[] aux_buffer = new byte[chunk.m_buffer.length + m_chunk_size]; + + System.arraycopy(aux_buffer, 0, chunk.m_buffer, 0, + chunk.m_buffer.length); + + chunk.setBuffer(aux_buffer); + + return true; + + } else + return false; + } + + public PointerCDR getPointer(int position) + { + //pre: position < available + + int num_chunk = 0; + int chunk_available = 0; + int available = 0; + while (num_chunk < m_chunks.size()) { + chunk_available = getChunk(num_chunk).getAvailable(); + if (position <= chunk_available + available - 1) + break; // this is the position + available += chunk_available; + num_chunk++; + } + + if (num_chunk >= m_chunks.size()) + return null; + + return new PointerCDR(this, num_chunk, position - available); + } + + public int getAvailable() + { + int available = 0; + int num_chunks = m_chunks.size(); + for (int i = 0; i < num_chunks; i++) + available += getChunk(i).getAvailable(); + + return available; + } + + public int getNumAvailableChunks() + { + int available = 0; + int num_chunks = m_chunks.size(); + for (int i = 0; i < num_chunks; i++) { + if (getChunk(i).getAvailable() > 0) + available++; + else + break; + } + + return available; + } + + /** + * Compares the data of two BufferCDR + * + * @return true if the data contained is equal. + */ + public boolean equal(BufferCDR buff) + { + int available = getAvailable(); + if (available != buff.getAvailable()) + return false; + int num_chunks = getNumAvailableChunks(); + + if (num_chunks != buff.getNumAvailableChunks()) + return false; + + for (int i = 0; i < num_chunks; i++) + if (getChunk(i).getAvailable() != buff.getChunk(i).getAvailable()) + return false; + + byte[] buffer_a, buffer_b; + for (int i = 0; i < num_chunks; i++) { + buffer_a = getChunk(i).getBuffer(); + buffer_b = buff.getChunk(i).getBuffer(); + int size = getChunk(i).getAvailable(); + for (int j = 0; j < size; j++) + if (buffer_a[j] != buffer_b[j]) + return false; + } + + return true; + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/CDR.java b/source/es/tid/TIDorbj/core/cdr/CDR.java new file mode 100644 index 0000000..d8d679d --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/CDR.java @@ -0,0 +1,151 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Collection of Basic Data type representation sizes in CDR. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDR +{ + + public final static int MAX_ALIGNMENT = 8; + + public final static int OCTET_SIZE = 1; + + public final static int BOOLEAN_SIZE = 1; + + public final static int CHAR_SIZE = 1; + + public final static int WCHAR_SIZE = 2; + + public final static int SHORT_SIZE = 2; + + public final static int USHORT_SIZE = 2; + + public final static int LONG_SIZE = 4; + + public final static int ULONG_SIZE = 4; + + public final static int FLOAT_SIZE = 4; + + public final static int LONGLONG_SIZE = 8; + + public final static int ULONGLONG_SIZE = 8; + + public final static int DOUBLE_SIZE = 8; + + //NOT IMPLEMENTED: + //public final static int LONG_DOUBLE_SIZE = 16; + + public final static boolean BIG_ENDIAN = false; + + public final static boolean LITTLE_ENDIAN = true; + + public final static boolean LOCAL_BYTE_ORDER = BIG_ENDIAN; + + /** + * Helper array to convert bytes to chars: the char is a component of the + * array, indexed by the byte value. + */ + public static final int[] CHAR_MAP = { 256 - 128, 256 - 127, 256 - 126, + 256 - 125, 256 - 124, 256 - 123, + 256 - 122, 256 - 121, 256 - 120, + 256 - 119, 256 - 118, 256 - 117, + 256 - 116, 256 - 115, 256 - 114, + 256 - 113, 256 - 112, 256 - 111, + 256 - 110, 256 - 109, 256 - 108, + 256 - 107, 256 - 106, 256 - 105, + 256 - 104, 256 - 103, 256 - 102, + 256 - 101, 256 - 100, 256 - 99, + 256 - 98, 256 - 97, 256 - 96, + 256 - 95, 256 - 94, 256 - 93, + 256 - 92, 256 - 91, 256 - 90, + 256 - 89, 256 - 88, 256 - 87, + 256 - 86, 256 - 85, 256 - 84, + 256 - 83, 256 - 82, 256 - 81, + 256 - 80, 256 - 79, 256 - 78, + 256 - 77, 256 - 76, 256 - 75, + 256 - 74, 256 - 73, 256 - 72, + 256 - 71, 256 - 70, 256 - 69, + 256 - 68, 256 - 67, 256 - 66, + 256 - 65, 256 - 64, 256 - 63, + 256 - 62, 256 - 61, 256 - 60, + 256 - 59, 256 - 58, 256 - 57, + 256 - 56, 256 - 55, 256 - 54, + 256 - 53, 256 - 52, 256 - 51, + 256 - 50, 256 - 49, 256 - 48, + 256 - 47, 256 - 46, 256 - 45, + 256 - 44, 256 - 43, 256 - 42, + 256 - 41, 256 - 40, 256 - 39, + 256 - 38, 256 - 37, 256 - 36, + 256 - 35, 256 - 34, 256 - 33, + 256 - 32, 256 - 31, 256 - 30, + 256 - 29, 256 - 28, 256 - 27, + 256 - 26, 256 - 25, 256 - 24, + 256 - 23, 256 - 22, 256 - 21, + 256 - 20, 256 - 19, 256 - 18, + 256 - 17, 256 - 16, 256 - 15, + 256 - 14, 256 - 13, 256 - 12, + 256 - 11, 256 - 10, 256 - 9, 256 - 8, + 256 - 7, 256 - 6, 256 - 5, 256 - 4, + 256 - 3, 256 - 2, 256 - 1, 0, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127 }; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/CDRInputStream.java b/source/es/tid/TIDorbj/core/cdr/CDRInputStream.java new file mode 100644 index 0000000..4d81019 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/CDRInputStream.java @@ -0,0 +1,2324 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.ValueFactory; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; +import es.tid.TIDorbj.core.util.FixedHolder; + +/** + * Portable InputStream for demarshalling. + *

+ * A CDRInputStream has an buffer iterator + * CDRIterator. The iterator maintains the data position and + * correct aligment, and TypeCode marshaling information. + * + * @see es.tid.TIDorbj.core.cdr.CDROutputStream + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDRInputStream extends org.omg.CORBA_2_3.portable.InputStream + implements org.omg.CORBA.DataInputStream +{ + + /** + * ORB instance that created the input stream. + */ + + TIDORB m_orb; + + /** + * GIOPVersion used. + */ + + GIOPVersion m_version; + + /** + * The buffer is a GIOP message. A GIOP Message implies that the GIOP Header + * space will be reserved in the BufferCDR, that is, each ChunkCDR will have + * the header size bytes allocated. + */ + + boolean m_is_message; + + /** + * Buffer iterator. + */ + + protected IteratorCDR m_iterator; + + /** + * Current chunk buffer. + */ + + protected byte[] m_chunk_buffer; + + /** + * Data buffer for Broken data splitted in to chunks in an encapsulations + */ + + protected byte[] m_data_buffer = null; + + protected static javax.rmi.CORBA.ValueHandler st_value_handler = null; + + + public CDRInputStream(TIDORB orb, byte[] buffer) + { + this(orb, new IteratorCDR(new BufferCDR(buffer))); + } + + public CDRInputStream(TIDORB orb, BufferCDR buffer) + { + this(orb, new IteratorCDR(buffer)); + } + + protected CDRInputStream(TIDORB orb, IteratorCDR iterator) { + this.m_orb = orb; + + if ( orb != null ){ + this.m_version = GIOPVersion.fromString ( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + } else { + this.m_version = GIOPVersion.fromString( + IIOPCommunicationLayerPropertiesInfo.DEFAULT_GIOP_VERSION + ); + } + + this.m_is_message = false; + this.m_iterator = iterator; + + m_chunk_buffer = iterator.m_chunk.m_buffer; + m_data_buffer = new byte[CDR.LONGLONG_SIZE]; + } + + // DataInputStream + static String[] st_data_input_ids = + { "IDL:omg.org/CORBA/DataInputStream:1.0" }; + + public String[] _truncatable_ids() + { + return st_data_input_ids; + } + + /** + * @return the GIOP version used to marshal. + */ + public GIOPVersion getVersion() + { + return m_version; + } + + /** + * Sets the GIOP version used to marshal. + */ + public void setVersion(GIOPVersion ver) + { + m_version = ver; + } + + /** + * @return true if the stream is a GIOP message. + */ + public boolean isMessage() + { + return m_is_message; + } + + /** + * Sets if the stream is a GIOP message. + */ + public void setMessage(boolean is) + { + m_is_message = is; + + if ((is) && (m_iterator.m_current_chunk_num == 0) + && (m_iterator.m_position == 0)) + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + } + + public org.omg.CORBA.ORB orb() + { + if (m_orb != null) + return m_orb; + else + return es.tid.TIDorbj.core.TIDORB.init(); + } + + /** + * Sets the stream byte order. + * + * @param byte_order + * if true little-endian, else big-endian + */ + public void setByteOrder(boolean byte_order) + { + m_iterator.setByteOrder(byte_order); + } + + /** + * @return the stream byte order, if true little-endian, else + * big-endian + */ + public boolean getByteOrder() + { + return m_iterator.getByteOrder(); + } + + /** + * @return the stream buffer + */ + public BufferCDR getBuffer() + { + return m_iterator.getBuffer(); + } + + /** + * @return the Encapsulation Context + */ + public ContextCDR getContextCDR() + { + return m_iterator.m_context; + } + + /** + * Creates a new Encapsulation Context with it own aligment an indirections. + */ + public void enterEncapsulation() + { + skipUlong(); // skip encapsulation size + // sets the real encapsulation start point + alignment(CDR.OCTET_SIZE); + m_iterator.enterEncapsulation(); + //sets the byte order + m_iterator.setByteOrder(read_boolean()); + } + + /** + * Close the Encapsulation Context, and restore the father Context. + * + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + public void exitEncapsulation() + { + m_iterator.exitEncapsulation(); + } + + /** + * Extract from the buffer an encapsulation, creating a new bufferCDR + * containing the octect sequence. + * + * @return a new CDRInputStream for reading the encapsulation. + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + public Encapsulation readEncapsulation() + { + return Encapsulation.read(this, m_version); + } + + public void skipEncapsulation() + { + int encapsulation_size = read_ulong(); + skipOctetArray(encapsulation_size); + } + + /** + * Sets the aligment offset in the current Context. + * + * @param pos + * the new offset + * @see es.tid.TIDorbj.core.cdr.AligmentOffset + */ + public void set_alignment_offset(int pos) + { + m_iterator.setAlignmentOffset(pos); + } + + /** + * @return the absolute value in the buffer order of the current position. + */ + public AbsolutePosition getAbsolutePosition() + { + return m_iterator.getPointer().getAbsolutePosition(); + } + + /** + * @return the current position in the buffer. + */ + + public PointerCDR getPointer() + { + return m_iterator.getPointer(); + } + + /** + * Jumps to the absolute position. + * + * @pram position the new position + */ + public void setPosition(AbsolutePosition position) + { + m_iterator.setPosition(position); + } + + /** + * @return a new inputstream pointing the same position. + */ + public CDRInputStream copy() + { + CDRInputStream stream = new CDRInputStream(m_orb, m_iterator.copy()); + stream.setMessage(m_is_message); + stream.setVersion(m_version); + return stream; + } + + public boolean read_boolean() + { + alignment(CDR.BOOLEAN_SIZE); + return ((m_chunk_buffer[m_iterator.m_position++] == 0) ? false : true); + } + + public void skipBoolean() + { + alignment(CDR.BOOLEAN_SIZE); + m_iterator.m_position++; + } + + public char read_char() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + alignment(CDR.CHAR_SIZE); + return (char) (0xff & m_chunk_buffer[m_iterator.m_position++]); + } + + public void skipChar() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + alignment(CDR.CHAR_SIZE); + m_iterator.m_position++; + } + + public char read_wchar() + { + + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + if (m_iterator.m_byte_order) + return (char) ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (char) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.WCHAR_SIZE); + if (m_iterator.m_byte_order) { + return (char) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (char) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipWchar() + { + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + m_iterator.m_position += CDR.WCHAR_SIZE; + } else { + skip(CDR.WCHAR_SIZE); + } + } + + public byte read_octet() + { + alignment(CDR.OCTET_SIZE); + return m_chunk_buffer[m_iterator.m_position++]; + } + + public void skipOctet() + { + alignment(CDR.OCTET_SIZE); + m_iterator.m_position++; + } + + public short read_short() + { + if (alignment(CDR.SHORT_SIZE)) { + if (m_iterator.m_byte_order) + return (short) + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (short) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.SHORT_SIZE); + if (m_iterator.m_byte_order) { + return (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipShort() + { + if (alignment(CDR.SHORT_SIZE)) { + m_iterator.m_position += CDR.SHORT_SIZE; + } else { + skip(CDR.SHORT_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" short = ushort values will be handled by the + * user + */ + public short read_ushort() + { + if (alignment(CDR.SHORT_SIZE)) { + if (m_iterator.m_byte_order) + return (short) ((m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8)); + else + return (short) + (((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff)); + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.USHORT_SIZE); + if (m_iterator.m_byte_order) { + return (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + return (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + } + } + + public void skipUshort() + { + if (alignment(CDR.USHORT_SIZE)) { + m_iterator.m_position += CDR.USHORT_SIZE; + } else { + skip(CDR.USHORT_SIZE); + } + } + + public int read_long() + { + if (alignment(CDR.LONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + (m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24); + } else { + return + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.LONG_SIZE); + if (m_iterator.m_byte_order) { + return (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + return ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + } + } + + public void skipLong() + { + if (alignment(CDR.LONG_SIZE)) { + m_iterator.m_position += CDR.LONG_SIZE; + } else { + skip(CDR.LONG_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" int = positive ulong values will be handled by + * the user + */ + public int read_ulong() + { + if (alignment(CDR.ULONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + (m_chunk_buffer[m_iterator.m_position++] & 0xff) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24); + } else { + return + ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 24) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 16) + | ((m_chunk_buffer[m_iterator.m_position++] & 0xff) << 8) + | (m_chunk_buffer[m_iterator.m_position++] & 0xff); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.ULONG_SIZE); + if (m_iterator.m_byte_order) { + return (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + return ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + } + } + + public void skipUlong() + { + if (alignment(CDR.ULONG_SIZE)) { + m_iterator.m_position += CDR.ULONG_SIZE; + } else { + skip(CDR.ULONG_SIZE); + } + } + + public long read_longlong() + { + if (alignment(CDR.LONGLONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 8) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 56); + + } else { + return + (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.LONGLONG_SIZE); + if (m_iterator.m_byte_order) { + return ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + return (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + } + } + + public void skip_longlong() + { + if (alignment(CDR.LONGLONG_SIZE)) { + m_iterator.m_position += CDR.LONGLONG_SIZE; + } else { + skip(CDR.LONGLONG_SIZE); + } + } + + /** + * JAVA MAPPING: "negative" longlong = positive ulonglong values will be + * handled by the user + */ + public long read_ulonglong() + { + if (alignment(CDR.ULONGLONG_SIZE)) { + if (m_iterator.m_byte_order) { + return + ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 8) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL)<< 56); + + } else { + return + (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[m_iterator.m_position++] & 0xffL); + } + } else { + readOctetArrayAux(m_data_buffer, 0, CDR.ULONGLONG_SIZE); + if (m_iterator.m_byte_order) { + return ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + return (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + } + } + + public void skipUlonglong() + { + if (alignment(CDR.ULONGLONG_SIZE)) { + m_iterator.m_position += CDR.ULONGLONG_SIZE; + } else { + skip(CDR.ULONGLONG_SIZE); + } + } + + public float read_float() + { + return java.lang.Float.intBitsToFloat(read_long()); + } + + public void skipFloat() + { + skipLong(); + } + + public double read_double() + { + return java.lang.Double.longBitsToDouble(read_longlong()); + } + + public void skipDouble() + { + skip_longlong(); + } + + public String read_string() + { + // read the string length, including the end of string '\0' character + int length = read_ulong(); + + if (length <= 0) + throw new MARSHAL("read_string: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + if (length == 1) { + skipChar(); //skip the null character + return ""; + } else { + char[] array = new char[length]; + readCharArrayAux(array, 0, length); + //skip the null character + return new String(array, 0, length - 1); + } + } + + public void skipString() + { + // read the string length, including the end of string '\0' character + int length = read_ulong(); + + if (length <= 0) + throw new MARSHAL("skip_string: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + skip(length); + } + + public String read_wstring() + { + // read the string length, in wstring there is a null '\0' character at + // the end + + int length = read_ulong(); + + // the length is the number of bytes in the wide-string + int real_length = 0; + + if (m_version == GIOPVersion.VERSION_1_2) { + real_length = (length / CDR.WCHAR_SIZE) - 1; + + } else if(m_version == GIOPVersion.VERSION_1_1) { + real_length = length - 1; + } else { + throw new MARSHAL("GIOP 1.0 does not supports wstring", + 6, + CompletionStatus.COMPLETED_NO); + } + + if (real_length < 0) + throw new MARSHAL( + "read_wstring: invalid string length: " + length, + 0, CompletionStatus.COMPLETED_NO); + + if (real_length == 0) { + skipWchar(); + return ""; + } else { + char[] array = new char[real_length]; + read_wchar_array(array, 0, real_length); + skipWchar(); // skiping the '\0' + return new String(array, 0, real_length); + } + } + + public void skipWstring() + { + // read the string length, in bytes, not including the end of string + // '\0' character + int length = read_ulong(); + skipOctetArray(length); + } + + public void read_boolean_array(boolean[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null boolean array reference.", 0, + CompletionStatus.COMPLETED_NO); + + int booleans_can_read = 0; + + // número de octetos que quedan por leer en el chunk actual + + int remain_booleans = length; + + int position = 0; + int stop_at = 0; + + while (remain_booleans > 0) { + + position = m_iterator.m_position; + + booleans_can_read = java.lang.Math.min(remain_booleans, + m_iterator.available()); + + stop_at = position + booleans_can_read; + + while (position < stop_at) { + value[offset++] = (m_chunk_buffer[position++] == 0) ? false + : true; + } + + m_iterator.m_position = stop_at; + remain_booleans -= booleans_can_read; + + if (remain_booleans > 0) { + getNextChunk(); + } + } + } + + public void skipBooleanArray(int length) + { + skip(length); + } + + public void read_char_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + readCharArrayAux(value, offset, length); + } + + public void readCharArrayAux(char[] value, int offset, int length) + { + int chars_can_read = 0; + int remain_chars = length; + int position = 0; + int stop_at = 0; + + while (remain_chars > 0) { + // calculates how many bytes the actual chunk has got. + chars_can_read = java.lang.Math.min(remain_chars, + m_iterator.available()); + + position = m_iterator.m_position; + + stop_at = position + chars_can_read; + + while (position < stop_at) + value[offset++] = (char) (m_chunk_buffer[position++] & 0xff); + + m_iterator.m_position = position; + remain_chars -= chars_can_read; + + if (remain_chars > 0) + getNextChunk(); + } + } + + public void skipCharArray(int length) + { + skip(length); + } + + public void read_wchar_array(char[] value, int offset, int length) + { + + if (value == null) + throw new BAD_PARAM("Null wchar array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos wchar que se pueden leer enteros + int wchars_can_read = 0; + + int position = 0; + + // numero de wchars que quedan + int remain_wchars = length; + + while (remain_wchars > 0) { + + if (!alignment(CDR.WCHAR_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.WCHAR_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (char) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + value[offset++] = (char) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + + remain_wchars--; + + } else { + position = m_iterator.m_position; + + wchars_can_read = java.lang.Math + .min( + remain_wchars, + m_iterator.available() + / CDR.WCHAR_SIZE); + + for (int i = wchars_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (char) ((m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8)); + else + value[offset++] = + (char) (((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_wchars -= wchars_can_read; + m_iterator.m_position = position; + + if (remain_wchars > 0) { + getNextChunk(); + } + } + } + } + + public void skipWcharArray(int length) + { + if (length > 0) { + alignment(CDR.WCHAR_SIZE); + skip(length * CDR.WCHAR_SIZE); + } + } + + public void read_octet_array(byte[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + readOctetArrayAux(value, offset, length); + } + + public void readOctetArrayAux(byte[] value, int offset, int length) + { + int to_read, how_many = length; + + while (how_many > 0) { + + // calculates how many bytes the actual chunk has got. + to_read = java.lang.Math.min(how_many, m_iterator.available()); + + System.arraycopy(m_chunk_buffer, m_iterator.m_position, value, + offset, to_read); + + offset += to_read; + m_iterator.m_position += to_read; + how_many -= to_read; + + if (how_many > 0) + getNextChunk(); + + } + } + + public void skipOctetArray(int length) + { + skip(length); + } + + public void read_short_array(short[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null short array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos short que se pueden leer enteros + int shorts_can_read = 0; + + int position = 0; + + // numero de shorts que quedan + int remain_shorts = length; + + while (remain_shorts > 0) { + + if (!alignment(CDR.SHORT_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.SHORT_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (short) ((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8)); + } else { + value[offset++] = (short) (((m_data_buffer[0] & 0xff) << 8) + | (m_data_buffer[1] & 0xff)); + } + + remain_shorts--; + + } else { + position = m_iterator.m_position; + + shorts_can_read = + java.lang.Math.min(remain_shorts, + m_iterator.available() + / CDR.SHORT_SIZE); + + for (int i = shorts_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (short) ((m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8)); + else + value[offset++] = + (short) (((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_shorts -= shorts_can_read; + m_iterator.m_position = position; + + if (remain_shorts > 0) { + getNextChunk(); + } + } + } + } + + public void skipShortArray(int length) + { + skipArray(length, CDR.SHORT_SIZE); + } + + public void read_ushort_array(short[] value, int offset, int length) + { + read_short_array(value, offset, length); + } + + public void skipUshortArray(int length) + { + skipArray(length, CDR.USHORT_SIZE); + } + + public void read_long_array(int[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos int que se pueden leer enteros + int ints_can_read = 0; + + int position = 0; + + // numero de ints que quedan + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.LONG_SIZE)) {// encapsulación, el dato no cabe + // completo + + readOctetArrayAux(m_data_buffer, 0, CDR.LONG_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = (m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24); + } else { + value[offset++] = ((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff); + } + + remain_ints--; + + } else { + position = m_iterator.m_position; + + ints_can_read = java.lang.Math + .min( + remain_ints, + m_iterator.available() + / CDR.LONG_SIZE); + + for (int i = ints_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + (m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 24); + else + value[offset++] = + ((m_chunk_buffer[position++] & 0xff) << 24) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff); + } + + remain_ints -= ints_can_read; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } + } + } + } + + public void skipLongArray(int length) + { + skipArray(length, CDR.LONG_SIZE); + } + + public void read_ulong_array(int[] value, int offset, int length) + { + read_long_array(value, offset, length); + } + + public void skipUlongArray(int length) + { + skipArray(length, CDR.ULONG_SIZE); + } + + public void read_longlong_array(long[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos long que se pueden leer enteros + int longs_can_read = 0; + + int position = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.LONGLONG_SIZE)) { // encapsulación, el dato no + // cabe completo + readOctetArrayAux(m_data_buffer, 0, CDR.LONGLONG_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56); + } else { + value[offset++] = + (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL); + } + + remain_longs--; + + } else { + position = m_iterator.m_position; + + longs_can_read = java.lang.Math + .min( + remain_longs, + m_iterator.available() + / CDR.LONGLONG_SIZE); + + for (int i = longs_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + ((long) m_chunk_buffer[position++] & 0xffL) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 56); + else + value[offset++] = + (((long) m_chunk_buffer[position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | ((long) m_chunk_buffer[position++] & 0xffL); + } + + remain_longs -= longs_can_read; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } + } + } + } + + public void skipLonglongArray(int length) + { + skipArray(length, CDR.LONGLONG_SIZE); + } + + public void read_ulonglong_array(long[] value, int offset, int length) + { + read_longlong_array(value, offset, length); + } + + // DataInputStream + public void read_ulonglong_array(org.omg.CORBA.ULongLongSeqHolder seq, + int offset, int length) + { + read_ulonglong_array(seq.value, offset, length); + } + + public void skipUlonglongArray(int length) + { + skipArray(length, CDR.ULONGLONG_SIZE); + } + + public void read_float_array(float[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos int que se pueden leer enteros + int ints_can_read = 0; + + int position = 0; + + // numero de ints que quedan + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.FLOAT_SIZE)) { // encapsulación, el dato no cabe + // completo + readOctetArrayAux(m_data_buffer, 0, CDR.FLOAT_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + Float.intBitsToFloat((m_data_buffer[0] & 0xff) + | ((m_data_buffer[1] & 0xff) << 8) + | ((m_data_buffer[2] & 0xff) << 16) + | ((m_data_buffer[3] & 0xff) << 24)); + } else { + value[offset++] = + Float.intBitsToFloat(((m_data_buffer[0] & 0xff) << 24) + | ((m_data_buffer[1] & 0xff) << 16) + | ((m_data_buffer[2] & 0xff) << 8) + | (m_data_buffer[3] & 0xff)); + } + + remain_ints--; + + } else { + position = m_iterator.m_position; + + ints_can_read = java.lang.Math + .min( + remain_ints, + m_iterator.available() + / CDR.FLOAT_SIZE); + + for (int i = ints_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + Float.intBitsToFloat( + (m_chunk_buffer[position++] & 0xff) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 24)); + else + value[offset++] = + Float.intBitsToFloat( + ((m_chunk_buffer[position++] & 0xff) << 24) + | ((m_chunk_buffer[position++] & 0xff) << 16) + | ((m_chunk_buffer[position++] & 0xff) << 8) + | (m_chunk_buffer[position++] & 0xff)); + } + + remain_ints -= ints_can_read; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } + } + } + } + + public void skipFloatArray(int length) + { + skipArray(length, CDR.FLOAT_SIZE); + } + + public void read_double_array(double[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de datos long que se pueden leer enteros + int longs_can_read = 0; + + int position = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.DOUBLE_SIZE)) { // encapsulación, el dato no cabe + // completo + + readOctetArrayAux(m_data_buffer, 0, CDR.DOUBLE_SIZE); + + if (m_iterator.m_byte_order) { + value[offset++] = + Double.longBitsToDouble( + ((long) m_data_buffer[0] & 0xffL) + | (((long) m_data_buffer[1] & 0xffL) << 8) + | (((long) m_data_buffer[2] & 0xffL) << 16) + | (((long) m_data_buffer[3] & 0xffL) << 24) + | (((long) m_data_buffer[4] & 0xffL) << 32) + | (((long) m_data_buffer[5] & 0xffL) << 40) + | (((long) m_data_buffer[6] & 0xffL) << 48) + | (((long) m_data_buffer[7] & 0xffL) << 56)); + } else { + value[offset++] = + Double.longBitsToDouble( + (((long) m_data_buffer[0] & 0xffL) << 56) + | (((long) m_data_buffer[1] & 0xffL) << 48) + | (((long) m_data_buffer[2] & 0xffL) << 40) + | (((long) m_data_buffer[3] & 0xffL) << 32) + | (((long) m_data_buffer[4] & 0xffL) << 24) + | (((long) m_data_buffer[5] & 0xffL) << 16) + | (((long) m_data_buffer[6] & 0xffL) << 8) + | ((long) m_data_buffer[7] & 0xffL)); + } + + remain_longs--; + + } else { + position = m_iterator.m_position; + + longs_can_read = + java.lang.Math.min(remain_longs, + m_iterator.available() + / CDR.LONGLONG_SIZE); + + for (int i = longs_can_read; i > 0; i--) { + if (m_iterator.m_byte_order) + value[offset++] = + Double.longBitsToDouble( + ((long) m_chunk_buffer[position++] & 0xffL) + | (((long) m_chunk_buffer[position++] & 0xffL) << 8) + | (((long) m_chunk_buffer[position++] & 0xffL) << 16) + | (((long) m_chunk_buffer[position++] & 0xffL) << 24) + | (((long) m_chunk_buffer[position++] & 0xffL) << 32) + | (((long) m_chunk_buffer[position++] & 0xffL) << 40) + | (((long) m_chunk_buffer[position++] & 0xffL) << 48) + | (((long) m_chunk_buffer[position++] & 0xffL) << 56)); + else + value[offset++] = + Double.longBitsToDouble( + (((long) m_chunk_buffer[position++] & 0xffL) << 56) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 48) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 40) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 32) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 24) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 16) + | (((long) m_chunk_buffer[position++] & 0xffL)<< 8) + | ((long) m_chunk_buffer[position++] & 0xffL)); + } + + remain_longs -= longs_can_read; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } + } + } + } + + public void skipDoubleArray(int length) + { + skipArray(length, CDR.DOUBLE_SIZE); + } + + public org.omg.CORBA.Object read_Object() + { + IOR ior = new DefaultIOR(); + ior.read( this ); + + if (ior.memberCount() == 0) // null reference + return null; + else + return ObjectImpl.fromIOR(m_orb, ior); + } + + public org.omg.CORBA.Object read_Object(java.lang.Class clz) + { + java.lang.Object stub = null; + + try { + stub = clz.newInstance(); + } + catch (InstantiationException ie) { + throw new org.omg.CORBA.BAD_PARAM("Can not instantiate class" + + clz.getName()); + } + catch (IllegalAccessException iae) { + throw new org.omg.CORBA.BAD_PARAM("Can not instantiate class: " + + iae.toString()); + } + + if ((stub != null) + && (stub instanceof org.omg.CORBA.portable.ObjectImpl)) { + org.omg.CORBA.portable.ObjectImpl obj_impl = + (org.omg.CORBA.portable.ObjectImpl) read_Object(); + org.omg.CORBA.portable.ObjectImpl stub_ref = + (org.omg.CORBA.portable.ObjectImpl) stub; + stub_ref._set_delegate(obj_impl._get_delegate()); + return stub_ref; + + } + throw new BAD_PARAM("Invalid Reference Class:" + + " it does not implements org.omg.CORBA.portable.ObjectImpl"); + } + + public void skipObject() + { + IOR.skip(this); + } + + public org.omg.CORBA.TypeCode read_TypeCode() + { + return TypeCodeReader.read(this); + } + + public void skipTypeCode() + { + read_TypeCode(); + //TypeCodeReader.skip(this); + } + + public org.omg.CORBA.Any read_any() + { + TypeCode type = read_TypeCode(); + + AnyImpl any = new AnyImpl(m_orb); + any.type(type); + any.read_value(this, type); + return any; + } + + public void skipAny() + { + TypeCode type = read_TypeCode(); + TypeCodeMarshaler.skipValue(type, this); + } + + public void read_any_array(org.omg.CORBA.Any[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + value[i] = read_any(); + } + + public org.omg.CORBA.Context read_Context() + { + return ContextImpl.read(this); + } + + public void skipContext() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + public org.omg.CORBA.Principal read_Principal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + + } + + public void skipPrincipal() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.math.BigDecimal read_fixed() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void skipFixed() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void skip_fixed(short digits, short scale) + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + TypeCodeMarshaler.skipValue(fixed_type, this); + } + + public org.omg.CORBA.Any read_fixed(short digits, short scale) + throws org.omg.CORBA.BadFixedValue + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + FixedHolder holder = new FixedHolder(fixed_type); + holder._read(this); + AnyImpl any = (AnyImpl) m_orb.create_any(); + any.insert_Streamable(holder); + return any; + } + + public void skip_fixed_array(int length, short digits, short scale) + { + TypeCode fixed_type = m_orb.create_fixed_tc(digits, scale); + + for (int i = 0; i < length; i++) + TypeCodeMarshaler.skipValue(fixed_type, this); + + } + + public void read_fixed_array(org.omg.CORBA.AnySeqHolder seq, int offset, + int length, short digits, short scale) + throws org.omg.CORBA.BadFixedValue + { + if ((seq == null) || (seq.value == null)) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (seq.value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + seq.value[i] = read_fixed(digits, scale); + } + + ///////////////////// + // DataInputStream // + ///////////////////// + + public void read_boolean_array(org.omg.CORBA.BooleanSeqHolder seq, + int offset, int length) + { + read_boolean_array(seq.value, offset, length); + } + + public void read_char_array(org.omg.CORBA.CharSeqHolder seq, int offset, + int length) + { + read_char_array(seq.value, offset, length); + } + + public void read_wchar_array(org.omg.CORBA.WCharSeqHolder seq, int offset, + int length) + { + read_wchar_array(seq.value, offset, length); + } + + public void read_octet_array(org.omg.CORBA.OctetSeqHolder seq, int offset, + int length) + { + read_octet_array(seq.value, offset, length); + } + + public void read_short_array(org.omg.CORBA.ShortSeqHolder seq, int offset, + int length) + { + read_short_array(seq.value, offset, length); + } + + public void read_ushort_array(org.omg.CORBA.UShortSeqHolder seq, + int offset, int length) + { + read_ushort_array(seq.value, offset, length); + } + + public void read_long_array(org.omg.CORBA.LongSeqHolder seq, int offset, + int length) + { + read_long_array(seq.value, offset, length); + } + + public void read_ulong_array(org.omg.CORBA.ULongSeqHolder seq, int offset, + int length) + { + read_ulong_array(seq.value, offset, length); + } + + public void read_longlong_array(org.omg.CORBA.LongLongSeqHolder seq, + int offset, int length) + { + read_longlong_array(seq.value, offset, length); + } + + public void read_float_array(org.omg.CORBA.FloatSeqHolder seq, int offset, + int length) + { + read_float_array(seq.value, offset, length); + } + + public void read_double_array(org.omg.CORBA.DoubleSeqHolder seq, + int offset, int length) + { + read_double_array(seq.value, offset, length); + } + + public void read_any_array(org.omg.CORBA.AnySeqHolder seq, int offset, + int length) + { + read_any_array(seq.value, offset, length); + } + + ///////////////// + // InputStream // + ///////////////// + public int available() + { + return m_iterator.bufferAvailable(); + } + + public int read() + { + return (int) read_octet(); + } + + public int read(byte[] value) + { + read_octet_array(value, 0, value.length); + return value.length; + } + + public int read(byte[] value, int offset, int length) + { + read_octet_array(value, offset, length); + return length; + } + + public boolean markSupported() + { + return true; + } + + public void mark(int readlimit) + { + m_iterator.mark(); + } + + public void reset() + throws java.io.IOException + { + m_iterator.reset(); + } + + //corba 2.3 + + protected ValueTypeInfo getIndirectedValue() + { + AbsolutePosition indirected_position = readIndirection(); + + java.lang.Object obj = + getContextCDR().lookupObject(indirected_position); + + if (obj instanceof ValueTypeInfo) + return (ValueTypeInfo) obj; + else + throw new MARSHAL("No Value Indirected"); + } + + public java.io.Serializable read_value() + { + return readValueWithId(null); + } + + public java.io.Serializable read_value(java.lang.String rep_id) + { + if (rep_id == null) + throw new BAD_PARAM("Null rep_id"); + + return readValueWithId(rep_id); + } + + // DataInputStream + public java.io.Serializable read_Value() + { + return read_value(); + } + + protected java.io.Serializable readValueWithId(java.lang.String rep_id) + { + alignment(CDR.LONG_SIZE); + + MarkCDR value_mark = m_iterator.getMark(); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + value_info = getIndirectedValue(); + + if ((rep_id != null) && (!value_info.is_truncable(rep_id))) + throw new BAD_PARAM("Cannot truncate value to: " + rep_id); + + return value_info.get_value(); + } + + String id = value_info.get_id(); + + if (id == null) { + if (rep_id == null) { + throw new MARSHAL("Unknown Repository Id"); + } + + id = rep_id; + } else if ((rep_id != null) && (!value_info.is_truncable(rep_id))) { + throw new BAD_PARAM("Cannot truncate value to: " + rep_id); + } + + java.io.Serializable value = null; + + if (id.equals("IDL:omg.org/CORBA/WStringValue:1.0")) { + // special handling of strings, according to spec + value = read_wstring(); + } else if (id.startsWith("IDL:")) { + ValueFactory factory = m_orb.lookup_value_factory(id); + + if (factory == null) + throw new MARSHAL("Cannot get Value Factory"); + + if (value_info.isFragmented()) { + throw new + NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + m_iterator.goBack(value_mark); + + value = factory.read_value(this); + } else + // RMI + { + // ValueHandler wants class, repository_id, and sending context. + // I wonder why it wants all of these. + // If we settle down on this implementation, compute these + // values more efficiently elsewhere. + + String className = + es.tid.TIDorbj.core.util.RepositoryId.className(id); + + Class c = null; + + try { + c = Thread.currentThread().getContextClassLoader() + .loadClass(className); + } + catch (ClassNotFoundException e) { + throw new RuntimeException("class not found: " + className); + } + + m_iterator.goBack(value_mark); + + initValueHandler(); + + value = + st_value_handler.readValue(this, //InputStream + 0, //offset + c, //value class + id, // repository Id + st_value_handler.getRunTimeCodeBase()); + } + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public java.io.Serializable read_value(java.lang.Class clz) + { + if ((clz == null)) + throw new BAD_PARAM(); + + java.lang.Object obj = null; + + try { + java.lang.reflect.Constructor constructor = + clz.getConstructor(new Class[0]); + + obj = constructor.newInstance(new Object[0]); + + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + + if (obj instanceof java.io.Serializable) + return read_value((java.io.Serializable) obj); + else + throw new + BAD_PARAM("Class does not implements java.io.Serializable"); + } + + public java.io.Serializable + read_value(org.omg.CORBA.portable.BoxedValueHelper factory) + { + alignment(CDR.LONG_SIZE); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + value_info = getIndirectedValue(); + + if (!value_info.get_id().equals(factory.get_id())) + throw new BAD_PARAM("Cannot truncate value"); + + return value_info.get_value(); + } + + es.tid.TIDorbj.core.util.RepositoryId[] ids = + value_info.get_repository_ids(); + + if ((ids == null) || (ids.length == 0)) { + String[] rep_ids = new String[1]; + rep_ids[0] = factory.get_id(); + value_info.set_repository_ids(rep_ids); + } else if (!ids[0].m_value.equals(factory.get_id())) { + throw new + BAD_PARAM("Invalid RepositoryId: value id does not " + + "match valuebox id"); + } + + if (value_info.isFragmented()) { + throw new NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + java.io.Serializable value = factory.read_value(this); + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public java.io.Serializable read_value(java.io.Serializable value) + { + alignment(CDR.LONG_SIZE); + + AbsolutePosition value_position = getAbsolutePosition(); + + ValueTypeInfo value_info = ValueTypeInfo.read(this); + + if (value_info.isNull()) + return null; + + if (value_info.isIndirection()) { + + value_info = getIndirectedValue(); + + java.io.Serializable value_readed = value_info.get_value(); + + if (!value_readed.getClass().isInstance(value)) + throw new BAD_PARAM("Cannot truncate value"); + + return value_readed; + } + + if (value instanceof org.omg.CORBA.portable.StreamableValue) { + org.omg.CORBA.portable.StreamableValue streamable = + (org.omg.CORBA.portable.StreamableValue) value; + + String value_id = value_info.get_id(); + + try { + if ((value_id != null) + && (!value_id.equals(streamable._type().id()))) + throw new BAD_PARAM("Streamable id is not the same"); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + streamable._read(this); + + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + + org.omg.CORBA.portable.CustomValue custom = + (org.omg.CORBA.portable.CustomValue) value; + + String value_id = value_info.get_id(); + + if (value_id != null) { + String[] custom_ids = custom._truncatable_ids(); + + boolean truncable = false; + + for (int i = 0; i < custom_ids.length; i++) { + if (value_info.is_truncable(custom_ids[i])) { + truncable = true; + break; + } + } + + if (!truncable) + throw new BAD_PARAM("Streamable id is not the same"); + } + + if (value_info.isFragmented()) { + throw new + NO_IMPLEMENT("Fragmented value reading not implemented"); + } + + custom.unmarshal(this); + } else if (value instanceof java.lang.String) { + value = read_wstring(); + } else if (value instanceof java.io.Serializable) { + initValueHandler(); + + value = + st_value_handler.readValue(this, //InputStream + 0, //offset + value.getClass(), //value class + value_info.get_id(), // repository Id + st_value_handler.getRunTimeCodeBase()); + } else { + throw new BAD_PARAM("No Serializable class"); + } + + value_info.set_value(value); + + getContextCDR().putPosition(value_position, value_info); + + return value; + } + + public void initValueHandler() + { + synchronized (this.getClass()) { + if (st_value_handler == null) + st_value_handler = javax.rmi.CORBA.Util.createValueHandler(); + } + } + + public java.lang.Object read_abstract_interface() + { + boolean is_reference = read_boolean(); + + if (is_reference) + return read_Object(); + else + return read_value(); + } + + //DataInputStream + + public java.lang.Object read_Abstract() + { + return read_abstract_interface(); + } + + public java.lang.Object read_abstract_interface(java.lang.Class clz) + { + boolean is_reference = read_boolean(); + + if (is_reference) + return read_Object(); + else + return read_value(clz); + } + + // tidorb operations + + public void skipIndirection() + { + skipLong(); + } + + public AbsolutePosition readIndirection() + { + // Prevent fragment jumps + + alignment(CDR.LONG_SIZE); + + // calculate the indirection + + AbsolutePosition typecode_indirection = getAbsolutePosition(); + + // read indirection offset + + int offset = read_long(); + + // SELF-INDIRECTINIG not allowed + + if (offset >= -CDR.LONG_SIZE) + throw new MARSHAL("Invalid offset"); + + int headers_length = 0; + + // if message add to offset the message headers + + if ((m_is_message) && (m_iterator.m_current_chunk_num > 0)) { + int fragment_header_size = 0; + + if (getVersion() == GIOPVersion.VERSION_1_2) + fragment_header_size = + GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; + else + fragment_header_size = + GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; + + BufferCDR buffer = getBuffer(); + + // minimun valid offset from the fragment where is the indirection + + int current_fragment = m_iterator.m_current_chunk_num; + + ChunkCDR chunk = buffer.getChunk(current_fragment); + + int offset_from_fragment = 0; + + if (chunk.hasHeader()) + offset_from_fragment = CDR.LONG_SIZE + fragment_header_size + - m_iterator.m_position; + else + offset_from_fragment = CDR.LONG_SIZE - m_iterator.m_position; + + // loop: add to offset fragment header size while the offset was + // less than valid offset from indirection fragment + while ((current_fragment > 0) && (offset < offset_from_fragment)) { + chunk = buffer.getChunk(--current_fragment); + + offset_from_fragment -= chunk.getAvailable(); + + if (chunk.hasHeader()) + offset -= fragment_header_size; + } + } + + AbsolutePosition referenced_position; + + referenced_position = typecode_indirection.addOffset(offset); + + if (referenced_position == null) + throw new MARSHAL("Invalid indirection: offset out of bounds.", 0, + CompletionStatus.COMPLETED_NO); + + // align the position to read the typecode in a aligned position of long + // this position alwais is aligned to long independently of + // encapsulation. + + // referenced_position.align(CDR.LONG_SIZE); + + return referenced_position; + } + + public void fixStarting() + { + m_iterator.fixStarting(); + } + + /** + * Sets the stream to the begining of the buffer. + */ + public void rewind() + { + m_iterator.rewind(); + + if ((m_is_message) && (m_iterator.m_current_chunk_num == 0) + && (m_iterator.m_position == 0)) + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Get the next chunk of the buffer + * + * @throws org.omg.CORBA.MARSHAL + * if the end of the buffer is reached. + * @see es.tid.TIDorbj.core.cdr.ChunkCDR + * @see es.tid.TIDorbj.core.cdr.BufferCDR + */ + public void getNextChunk() + { + if ((m_is_message) && (m_version != GIOPVersion.VERSION_1_0)) { + /* + * if(version == GIOPVersion.VERSION_1_0) throw new MARSHAL("End of + * Buffer: GIOP 1.0 does not allows fragmentation"); + */ + m_iterator.nextChunk(); + + if (m_iterator.m_chunk.hasHeader()) { + skip(GIOPHeader.HEADER_SIZE); + + if (m_version == GIOPVersion.VERSION_1_2) { + GIOPFragmentMessage.skipFragmentHeader1_2(this); + } + } + + } else { + m_iterator.nextChunk(); + } + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Set the stream pointer to the next aligned position of given data type + * + * @param type_size + * the type size in octets + */ + public void goNextAlignedPosition(int type_size) + { + // set the aligned position + + int next_position = m_iterator.alignPosition(type_size); + + if (next_position > m_iterator.m_chunk.m_available) { + if (m_iterator.m_encapsulation) { + // continue the encapsulation aligment in next chunk + int gap = next_position - m_iterator.m_position; + skip(gap); + alignment(CDR.OCTET_SIZE); // prevents next_position == length + } else { + getNextChunk(); + } + } else if (next_position == m_iterator.m_chunk.m_available) { + getNextChunk(); + } else { + m_iterator.m_position = next_position; + } + } + + /** + * Sets the reading pointer in the correct aligmnet for the data type. If + * necessary, gets the next chunk. + *

+ * CORBA 2.3 specification says: A primitive data type of 8 bytes or + * smaller, should never be broken across two fragments.Therefore, if the + * remaining bytes are not sufficient for reading the data next chunk will + * be set for reading. + *

+ * If it is reading a encapsulation and the data is broken into two chunks, + * reads the data compoentes byte per byte. + * + * @param type_size the type size for alignment. + * @return true if can read directly the data or + * false if byte swap is needed because the data is + * splitted in two framgments and is contended in a encapsulation. + * @throws org.omg.CORBA.MARSHAL + * if the end of the buffer is reached. + */ + + public boolean alignment(int type_size) + throws org.omg.CORBA.MARSHAL + { + + goNextAlignedPosition(type_size); + + if (m_iterator.enoughSpace(type_size)) + return true; + + // there is no space for whole data bytes + + if (m_iterator.m_encapsulation) + return false; // marshal byte per byte + + // marshaling in the main buffer, get next chunk + getNextChunk(); + + return true; + } + + private void skipArray(int length, int type_length) + { + if (length < 0) + throw new BAD_PARAM("Invalid array length", 0, + CompletionStatus.COMPLETED_NO); + + // número de octetos pertenecientes a datos que se pueden leer enteros + int octets_can_skip = 0; + + // numero de datos que quedan por saltar + int remain_data = length; + + while (remain_data > 0) { + + if (!alignment(type_length)) { // encapsulación, el dato no cabe + // completo + + skip(type_length); + + remain_data--; + + } else { + octets_can_skip = java.lang.Math.min(remain_data * type_length, + m_iterator.available()); + + remain_data -= octets_can_skip / type_length; + m_iterator.m_position += octets_can_skip; + + if (remain_data > 0) { + getNextChunk(); + } + } + } + } + + public long skip(long n) + { + if (n > 0L) { + int chunk_left = m_iterator.available(); + if (n <= chunk_left) + m_iterator.skip((int) n); + else { + getNextChunk(); + skip(n - chunk_left); + } + return n; + } + return 0; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/CDROutputStream.java b/source/es/tid/TIDorbj/core/cdr/CDROutputStream.java new file mode 100644 index 0000000..a818170 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/CDROutputStream.java @@ -0,0 +1,1810 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.DATA_CONVERSION; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.portable.ValueBase; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * Portable OutputStream for demarshalling. + *

+ * A CDROutputStream has an buffer iterator + * CDRIterator. The iterator maintains the data position and + * correct aligment, and TypeCode marshaling information. + * + * @see es.tid.TIDorbj.core.cdr.CDRInputStream + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class CDROutputStream extends org.omg.CORBA_2_3.portable.OutputStream + implements org.omg.CORBA.DataOutputStream +{ + + /** + * ORB instance that created the output stream. + */ + + TIDORB m_orb; + + /** + * GIOPVersion used. + */ + + GIOPVersion m_version; + + /** + * The buffer is a GIOP message. A GIOP Message implies that the GIOP Header + * space will be reserved in the BufferCDR, that is, each ChunkCDR will have + * the header size bytes allocated. + */ + + boolean m_is_message; + + /** + * Buffer Iterator. + */ + protected IteratorCDR m_iterator; + + /** + * Current chunk buffer. + */ + + protected byte[] m_chunk_buffer; + + /** + * Data buffer for Broken data splitted in to chunks in an encapsulations + */ + + protected byte[] m_data_buffer = null; + + protected static javax.rmi.CORBA.ValueHandler st_value_handler = null; + + // DataOutputStream + static String[] st_data_output_ids = + { "IDL:omg.org/CORBA/DataOutputStream:1.0" }; + + public String[] _truncatable_ids() + { + return st_data_output_ids; + } + + public CDROutputStream(TIDORB orb, byte[] buffer) + { + this(orb, new IteratorCDR(new BufferCDR(buffer))); + } + + public CDROutputStream(TIDORB orb, BufferCDR buffer) + { + this(orb, new IteratorCDR(buffer)); + } + + public CDROutputStream(TIDORB orb, int chunk_size) + { + this(orb, new IteratorCDR(new BufferCDR(chunk_size))); + } + + protected CDROutputStream(TIDORB orb, IteratorCDR iterator) + { + m_orb = orb; + + if ( orb != null ){ + this.m_version = GIOPVersion.fromString ( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + } else { + this.m_version = GIOPVersion.fromString( + IIOPCommunicationLayerPropertiesInfo.DEFAULT_GIOP_VERSION + ); + } + + this.m_is_message = false; + this.m_iterator = iterator; + iterator.m_byte_order = CDR.BIG_ENDIAN; + + m_chunk_buffer = iterator.m_chunk.m_buffer; + m_data_buffer = new byte[CDR.LONGLONG_SIZE]; + } + + /** + * @return the GIOP version used to marshal. + */ + public GIOPVersion getVersion() + { + return m_version; + } + + /** + * Sets the GIOP version used to marshal. + */ + public void setVersion(GIOPVersion ver) + { + m_version = ver; + } + + /** + * @return true if the stream is a GIOP message. + */ + public boolean isMessage() + { + return m_is_message; + } + + /** + * Sets if the stream is a GIOP message. + */ + public void setMessage(boolean is) + { + m_is_message = is; + + if ((is) && (m_iterator.m_position == 0)) { + skip(es.tid.TIDorbj.core.comm.giop.GIOPHeader.HEADER_SIZE); + } + } + + /** + * @return the stream byte order, if true little-endian, else + * big-endian + */ + public boolean getByteOrder() + { + return m_iterator.getByteOrder(); + } + + /** + * @return the stream buffer + */ + public BufferCDR getBuffer() + { + return m_iterator.getBuffer(); + } + + /** + * Sets the aligment offset in the current Context. + * + * @param pos + * the new offset + * @see es.tid.TIDorbj.core.cdr.AligmentOffset + */ + public void setAlignmentOffset(int pos) + { + m_iterator.setAlignmentOffset(pos); + } + + /** + * @return pointer to the actual position in the buffer. + */ + public PointerCDR actualPointer() + { + return m_iterator.getPointer(); + } + + /** + * Creates a new Encapsulation Context with it own aligment an indirections. + */ + public void enterEncapsulation() + { + // skip the length + + CDROutputStream length_out = copy(); + + write_ulong(1); + + // get the real start position of encapsulation + + alignment(CDR.OCTET_SIZE); + + m_iterator.enterEncapsulation(); + + //write byte order + write_boolean(m_iterator.getByteOrder()); + + // save the length output stream in the new context + m_iterator.m_context.setLengthOut(length_out); + } + + /** + * Close the Encapsulation Context, write en encapsulation length, and + * restore the father Context. + * + * @see es.tid.TIDorbj.core.cdr.ContextCDR + */ + + public void exitEncapsulation() + { + + CDROutputStream length_out = m_iterator.m_context.m_length_out; + + if (length_out == null) + throw new org.omg.CORBA.INTERNAL("Null Length out"); + + int headers_length = 0; + + // if message Calculate the headers size to subtract the value to the + // Encapsulation size + /* + * if (message) { int fragments = iterator.current_chunk_num - + * length_out.iterator.current_chunk_num; + * + * + * if(version == GIOPVersion.VERSION_1_2) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; else if (version == + * GIOPVersion.VERSION_1_1) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; else headers_length = + * 0; } + */ + int encapsulation_length = + getAbsolutePosition().getValue() + - m_iterator.m_context.m_starts_at.getAbsolutePosition().getValue(); + // - headers_length; + + length_out.write_ulong(encapsulation_length); + + m_iterator.m_context.deleteLengthOut(); + + m_iterator.exitEncapsulation(); + + } + + /** + * @return an input stream with its beginning at this marshaling position + */ + public CDRInputStream inputStreamAtThisPosition() + { + CDRInputStream input = new CDRInputStream(m_orb, m_iterator.copy()); + input.fixStarting(); + input.setMessage(m_is_message); + input.setVersion(m_version); + return input; + } + + public org.omg.CORBA.ORB orb() + { + if (m_orb != null) + return m_orb; + else + return es.tid.TIDorbj.core.TIDORB.init(); + } + + public org.omg.CORBA.portable.InputStream create_input_stream() + { + CDRInputStream input; + + input = new CDRInputStream(m_orb, m_iterator.copy()); + + input.setMessage(m_is_message); + input.setVersion(m_version); + + input.rewind(); + + return input; + } + + /** + * @return a new inputstream pointing the same position. + */ + public CDROutputStream copy() + { + CDROutputStream stream = new CDROutputStream(m_orb, m_iterator.copy()); + stream.setMessage(m_is_message); + stream.setVersion(m_version); + return stream; + } + + public ContextCDR getContextCDR() + { + return m_iterator.m_context; + } + + /** + * Writes as an encapsulation the buffer. + *

+ * The first octet in the encapsulation must be the byte-order. + * + * @encapsulation a buffer with the encapsulation. + */ + public void writeEncapsulation(Encapsulation encapsulation) + { + encapsulation.write(this); + } + + /** + * @return the absolute value in the buffer order of the current position. + */ + public AbsolutePosition getAbsolutePosition() + { + return m_iterator.getPointer().getAbsolutePosition(); + } + + public PointerCDR getPointer() + { + return m_iterator.getPointer(); + } + + /** + * Jumps to the absolute position. + * + * @pram position the new position + */ + public void setPosition(AbsolutePosition position) + { + m_iterator.setPosition(position); + } + + public void write_boolean(boolean value) + { + alignment(CDR.BOOLEAN_SIZE); + m_chunk_buffer[m_iterator.m_position++] = (value) ? (byte) 1 : (byte) 0; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_char(char value) + { + // WARNING: Java char is 2 bytes long, there is a cast + // from char to byte + if (value > 255) { + throw new DATA_CONVERSION("Char out of range.", + 0, + CompletionStatus.COMPLETED_NO); + } + alignment(CDR.CHAR_SIZE); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_wchar(char value) + { + // Java char is 2 bytes long, there is a cast + + // WARNING: Java char is 2 bytes long, there is a cast + // from byte to char + if (alignment(CDR.WCHAR_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.WCHAR_SIZE); + } + } + + public void write_octet(byte value) + { + alignment(CDR.OCTET_SIZE); + m_chunk_buffer[m_iterator.m_position++] = value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + + public void write_short(short value) + { + if (alignment(CDR.SHORT_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.SHORT_SIZE); + } + } + + public void write_ushort(short value) + { + // JAVA MAPPING: "negative" int = positive ulong values + // will be handled by the user + if (alignment(CDR.USHORT_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + + } else { + m_data_buffer[0] = (byte) (value >>> 8); + m_data_buffer[1] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.USHORT_SIZE); + } + } + + public void write_long(int value) + { + if (alignment(CDR.LONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 24); + m_data_buffer[1] = (byte) (value >>> 16); + m_data_buffer[2] = (byte) (value >>> 8); + m_data_buffer[3] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.LONG_SIZE); + } + } + + public void write_ulong(int value) + { + // JAVA MAPPING: "negative" int = positive ulong values + // will be handled by the user + + if (alignment(CDR.ULONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 24); + m_data_buffer[1] = (byte) (value >>> 16); + m_data_buffer[2] = (byte) (value >>> 8); + m_data_buffer[3] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.ULONG_SIZE); + } + } + + public void write_longlong(long value) + { + if (alignment(CDR.LONGLONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 56); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 48); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 40); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 32); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) value; + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 56); + m_data_buffer[1] = (byte) (value >>> 48); + m_data_buffer[2] = (byte) (value >>> 40); + m_data_buffer[3] = (byte) (value >>> 32); + m_data_buffer[4] = (byte) (value >>> 24); + m_data_buffer[5] = (byte) (value >>> 16); + m_data_buffer[6] = (byte) (value >>> 8); + m_data_buffer[7] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.LONGLONG_SIZE); + } + } + + public void write_ulonglong(long value) + { + // JAVA MAPPING: "negative" long = positive ulonglong values + // will be handled by the user + + if (alignment(CDR.ULONGLONG_SIZE)) { + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 56); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 48); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 40); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 32); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 24); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 16); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 8); + m_chunk_buffer[m_iterator.m_position++] = (byte) (value >>> 0); + //recalculates the available bytes + if (m_iterator.m_position > m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } else { + m_data_buffer[0] = (byte) (value >>> 56); + m_data_buffer[1] = (byte) (value >>> 48); + m_data_buffer[2] = (byte) (value >>> 40); + m_data_buffer[3] = (byte) (value >>> 32); + m_data_buffer[4] = (byte) (value >>> 24); + m_data_buffer[5] = (byte) (value >>> 16); + m_data_buffer[6] = (byte) (value >>> 8); + m_data_buffer[7] = (byte) value; + write_octet_array(m_data_buffer, 0, CDR.ULONGLONG_SIZE); + } + } + + public void write_float(float value) + { + write_long(java.lang.Float.floatToIntBits(value)); + } + + public void write_double(double value) + { + write_longlong(java.lang.Double.doubleToLongBits(value)); + + } + + public void write_string(String value) + { + if (value == null) + throw new BAD_PARAM("Null string reference.", 0, + CompletionStatus.COMPLETED_NO); + + // write the string and the final of string char '\0' + + int string_length = value.length(); + + int cdr_string_length = string_length + 1; + + char[] char_array = new char[cdr_string_length]; + + value.getChars(0, string_length, char_array, 0); + + char_array[string_length] = '\0'; + + // write length + + write_ulong(cdr_string_length); + + // write value data + + writeCharArrayAux(char_array, 0, cdr_string_length); + } + + public void write_wstring(String value) + { + if (value == null) + throw new BAD_PARAM("Null string reference.", 0, + CompletionStatus.COMPLETED_NO); + + // write the string and the final of string char '\0' + + char[] char_array = value.toCharArray(); + + // write length + + if (m_version == GIOPVersion.VERSION_1_2) { + write_ulong((char_array.length + 1) * CDR.WCHAR_SIZE); + + } else if (m_version == GIOPVersion.VERSION_1_1){ + write_ulong(char_array.length + 1); + } else { + throw new MARSHAL("wstring is not present in GIOP 1.0", + 6, + CompletionStatus.COMPLETED_NO); + } + + // write value data + write_wchar_array(char_array, 0, char_array.length); + + // write string end char + write_wchar('\0'); + } + + public void write_boolean_array(boolean[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null boolean array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int can_write = 0; + + // número de octetos que quedan por escribir + + int remain_booleans = length; + + int position = 0; + int stop_at = 0; + + while (remain_booleans > 0) { + + position = m_iterator.m_position; + + can_write = java.lang.Math.min(remain_booleans, + m_chunk_buffer.length - position); + + stop_at = position + can_write; + + while (position < stop_at) { + m_chunk_buffer[position++] = (byte) ((value[offset++]) ? 1 : 0); + } + + m_iterator.m_position = stop_at; + remain_booleans -= can_write; + + if (remain_booleans > 0) { + getNextChunk(); + } else { + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + } + + public void write_char_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null char array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + writeCharArrayAux(value, offset, length); + } + + public void writeCharArrayAux(char[] value, int offset, int length) + { + int chars_can_write = 0; + + // número de octetos que quedan por escribir + + int remain_chars = length; + + int position = 0; + int stop_at = 0; + + int current_value = 0; + + while (remain_chars > 0) { + + position = m_iterator.m_position; + + chars_can_write = + java.lang.Math.min( remain_chars, + m_chunk_buffer.length - position); + + stop_at = position + chars_can_write; + + for (; position < stop_at;) { + + current_value = value[offset++]; + + // CORBA chars are 1 byte length, value must be < 256 + if (current_value > 255) { + throw new DATA_CONVERSION("Char out of range.", + 0, + CompletionStatus.COMPLETED_NO); + } + + m_chunk_buffer[position++] = (byte) current_value; + } + + m_iterator.m_position = stop_at; + remain_chars -= chars_can_write; + + if (remain_chars > 0) { + getNextChunk(); + } else { + if (m_iterator.m_chunk.m_available < m_iterator.m_position) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + } + + public void write_wchar_array(char[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null wchar array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos wchar que se pueden escribir enteros + int wchars_can_write = 0; + + int position = 0; + int wchar_value = 0; + + // numero de wchars que quedan + int remain_wchars = length; + + while (remain_wchars > 0) { + + if (!alignment(CDR.WCHAR_SIZE)) // encapsulación, el dato no cabe + // completo + { + wchar_value = value[offset++]; + m_data_buffer[0] = (byte) (wchar_value >>> 8); + m_data_buffer[1] = (byte) wchar_value; + + write_octet_array(m_data_buffer, 0, CDR.WCHAR_SIZE); + + remain_wchars--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + wchars_can_write = + java.lang.Math.min(remain_wchars, + free_octets / CDR.WCHAR_SIZE); + + for (int i = wchars_can_write; i > 0; i--) { + wchar_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (wchar_value >>> 8); + m_chunk_buffer[position++] = (byte) wchar_value; + } + + remain_wchars -= wchars_can_write; + m_iterator.m_position = position; + + if (remain_wchars > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_octet_array(byte[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null byte array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir + int remain_bytes = length; + + // bytes que se pueden escribir por vuelta + int bytes_can_write = 0; + int position = 0; + + while (remain_bytes > 0) { + + position = m_iterator.m_position; + + bytes_can_write = java.lang.Math + .min( + remain_bytes, + m_chunk_buffer.length + - position); + + System.arraycopy(value, offset, m_chunk_buffer, position, + bytes_can_write); + + m_iterator.m_position += bytes_can_write; + remain_bytes -= bytes_can_write; + offset += bytes_can_write; + + if (remain_bytes > 0) + getNextChunk(); + else if (m_iterator.m_chunk.m_available < m_iterator.m_position) + m_iterator.m_chunk.m_available = m_iterator.m_position; + } + } + + public void write_short_array(short[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null short array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos short que se pueden escribir enteros + int shorts_can_write = 0; + + int position = 0; + int short_value = 0; + + // numero de shorts que quedan + int remain_shorts = length; + + while (remain_shorts > 0) { + + if (!alignment(CDR.SHORT_SIZE)) // encapsulación, el dato no cabe + // completo + { + short_value = value[offset++]; + m_data_buffer[0] = (byte) (short_value >>> 8); + m_data_buffer[1] = (byte) short_value; + + write_octet_array(m_data_buffer, 0, CDR.SHORT_SIZE); + + remain_shorts--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + shorts_can_write = + java.lang.Math.min(remain_shorts, + free_octets / CDR.SHORT_SIZE); + + for (int i = shorts_can_write; i > 0; i--) { + short_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (short_value >>> 8); + m_chunk_buffer[position++] = (byte) short_value; + } + + remain_shorts -= shorts_can_write; + m_iterator.m_position = position; + + if (remain_shorts > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ushort_array(short[] value, int offset, int length) + { + write_short_array(value, offset, length); + } + + public void write_long_array(int[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null int array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos int que se pueden escribir enteros + int ints_can_write = 0; + + int position = 0; + int int_value = 0; + + // numero de ints que quedan por escribir + int remain_ints = length; + + while (remain_ints > 0) { + + if (!alignment(CDR.LONG_SIZE)) // encapsulación, el dato no cabe + // completo + { + int_value = value[offset++]; + + m_data_buffer[0] = (byte) (int_value >>> 24); + m_data_buffer[1] = (byte) (int_value >>> 16); + m_data_buffer[2] = (byte) (int_value >>> 8); + m_data_buffer[3] = (byte) int_value; + write_octet_array(m_data_buffer, 0, CDR.LONG_SIZE); + + remain_ints--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + ints_can_write = + java.lang.Math.min(remain_ints, + free_octets / CDR.LONG_SIZE); + + for (int i = ints_can_write; i > 0; i--) { + int_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (int_value >>> 24); + m_chunk_buffer[position++] = (byte) (int_value >>> 16); + m_chunk_buffer[position++] = (byte) (int_value >>> 8); + m_chunk_buffer[position++] = (byte) int_value; + } + + remain_ints -= ints_can_write; + m_iterator.m_position = position; + + if (remain_ints > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ulong_array(int[] value, int offset, int length) + { + write_long_array(value, offset, length); + } + + public void write_longlong_array(long[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null long array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos long que se pueden escribir enteros + int longs_can_write = 0; + + int position = 0; + long long_value = 0; + + // numero de longs que quedan + int remain_longs = length; + + while (remain_longs > 0) { + + if (!alignment(CDR.LONGLONG_SIZE)) + { + // encapsulation, the data does not fit complete + long_value = value[offset++]; + + m_data_buffer[0] = (byte) (long_value >>> 56); + m_data_buffer[1] = (byte) (long_value >>> 48); + m_data_buffer[2] = (byte) (long_value >>> 40); + m_data_buffer[3] = (byte) (long_value >>> 32); + m_data_buffer[4] = (byte) (long_value >>> 24); + m_data_buffer[5] = (byte) (long_value >>> 16); + m_data_buffer[6] = (byte) (long_value >>> 8); + m_data_buffer[7] = (byte) long_value; + + write_octet_array(m_data_buffer, 0, CDR.LONGLONG_SIZE); + + remain_longs--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + longs_can_write = + java.lang.Math.min(remain_longs, + free_octets / CDR.LONGLONG_SIZE); + + for (int i = longs_can_write; i > 0; i--) { + long_value = value[offset++]; + m_chunk_buffer[position++] = (byte) (long_value >>> 56); + m_chunk_buffer[position++] = (byte) (long_value >>> 48); + m_chunk_buffer[position++] = (byte) (long_value >>> 40); + m_chunk_buffer[position++] = (byte) (long_value >>> 32); + m_chunk_buffer[position++] = (byte) (long_value >>> 24); + m_chunk_buffer[position++] = (byte) (long_value >>> 16); + m_chunk_buffer[position++] = (byte) (long_value >>> 8); + m_chunk_buffer[position++] = (byte) long_value; + } + + remain_longs -= longs_can_write; + m_iterator.m_position = position; + + if (remain_longs > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_ulonglong_array(long[] value, int offset, int length) + { + write_longlong_array(value, offset, length); + } + + public void write_float_array(float[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null float array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos float que se pueden escribir enteros + int ints_can_write = 0; + + int position = 0; + int int_value = 0; + + // numero de floats que quedan que quedan por escribir + int remain_floats = length; + + while (remain_floats > 0) { + + if (!alignment(CDR.FLOAT_SIZE)) // encapsulación, el dato no cabe + // completo + { + int_value = Float.floatToIntBits(value[offset++]); + + m_data_buffer[0] = (byte) (int_value >>> 24); + m_data_buffer[1] = (byte) (int_value >>> 16); + m_data_buffer[2] = (byte) (int_value >>> 8); + m_data_buffer[3] = (byte) int_value; + write_octet_array(m_data_buffer, 0, CDR.FLOAT_SIZE); + + remain_floats--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + ints_can_write = + java.lang.Math.min(remain_floats, + free_octets / CDR.FLOAT_SIZE); + + for (int i = ints_can_write; i > 0; i--) { + int_value = Float.floatToIntBits(value[offset++]); + + m_chunk_buffer[position++] = (byte) (int_value >>> 24); + m_chunk_buffer[position++] = (byte) (int_value >>> 16); + m_chunk_buffer[position++] = (byte) (int_value >>> 8); + m_chunk_buffer[position++] = (byte) int_value; + } + + remain_floats -= ints_can_write; + m_iterator.m_position = position; + + if (remain_floats > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_double_array(double[] value, int offset, int length) + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new BAD_PARAM( + "value.length - offset must be less than length"); + + // número de octetos que quedan por escribir en el chunk actual + int free_octets = 0; + + // número de datos double que se pueden escribir enteros + int doubles_can_write = 0; + + int position = 0; + long long_value = 0; + + // numero de doubles que quedan + int remain_doubles = length; + + while (remain_doubles > 0) { + + if (!alignment(CDR.DOUBLE_SIZE)) { + long_value = Double.doubleToLongBits(value[offset++]); + + m_data_buffer[0] = (byte) (long_value >>> 56); + m_data_buffer[1] = (byte) (long_value >>> 48); + m_data_buffer[2] = (byte) (long_value >>> 40); + m_data_buffer[3] = (byte) (long_value >>> 32); + m_data_buffer[4] = (byte) (long_value >>> 24); + m_data_buffer[5] = (byte) (long_value >>> 16); + m_data_buffer[6] = (byte) (long_value >>> 8); + m_data_buffer[7] = (byte) long_value; + + write_octet_array(m_data_buffer, 0, CDR.DOUBLE_SIZE); + + remain_doubles--; + + } else { + position = m_iterator.m_position; + + free_octets = m_chunk_buffer.length - position; + + doubles_can_write = + java.lang.Math.min(remain_doubles, + free_octets / CDR.DOUBLE_SIZE); + + for (int i = doubles_can_write; i > 0; i--) { + long_value = Double.doubleToLongBits(value[offset++]); + m_chunk_buffer[position++] = (byte) (long_value >>> 56); + m_chunk_buffer[position++] = (byte) (long_value >>> 48); + m_chunk_buffer[position++] = (byte) (long_value >>> 40); + m_chunk_buffer[position++] = (byte) (long_value >>> 32); + m_chunk_buffer[position++] = (byte) (long_value >>> 24); + m_chunk_buffer[position++] = (byte) (long_value >>> 16); + m_chunk_buffer[position++] = (byte) (long_value >>> 8); + m_chunk_buffer[position++] = (byte) long_value; + } + + remain_doubles -= doubles_can_write; + m_iterator.m_position = position; + + if (remain_doubles > 0) { + getNextChunk(); + } else if (m_iterator.m_chunk.m_available < position) + m_iterator.m_chunk.m_available = position; + } + } + } + + public void write_Object(org.omg.CORBA.Object value) + { + if (value == null) { + es.tid.TIDorbj.core.iop.IOR.nullIOR().write(this); + return; + } + + if (value instanceof ValueBase) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if (value instanceof org.omg.CORBA.LocalObject) + throw new MARSHAL("Impossible to marshall a local object.", + 4, CompletionStatus.COMPLETED_NO); + + org.omg.CORBA.portable.Delegate delegate = + ((org.omg.CORBA.portable.ObjectImpl) value) + ._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + ((CommunicationDelegate) delegate).getReference().write(this); + } else { // write ior from anothers's ORB Object + IOR ior = + DefaultIOR.fromString(m_orb, + delegate.orb(value).object_to_string(value)); + ior.write(this); + } + } + + public void write_TypeCode(org.omg.CORBA.TypeCode value) + { + if (value == null) + throw new BAD_PARAM("Null TypeCode reference.", 0, + CompletionStatus.COMPLETED_NO); + + TypeCodeMarshaler.marshal(value, this); + } + + public void write_any(org.omg.CORBA.Any value) + { + if (value == null) + throw new BAD_PARAM("Null any reference.", 0, + CompletionStatus.COMPLETED_NO); + + write_TypeCode(value.type()); + value.write_value(this); + } + + //DataOutputStream + public void write_any_array(org.omg.CORBA.Any[] value, int offset, + int length) + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + write_any(value[i]); + } + + public void write_Context(org.omg.CORBA.Context ctx, + org.omg.CORBA.ContextList contexts) + { + if (ctx == null) + throw new BAD_PARAM("Null context reference.", 0, + CompletionStatus.COMPLETED_NO); + + ContextImpl.write(this, ctx, contexts); + } + + /** + * @deprecated Deprecated by CORBA 2.2 + */ + + public void write_Principal(org.omg.CORBA.Principal value) + { + throw new org.omg.CORBA.NO_IMPLEMENT("Deprecated by CORBA 2.2"); + } + + public void write_fixed(java.math.BigDecimal value) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void write_fixed(org.omg.CORBA.Any value) + throws org.omg.CORBA.BadFixedValue + { + if ((value == null) + || (value.type().kind().value() != org.omg.CORBA.TCKind._tk_fixed)) + throw new org.omg.CORBA.BadFixedValue(); + + value.write_value(this); + } + + public void write_fixed_array(org.omg.CORBA.Any[] value, int offset, + int length) + throws org.omg.CORBA.BadFixedValue + { + if (value == null) + throw new BAD_PARAM("Null double array reference.", 0, + CompletionStatus.COMPLETED_NO); + if (length < 0) + throw new BAD_PARAM("length must be greater than zero"); + + if (value.length - offset < length) + throw new + BAD_PARAM("value.length - offset must be less than length"); + + int last = offset + length; + + for (int i = offset; i < last; i++) + write_fixed(value[i]); + } + + // CORBA 2.3 + + public void write_value(java.io.Serializable value) + { + writeValueWithId(value, null); + } + + public void write_value(java.io.Serializable value, java.lang.String rep_id) + { + writeValueWithId(value, rep_id); + } + + protected void writeValueWithId(java.io.Serializable value, + java.lang.String rep_id) + { + if (writeValueTags(value)) + return; + + if (value instanceof java.lang.String) { + writeWStringValue((String) value); + } else if (value instanceof org.omg.CORBA.portable.StreamableValue) { + writeStreamableValue( + (org.omg.CORBA.portable.StreamableValue) value); + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + writeCustomValue((org.omg.CORBA.portable.CustomValue) value); + } else { + initValueHandler(); + + st_value_handler.writeValue(this, value); + } + } + + public void write_value(java.io.Serializable value, Class clz) + { + if (writeValueTags(value)) + return; + + if (value instanceof java.lang.String) { + writeWStringValue((String) value); + } else if (value instanceof org.omg.CORBA.portable.StreamableValue) { + writeStreamableValue( + (org.omg.CORBA.portable.StreamableValue) value); + } else if (value instanceof org.omg.CORBA.portable.CustomValue) { + writeCustomValue((org.omg.CORBA.portable.CustomValue) value); + } else { // boxed value?? + + java.lang.Object obj = null; + + try { + java.lang.reflect.Constructor constructor = + clz.getConstructor(new Class[0]); + + obj = constructor.newInstance(new Object[0]); + + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + + if (obj instanceof org.omg.CORBA.portable.BoxedValueHelper) { + writeBoxedValue(value, + (org.omg.CORBA.portable.BoxedValueHelper) value); + } else { + initValueHandler(); + ValueTypeInfo value_info = new ValueTypeInfo(); + String[] ids = { st_value_handler.getRMIRepositoryID(clz) }; + value_info.set_repository_ids(ids); + value_info.write(this); + st_value_handler.writeValue(this, value); + } + } + } + + public void write_value(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) + { + if (writeValueTags(value)) + return; + + writeBoxedValue(value, factory); + + } + + //DataOutputStream + public void write_Value(java.io.Serializable value) + { + write_value(value); + } + + /** + * Try to write null or an indirection tags + * + * @return true if written or false otherwise + */ + + protected boolean writeValueTags(java.io.Serializable value) + { + // write null + + if (value == null) { + ValueTypeInfo.write_null(this); + return true; + } + + PointerCDR previous_position = getContextCDR().lookupPosition(value); + + if (previous_position != null) { + writeIndirection(previous_position); + return true; + } + + return false; + } + + protected void writeWStringValue(String value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + write_wstring(value); + + getContextCDR().putObject(value, value_position); + } + + protected void + writeStreamableValue(org.omg.CORBA.portable.StreamableValue value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + value_info.set_repository_ids(value._truncatable_ids()); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + value._write(this); + + getContextCDR().putObject(value, value_position); + } + + protected void writeCustomValue(org.omg.CORBA.portable.CustomValue value) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + value_info.set_repository_ids(value._truncatable_ids()); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + value.marshal(this); + + getContextCDR().putObject(value, value_position); + } + + protected void + writeBoxedValue(java.io.Serializable value, + org.omg.CORBA.portable.BoxedValueHelper factory) + { + ValueTypeInfo value_info = new ValueTypeInfo(); + + String[] ids = { factory.get_id() }; + + value_info.set_repository_ids(ids); + + // aligns to get the value position + + alignment(CDR.LONG_SIZE); + + // calculate the value position + + PointerCDR value_position = getPointer(); + + value_info.write(this); + + factory.write_value(this, value); + + getContextCDR().putObject(value, value_position); + } + + public void initValueHandler() + { + synchronized (this.getClass()) { + if (st_value_handler == null) + st_value_handler = javax.rmi.CORBA.Util.createValueHandler(); + } + } + + public void write_abstract_interface(java.lang.Object object) + { + if (object == null) + throw new org.omg.CORBA.BAD_PARAM("Null value reference"); + + if (object instanceof org.omg.CORBA.Object) { + org.omg.CORBA.Object ref = (org.omg.CORBA.Object) object; + + // is an object ref + write_boolean(true); + write_Object(ref); + + } else if (object instanceof java.io.Serializable) { + write_boolean(false); + write_value((java.io.Serializable) object); + } else + throw new + MARSHAL("Cannot marshal value: it does not implements " + + "java.io.Serializable or is not a org.omg.CORBA.Object"); + } + + //DataOutputStream + public void write_Abstract(java.lang.Object value) + { + write_abstract_interface(value); + } + + // TIDORB + + // write_referenceable_string for RepositoryId and URL + + protected void writeReferenceableString(String id) + { + PointerCDR previous_position = getContextCDR().lookupPosition(id); + + if (previous_position != null) { + writeIndirection(previous_position); + return; + } + + // aligns to get the id position + + alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + PointerCDR id_position = getPointer(); + + write_string(id); + + getContextCDR().putObject(id, id_position); + } + + public void writeIndirection(PointerCDR previous_position) + { + write_long(0xFFFFFFFF); + + // prevents that indirection value will be marshaled in the next chunk + + alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + // int headers_length = 0; + + // if message Calculate the headers size to subtract the value to the + // Encapsulation size + /* + * if (get_message()) { int fragments = getCurrentChunkNum() - + * previous_position.getNumChunk(); + * + * if(get_version() == GIOPVersion.VERSION_1_2) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_2; else if (get_version() == + * GIOPVersion.VERSION_1_1) headers_length = fragments * + * GIOPFragmentMessage.FRAGMENT_HEADER_SIZE_1_1; else headers_length = + * 0; } + */ + AbsolutePosition indirection_position; + + indirection_position = getAbsolutePosition(); + + int offset = previous_position.getAbsolutePosition().getValue() + - indirection_position.getValue(); + // + headers_length; + + write_long(offset); + + return; + } + + public int getCurrentChunkNum() + { + return m_iterator.m_current_chunk_num; + } + + /* + * public void getNextFragmentHeader() { if(!message) throw new + * org.omg.CORBA.INTERNAL("Not it a message"); + * + * if(version == GIOPVersion.VERSION_1_0) throw new MARSHAL("End of Buffer: GIOP + * 1.0 does not allows fragmentation"); + * + * iterator.nextChunk(); + * + * chunk_buffer = iterator.chunk.buffer; } + */ + public void getNextChunk() + { + m_iterator.m_chunk.m_available = m_chunk_buffer.length; + /* + * if (message) { if(version == GIOPVersion.VERSION_1_0) { // throw new + * MARSHAL("End of Buffer: GIOP 1.0 does not allows fragmentation"); + * iterator.bufferCDR.grow_1_0(); } else { if(iterator.current_chunk_num == + * (iterator.bufferCDR.getNumChunks() -1)) iterator.bufferCDR.grow(); + * + * iterator.nextChunk(); + * + * skip(GIOPHeader.HEADER_SIZE); + * + * if(version == GIOPVersion.VERSION_1_2) { + * GIOPFragmentMessage.skip_fragment_header_1_2(this); } } } else { + */ + if (m_iterator.m_current_chunk_num + == (m_iterator.m_buffer_cdr.getNumChunks() - 1)) + m_iterator.m_buffer_cdr.grow(); + + m_iterator.nextChunk(); + // } + + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + } + + /** + * Set the stream pointer to the next aligned position of given data type + * + * @param type_size + * the type size in octets + */ + protected void goNextAlignedPosition(int type_size) + { + int next_position = m_iterator.alignPosition(type_size); + + if (next_position < m_chunk_buffer.length) { + m_iterator.m_position = next_position; + return; + } + + /* + * if (message && (version == GIOPVersion.VERSION_1_0)) { getNextChunk(); + * iterator.position = next_position; return; } + */ + + if ((next_position > m_chunk_buffer.length) + && (m_iterator.m_encapsulation)) { + // continue the encapsulation aligment in next chunk + int gap = next_position - m_iterator.m_position; + skip(gap); + alignment(CDR.OCTET_SIZE); // prevents next_position == length + return; + } + + getNextChunk(); + } + + /** + * Set the stream pointer to the next aligned position of given data type + * and sets it as the last available position + * + * @param type_size + * the type size in octets + */ + public void fixNextAlignedPosition(int type_size) + { + goNextAlignedPosition(type_size); + + if (m_iterator.m_position >= m_iterator.m_chunk.m_available) + m_iterator.m_chunk.m_available = m_iterator.m_position + 1; + } + + /** + * Sets the writing pointer in the correct aligmnet for the data type. If + * necessary, gets the next chunk. + *

+ * CORBA 2.3 specification says: A primitive data type of 8 bytes or + * smaller, should never be broken across two fragments.Therefore, if the + * remaining bytes are not sufficient for reading the data next chunk will + * be set for reading. + *

+ * If it is reading a encapsulation and the data is broken into two chunks, + * reads the data compoentes byte per byte. + * + * @param type_size the type size for alignment. + * @return true if can read directly the data or + * false if byte swap is needed because the data is + * splitted in two framgments and is contended in a encapsulation. + */ + + public boolean alignment(int type_size) + { + // set the aligned position + + goNextAlignedPosition(type_size); + + if (m_iterator.enoughSpace(type_size)) + return true; + + // there is no space for whole data bytes + + m_iterator.m_chunk.m_available = m_chunk_buffer.length; + + if (m_iterator.m_encapsulation) + return false; // marshal byte per byte + + // marshaling in the main buffer, get next chunk + getNextChunk(); + + return true; + } + + public void skip(long n) + { + if (n > 0L) { + int chunk_left = m_chunk_buffer.length - m_iterator.m_position; + + if (chunk_left <= 0) { + getNextChunk(); + skip(n); + } else if (n <= chunk_left) { + m_iterator.skip((int) n); + if (m_iterator.m_position >= m_iterator.m_chunk.m_available) { + m_iterator.m_chunk.m_available = m_iterator.m_position + 1; + } + } else { + getNextChunk(); + skip(n - chunk_left); + } + } + } + + /** + * Recycle the buffer pointered by the stream. + * + * @see es.tid.TIDorbj.core.cdr.BufferCDR + */ + public void recycle() + { + m_iterator.rewind(); + m_iterator.m_buffer_cdr.recycle(); + m_chunk_buffer = m_iterator.m_chunk.m_buffer; + m_is_message = false; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/ChunkCDR.java b/source/es/tid/TIDorbj/core/cdr/ChunkCDR.java new file mode 100644 index 0000000..600a27d --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/ChunkCDR.java @@ -0,0 +1,162 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents a segment of a CDR buffer. It controls a marshaling byte buffer + * that can be send or received in a IIOP message. + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ChunkCDR +{ + + /** + * framgments of the chunk. + */ + protected byte[] m_buffer; + + /** + * Represents the amount of data available. Available is equal or lower than + * chunk length. + */ + protected int m_available; + + /** + * The starting of the chunk has an message header + */ + protected boolean m_with_message_header; + + /** + * Constructor, gets the control of the byte array. It will have only a + * fragment and it will not be increaseable. + */ + public ChunkCDR(byte[] byte_array) + { + m_buffer = byte_array; + m_available = m_buffer.length; + m_with_message_header = false; + } + + /** + * Constructor, gets the control of the byte array. It will have only a + * fragment and it will not be increaseable. + */ + public ChunkCDR(int fixed_size) + { + m_buffer = new byte[fixed_size]; + m_available = 0; + m_with_message_header = false; + } + + public boolean hasHeader() + { + return m_with_message_header; + } + + public void setHeader(boolean value) + { + m_with_message_header = value; + } + + /** + * @return the byte array associated to the buffer. + */ + public byte[] getBuffer() + { + return m_buffer; + } + + /** + * Sets the available bytes to 0. It is used to reuse the chunk buffer for + * new data. + */ + public void recycle() + { + m_available = 0; + } + + /** + * Sets the available bytes to the value position. An error + * can appear if the value is higher than the buffer length. + * + * @return true if OK or false on error. + */ + public boolean setAvailable(int value) + { + if (value <= m_buffer.length) { + m_available = value; + return true; + } + return false; + } + + /** + * @return The available bytes. + */ + + public int getAvailable() + { + return m_available; + } + + /** + * @return The lentgh ofthe byte buffer. + */ + + public int getLength() + { + return m_buffer.length; + } + + public void setBuffer(byte[] new_buffer) + { + m_buffer = null; + m_buffer = new_buffer; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/ContextCDR.java b/source/es/tid/TIDorbj/core/cdr/ContextCDR.java new file mode 100644 index 0000000..5709fd7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/ContextCDR.java @@ -0,0 +1,273 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Represents the contexts of a buffer marshaling across different + * encapsulations. The context is defined by: + *

    + *
  • if it is a encapsulation context + *
  • the alignment offset + *
  • the byte-order + *
  • the father context + *
+ * The context creates a list of encapsulations for navigate in and out of + * encapsulations. The list represented by the context is a + * + * @see TIDorb.corba.cdr.AlignmentOffset + * + * @autor Juan A. Cáceres + * @version 1.1 + */ + +public class ContextCDR +{ + + /** + * big-endian if true or little-endian, otherwise. + */ + protected boolean m_byte_order; + + /** + * The father context. In the root context, the father will be + * null. + */ + + protected ContextCDR m_father; + + /** + * alignment offset of the encapsulation. + * + * @see es.tid.TIDorbj.core.cdr.AlignmentOffset + */ + protected AlignmentOffset m_offset; + + /** + * Where is the beginnig of the encapsulation. + */ + + protected PointerCDR m_starts_at; + + /** + * The indirection node of the buffer. Here are all the typecodes that have + * been readed and can be indirectioned. + */ + + private IndirectionNode m_indirection_node; + + /** + * The TypeCode Position Node of the buffer. Here are all the typecodes that + * have been writed in the buffer and can be indirectioned. + */ + + private PositionsNode m_positions_node; + + /** + * The CDROutputStream that will write the encapsulation length. + */ + + protected CDROutputStream m_length_out; + + /** + * Constructor of the root context. A route of encapsulation contexts will + * end here. + * + * @see es.tid.TIDorbj.core.cdr.AlignmentOffset + */ + + public ContextCDR(PointerCDR start) + { + m_byte_order = CDR.LOCAL_BYTE_ORDER; + m_offset = AlignmentOffset.calculateOffsetFrom(0); + m_father = null; + m_starts_at = start; + m_indirection_node = null; + m_positions_node = null; + } + + public ContextCDR(PointerCDR start, ContextCDR father, + AlignmentOffset offset) + { + m_starts_at = start; + m_byte_order = father.m_byte_order; + this.m_offset = offset; + this.m_father = father; + m_indirection_node = null; + m_positions_node = null; + } + + public ContextCDR getFather() + { + return m_father; + } + + public boolean isRootContext() + { + return m_father == null; + } + + public void setOffset(AlignmentOffset value) + { + m_offset = value; + } + + public AlignmentOffset getOffset() + { + return m_offset; + } + + public void setByteOrder(boolean value) + { + m_byte_order = value; + } + + public boolean getByteOrder() + { + return m_byte_order; + } + + public void setLengthOut(CDROutputStream out) + { + m_length_out = out; + } + + public void deleteLengthOut() + { + m_length_out = null; + } + + public PointerCDR getStartPointer() + { + return m_starts_at; + } + + public synchronized PointerCDR lookupPosition(java.lang.Object id) + { + PositionsNode node = getPositionsNode(); + + PointerCDR position = node.lookup(id); + + if (position != null) + return position; + + if (m_father == null) + return null; + + position = m_father.lookupPosition(id); + + if (position != null) + node.indirection(position.getAbsolutePosition()); + + return position; + + } + + public synchronized void putObject(java.lang.Object obj, + PointerCDR position) + { + getPositionsNode().put(obj, position); + } + + public synchronized Object lookupObject(AbsolutePosition position) + { + IndirectionNode node = getIndirectionNode(); + + Object obj = node.lookup(position); + + if (obj != null) + return obj; + + if (m_father != null) + return m_father.lookupObject(position); + else + return null; + + } + + public synchronized void putPosition(AbsolutePosition position, + java.lang.Object obj) + { + getIndirectionNode().put(position, obj); + } + + private synchronized IndirectionNode getIndirectionNode() + { + if (m_indirection_node == null) { + AbsolutePosition starting = m_starts_at.getAbsolutePosition(); + if (m_father == null) + m_indirection_node = new IndirectionNode(starting); + else + m_indirection_node = + new IndirectionNode(starting, + m_father + .getIndirectionNode() + .getTable()); + } + + return m_indirection_node; + } + + private synchronized PositionsNode getPositionsNode() + { + if (m_positions_node == null) { + m_positions_node = + new PositionsNode(m_starts_at.getAbsolutePosition()); + } + + return m_positions_node; + } + + public boolean inAnEncapsulation() + { + return (m_father != null); + } + + public boolean hasExternalIndirections() + { + return (((m_indirection_node == null) ? false + : m_indirection_node.hasExternalIndirections()) + || ((m_positions_node == null) ? false + : m_positions_node.hasExternalIndirections())); + } +} + diff --git a/source/es/tid/TIDorbj/core/cdr/Encapsulation.java b/source/es/tid/TIDorbj/core/cdr/Encapsulation.java new file mode 100644 index 0000000..75fb572 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/Encapsulation.java @@ -0,0 +1,302 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.ORB; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +/** + * Represents the content data of an encapsulation (including the byte-order). + * An Encapsulation can be read to copy the content data from an input stream. + *

+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class Encapsulation +{ + + /** + * The empty encapsulation. + */ + + private static Encapsulation st_empty = null; + + /** + * The ORB. + */ + protected TIDORB m_orb; + + /** + * GIOPVersion + */ + protected GIOPVersion m_version; + + /** + * The octet sequence data. + */ + protected byte[] m_data; + + /** + * Start Position of the encapsulation in the byte array. + */ + int m_data_offset; + + /** + * Length of the encapsulation in the byte array. + */ + int m_data_length; + + /** + * Protected Constructor. Creates an empty encapsulation. + */ + protected Encapsulation(TIDORB orb, GIOPVersion ver) + { + this.m_orb = orb; + m_version = ver; + m_data_length = 0; + m_data_offset = 0; + } + + /** + * Protected Constructor. + * + * @param orb + * The ORB. + * @param key_buffer + * The octet sequence data. + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + */ + protected Encapsulation(TIDORB orb, GIOPVersion ver, byte[] key_buffer, + int offset, int length) + { + this.m_orb = orb; + m_version = ver; + m_data = key_buffer; + m_data_offset = offset; + m_data_length = length; + } + + public TIDORB getORB() + { + return m_orb; + } + + /** + * @return the encapsulation length (in octets). + */ + public int getLength() + { + return m_data_length; + } + + /** + * @return the encapsulation start position in the octet sequence. + */ + public int getOffset() + { + return m_data_offset; + } + + /** + * @return the encapsulation octet sequence. + */ + public byte[] getOctetSequence() + { + return m_data; + } + + /** + * Compares two encapsulations. + */ + public boolean equal(Encapsulation other) + { + if (other == null) + return false; + + if (m_data_length != other.m_data_length) + return false; + + int i = m_data_offset; + int j = other.m_data_offset; + + for (int length = 0; length < m_data_length; length++) { + if (m_data[i++] != other.m_data[j++]) + return false; + } + + return true; + } + + /** + * Gets a sub-encapsulation in the octet sequence. + * + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + */ + public Encapsulation getChild(int offset, int length) + { + if ((offset >= m_data_length) + || ((m_data_length - offset - length) < 0)) + return null; + else + return new Encapsulation(m_orb, m_version, m_data, offset, length); + } + + /** + * @return the empty encapsulation. + */ + public static Encapsulation getEmpty() + { + if (st_empty == null) + st_empty = new Encapsulation(null, GIOPVersion.VERSION_1_0); + + return st_empty; + } + + /** + * Static Encapsulation Creator operation. + * + * @param orb + * The ORB. key_buffer The octet sequence data. + * @param offset + * Start Position of the encapsulation in the byte array. + * @param length + * Length of the encapsulation in the byte array. + * @return a new Encapsulation. + */ + + public static Encapsulation create(TIDORB orb, + GIOPVersion ver, + byte[] key_buffer, + int offset, + int length) + { + if (length < 0) + return null; + + if (length == 0) + return getEmpty(); + + if ((key_buffer == null) || (offset < 0) + || (key_buffer.length - offset - length < 0)) + return null; + + return new Encapsulation(orb, ver, key_buffer, offset, length); + } + + /** + * @return an input stream for reading the encapsulation data. + */ + public CDRInputStream createInputStream() + { + if (m_data_length == 0) + return null; + + CDRInputStream input = new CDRInputStream(m_orb, m_data); + + if (m_data_offset > 0) { + input.skip(m_data_offset); + input.fixStarting(); + } + + input.setByteOrder(input.read_boolean()); + input.setVersion(m_version); + + return input; + } + + /** + * Writes the encapsulation data in an output stream. + * + * @param out + * the output stream. + */ + public void write(CDROutputStream out) + { + out.write_ulong(m_data_length); + + if (m_data_length > 0) + out.write_octet_array(m_data, m_data_offset, m_data_length); + } + + /** + * Reads a new encapsulation from an input stream. + * + * @param out + * the output stream. + */ + + public static Encapsulation read(CDRInputStream input, GIOPVersion ver) + { + ORB orb = input.orb(); + + Encapsulation encap = null; + if (orb instanceof TIDORB) + encap = new Encapsulation((TIDORB) orb, ver); + else + encap = new Encapsulation(null, ver); + + encap.doRead(input); + + return encap; + } + + private void doRead(CDRInputStream input) + { + m_data_length = input.read_ulong(); + + if (m_data_length > 0) { + m_data = new byte[m_data_length]; + input.read_octet_array(m_data, 0, m_data_length); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/IndirectionNode.java b/source/es/tid/TIDorbj/core/cdr/IndirectionNode.java new file mode 100644 index 0000000..0f6e133 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/IndirectionNode.java @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Hashtable; + +/** + * The Indirection class represents a node in the indirections to + * the typecodes marshaled in the actual Encapsulation. If the node is in an + * inner Encapsulation then it will references to the father encapsulation node. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IndirectionNode +{ + + private java.util.Hashtable m_table; + + /** + * Encapsulation Context. + */ + + private AbsolutePosition m_root_position; + + private AbsolutePosition m_lower_indirection; + + public IndirectionNode(AbsolutePosition start_position) + { + m_table = new Hashtable(); + m_root_position = start_position; + m_lower_indirection = m_root_position; + } + + public IndirectionNode(AbsolutePosition start_position, + java.util.Hashtable table) + { + m_table = table;// new Hashtable(); + m_root_position = start_position; + m_lower_indirection = m_root_position; + } + + /** + * Search an indirected object in the buffer + */ + public synchronized Object lookup(AbsolutePosition position) + { + + if (position.getValue() < m_lower_indirection.getValue()) { + m_lower_indirection = position; + return null; + } + + return m_table.get(position); + } + + public void put(AbsolutePosition position, java.lang.Object obj) + { + m_table.put(position, obj); + } + + public boolean hasExternalIndirections() + { + return m_lower_indirection.getValue() < m_root_position.getValue(); + } + + public java.util.Hashtable getTable() + { + return m_table; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/IteratorCDR.java b/source/es/tid/TIDorbj/core/cdr/IteratorCDR.java new file mode 100644 index 0000000..1f4f359 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/IteratorCDR.java @@ -0,0 +1,483 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.CompletionStatus; + +/** + * PositionCDR class gets track of byte array covering for marshaling and + * unmarshaling. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class IteratorCDR +{ + + /** + * Byte order of data in stream: big-endian if true, or + * little-endian if false + */ + protected boolean m_byte_order; + + /** + * The buffer controled by the buffer; + */ + + BufferCDR m_buffer_cdr; + + /** + * Actual Chunk Number. + */ + protected int m_current_chunk_num; + + /** + * The chunk covered + */ + protected ChunkCDR m_chunk; + + /** + * The actual position in the chunk + */ + protected int m_position; + + /** + * It is in an encapsulation. + */ + protected boolean m_encapsulation; + + /** + * Actual stream aligment offset. + */ + + protected AlignmentOffset m_alignment_offset; + + /** + * Last alignment calculated. + */ + + protected int m_last_alignment; + + /** + * Encapsulation context list. + */ + + protected ContextCDR m_context; + + /** + * Last mark for reset + */ + protected MarkCDR m_last_reset_mark; + + /** + * Starting mark for rewind + */ + protected MarkCDR m_starting_mark; + + // Constructor + + // Forbides the illegal use of a unitialized iterator. + + private IteratorCDR() + {} + + /** + * Constructor: gets a byte array referencen an places its position to 0 + */ + public IteratorCDR(BufferCDR buffer) + { + // Iterator in the buffer with root context + // generate the root position with root context an initial pointer, + m_buffer_cdr = buffer; + m_current_chunk_num = 0; + m_position = 0; + + PointerCDR initial_pointer = new PointerCDR(m_buffer_cdr, + m_current_chunk_num, + m_position); + + m_context = new ContextCDR(initial_pointer); + + // sets the iterator state ready to start at the beginnig of buffer. + fixStarting(); + + rewind(); + } + + /** + * Gets a byte array referencen an places its to the initial position. + */ + + public IteratorCDR(ContextCDR initial_context) + { + // Initial position values: + + m_context = initial_context; + + // sets the iterator state ready to start at the beginnig of buffer. + fixStarting(); + + rewind(); + } + + /** + * Sets the iterator possition to the starting position. + */ + + public void rewind() + { + goBack(m_starting_mark); + } + + protected MarkCDR getMark() + { + return new MarkCDR(m_context, getPointer()); + } + + protected void goBack(MarkCDR mark) + { + // context values + m_context = mark.getContext(); + + m_byte_order = m_context.getByteOrder(); + m_encapsulation = m_context.inAnEncapsulation(); + m_alignment_offset = m_context.getOffset(); + m_last_alignment = CDR.OCTET_SIZE; + + // pointer values; + PointerCDR initial_pointer = mark.getPointer(); + + m_current_chunk_num = initial_pointer.getNumChunk(); + m_buffer_cdr = initial_pointer.getBuffer(); + m_position = initial_pointer.getPosition(); + + m_chunk = m_buffer_cdr.getChunk(m_current_chunk_num); + + m_last_reset_mark = null; + } + + public void reset() + throws java.io.IOException + { + // state checking + if (m_last_reset_mark == null) + throw new java.io.IOException("Stream has no been marked"); + + goBack(m_last_reset_mark); + } + + public IteratorCDR copy() + { + + IteratorCDR new_iterator = new IteratorCDR(); + + new_iterator.m_context = m_context; + new_iterator.m_byte_order = m_context.getByteOrder(); + new_iterator.m_encapsulation = m_context.inAnEncapsulation(); + new_iterator.m_alignment_offset = m_context.getOffset(); + + // marks + + new_iterator.m_starting_mark = m_starting_mark; + new_iterator.m_last_reset_mark = null; + + new_iterator.m_current_chunk_num = m_current_chunk_num; + new_iterator.m_buffer_cdr = m_buffer_cdr; + new_iterator.m_position = m_position; + + new_iterator.m_chunk = m_chunk; + + return new_iterator; + } + + /** + * Returns the buffer CDR. + */ + public BufferCDR getBuffer() + { + + return m_buffer_cdr; + } + + /** + * @return the chunk pointered. + */ + public ChunkCDR getChunk() + { + + return m_chunk; + } + + /** + * @return true if little-endian or false if + * big-endian + */ + + public boolean getByteOrder() + { + return m_byte_order; + } + + /** + * Sets the byte order. + * + * @param byte_order + * is true if little-endian or false + * if big-endian + */ + + public void setByteOrder(boolean byte_order) + { + this.m_byte_order = byte_order; + m_context.setByteOrder(byte_order); + } + + /** + * @return the remaining bytes of the current chunk. + */ + + public int available() + { + int av = m_chunk.getAvailable() - m_position; + if (av < 0) + return 0; + else + return av; + } + + /** + * @return the remaining bytes of the buffer. + */ + + public int bufferAvailable() + { + int av = available(); + int num_chunks = m_buffer_cdr.getNumAvailableChunks(); + + for (int i = num_chunks - 1; i > m_current_chunk_num; i--) + av = m_buffer_cdr.getChunk(i).getAvailable(); + + return av; + } + + /** + * @return a pointer to actual position in the buffer, + */ + + PointerCDR getPointer() + { + return new PointerCDR(m_buffer_cdr, m_current_chunk_num, m_position); + } + + public void fixStarting() + { + m_starting_mark = getMark(); + } + + public void mark() + { + m_last_reset_mark = getMark(); + } + + /** + * Changes the alignment offset for a new Encapsulation, taking the actual + * position as the 0 positon of the encapsulation. Also, saves the actual + * aligment offset that will be restored when the + * exitEncapsulation were called. + */ + + public void enterEncapsulation() + { + ContextCDR new_context; + + m_encapsulation = true; + AlignmentOffset new_alignment_offset; + + new_alignment_offset = AlignmentOffset.calculateOffsetFrom(m_position); + + new_context = new ContextCDR(getPointer(), m_context, + new_alignment_offset); + m_context = new_context; + m_alignment_offset = new_alignment_offset; + } + + public void setAlignmentOffset(int relative_position) + { + + m_alignment_offset = + AlignmentOffset.calculateOffsetFrom(relative_position); + + m_context.setOffset(m_alignment_offset); + + } + + /** + * Restores the alignment offset for the Encapsulation containing the actual + * Encapsulation that it has been exited. + */ + + public void exitEncapsulation() + { + m_context = m_context.getFather(); + + m_byte_order = m_context.getByteOrder(); + m_alignment_offset = m_context.getOffset(); + m_encapsulation = m_context.inAnEncapsulation(); + } + + /** + * Says if it is in a encapsulation or in the main stream. + * + * @return true if it is in an encapsulation or + * false otherwise + */ + public boolean inAnEncapsulation() + { + return m_encapsulation; + } + + public void nextChunk() + throws org.omg.CORBA.MARSHAL + { + m_current_chunk_num++; + + if (m_current_chunk_num >= m_buffer_cdr.getNumChunks()) + throw new org.omg.CORBA.MARSHAL("END OF BUFFER", 0, + CompletionStatus.COMPLETED_NO); + + m_chunk = m_buffer_cdr.getChunk(m_current_chunk_num); + m_position = 0; + } + + /** + * Sets the covering position. It assumes if the new position is less than + * actual, the position is in a father encapsulation, of if greater is in + * the same encapsulation. + * + * @return true if OK, or false if it is a bad + * position. + */ + + public boolean setPosition(AbsolutePosition new_position) + { + // search the context + + int n = new_position.getValue(); + while (n < m_context.getStartPointer().getAbsolutePosition().getValue()) + exitEncapsulation(); + + // sets the chunk and position + + PointerCDR pointer = m_buffer_cdr.getPointer(n); + + if (pointer != null) { + m_current_chunk_num = pointer.getNumChunk(); + m_position = pointer.getPosition(); + return true; + } + // error bad position + return false; + } + + public void skip(int n) + { + m_position += n; + } + + /** + * Calculates the aligned position for the given type size. The aligment is + * refered at the actual encapsulation beginning. + * + * @param type_size + * the data type size. + */ + protected int alignPosition(int type_size) + { + int gap, rest; + rest = (m_position + m_alignment_offset.m_value) % type_size; + gap = (rest == 0) ? 0 : (type_size - rest); + return (m_position + gap); + } + + /** + * Says if the data must be aligned. + * + * @param type_size + * the data type size + */ + + public boolean mustAlign(int type_size) + { + return (m_position != alignPosition(type_size)); + } + + /** + * Changes aligns the position for the given type size.The aligment is + * refered at the actual encapsulation beginning. + * + * @param type_size + * the data type size. + */ + + public void align(int type_size) + { + m_position = alignPosition(type_size); + } + + /** + * Says if there is enougth space in the actual chunk for writting data from + * a given size. + * + * @param type_size the data type size. + * @return true<\code> if there is enougth space or false<\code> + * otherwise. + */ + + public boolean enoughSpace(int type_size) + { + return ((m_chunk.m_buffer.length - alignPosition(type_size)) + >= type_size); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/MarkCDR.java b/source/es/tid/TIDorbj/core/cdr/MarkCDR.java new file mode 100644 index 0000000..6afb5e0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/MarkCDR.java @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * Mark stack used for mark and rewind methods in CDRInputStream. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class MarkCDR +{ + + public MarkCDR(ContextCDR context, PointerCDR pointer) + { + m_context = context; + m_pointer = pointer; + } + + public ContextCDR getContext() + { + return m_context; + } + + public PointerCDR getPointer() + { + return m_pointer; + } + + /** + * Initial context for rewind. + */ + + protected ContextCDR m_context; + + /** + * Poiner to a buffer position. . + */ + + protected PointerCDR m_pointer; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/PointerCDR.java b/source/es/tid/TIDorbj/core/cdr/PointerCDR.java new file mode 100644 index 0000000..d83f214 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/PointerCDR.java @@ -0,0 +1,137 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +/** + * PointerCDR class points up a buffer position for future marshaling and + * unmarshaling. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class PointerCDR +{ + /** + * Buffer pointered. + */ + private BufferCDR m_buffer; + + /** + * Chunk number of the buffer. + */ + private int m_num_chunk; + + /** + * Position in the chunk + */ + private int m_position; + + /** + * Absolute position in the buffer. + */ + private AbsolutePosition m_absolute_position; + + /** + * Constructor: creates a pointer to position of a chunk in a buffer. + */ + + public PointerCDR(BufferCDR buffer, int num_chunk, int position) + { + this.m_buffer = buffer; + this.m_num_chunk = num_chunk; + this.m_position = position; + m_absolute_position = null; + } + + public BufferCDR getBuffer() + { + return m_buffer; + } + + public int getNumChunk() + { + return m_num_chunk; + } + + public int getPosition() + { + return m_position; + } + + /** + * Calculates the absolute position of a pointer from the begining of the + * buffer. + * + * @return the absulte position from the begining of the buffer. + */ + + public AbsolutePosition getAbsolutePosition() + { + + if (m_absolute_position == null) { + + int total_position = 0; + // add all the precedent chunks sizes + for (int i = 0; i < m_num_chunk; i++) + total_position += m_buffer.getChunk(i).getLength(); + // add the actual chunk position + total_position += m_position; + m_absolute_position = + AbsolutePosition.createAbsolutePosition(total_position); + } + return m_absolute_position; + } + + /** + * calculates the hash code of the pointer for a Hashtable. The hash code is + * the absolute position in the buffer that is a unique value in the buffer. + * + * @return the hash code. + */ + + public int hashCode() + { + return getAbsolutePosition().getValue(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/PositionsNode.java b/source/es/tid/TIDorbj/core/cdr/PositionsNode.java new file mode 100644 index 0000000..4178549 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/PositionsNode.java @@ -0,0 +1,149 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import java.util.Hashtable; + +/** + * The PositionNode class represents a table with the identifier + * and the position of the objects that has been marshaled in a buffer. + *

+ * The table entries are the Object identifier and the AbsolutePosition of the + * Object. + *

+ * There is a PositionNode per encapsulation, an they are linked + * to the father encausulation node throght the Encapsulation contexts. + * + *

+ * Copyright 2001 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class PositionsNode +{ + + /** + * Hashtable that contains Absolute positions of the TypeCodes. The keys are + * the repository ids. + */ + private Hashtable m_table; + + /** + * Position at the beginning of the encapsulation. + */ + private AbsolutePosition m_root_position; + + /** + * Lower Inidirected in the encapsulation sequence that has been looking up. + */ + private AbsolutePosition m_lower_indirection; + + public PositionsNode(AbsolutePosition type_code_position) + { + m_table = null; + m_root_position = type_code_position; + m_lower_indirection = m_root_position; + } + + /** + * Looks up if an Object has been yet marshaled in a stream. + * If the object has been marshaled in a father encapsulation, the it will + * remark it at the lower_indirection + * + * @param id + * the Object Id of the marshaled Object. + */ + public synchronized PointerCDR lookup(java.lang.Object obj) + { + // search in own table + if (m_table != null) + return (PointerCDR) m_table.get(obj); + + return null; + } + + /** + * notify the node that a indirection has been set thru this node + * + * @return true if the indirection pass through + */ + public synchronized void indirection(AbsolutePosition position) + { + if ((position != null) + && (position.getValue() < m_lower_indirection.getValue())) { + m_lower_indirection = position; + } + } + + /** + * Saves a TypeCode position in the table. + * + * @param id + * the Object Id of the marshaled object + * @param position + * the object position in the buffer + */ + + public synchronized void put(java.lang.Object id, PointerCDR position) + { + if (m_table == null) + m_table = new Hashtable(); + + m_table.put(id, position); + } + + /** + * Used to calculate if an marshaled TypeCode has any indirection out of the + * encapsulation. This means that a TypeCode encapsulation may or not be + * reused. + * + * @return whether or not has any indirection out of the encapsulation. + */ + public boolean hasExternalIndirections() + { + return m_lower_indirection.getValue() < m_root_position.getValue(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/TypeCodeReader.java b/source/es/tid/TIDorbj/core/cdr/TypeCodeReader.java new file mode 100644 index 0000000..49bf6a7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/TypeCodeReader.java @@ -0,0 +1,267 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 153 $ +* Date: $Date: 2007-12-12 08:57:20 +0100 (Wed, 12 Dec 2007) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.TypeCodeCache; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeImpl; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * TypeCode Demarshaling class. Reads the typecode kind and + * creates a new typecode finishing its remarshaling. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +class TypeCodeReader +{ + + /** + * Read a TypeCode from the InputStream. + * + * @param input + * the input stream + */ + public static TypeCode read(CDRInputStream input) + { + + // aligns to get the typeCode position + + input.alignment(CDR.LONG_SIZE); + + // gets the typecode position + + PointerCDR typecode_position = input.getPointer(); + + // read the tc_kind value + int kind = input.read_long(); + + if (kind == -1) // indirection + { + return readIndirection(input); + } + + // typecode kind + TCKind tc_kind = null; + + try { + tc_kind = TCKind.from_int(kind); + } + catch (BAD_PARAM bp) { + throw new BAD_TYPECODE("Invalid kind: " + bp.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + // Typecode readed + TypeCodeImpl type = null; + + if (TypeCodeFactory.isComplex(tc_kind)) { + TypeCode cached_type = findInCache(input); + + if (cached_type != null) { + input.skipEncapsulation(); + input.getContextCDR() + .putPosition(typecode_position.getAbsolutePosition(), + cached_type); + return cached_type; + } + + type = TypeCodeFactory.getComplexTypeCode(tc_kind); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + type.partialUnmarshal(input); + + // it is a complex typecode: insert the typecode in the table and + // unmarshal + + input.getContextCDR() + .putPosition(typecode_position.getAbsolutePosition(), type); + + return putInCache(input, type); + + } else if (TypeCodeFactory.isSemiComplex(tc_kind)) { + + type = TypeCodeFactory.getSemiComplexTypeCode(tc_kind); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + type.partialUnmarshal(input); + + return type; + + } else { // is basic + + type = TypeCodeFactory.getBasicTypeCode(tc_kind); + + if (type == null) + throw new org.omg.CORBA.INTERNAL("Error reading typecode"); + if (input.m_orb.m_conf.exhaustive_equal) { + type.setExhaustiveEqual(input.m_orb.m_conf.exhaustive_equal); + } + return type; + } + } + + /** + * Read a TypeCode from the InputStream. + * + * @param input + * the input stream + */ + public static TypeCode readIndirection(CDRInputStream input) + { + AbsolutePosition referenced_position = input.readIndirection(); + + // search in the indirection node + + java.lang.Object obj = input.getContextCDR() + .lookupObject(referenced_position); + + if (obj != null) { + if (obj instanceof TypeCode) { + return (TypeCode) obj; + } else { + throw new MARSHAL("Invalid indirection: no typecode indirected"); + } + } + + // Visibroker makes indirections to basic types, is it one? + + CDRInputStream indirection_input = input.copy(); + + indirection_input.setPosition(referenced_position); + + TCKind tc_kind = TCKind.from_int(indirection_input.read_long()); + + TypeCodeImpl type = TypeCodeFactory.getBasicTypeCode(tc_kind); + + if (type == null) // it is not a basic typeCode: ERROR!!! + throw new MARSHAL("Invalid indirection: no typecode indirected."); + + return type; + } + + public static TypeCode findInCache(CDRInputStream input) + { + TIDORB orb = (TIDORB) input.orb(); + + if (orb == null) + return null; + + TypeCodeCache cache = orb.getTypeCodeCache(); + + if (cache != null) { + + // lectura adelantada del repository id para ver si ya está en la + // cache + + CDRInputStream encap = input.copy(); + + encap.enterEncapsulation(); + + String rep_id = encap.read_string(); + + encap = null; + + return cache.find(rep_id); + } + + return null; + } + + public static TypeCode putInCache(CDRInputStream input, TypeCode tc) + { + TIDORB orb = (TIDORB) input.orb(); + + if (orb == null) + return tc; + + TypeCodeCache cache = orb.getTypeCodeCache(); + + if (cache != null) { + return cache.put(tc); + } + return tc; + } + + public static void skip(CDRInputStream input) + { + + int kind; // typecode kind value + TCKind tc_kind; // typecode kind + TypeCodeImpl type = null; // typecode + + // read the tc_kind value + kind = input.read_long(); + + if (kind == -1) { // indirection + // skip indirection offset + input.skipLong(); + } + + try { + tc_kind = TCKind.from_int(kind); + } + catch (BAD_PARAM bp) { + throw new BAD_TYPECODE("Invalid kind: " + bp.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + TypeCodeMarshaler.skipParams(tc_kind, input); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/cdr/ValueTypeInfo.java b/source/es/tid/TIDorbj/core/cdr/ValueTypeInfo.java new file mode 100644 index 0000000..98c1c0d --- /dev/null +++ b/source/es/tid/TIDorbj/core/cdr/ValueTypeInfo.java @@ -0,0 +1,342 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.cdr; + +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.util.CodeBaseURL; +import es.tid.TIDorbj.core.util.RepositoryId; + +public class ValueTypeInfo +{ + + public final static int NULL_TAG = 0; + + /* value tags constants */ + public final static int CODE_BASE_BIT = 0x00000001; + + public final static int SINGLE_REPOSITORY_ID = 0x00000002; + + public final static int REPOSITORY_ID_LIST = 0x00000006; + + public final static int INDIRECTION_TAG = 0xffffffff; + + public final static int FRAGMENTED_BIT = 0x00000008; + + public final static int MIN_VALUE_TAG = 0x7ffff00; + + public final static int MAX_VALUE_TAG = 0x7ffffff; + + public final static int MIN_CHUNK_SIZE = 0; + + public final static int MAX_CHUNK_SIZE = 0x7ffff00; + + private CodeBaseURL m_code_base_url; + + private RepositoryId[] m_repository_ids; + + private int m_value_tag; + + private java.io.Serializable m_value; + + public ValueTypeInfo() + { + m_code_base_url = null; + m_repository_ids = null; + m_value_tag = MIN_VALUE_TAG; + m_value = null; + } + + protected ValueTypeInfo(int value_tag) + { + m_code_base_url = null; + m_repository_ids = null; + m_value_tag = value_tag; + m_value = null; + } + + public boolean isNull() + { + return m_value_tag == NULL_TAG; + } + + public boolean isIndirection() + { + return m_value_tag == INDIRECTION_TAG; + } + + public boolean isFragmented() + { + return ((!isIndirection()) + && ((m_value_tag & FRAGMENTED_BIT) == FRAGMENTED_BIT)); + } + + public boolean is_state() + { + return (m_value_tag != NULL_TAG) && (m_value_tag != INDIRECTION_TAG); + } + + public RepositoryId[] get_repository_ids() + { + return m_repository_ids; + } + + public String get_id() + { + if ((m_repository_ids == null) || (m_repository_ids.length == 0)) + return null; + return m_repository_ids[0].m_value; + } + + public boolean is_truncable(String rep_id) + { + String value_id = null; + + if (m_repository_ids != null) { + for (int i = 0; i < m_repository_ids.length; i++) { + value_id = m_repository_ids[i].m_value; + + if (rep_id.equals(value_id)) { + return true; + } + } + } + return false; + } + + public void set_repository_ids(String[] ids) + { + RepositoryId[] rep_ids = new RepositoryId[ids.length]; + + for (int i = 0; i < ids.length; i++) { + rep_ids[i] = new RepositoryId(ids[i]); + } + set_repository_ids(rep_ids); + } + + public void set_repository_ids(RepositoryId[] ids) + { + m_repository_ids = ids; + + if ((ids == null) || (ids.length == 0)) { + m_value_tag &= ~REPOSITORY_ID_LIST; + } else if (ids.length == 1) { + m_value_tag &= ~REPOSITORY_ID_LIST; + m_value_tag |= SINGLE_REPOSITORY_ID; + } else { + m_value_tag |= REPOSITORY_ID_LIST; + } + } + + public void set_value(java.io.Serializable val) + { + m_value = val; + } + + public java.io.Serializable get_value() + { + return m_value; + } + + public boolean has_code_base_url() + { + return m_code_base_url != null; + } + + public CodeBaseURL get_code_base_url() + { + return m_code_base_url; + } + + public void set_code_base_url(CodeBaseURL url) + { + m_code_base_url = url; + + if (url == null) + m_value_tag &= ~CODE_BASE_BIT; + else + m_value_tag |= CODE_BASE_BIT; + } + + public void set_fragmented(boolean value) + { + if (value) + m_value_tag |= FRAGMENTED_BIT; + else + m_value_tag &= ~FRAGMENTED_BIT; + } + + public static ValueTypeInfo read(CDRInputStream in) + { + int value = in.read_long(); + + ValueTypeInfo info = new ValueTypeInfo(value); + + info.read_info(in); + + return info; + } + + public static void write_null(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(NULL_TAG); + } + + public void write(CDROutputStream out) + { + out.write_long(m_value_tag); + write_code_base_url(out); + write_type_info(out); + } + + protected void read_info(CDRInputStream input) + { + if ((m_value_tag != INDIRECTION_TAG) && (m_value_tag != NULL_TAG)) { + read_code_base_url(input); + read_type_info(input); + } + } + + protected void read_code_base_url(CDRInputStream input) + { + if ((m_value_tag & CODE_BASE_BIT) == 0x0) + return; + + input.alignment(CDR.LONG_SIZE); + + AbsolutePosition this_url_position = input.getAbsolutePosition(); + + int code_base_tag = input.read_long(); + + if (code_base_tag == INDIRECTION_TAG) { + AbsolutePosition url_position = input.readIndirection(); + java.lang.Object obj = input.getContextCDR() + .lookupObject(url_position); + + if ((obj != null) && (obj instanceof CodeBaseURL)) + m_code_base_url = (CodeBaseURL) obj; + else + throw new MARSHAL("Invalid URL indirection"); + } else { // read code_base_url + char[] chars = new char[code_base_tag]; + input.read_char_array(chars, 0, code_base_tag); + m_code_base_url = new CodeBaseURL(new String(chars)); + input.getContextCDR().putPosition(this_url_position, + m_code_base_url); + } + } + + protected void write_code_base_url(CDROutputStream out) + { + if (m_code_base_url != null) + out.write_string(m_code_base_url.m_url); + } + + protected void read_type_info(CDRInputStream input) + { + if ((m_value_tag & REPOSITORY_ID_LIST) == REPOSITORY_ID_LIST) { + // read ids sequence + int length = input.read_long(); + + if (length < 0) + throw new MARSHAL("Invalid RepositoryId seq length < 0"); + + m_repository_ids = new RepositoryId[length]; + + for (int i = 0; i < length; i++) + m_repository_ids[i] = read_repository_id(input); + + } else if ((m_value_tag & SINGLE_REPOSITORY_ID) == SINGLE_REPOSITORY_ID) { + // int length = input.read_long(); + + // if(length != 1) + // throw new MARSHAL("Invalid RepositoryId seq length != 1"); + + m_repository_ids = new RepositoryId[1]; + + m_repository_ids[0] = read_repository_id(input); + } // else there is no type data + } + + protected RepositoryId read_repository_id(CDRInputStream input) + { + input.alignment(CDR.LONG_SIZE); + AbsolutePosition id_position = input.getAbsolutePosition(); + + int repository_id_tag = input.read_long(); + if (repository_id_tag == INDIRECTION_TAG) { + AbsolutePosition url_position = input.readIndirection(); + java.lang.Object obj = input.getContextCDR() + .lookupObject(url_position); + + if ((obj != null) && (obj instanceof RepositoryId)) + return (RepositoryId) obj; + else + throw new MARSHAL("Invalid RepositoryId indirection"); + } else { + char[] chars = new char[repository_id_tag]; + input.read_char_array(chars, 0, repository_id_tag); + RepositoryId id = + new RepositoryId(new String(chars, 0, + repository_id_tag - 1)); + input.getContextCDR().putPosition(id_position, id); + return id; + } + } + + protected void write_type_info(CDROutputStream out) + { + if (m_code_base_url != null) + out.writeReferenceableString(m_code_base_url.m_url); + + if (m_repository_ids != null) { + if ((m_value_tag & REPOSITORY_ID_LIST) == REPOSITORY_ID_LIST) { + out.write_long(m_repository_ids.length); + for (int i = 0; i < m_repository_ids.length; i++) + out.writeReferenceableString(m_repository_ids[i].m_value); + } else { // SINGLE_REPOSITORY_ID + out.writeReferenceableString(m_repository_ids[0].m_value); + } + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/.svn/all-wcprops b/source/es/tid/TIDorbj/core/comm/.svn/all-wcprops new file mode 100644 index 0000000..a32d592 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/all-wcprops @@ -0,0 +1,65 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm +END +CommunicationException.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/CommunicationException.java +END +LocateResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/LocateResponseHandler.java +END +ResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ResponseHandler.java +END +ForwardRequest.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ForwardRequest.java +END +RequestDispatcher.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/RequestDispatcher.java +END +Connection.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/481/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/Connection.java +END +CommunicationDelegate.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/CommunicationDelegate.java +END +CommunicationManager.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/CommunicationManager.java +END +PropertyInfo.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/PropertyInfo.java +END +CommunicationLayer.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/CommunicationLayer.java +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/entries b/source/es/tid/TIDorbj/core/comm/.svn/entries new file mode 100644 index 0000000..f06de3b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/entries @@ -0,0 +1,380 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +CommunicationDelegate.java +file + + + + +2010-04-28T10:50:56.000000Z +b806162cbda764fa8add9f6a8a70bed4 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +13973 + +CommunicationManager.java +file +478 + + + +2011-04-29T14:42:47.000000Z +99b332b4d6aeb78a0ee26956937da353 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +24763 + +PropertyInfo.java +file + + + + +2009-05-27T12:24:01.000000Z +1ab1a98e86c594fa0e961db5e284afc7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4613 + +iiop +dir + +CommunicationLayer.java +file + + + + +2009-05-27T12:24:01.000000Z +adec86a4d88a85b862a75408df53266f +2008-04-12T14:33:40.707510Z +274 +avega +has-props + + + + + + + + + + + + + + + + + + + + +9537 + +CommunicationException.java +file + + + + +2009-05-27T12:24:01.000000Z +e8f0acb8e8873b4de2ce53be6597dbbd +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2097 + +LocateResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +8c978935cd729d5d004f76b84786a2e4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2270 + +ssliop +dir + +local +dir + +ResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +6974468309ed4a85aaf9c220b9544789 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2978 + +ForwardRequest.java +file + + + + +2009-05-27T12:24:01.000000Z +b6da9b961a4cc4599dddd7656ccb68d0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +307 + +giop +dir + +RequestDispatcher.java +file + + + + +2009-05-27T12:24:01.000000Z +daa952892b96be8dd9148c51128e8288 +2007-05-10T10:05:13.109677Z +67 +avega +has-props + + + + + + + + + + + + + + + + + + + + +6317 + +Connection.java +file +481 + + + +2012-05-04T14:29:01.000000Z +4fe069a0db31b88e1e667094768351a1 +2012-05-08T15:39:32.674920Z +481 +avega + + + + + + + + + + + + + + + + + + + + + +66512 + diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationDelegate.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationDelegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationDelegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationException.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationManager.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/CommunicationManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ForwardRequest.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ForwardRequest.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ForwardRequest.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/LocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/LocateResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/LocateResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/PropertyInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/PropertyInfo.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/PropertyInfo.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/RequestDispatcher.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/RequestDispatcher.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/RequestDispatcher.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/prop-base/ResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationDelegate.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationDelegate.java.svn-base new file mode 100644 index 0000000..c4459f2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationDelegate.java.svn-base @@ -0,0 +1,513 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision$ + * Date: $Date$ + * Last modified by: $Author$ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.InvalidPolicies; +import org.omg.CORBA.Object; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.portable.Delegate; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.ContextListImpl; +import es.tid.TIDorbj.core.ExceptionListImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * + * CommunicationDelegate is the base type for ORB's to be uncoupled of the + * underlying communications infraestructure from the 'client' side. + * It contains the base methods to allow sending requests to other ORB's. It + * keeps also the org.omg Delegate view, to allow regular corba Helper and + * Holder interaction. + * + * @author Juan Pablo Rojas. + * + */ +public abstract class CommunicationDelegate extends Delegate { + + protected TIDORB orb; + protected IOR reference; + protected CommunicationDelegate forwardReference; + protected PolicyContext policyContext; + + /** + * + */ + public CommunicationDelegate() { + super(); + this.orb = null; + this.reference = null; + this.policyContext = null; + } + + public CommunicationDelegate( TIDORB orb ) { + super(); + setORB( orb ); + } + + public void setORB(TIDORB orb) { + if (orb != null) { + this.orb = orb; + } else { + throw new IllegalArgumentException("Parameter 'orb' cannot be null"); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public void setReference(IOR ior) { + if (ior != null) { + this.reference = ior; + } else { + throw new IllegalArgumentException("Parameter 'ior' cannot be null"); + } + }//setReference + + /* + * As IOR could be set in it's generic and not unmarshalled way, children de + * legates should replace the generic implementation with a more specialized + * version... + */ + public abstract IOR getReference();/* { + return this.reference; + }//getReference*/ + + public synchronized void setPolicyContext( PolicyContext policyContext ){ + this.policyContext = policyContext; + }//setPolicyContext + + public PolicyContext getPolicyContext(){ + synchronized( this ) { + if ( this.policyContext == null ){ + this.policyContext = new PolicyContext(null); + } + } + return this.policyContext; + }//getPolicyContext + + public boolean is_a(org.omg.CORBA.Object self, String repositoryIdentifier) { + if (repositoryIdentifier == null) { + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (repositoryIdentifier.equals("IDL:omg.org/CORBA/Object:1.0")) { + return true; + } + if (repositoryIdentifier.equals(this.reference.getTypeId())) { + return true; + } + // search in known interface + String[] interf_ids = ((org.omg.CORBA.portable.ObjectImpl) self)._ids(); + + if (interf_ids != null) { + for (int i = 0; i < interf_ids.length; i++) { + if (repositoryIdentifier.equals(interf_ids)) { + return true; + } + } + } + + //ask to the remote object + if (this.orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + return this.invoke_is_a(self, repositoryIdentifier); + } + + public boolean is_equivalent(org.omg.CORBA.Object self, + org.omg.CORBA.Object other) { + if (other == null) { + throw new BAD_PARAM("Null reference"); + } + // are they the same object? + if (self == other) { + return true; + } + Delegate delegate = + ( (org.omg.CORBA.portable.ObjectImpl) other )._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + return this.reference.equivalent( + ((CommunicationDelegate) delegate).getReference() + ); + } else { + return toString().equals( + delegate.orb(other).object_to_string(other) + ); + } + } + + public org.omg.CORBA.ORB orb( org.omg.CORBA.Object self ){ + return this.orb; + } + + public int hash(org.omg.CORBA.Object self, int maximum) { + int code = this.reference.hashCode(); + if (code > maximum) { + code %= maximum; + } + return code; + }//hash + + + public org.omg.CORBA.Request request( org.omg.CORBA.Object self, + String operation ) { + if (operation == null) { + throw new BAD_PARAM( + "Null operation string", 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( this.orb == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO + ); + } + //TODO: RequestImpl should be common to all delegates, rename it? + return new RequestImpl( + self, + new ContextImpl( this.orb, "" ), + operation, + new NVListImpl( this.orb ), + null, + new ExceptionListImpl(), + new ContextListImpl() + ); + }//request + + public org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result ) { + + if ( this.orb == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO + ); + }//configurationCheck + + if ( self == null || + ctx == null || + operation == null || + arg_list == null ) { + + throw new BAD_PARAM( + "Null reference.", 0, CompletionStatus.COMPLETED_NO + ); + }//parametersCheck + + return new RequestImpl( + self, + ctx, + operation, + arg_list, + result, + new ExceptionListImpl(), + new ContextListImpl() + ); + }//createRequest + + public org.omg.CORBA.Request create_request( org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist ) { + + if ( this.orb == null ) { + throw new BAD_OPERATION( + "ORB Singleton: Can not create request", 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( self == null || + ctx == null || + operation == null || + arg_list == null || + exclist == null || + ctxlist == null ) { + + throw new BAD_PARAM( + "Null reference", 0, CompletionStatus.COMPLETED_NO ); + } + + return new RequestImpl( + self, + ctx, + operation, + arg_list, + result, + exclist, + ctxlist + ); + }//createRequest + + + public org.omg.CORBA.Policy get_policy( + org.omg.CORBA.Object self, + int policy_type ) { + + PolicyContext request_context; + request_context = createRequestPolicyContext(); + + return request_context.getPolicy( policy_type ); + }//get_policy + + public org.omg.CORBA.Object set_policy_override( + org.omg.CORBA.Object self, + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add ) { + + org.omg.CORBA.portable.ObjectImpl copy; + copy = ( org.omg.CORBA.portable.ObjectImpl ) self._duplicate(); + + //TODO: Note that the delegate stored in object reference must be a + //CommunicationsDelegate instance! + CommunicationDelegate delegate = ( CommunicationDelegate )copy._get_delegate(); + + try { + delegate.getPolicyContext().setPolicies(policies, set_add); + } catch (InvalidPolicies iv) {} + return copy; + + }//set_policy_override + + /* + * UNIMPLEMENTED API + */ + public org.omg.CORBA.DomainManager[] _get_domain_managers( + org.omg.CORBA.Object self ) { + + throw new org.omg.CORBA.NO_IMPLEMENT(); + }//_get_domain_managers + + + /* + * DEPRECATED API + */ + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.InterfaceDef get_interface(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + /* + * Utility methods used by TIDOrbJ + */ + + public void setForward(ForwardRequest fe) + { + try { + this.forwardReference = + orb.getCommunicationManager().createDelegate(fe.forward_reference); + } + catch (CommunicationException e) { + throw new INV_OBJREF("Cannot create delegate for: " + + fe.forward_reference.toString()); + } + + orb.printTrace( + Trace.DEBUG, new String[]{ + "DelegateImpl::non_exist(): ", + this.getReference().toString(), + " forwarded to: ", + this.forwardReference.toString() + } + ); + } + + /** + * Creates the PolicyContext for a request using reference + thread + ORB + * PolicyManagers + */ + public PolicyContext createRequestPolicyContext() + { + // generates effective Request context + + PolicyContext context = getPolicyContext(); + context = context.duplicate(); + Thread currentThread = Thread.currentThread(); + + // thread_context has as father ORB Context + PolicyContext thread_context = + orb.getPolicyContextManager().getThreadContext(currentThread); + + context.setFatherContext(thread_context); + return context; + } + + /* + * must use CommunicationManager to retrieve a valid delegate + * from provided ior. + * @deprecated since 6.0.1 + */ + public CommunicationDelegate fromString( TIDORB orb, String ior ) { + throw new UnsupportedOperationException(); + } + + public String toString(){ + if ( this.reference != null ) { + return this.reference.toString(); + } else { + throw new IllegalStateException( "No reference configured!" ); + } + } + + protected boolean invoke_is_a( org.omg.CORBA.Object self, String id ){ + // Create the request: + org.omg.CORBA.Request request = request(self, "_is_a"); + + // insert the parameter and return type + Any inputAny = request.add_named_in_arg( "repositoryIdentifier" ); + inputAny.insert_string(id); + request.set_return_type( this.orb.get_primitive_tc(TCKind.tk_boolean) ); + + // Perform the invocation: + request.invoke(); + + java.lang.Exception exception; + if ( ( exception = request.env().exception() ) != null ) { + throw (org.omg.CORBA.SystemException) exception; + } + + // Extrae el resultado y los argumentos de salida: + return request.return_value().extract_boolean(); + + }//invoke_is_a + + public org.omg.CORBA.portable.OutputStream request( + org.omg.CORBA.Object object, + String operation, + boolean responseExpected ){ + + if ( this.is_local( object ) ) { + throw new BAD_OPERATION( + "Request is only valid for remote objects" + ); + } + + org.omg.CORBA.portable.ObjectImpl target; + target = (org.omg.CORBA.portable.ObjectImpl) object; + + StreamRequestImpl request = new StreamRequestImpl( + this.orb, + target, + operation, + responseExpected + ); + + this.prepareRequest(request); + + return request.getOutputStream(); + + } + + public String get_codebase( org.omg.CORBA.Object self ){ + return null; + } + + /* + * To be implemented by concrete implementations + */ + public abstract boolean isLocal( org.omg.CORBA.Object self ); + + public abstract boolean non_existent( org.omg.CORBA.Object self ); + + public abstract org.omg.CORBA.Object duplicate( org.omg.CORBA.Object self ); + + public abstract void release( org.omg.CORBA.Object self ); + + public abstract void release_reply( + org.omg.CORBA.Object self, + org.omg.CORBA.portable.InputStream inputStream + ); + + //TODO: actually this operation is performed by the 'old' commLayer itself + public abstract void prepareRequest( StreamRequestImpl request ); + + public abstract void onewayRequest( RequestImpl request ); + + public abstract void invoke( RequestImpl request ); + + // AMI callback operations + public abstract void asyncRequest( RequestImpl request, Object ami_handler ); + + public abstract org.omg.CORBA.portable.InputStream invoke( + org.omg.CORBA.Object object, + org.omg.CORBA.portable.OutputStream stream ) + throws + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException ; + + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationException.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationException.java.svn-base new file mode 100644 index 0000000..1816c75 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationException.java.svn-base @@ -0,0 +1,71 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +/** + * + * Generic excetion thrown from communications infraestructure. TODO: this + * should be concreted upon refactoring evolution + * + * @author jprojas + * + */ +public class CommunicationException extends Exception { + + public CommunicationException(){ + super(); + } + + public CommunicationException( String message ){ + super( message ); + } + + public CommunicationException( String message, Throwable cause ){ + super( message, cause ); + } + + public CommunicationException( Throwable cause ){ + super( cause ); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationLayer.java.svn-base new file mode 100644 index 0000000..d1c3f95 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationLayer.java.svn-base @@ -0,0 +1,249 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision$ + * Date: $Date$ + * Last modified by: $Author$ + * + * (C) Copyright 2004 Telefónica Investigación y Desarrollo + * S.A.Unipersonal (Telefónica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ + +package es.tid.TIDorbj.core.comm; + + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +; + +/** + * The interface of every CommunicationLayer implementation. + * + * @see CommunicationManager + */ +public interface CommunicationLayer { + + + public abstract void setORB( TIDORB orb ); + public abstract TIDORB getORB(); + + public void setServerModeEnabled( boolean value ) throws CommunicationException; + public boolean isServerModeEnabled(); + + public void shutdown( boolean waitForCompletion ); + + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the given URL. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + * @param url the URL of the service to which to connect + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(String url) throws CommunicationException; + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the given URL. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + *

The java.util.Properties argument can be used to pass + * arbitrary string tag/value pairs as connection arguments. + * + * @param url the URL of the service to which to connect + * @param info a list of arbitrary string tag/value pairs as arguments. + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(String url, java.util.Properties info) + throws CommunicationException; + + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the service identified by the given reference. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + * @param url the URL of the service to which to connect + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(IOR ior) throws CommunicationException; + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the service identified by the given reference. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + *

The java.util.Properties argument can be used to pass + * arbitrary string tag/value pairs as connection arguments. + * + * @param ior the IOR of the service to which to connect + * @param info a list of arbitrary string tag/value pairs as + * connection arguments. + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(IOR ior, java.util.Properties info) + throws CommunicationException; + + /** + * Retrieves whether the driver thinks that it can open a connection + * to the resource identified by the given URL. + * + * @param url the URL of the desired resource + * @return true if this driver understands the given URL; + * false otherwise + * @exception CommunicationException if a database access error occurs + */ + boolean accepts(String url) throws CommunicationException; + + + /** + * Retrieves whether the driver thinks that it can open a connection + * to the resource identified by the given URL. + * + * @param ior the IOR associated with the desired service + * @return true if this driver understands the given URL; + * false otherwise + * @exception CommunicationException if a database access error occurs + */ + boolean accepts(IOR ior) throws CommunicationException; + + /** + * Creates an base ior containing the information regarding the + * communication's configuration (ie, prototol, version, host & port used) + * @return an ior filled with the communications info available for + * current layer. + * @throws CommunicationException + */ + IOR createIOR( String repositoryId, ObjectKey key, TaggedComponent[] components ) + throws CommunicationException; + + /** + * Creates an base url containing the information regarding the + * communication's configuration (ie, prototol, version, host & port used) + * @return an String filled with the communications info available for + * current layer. + * @throws CommunicationException + */ + String createURL( String repositoryId, ObjectKey key ) throws CommunicationException; + + + //TODO: check the convenience of these method + public String getInitialReference( IOR ior ) throws CommunicationException; + public String getInitialReference( String url ) throws CommunicationException; + + + public boolean isLocal( IOR ior ) throws CommunicationException; + public boolean isLocal( String url ) throws CommunicationException; + + + /** + * Gets information about the possible properties for this driver. + *

+ * The getPropertyInfo method is intended to allow a generic + * GUI tool to discover what properties it should prompt + * a human for in order to get + * enough information to connect to a certain service. Note that depending on + * the values the human has supplied so far, additional values may become + * necessary, so it may be necessary to iterate though several calls + * to the getPropertyInfo method. + * + * @param url the URL of the database to which to connect + * @param info a proposed list of tag/value pairs that will be sent on + * connect open + * @return an array of DriverPropertyInfo objects describing + * possible properties. This array may be an empty array if + * no properties are required. + * @exception CommunicationException if some error occurs + */ + PropertyInfo[] getPropertiesInfo(); + PropertyInfo getPropertyInfo( String name ); + + + /** + * Retrieves the Layer's major version number. Initially this should be 1. + * + * @return this Layer's major version number + */ + int getMajorVersion(); + + /** + * Gets the Layer's minor version number. Initially this should be 0. + * @return this Layers's minor version number + */ + int getMinorVersion(); + + /** + * Gets the Layers identification string. + */ + String getId(); + + /** + * Gets the Layers identification string. + */ + void dump(java.io.PrintWriter writer); + + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationManager.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationManager.java.svn-base new file mode 100644 index 0000000..88c9642 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/CommunicationManager.java.svn-base @@ -0,0 +1,725 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision$ + * Date: $Date$ + * Last modified by: $Author$ + * + * (C) Copyright 2004 Telefnica Investigacin y Desarrollo + * S.A.Unipersonal (Telefnica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm; + +import java.util.Hashtable; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.util.Trace; + +/** + * Based on the jdbc interface and driver registry implementation, + * CommunicationManager will provide a way to uncouple the underlying + * communications infraestructure from the logic regarding the processing, + * execution and result retrieval of incoming and outgoing requests. + * + * Through the CommunicationManager, ORB will be able to obtain a + * concrete CommunicationDelegate depending on the URL / IOR + * provided, so that the actual communication process will be managed by the + * underlying implementation + * + * From the internal side of each CommunicationLayer, it will + * provide a reference to a RequestDispatcher object that will hold + * the process of request enqueual into ORB's infraestructure + * + * @author Juan Pablo Rojas + * + * + */ +public class CommunicationManager { + + + private boolean offline; + + /** + * Attempts to establish a connection to the given database URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered layers. + * + * @param url + * a service url of the form + * protocol:subprotocol:subname + * @return a connection to the URL + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate(String url) + throws CommunicationException { + + java.util.Properties info = new java.util.Properties(); + + return ( createDelegate( url, info ) ); + } + + /** + * Attempts to create a delegate for the given URL. The + * CommunicationManager attempts to select the appropriate + * CommunicationLayer from the set of registered layers. + * + * @param ior a service ior + * + * @return a CommunicationDelegate to the desired service + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( IOR ior ) + throws CommunicationException { + + java.util.Properties info = new java.util.Properties(); + + return ( createDelegate( ior, info ) ); + } + + /** + * Attempts to locate a layer that understands the given URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered layers. + * + * @param url + * a URL of the form + * :: + * @return a CommunicationsLayer object representing a layer that can + * connect to the given service + * @exception CommunicationException + * if an error occurs + */ + public synchronized CommunicationLayer getLayer(String url) + throws CommunicationException { + println("CommunicationManager.getLayer(\"" + url + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + try { + println(" trying " + li); + if (li.layer.accepts(url)) { + // Success! + println("getLayer returning " + li); + return (li.layer); + } + } catch (CommunicationException ex) { + // Drop through and try the next driver. + } + } + + println("getLayer: no suitable layer"); + throw new CommunicationException("No suitable layer"); + } + + + + /** + * Attempts to locate a layer that matches the given Id. . + * + * @param id + * + * @return a CommunicationsLayer object representing a layer + * identified as id, or null if the layer wasn't found + */ + public CommunicationLayer getLayerById( String id ) { + + // TODO trace it + // println("CommunicationManager.getLayerById(\"" + id + "\")"); + + if (!initialized) { + initialize(); + } + CommunicationLayer desiredLayer = null; + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + //println( " trying " + li ); + if (li.layer.getId().equals( id )) { + // Success! + // println( "getLayer returning " + li ); + desiredLayer = li.layer; + } + + } + return desiredLayer; + }//getLayerById + + + /** + * Attempts to locate a layer that can connect to the service bound to the + * IOR object passed as an argument. The CommunicationManager + * attempts to select an appropriate layer from the set of registered communication + * layers. + * + * @param ior + * a service IOR + * @return a CommunicationLayer object representing a driver that can + * connect to the given URL + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationLayer getLayer( IOR ior ) + throws CommunicationException { + + println("CommunicationManager.getDriver(\"" + ior + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + try { + println( " trying " + li ); + if (li.layer.accepts( ior )) { + // Success! + println( "getLayer returning " + li ); + return ( li.layer ); + } + } catch ( CommunicationException ex ) { + // Drop through and try the next driver. + } + } + + println( "getLayer: no suitable layer" ); + throw new CommunicationException( "No suitable layer" ); + } + + /** + * Registers the given layer with the CommunicationManager. + * A newly-loaded driver class should call the method + * registerDriver to make itself known to the + * CommunicationManager. + * + * @param layer + * the new CommunicationLayer that is to be registered with the + * CommunicationManager + * @exception CommunicationException + * if an error occurs + */ + public synchronized void registerLayer(CommunicationLayer layer) + throws CommunicationException { + + if (!initialized) { + initialize(); + } + + LayerInfo li = new LayerInfo(); + li.layer = layer; + li.layerClass = layer.getClass(); + li.layerClassName = li.layerClass.getName(); + availableLayers.addElement(li); + println( "registerLayer: " + li ); + } + + /** + * Drops a layer from the CommunicationManager's list. + * Applets can only deregister availableLayers from their own classloaders. + * + * @param layer + * the CommunicationLayer to drop + * @exception CommunicationException + * if an error occurs + */ + public synchronized void deregisterLayer(CommunicationLayer layer) + throws CommunicationException { + + println( "CommunicationManager.deregisterLayer: " + layer ); + + // Walk through the loaded availableLayers. + int i; + LayerInfo li = null; + for (i = 0; i < availableLayers.size(); i++) { + li = (LayerInfo) availableLayers.elementAt(i); + if (li.layer == layer) { + break; + } + } + // If we can't find the driver just return. + if (i >= availableLayers.size()) { + println(" couldn't find driver to unload"); + return; + } + + // Remove the layer. Other entries in availableLayers get shuffled down. + availableLayers.removeElementAt(i); + }//deregisterLayer + + /** + * Prints a message to the current log stream. + * + * @param message + * a log or tracing message + */ + public void println( String message ) { + if ( this.orb != null ){ + if ( this.orb.m_trace != null ){ + this.orb.m_trace.print( Trace.DEEP_DEBUG, message ); + } + } + } + + public void println( String msg, Throwable th ){ + if ( this.orb != null ){ + if ( this.orb.m_trace != null ){ + this.orb.m_trace.printStackTrace( Trace.DEEP_DEBUG, msg, th ); + } + } + } + + //------------------------------------------------------------------------ + //Initialization stuff + + private void loadInitialLayers() { + String layers; + try { + //if (this.orb.m_conf. + layers = this.orb.m_conf.comm_layers; + } catch (Exception ex) { + layers = null; + } + println("CommunicationManager.initialize: = " + ConfORB.comm_layers_name + ": " + layers ); + if (layers == null) { + return; + } + while (layers.length() != 0) { + int x = layers.indexOf(':'); + String layer; + if (x < 0) { + layer = layers; + layers = ""; + } else { + layer = layers.substring(0, x); + layers = layers.substring(x + 1); + } + if (layer.length() == 0) { + continue; + } + try { + println("CommunicationManager.Initialize: loading " + layer); + Class currentLayerClass = Class.forName(layer); + //Class currentLayerClass = Class.forName(layer, true, ClassLoader.getSystemClassLoader()); + if ( currentLayerClass != null ){ + CommunicationLayer currentLayer; + currentLayer = (CommunicationLayer) currentLayerClass.newInstance(); + + LayerInfo li = new LayerInfo(); + li.layerClassName = layer; + li.layerClass = currentLayerClass; + li.layer = currentLayer; + availableLayers.add( li ); + //TODO: modify apis to provide a reference to it's own layer + //as soon as possible, at this moment, they access it's pare + //nt layer through communicationManager, so it must be added + //prior to initialization (performed at setOrb's). + currentLayer.setORB( this.orb ); + + currentLayer.dump(this.orb.m_trace.getLog()); + + } + } catch (Exception ex) { + println("CommunicationManager.Initialize: load failed: " + ex, ex); + } + } + } + + /** + * Attempts to establish a connection to the given service URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered JDBC availableLayers. + * + * @param url + * a service url of the form + * :: + * @param info + * a list of arbitrary string tag/value pairs as connection + * arguments; + * @return a CommunicationDelegate instance which will manage + * requests to the specified service + * @exception SQLException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( + String url, + java.util.Properties info) + throws CommunicationException { + + if (url == null) { + throw new CommunicationException( "Parameter 'url' cannot be null" ); + } + + println("CommunicationManager.connect(\"" + url + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to make a connection. + // Remember the first exception that gets raised so we can reraise it. + Exception reason = null; + CommunicationLayer commLayer; + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + // If the caller does not have permission to load the driver then + // skip it. + try { + println( " trying " + li ); + if ( li.layer.accepts( url ) ){ + CommunicationDelegate result = li.layer.createDelegate(url, info); + if (result != null) { + // Success! + println( "connect returning " + li ); + return (result); + } + } + } catch (CommunicationException ce ){ + if ( reason != null ){ + reason = ce; + } + } + } + + // if we got here nobody could connect. + if (reason != null) { + println( "connect failed: " + reason ); + throw new CommunicationException( "connect failed", reason ); + } + + println( "connect: no suitable driver" ); + throw new CommunicationException( "No suitable driver" ); + } + + /** + * Attempts to establish a connection to the given service IOR. The + * CommunicationManager attempts to select an appropriate + * CommunicationLayer from the set of registered layers. + * + * @param ior the service IOR + * + * :: + * @param info + * a list of arbitrary string tag/value pairs as connection + * arguments; + * @return a CommunicationDelegate instance which will manage + * requests to the specified service + * @exception SQLException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( + IOR ior, + java.util.Properties info) + throws CommunicationException { + + if (ior == null) { + throw new CommunicationException( "Parameter 'ior' cannot be null" ); + } + + println("CommunicationManager.connect(\"" + ior + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to make a connection. + // Remember the first exception that gets raised so we can reraise it. + Exception reason = null; + CommunicationLayer commLayer; + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + // If the caller does not have permission to load the driver then + // skip it. + try { + println( " trying " + li ); + if ( li.layer.accepts( ior ) ){ + CommunicationDelegate result = li.layer.createDelegate(ior, info); + if (result != null) { + // Success! + println( "connect returning " + li ); + return (result); + } + } + } catch (CommunicationException ce ){ + if ( reason != null ){ + reason = ce; + } + } + } + + // if we got here nobody could connect. + if (reason != null) { + println( "connect failed: " + reason ); + throw new CommunicationException( "connect failed", reason ); + } + + println( "connect: no suitable driver" ); + throw new CommunicationException( "No suitable layer" ); + } + + //TODO: check the convenience of these method + public String getInitialReference( IOR ior ) throws CommunicationException { + if (!initialized) { + initialize(); + } + + String initialReference; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( ior ); + if ( peerLayer != null ){ + initialReference = peerLayer.getInitialReference( ior ); + } else { + initialReference = null; + } + return initialReference; + } + + public String getInitialReference( String url ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + String initialReference; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( url ); + if ( peerLayer != null ){ + initialReference = peerLayer.getInitialReference( url ); + } else { + initialReference = null; + } + return initialReference; + } + + + public boolean isLocal( IOR ior ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + boolean isLocal; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( ior ); + if ( peerLayer != null ){ + isLocal = peerLayer.isLocal( ior ); + } else { + throw new CommunicationException( "Invalid ior: no suitable layer" ); + } + return isLocal; + } + + + public boolean isLocal( String url ) throws CommunicationException{ + + if (!initialized) { + initialize(); + } + + boolean isLocal; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( url ); + if ( peerLayer != null ){ + isLocal = peerLayer.isLocal( url ); + } else { + throw new CommunicationException( "Invalid url: no suitable layer" ); + } + return isLocal; + } + + /** + * @param b + */ + public synchronized void setServerModeEnabled( boolean b ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + if ( this.offline ) { + + this.getLayerById( IIOPCommunicationLayer.ID ).setServerModeEnabled( + b + ); + + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.setServerModeEnabled( b ); + } + this.offline = false; + } + }//setServerModeEnabled + + + /** + * @param waitForCompletion + */ + public synchronized void shutdown( boolean waitForCompletion ) { + + if (!initialized) { + initialize(); + } + + if ( !this.offline ) { + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.shutdown( waitForCompletion ); + } + this.offline = true; + } + } + + /** + * + */ + public void destroy() { + + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.shutdown(false); + } + + } + + public synchronized RequestDispatcher getRequestDispatcher() { + if ( this.dispatcher == null ){ + this.dispatcher = new RequestDispatcher( this.orb ); + } + return this.dispatcher; + }//getRequestDispatcher + + + public static synchronized CommunicationManager getInstance( TIDORB orb ){ + if ( CommunicationManager.instances == null ){ + CommunicationManager.instances = new Hashtable(); + } + if ( orb != null ){ + CommunicationManager manager; + manager = ( CommunicationManager )CommunicationManager.instances.get( orb ); + if ( manager == null ){ + manager = new CommunicationManager( orb ); + CommunicationManager.instances.put( orb, manager ); + } + return manager; + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setOrb + + public synchronized String toString(){ + StringBuffer toString; + toString = new StringBuffer(); + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i=0; i < layersCount; i++ ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + toString.append( actualLayerInfo.layer); + if ( i < layersCount - 1 ){ + toString.append( ' ' ); + } + } + return toString.toString(); + } + + private CommunicationManager( TIDORB orb ){ + this.orb = orb; + } + + public TIDORB getORB(){ + return this.orb; + } + + // Class initialization. + private void initialize() { + if (initialized) { + return; + } + initialized = true; + this.loadInitialLayers(); + this.offline = true; + println(" CommunicationManager initialized"); + } + + + private TIDORB orb = null; + + private RequestDispatcher dispatcher = null; + + private java.util.Vector availableLayers = new java.util.Vector(); + + private static Hashtable instances; + + private boolean initialized = false; + + + +} + +// LayerInfo is a package-private support class. + +class LayerInfo { + CommunicationLayer layer; + + Class layerClass; + + String layerClassName; + + public String toString() { + return ("driver[className=" + layerClassName + "," + layer + "]"); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/Connection.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/Connection.java.svn-base new file mode 100644 index 0000000..ae884af --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/Connection.java.svn-base @@ -0,0 +1,2047 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import java.io.IOException; +import java.net.Socket; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.comm.ssliop.*; + +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb IIOP IIOPConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +abstract public class Connection extends ORBComponent implements RemovableObject { + //public class IIOPConnection extends Connection { + + /** + * Client connection mode. + */ + public final static int CLIENT_MODE = 0; + + /** + * Server connection mode. + */ + public final static int SERVER_MODE = 1; + + /** + * Bidirectional connection mode. + */ + public final static int BIDIRECTIONAL_MODE = 2; + + /** + * IIOPConnection mode. + */ + protected int m_mode; + + /** + * IIOPConnection state. + */ + protected ConnectionState m_state; + + /** + * Pending requests in POA. + */ + protected Counter m_requests_in_POA; + + /** + * Actual id count. The ids will be given sequentialy. + */ + private Counter id_count; + + /** + * IIOPConnection identifier: the local port related to the connection socket. + */ + + protected int my_port = 0; + + /** + * Server Object Listen Points assitiated. + */ + + protected java.util.Hashtable m_addresses; + + /** + * First client address; + */ + + protected ListenPoint m_initial_point; + + /** + * The IIOPConnectionManager. + */ + + protected IIOPConnectionManager m_manager; + + /** + * Lock list where the pending requests are waiting for response. + */ + + protected LockList m_lock_list; + + /** + * Lock list where the pending asynchronous requests are waiting for response. + */ + + protected AMILockList m_ami_lock_list; + + /** + * Table with the uncompleted messages that has more fragments. + */ + + protected UseTable m_uncompleted_messages; + + /** + * Maintains the actual request id for fragmented message in GIOP 1.1 + */ + + RequestId m_current_request_id; + + /** + * Bidirectional Service Context. It will be sent in the next + * Request/Response. + */ + + protected ServiceContextList m_bidirectional_service; + + /** + * Says if the bidirecitonal context has to been sent or not. + */ + + protected boolean m_send_bidirectional_service; + + /** + * Write messages in socket monitor. + */ + + protected ConnectionWriteMonitor m_write_monitor; + + /** + * IIOPConnection buffer for writting headers. + */ + byte[] m_send_header_buffer; + + /** + * IIOPConnection buffer for receiving headers. + */ + byte[] m_receive_header_buffer; + + /** + * The toString() return value. + */ + protected String m_str = null; + + /** + * Register the connection at the connection manager and initialize the + * connection socket with the ORB configuration values. + * + * @see es.tid.TIDorbj.core.ConfORB + */ + +// private boolean tcpNoDelay; +// private int soTimeout; +// private int soLinger; + private int maxUncompletedMessages; +// private int socketWriteTimeout; + private GIOPVersion giopVersion; + private int giopFragmentSize; + private boolean ipv6; + + /** + * Says if QoS is enabled not. + */ + long max_response_blocked_time; + + /** + * Says if QoS is enabled not. + */ + boolean qos_enabled; + + /** + * Says if the client can sssume that server uses ziop or not. + */ + boolean assume_ziop_server; + + protected Connection(IIOPConnectionManager mngr) + { + super(mngr.orb()); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + maxUncompletedMessages = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.MAX_UNCOMPLETED_MESSAGES ) + .getInt(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + + giopFragmentSize = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.FRAGMENT_SIZE ) + .getInt(); + + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + if (this.ipv6 == true) + { + System.setProperty("java.net.preferIPv6Address","true"); + System.setProperty("java.net.preferIPv4Stack","false"); + } + + max_response_blocked_time = m_orb.m_conf.max_blocked_time; + qos_enabled = m_orb.m_conf.qos_enabled; + assume_ziop_server = m_orb.m_conf.assume_ziop_server; + + m_state = new ConnectionState(); + + m_requests_in_POA = new Counter(); + + id_count = new Counter(); + + m_current_request_id = null; + + m_lock_list = new LockList(); + + m_ami_lock_list = m_orb.getAMIManager().getAMILockList(); + + m_uncompleted_messages = new UseTable( maxUncompletedMessages ); + + m_send_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + m_receive_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + + } + + /** + * Start the connection thread execution. + */ + public void init() + { + try { + ConnectionThread conn_thread = new ConnectionThread(this); + conn_thread.setDaemon(false); + conn_thread.start(); + } + catch (Throwable thw) { + throw new org.omg.CORBA.NO_RESOURCES( + "Can't create thread: " + thw.toString() ); + } + + } + + /** + * IIOPConnection hash code. + */ + public abstract int hashCode(); + + public abstract boolean equals(Object obj); + + public abstract String toString(); + + + /** + * Add a new listen point for whose this connection can be uses to sending + * request. This will be usefull if this connection is bidirectional. + * + * @param listen_point + * the new listen point of an bidirectional connection + */ + public void addListenPoint(ListenPoint listen_point) + { + m_addresses.put(listen_point, listen_point); + } + + /** + * @return the listen points associated to this connection + */ + public Enumeration getListenPoints() + { + return m_addresses.elements(); + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects that a referenced object is defined in a + * "Bidirectional POA". The contest will be sent in the next response. + * + * @param context + * the list containing the BiDirServiceContext + */ + public void setBidirectionalMode(ServiceContextList context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + m_bidirectional_service = context; + + m_send_bidirectional_service = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, toString() + + ": Setting Bidirectional Mode."); + } + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects a bidirectional context in a request or + * response sent by the peer. + * + * @param context + * the bidirectional context + */ + + public void setBidirectionalModeByPeer(BiDirServiceContext context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + if (m_orb.m_trace != null) { + m_orb + .printTrace( + Trace.DEBUG, + toString() + + ": Setting Bidirectional Mode by Peer."); + } + + for (int i = 0; i < context.m_listen_points.length; i++) { + addListenPoint(context.m_listen_points[i]); + m_manager.addBidirectionalConnection(context.m_listen_points[i], + (es.tid.TIDorbj.core.comm.Connection)this); + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + toString() + + " will be connected to" + + context.m_listen_points[i].toString()); + } + } + + } + + /** + * Test whether the connection is still opened or not. + * + * @return true if open or false if not. + */ + + public boolean isOpen() + { + return m_state.isOpen(); + } + + /** + * @return the communication error (if exits) + */ + public COMM_FAILURE getConnectionError() + { + return m_state.getError(); + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isClientConnection() + { + return m_mode == CLIENT_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isServerConnection() + { + return m_mode == SERVER_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isBidirectionalConnection() + { + return m_mode == BIDIRECTIONAL_MODE; + } + + /** + * The connection has recived a close connection. + */ + public void closeByPair() + { + if (m_state.setClosing()) { + m_manager.closing(this); + close(); + } + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, toString() + " closed by pair"); + } + + /** + * The connection will be closed by the connection manager. + * + * @see es.tid.TIDorbj.core.comm.iiop.IIOPConnectionManager + */ + + public void closeByManager() + { + if (m_state.setClosing()) { + if (m_mode != CLIENT_MODE) + sendClose(); + + if (m_lock_list.size() != 0) + m_state.seterror( + new COMM_FAILURE("IIOPConnection Closed because the max. " + + "connection number has been reached.", + 0, + CompletionStatus.COMPLETED_NO)); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " closed by IIOPConnection Manager"); + } + } + + /** + * The connection is closed due to the socket is broken. + * + * @param error + * the broken communication error + */ + + public void closeByBrokenConnection(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + public void closeByError(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + protected abstract void close(); + + public void sendClose() + { + try { + GIOPHeader header; + header = new GIOPHeader( giopVersion, MsgType.CloseConnection); + + sendMessage(header); + } + catch (Exception e) {} + } + + public void sendError() { + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, toString() + " : sending a GIOP Message error." + ); + } + + GIOPHeader error; + error = new GIOPHeader( giopVersion , MsgType.MessageError); + sendMessage(error); + } + + public void sendHeader(GIOPHeader header) { + header.toByteArray(m_send_header_buffer); + write(m_send_header_buffer); + } + + protected GIOPHeader receiveHeader() { + read(m_receive_header_buffer); + return GIOPHeader.fromByteArray(m_receive_header_buffer); + } + + protected void sendMessage(GIOPHeader header) { + try { + m_write_monitor.initWrite(); + } catch (WriteTimeout to) { + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + sendHeader(header); + + m_write_monitor.endWrite(); + } + + public void sendMessage(GIOPMessage message) { + if (m_state.isOpen()) { + m_manager.use(this); + } + + message.send(this); + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + ": ", + message.toString(), + " has been sent!" + } + ); + } + } + + public void receiveMessage() { + while (true) { + + if (m_state.isOpen()) { + m_manager.use(this); + } else { + break; + } + + try { + + // wait for reply + GIOPHeader header = receiveHeader(); + + + // Attend for compressed messages + if (header.getCompressed()){ + ZIOPMessage ziop_message = new ZIOPMessage(header, giopFragmentSize); + + ziop_message.receiveBody(this, m_receive_header_buffer); + + ziop_message.connect_GIOPMessage(this); + continue; + } + + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (message.hasBody()) { + message.receiveBody(this, m_receive_header_buffer); + } + + if (m_orb.m_trace != null){ + m_orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + m_orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + switch (header.getMsgType().m_value) + { + + case MsgType._Request: + manageMessage((GIOPRequestMessage) message); + break; + case MsgType._Reply: + manageMessage((GIOPReplyMessage) message); + break; + case MsgType._CancelRequest: + manageMessage((GIOPCancelRequestMessage) message); + break; + case MsgType._LocateRequest: + manageMessage((GIOPLocateRequestMessage) message); + break; + case MsgType._LocateReply: + manageMessage((GIOPLocateReplyMessage) message); + break; + case MsgType._Fragment: + manageMessage((GIOPFragmentMessage) message); + break; + case MsgType._CloseConnection: + closeByPair(); + return; + case MsgType._MessageError: + closeByError( + new COMM_FAILURE("IIOPConnection closed due to pair " + + "message error.")); + return; + } + + } + catch (org.omg.CORBA.COMM_FAILURE comm) { + closeByError(comm); + return; + } + catch (Throwable excp) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.ERROR, toString(), excp); + + closeByError(new COMM_FAILURE(excp.toString())); + return; + } + } + } + + public void manageMessage(GIOPFragmentMessage message) + { + RequestId id = null; + + if (GIOPVersion.VERSION_1_2.equals(message.getHeader().getVersion())) + id = message.getRequestId(); + else if (m_current_request_id == null) { // unexpected fragment message + closeByError(new COMM_FAILURE("Unexpected fragment message.", 0, + CompletionStatus.COMPLETED_NO)); + return; + } else + id = m_current_request_id; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + toString() + " : GIOP Fragment Message has received." + ); + } + + FragmentedMessageHolder holder = + (FragmentedMessageHolder) m_uncompleted_messages.get(id); + + if (holder == null) { + // discard message + return; + } + + GIOPFragmentedMessage fragmented_message = holder.m_message; + + fragmented_message.addFragment(message); + + if (!message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received. + + m_uncompleted_messages.remove(id); + + switch (fragmented_message.getHeader().getMsgType().m_value) + { + case MsgType._Request: + dispatchRequest((GIOPRequestMessage) fragmented_message); + break; + case MsgType._LocateRequest: + dispatchRequest((GIOPLocateRequestMessage) fragmented_message); + break; + // CLIENT MESSAGES + case MsgType._Reply: + serviceContextReceived( + ((GIOPReplyMessage) + fragmented_message).getServiceContextList()); + case MsgType._LocateReply: + { + m_current_request_id = null; + Lock lock = m_lock_list.get(id); + AMILock ami_lock = m_ami_lock_list.get(id); + if (lock != null) { // the lock has not been discarded + lock.setMessage(fragmented_message); + lock.setCompleted(); + } else if (ami_lock != null) { + ami_lock.setMessage(fragmented_message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + } + } + + public void manageMessage(GIOPReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("Reply has been received by Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) { + return; // discard + } + + if (message.getHeader().hasMoreFragments()) { + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE("Fragment message expeted, " + + "but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + + } + } else { + serviceContextReceived(message.getServiceContextList()); + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPLocateReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("LocateReply has been received by " + + "Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) + return; // the lock hast expired, discard the message + + if (message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateReply can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else { + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPCancelRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "CancelRequest has been received by Client IIOPConnection")); + return; + } + + m_uncompleted_messages.remove(message.getRequestId()); + } + + public void manageMessage(GIOPLocateRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateRequest can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + protected abstract void dispatchRequest(GIOPLocateRequestMessage message); + + + protected abstract void dispatchRequest(GIOPRequestMessage message); + + + /** + * Try to resolve the url received in a Request ObjectKey + */ + + protected org.omg.CORBA.Object resolveURL(String url) { + try { + // Backward compatibility, ObjectId now expected + + if (url.startsWith("corbaloc:tidorbj:")) { + return m_orb.string_to_object(url); + } else { + + String object_id = null; + + if (url.startsWith("corbaloc:ssliop:")) { + object_id = SSLIOPCorbaloc.getObjectId(url); + } else if ((url.startsWith("corbaloc:iiop:")) + || (url.startsWith("corbaloc::"))) { + object_id = IIOPCorbaloc.getObjectId(url); + } else { + // standard version + object_id = url; + } + + return m_orb.resolve_initial_references(object_id); + } + } + catch (Throwable th) {} + + return null; + } + + public void manageMessage(GIOPRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + if (m_orb.m_trace != null) + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE( + "Fragment message expeted, but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + public boolean sendLocateRequest(IIOPIOR ior, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + return sendLocateRequest(ior, AddressingDisposition.KeyAddr, + policy_context); + } + + private boolean sendLocateRequest(IIOPIOR ior, + AddressingDisposition disposition, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + RequestId id = generateId(); + + GIOPLocateRequestMessage message = + new GIOPLocateRequestMessage(profile.getVersion(), + id, + giopFragmentSize ); + + // create the reply lock + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + + ": sending LocationRequest " + + id.toString()); + + switch (disposition.value()) + { + case AddressingDisposition._KeyAddr: + message.insertAddress(m_manager.orb(), + ior.toObjectKeyAddress()); + break; + case AddressingDisposition._ProfileAddr: + message.insertAddress(m_manager.orb(), + ior.toProfileAddress()); + break; + case AddressingDisposition._ReferenceAddr: + message.insertAddress(m_manager.orb(), + ior.toIORAddress()); + } + + sendMessage(message); + + // block the thread waiting for response + + lock.waitForCompletion(timeout); + + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No LocateReply message", 0, + CompletionStatus.COMPLETED_NO); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._LocateReply) { + throw new MARSHAL("No LocateReply message received", 0, + CompletionStatus.COMPLETED_NO); + } + + GIOPLocateReplyMessage reply_message = + (GIOPLocateReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case LocateReplyStatusType._UNKNOWN_OBJECT: + return false; + case LocateReplyStatusType._OBJECT_HERE: + return true; + case LocateReplyStatusType._OBJECT_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._OBJECT_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._LOC_SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case LocateReplyStatusType._LOC_NEEDS_ADDRESSING_MODE: + return sendLocateRequest( + ior, + reply_message.extractAddressingDisposition(), + policy_context); + } + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + return false; + } + + public void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE + { + sendOnewayRequestAsync(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE + { + // verify if the request can be sent + m_state.verifyForRequest(); + + request.setId(generateId()); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + } + + public void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendOnewayRequestSync(request, ior, AddressingDisposition.KeyAddr); + + } + + private void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + // verify if the request can be sent + m_state.verifyForRequest(); + + Lock lock = new Lock(); + + lock.requestId(request.getId()); + m_lock_list.put(lock); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + + } + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) + throw new INTERNAL("No Reply message"); + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) + throw new MARSHAL("No LocateReply message received"); + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: // traza + case ReplyStatusType._USER_EXCEPTION: // traza + case ReplyStatusType._SYSTEM_EXCEPTION: // traza + break; // nothing to do, it is a oneway request + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendOnewayRequestSync( + request, + ior, + reply_message.extractAddressingDisposition()); + } + } + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendRequest(request, ior, AddressingDisposition.KeyAddr); + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = + new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + setServiceContextList(policy_context, message); + + message.insertRequest(request, ior, disposition); + + try { + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + sendMessage(message); + } + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + // block the thread waiting for response + + + lock.waitForCompletion(timeout); + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + request.setCompletedYes(); + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + reply_message.extractArguments(request); + break; + case ReplyStatusType._USER_EXCEPTION: + request.setUserException( + reply_message.extractUserException( + request.exceptions())); + break; + case ReplyStatusType._SYSTEM_EXCEPTION: + request.setSystemException( + reply_message.extractSystemException()); + break; + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendRequest(request, ior, + reply_message.extractAddressingDisposition()); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + public org.omg.CORBA.portable.InputStream + sendRequest(es.tid.TIDorbj.core.iop.IOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest, + org.omg.CORBA.portable.RemarshalException, + org.omg.CORBA.portable.ApplicationException + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // write operation context: o conxtests + stream.write_ulong(0); + + es.tid.TIDorbj.core.cdr.CDRInputStream header_input = + new es.tid.TIDorbj.core.cdr.CDRInputStream(null, + stream.getBuffer()); + + GIOPHeader header = new GIOPHeader(); + + header.read(header_input); + + header_input = null; + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (!(message instanceof GIOPRequestMessage)) + throw new BAD_OPERATION("No Request message in stream"); + + message.setMessageBuffer(stream.getBuffer()); + message.setMessageCompleted(true); + + GIOPRequestMessage request_msg = (GIOPRequestMessage) message; + + ServerRequestImpl srv_request = request_msg.extractRequest(m_orb); + + RequestId id = srv_request.getId(); + + if (!srv_request.withResponse()) { + if (m_orb.m_trace != null) { + String[] msg = { toString(), + ": Sending Oneway Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + sendMessage(message); + + } else { + + Lock lock = new Lock(); + + lock.requestId(id); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { toString(), ": Sending Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + try { + sendMessage(message); + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + // block the thread waiting for response + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + return input; + } + case ReplyStatusType._USER_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + String excp_id = input.read_string(); + input.rewind(); + throw new ApplicationException( + excp_id, + reply_message.getDataInput()); + } + case ReplyStatusType._SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + throw new org.omg.CORBA.portable.RemarshalException(); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + return null; + } + + public void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) //*opc1*, Object ami_handler) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendAsyncRequest(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, //*opc1* Object ami_handler, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + PolicyContext policy_context = request.getPolicyContext(); + + long timeout = QoS.checkRequestTime(this.m_orb, policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + + AMILock ami_lock = new AMILock(); + ami_lock.requestId(message.getRequestId()); + ami_lock.setHandler(request.get_ami_handler()); + ami_lock.setRequest(request); + ami_lock.setIor(ior); + + m_ami_lock_list.put(ami_lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Asynchronous Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + setServiceContextList(policy_context, message); + + try { + message.insertRequest(request, ior, disposition); + sendMessage(message); + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + + /* hacerlo dentro de thread k mira tiempo de las peticiones as�ncronas + } else { + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + request.setCompletedMaybe(); + throw new RECOVERABLE_COMM_FAILURE( + new COMM_FAILURE("IIOPConnection closed by pair")); + + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(); + } + }*/ + } + + + public void prepareRequest( StreamRequestImpl request, IIOPIOR ior ) { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) + ver = orb_ver; + + GIOPRequestMessage message = new GIOPRequestMessage(ver, + request.getId(), + giopFragmentSize); + + message.prepareRequest(request, ior, AddressingDisposition.KeyAddr); + + } + + public void sendReply(ServerRequestImpl request, PolicyContext policy_context) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPReplyMessage message = new GIOPReplyMessage(request.getVersion(), + request.getId(), + giopFragmentSize); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + message.insertResultRequest(m_orb, request); + + CompressorIdLevel compressor = request.get_compressor(); + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + + int low_value = 0; + float min_ratio = 0; + + + if (policy_context != null) { + low_value = ZIOP.getLowValue(policy_context); + min_ratio = ZIOP.getMinRatio(policy_context); + + compressor.compression_level = + ZIOP.getLevelCompressor(compressor.compressor_id, + policy_context); + } + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + + } else { + sendMessage(message); + } + } + + public void sendLocateReply(GIOPVersion version, RequestId id, boolean here) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + if (here) + message.insertObjectHere(m_orb); + else + message.insertUnknownObject(m_orb); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + org.omg.CORBA.Object obj) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + message.insertForward(m_orb, obj); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + SystemException excep) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize); + + message.insertSystemException(m_orb, excep); + + sendMessage(message); + } + + protected void setServiceContextList(PolicyContext policy_context, + GIOPRequestMessage message) + { + Vector contexts = new Vector(); + + // Invocation Service Context + + InvocationPoliciesContext invocationPolicies = null; + if (policy_context != null) { + invocationPolicies = policy_context.getInvocationPolicyServiceContext(); + } + if(invocationPolicies != null) { + contexts.add(invocationPolicies); + } + + // Bidirectional Service context + if (m_send_bidirectional_service) { + + contexts.add(m_bidirectional_service.m_components[0]); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + int num_services = contexts.size(); + if ( num_services > 0) { + + ServiceContextList services = new ServiceContextList(num_services); + + contexts.toArray(services.m_components); + + message.setServiceContextList(services); + } + } + + protected void serviceContextReceived(ServiceContextList services) + { + if (services == null) + return; + + for (int i = 0; i < services.m_components.length; i++) { + if ((services.m_components[i] != null) + && (services.m_components[i].m_context_id + == org.omg.IOP.BI_DIR_IIOP.value)) { + setBidirectionalModeByPeer( + (BiDirServiceContext) services.m_components[i]); + } + } + } + + /** + * RemovableObject interface method + */ + + public boolean canBeRemoved() + { + return !hasPendingRequests(); + } + + public synchronized boolean hasPendingRequests() + { + if (m_mode == CLIENT_MODE) { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0)); + } else { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0) + || (m_requests_in_POA.isNonZero())); + } + } + + public RequestId generateId() + { + return new RequestId(id_count.postInc()); + } + + public void read(byte[] buffer) + { + read(buffer, 0, buffer.length); + } + + public abstract void read(byte[] buffer, int offset, int length); + + protected abstract void write(byte[] buffer); + + protected abstract void write(byte[] buffer, int offset, int length); + + /* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAMBIAR PARA MANDAR UN MENSAJE CON + * VARIOS CHUNKS + */ + public void writeVersion1_0(BufferCDR buffer) + {/* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * if(num_chunks > 1) throw new MARSHAL("GIOP 1.0 does not allow + * fragmentation"); + * + * ChunkCDR chunk = null; + * + * synchronized(write_mutex) { chunk = buffer.getChunk(0); + * write(chunk.getBuffer(),0,chunk.getAvailable()); } + */ + writeVersion1_1(buffer); // the buffer is only one message + } + + public void writeVersion1_1(BufferCDR buffer) + { + int num_chunks = buffer.getNumAvailableChunks(); + + ChunkCDR chunk = null; + + // Check write Monitor + try { + m_write_monitor.initWrite(); + } + catch (WriteTimeout wt) { // WriteTimeout: close this connection + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + // write loop + + for (int i = 0; i < num_chunks; i++) { + chunk = buffer.getChunk(i); + write(chunk.getBuffer(), 0, chunk.getAvailable()); + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DUMP, "GIOP message chunk sent - HEXDUMP " + + chunk.getAvailable() + " bytes"); + m_orb.printDump(Trace.DUMP, + chunk.getBuffer(), + chunk.getAvailable()); + } + + } + // free write monitor + + m_write_monitor.endWrite(); + } + + public void writeVersion1_2(BufferCDR buffer) + { + writeVersion1_1(buffer); + /* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * ChunkCDR chunk = null; + * + * for(int i = 0; i < num_chunks; i++) { chunk = buffer.getChunk(i); + * + * synchronized(write_mutex) { + * write(chunk.getBuffer(),0,chunk.getAvailable()); } } + */ + } +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/ForwardRequest.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/ForwardRequest.java.svn-base new file mode 100644 index 0000000..711f22e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/ForwardRequest.java.svn-base @@ -0,0 +1,19 @@ +package es.tid.TIDorbj.core.comm; + +import es.tid.TIDorbj.core.iop.IOR; + +/** + * @author caceres + * + */ + +public class ForwardRequest extends Exception +{ + public IOR forward_reference; + + public ForwardRequest(IOR forward_reference) + { + this.forward_reference = forward_reference; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/LocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/LocateResponseHandler.java.svn-base new file mode 100644 index 0000000..93969c1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/LocateResponseHandler.java.svn-base @@ -0,0 +1,64 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +/** + * Base interface used to return the response upon Request arrival. + * In this case, it provides an aditional method to support returning the result + * of the Locate operation. + * + * Actually, a CommunicationLayer implementation must provide an instance of + * type QueuedLocateResponseHandler, which extends this interface. Upon + * refactoring proccess completes, this should be done just implementing this + * one... TODO: Maybe a delegation aproach should work + * + * @author Juan Pablo Rojas + * + */ + +//TODO: maybe these should be called RequestHandlers? +public interface LocateResponseHandler extends ResponseHandler { + + public abstract void submitResponse( boolean value ); + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/PropertyInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/PropertyInfo.java.svn-base new file mode 100644 index 0000000..e865e75 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/PropertyInfo.java.svn-base @@ -0,0 +1,155 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.comm; + +/** + *

CommunicationLayer properties for making a connection. The + * PropertyInfo could be used by automatic code generation ides to + * interact with CommunicationManager and retrieve each registered + * layer's available properties. + * + * @author Juan Pablo Rojas + */ + +public class PropertyInfo { + + /** + * Constructs a CommunicationLayerPropertyInfo object with a name and value; + * other members default to their initial values. + * + * @param name the name of the property + * @param value the current value, which may be null + */ + public PropertyInfo(String name, String value) { + this.name = name; + this.value = value; + } + + /** + * The name of the property. + */ + private String name; + public void setName( String name ){ + this.name = name; + } + public String getName(){ + return this.name; + } + + + /** + * A brief description of the property, which may be null. + */ + private String description = null; + public void setDescription( String description ){ + this.description = description; + } + public String getDescription(){ + return this.description; + } + + /** + * The required field is true if a value must be + * supplied for this property and false otherwise. + */ + private boolean required = false; + public void setRequired( boolean value ){ + this.required = value; + } + public boolean isRequired(){ + return this.required; + } + + /** + * The value field specifies the current value of + * the property, based on a combination of the information + * supplied to the method. + */ + public String value = null; + public void setValue( String value ){ + this.value = value; + } + public String getValue(){ + return this.value; + } + public String getString(){ + return this.value; + } + public int getInt(){ + if ( this.value != null ) { + return Integer.parseInt( this.value ); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + public boolean getBoolean(){ + if ( this.value != null ){ + return Boolean.valueOf( this.value ).booleanValue(); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + public byte[] getBytes(){ + if ( this.value != null ){ + return this.value.getBytes(); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + + /** + * An array of possible values if the value for the field + * DriverPropertyInfo.value may be selected + * from a particular set of values; otherwise null. + */ + private String[] choices = null; + public void setChoices( String[] choices ){ + this.choices = choices; + } + public String[] getChoices(){ + return this.choices; + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/RequestDispatcher.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/RequestDispatcher.java.svn-base new file mode 100644 index 0000000..30581c6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/RequestDispatcher.java.svn-base @@ -0,0 +1,188 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.UNKNOWN; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.poa.POAImpl; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.poa.POAManagerImpl; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.poa.QueuedRequest; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.util.Trace; + + +/** + * RequestDispather provides methods to each CommunicationLayer + * implementation to enable Request processing and Response submission, allowing + * disacoupling the implementation from the ORB's request processing implementa- + * tion. + * + * @author Juan Pablo Rojas + * + */ +public class RequestDispatcher { + + /* + * The orb instance + */ + private TIDORB orb; + private POAImpl rootPOA; + private POAManagerImpl rootPOAManager; + private CommunicationManager communicationManager; + + /** + * @param orb + */ + public RequestDispatcher(TIDORB orb ) { + if ( orb != null ){ + this.orb = orb; + this.rootPOA = this.orb.initPOA(); + this.rootPOAManager = ( POAManagerImpl )this.rootPOA.the_POAManager(); + this.communicationManager = CommunicationManager.getInstance( this.orb ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//RequestDispatcher + + + /** + * @param responseHandler + */ + + //TODO: Queued stuff should be only known here... see how to make a + //queue delegate to use from ExecThread + public void dispatchRequest( QueuedLocateResponseHandler locateResponseHandler ) { + if ( locateResponseHandler != null ){ + + setPOAKey(locateResponseHandler); + + if ( this.orb.m_trace != null) { + this.orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + "Dispatching LocateRequest ", + locateResponseHandler.getObjectKey().toString() + } + ); + } + this.rootPOAManager.put( locateResponseHandler ); + } else { + //TODO: ask juan about the exception conventions inside TIDORB + throw new BAD_PARAM( "null response handler" ); + } + }//dispatchRequest + + public void dispatchRequest( QueuedResponseHandler responseHandler ) { + if ( responseHandler != null ){ + + if(setPOAKey(responseHandler)) { + + this.rootPOAManager.put( responseHandler ); + + if ( this.orb.m_trace != null) { + ServerRequest request = responseHandler.getServerRequest(); + this.orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Dispatching ", + responseHandler.toString() + } + ); + } + } + } else { + throw new BAD_PARAM( "null response handler" ); + } + }//dispatchRequest + + /** + * Search the POAKey to the request + * @param request + * @return true if the key has been set + */ + private boolean setPOAKey(QueuedRequest request) { + + ObjectKey objectKey; + objectKey = request.getObjectKey(); + + POAKey poaKey; + try { + poaKey = orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + request.setPOAKey( poaKey ); + return true; + } catch (ForwardRequest fr) { + request.submitResponse(fr.forward_reference); + } catch (SystemException one) { + if ( this.orb.m_trace != null) { + this.orb.printTrace(Trace.DEEP_DEBUG, + "Submitting a system exception in request", + one); + } + request.submitResponse(one); + } catch ( Throwable th ){ + if ( this.orb.m_trace != null) { + this.orb.printTrace(Trace.DEEP_DEBUG, + "Submitting a CORBA UNKNOWN exception in request"); + } + request.submitResponse(new UNKNOWN()); + } + return false; + } + + public void dispose(){ + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/.svn/text-base/ResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/.svn/text-base/ResponseHandler.java.svn-base new file mode 100644 index 0000000..98e3e0a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/.svn/text-base/ResponseHandler.java.svn-base @@ -0,0 +1,94 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Base interface used to return the response upon Request arrival. + * In this case, it provides methods for accesing the incoming requests field's + * necessary for it's correct execution, and methods to communicate the + * invocation result to the origin. + * + * Actually, a CommunicationLayer implementation must provide an instance of + * type QueuedResponseHandler, which extends this interface. Upon + * refactoring proccess is completed, this should be done just implementing this + * one... TODO: Maybe a delegation aproach should work + * + * @author Juan Pablo Rojas + */ +public interface ResponseHandler { + + + + /* + * Methods included for local request's optimization + */ + public abstract PolicyContext getPolicyContext(); + + /* + * Response origin ( read only -- implementation dependent ) + **/ + public abstract ObjectKey getObjectKey(); + + public abstract ServerRequest getServerRequest(); + + + /* + * Related request invocation result + * */ + + public abstract void submitResponse( Object reference ); + + public abstract void submitResponse( SystemException e ); + + public abstract void submitResponse(); + + +} diff --git a/source/es/tid/TIDorbj/core/comm/CommunicationDelegate.java b/source/es/tid/TIDorbj/core/comm/CommunicationDelegate.java new file mode 100644 index 0000000..7490e37 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/CommunicationDelegate.java @@ -0,0 +1,513 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision: 395 $ + * Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ + * Last modified by: $Author: avega $ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.InvalidPolicies; +import org.omg.CORBA.Object; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.portable.Delegate; + +import es.tid.TIDorbj.core.ContextImpl; +import es.tid.TIDorbj.core.ContextListImpl; +import es.tid.TIDorbj.core.ExceptionListImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * + * CommunicationDelegate is the base type for ORB's to be uncoupled of the + * underlying communications infraestructure from the 'client' side. + * It contains the base methods to allow sending requests to other ORB's. It + * keeps also the org.omg Delegate view, to allow regular corba Helper and + * Holder interaction. + * + * @author Juan Pablo Rojas. + * + */ +public abstract class CommunicationDelegate extends Delegate { + + protected TIDORB orb; + protected IOR reference; + protected CommunicationDelegate forwardReference; + protected PolicyContext policyContext; + + /** + * + */ + public CommunicationDelegate() { + super(); + this.orb = null; + this.reference = null; + this.policyContext = null; + } + + public CommunicationDelegate( TIDORB orb ) { + super(); + setORB( orb ); + } + + public void setORB(TIDORB orb) { + if (orb != null) { + this.orb = orb; + } else { + throw new IllegalArgumentException("Parameter 'orb' cannot be null"); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public void setReference(IOR ior) { + if (ior != null) { + this.reference = ior; + } else { + throw new IllegalArgumentException("Parameter 'ior' cannot be null"); + } + }//setReference + + /* + * As IOR could be set in it's generic and not unmarshalled way, children de + * legates should replace the generic implementation with a more specialized + * version... + */ + public abstract IOR getReference();/* { + return this.reference; + }//getReference*/ + + public synchronized void setPolicyContext( PolicyContext policyContext ){ + this.policyContext = policyContext; + }//setPolicyContext + + public PolicyContext getPolicyContext(){ + synchronized( this ) { + if ( this.policyContext == null ){ + this.policyContext = new PolicyContext(null); + } + } + return this.policyContext; + }//getPolicyContext + + public boolean is_a(org.omg.CORBA.Object self, String repositoryIdentifier) { + if (repositoryIdentifier == null) { + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + } + + if (repositoryIdentifier.equals("IDL:omg.org/CORBA/Object:1.0")) { + return true; + } + if (repositoryIdentifier.equals(this.reference.getTypeId())) { + return true; + } + // search in known interface + String[] interf_ids = ((org.omg.CORBA.portable.ObjectImpl) self)._ids(); + + if (interf_ids != null) { + for (int i = 0; i < interf_ids.length; i++) { + if (repositoryIdentifier.equals(interf_ids)) { + return true; + } + } + } + + //ask to the remote object + if (this.orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + return this.invoke_is_a(self, repositoryIdentifier); + } + + public boolean is_equivalent(org.omg.CORBA.Object self, + org.omg.CORBA.Object other) { + if (other == null) { + throw new BAD_PARAM("Null reference"); + } + // are they the same object? + if (self == other) { + return true; + } + Delegate delegate = + ( (org.omg.CORBA.portable.ObjectImpl) other )._get_delegate(); + + if (delegate instanceof CommunicationDelegate) { + return this.reference.equivalent( + ((CommunicationDelegate) delegate).getReference() + ); + } else { + return toString().equals( + delegate.orb(other).object_to_string(other) + ); + } + } + + public org.omg.CORBA.ORB orb( org.omg.CORBA.Object self ){ + return this.orb; + } + + public int hash(org.omg.CORBA.Object self, int maximum) { + int code = this.reference.hashCode(); + if (code > maximum) { + code %= maximum; + } + return code; + }//hash + + + public org.omg.CORBA.Request request( org.omg.CORBA.Object self, + String operation ) { + if (operation == null) { + throw new BAD_PARAM( + "Null operation string", 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( this.orb == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO + ); + } + //TODO: RequestImpl should be common to all delegates, rename it? + return new RequestImpl( + self, + new ContextImpl( this.orb, "" ), + operation, + new NVListImpl( this.orb ), + null, + new ExceptionListImpl(), + new ContextListImpl() + ); + }//request + + public org.omg.CORBA.Request create_request( + org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result ) { + + if ( this.orb == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO + ); + }//configurationCheck + + if ( self == null || + ctx == null || + operation == null || + arg_list == null ) { + + throw new BAD_PARAM( + "Null reference.", 0, CompletionStatus.COMPLETED_NO + ); + }//parametersCheck + + return new RequestImpl( + self, + ctx, + operation, + arg_list, + result, + new ExceptionListImpl(), + new ContextListImpl() + ); + }//createRequest + + public org.omg.CORBA.Request create_request( org.omg.CORBA.Object self, + org.omg.CORBA.Context ctx, + String operation, + org.omg.CORBA.NVList arg_list, + org.omg.CORBA.NamedValue result, + org.omg.CORBA.ExceptionList exclist, + org.omg.CORBA.ContextList ctxlist ) { + + if ( this.orb == null ) { + throw new BAD_OPERATION( + "ORB Singleton: Can not create request", 0, CompletionStatus.COMPLETED_NO + ); + } + + if ( self == null || + ctx == null || + operation == null || + arg_list == null || + exclist == null || + ctxlist == null ) { + + throw new BAD_PARAM( + "Null reference", 0, CompletionStatus.COMPLETED_NO ); + } + + return new RequestImpl( + self, + ctx, + operation, + arg_list, + result, + exclist, + ctxlist + ); + }//createRequest + + + public org.omg.CORBA.Policy get_policy( + org.omg.CORBA.Object self, + int policy_type ) { + + PolicyContext request_context; + request_context = createRequestPolicyContext(); + + return request_context.getPolicy( policy_type ); + }//get_policy + + public org.omg.CORBA.Object set_policy_override( + org.omg.CORBA.Object self, + org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add ) { + + org.omg.CORBA.portable.ObjectImpl copy; + copy = ( org.omg.CORBA.portable.ObjectImpl ) self._duplicate(); + + //TODO: Note that the delegate stored in object reference must be a + //CommunicationsDelegate instance! + CommunicationDelegate delegate = ( CommunicationDelegate )copy._get_delegate(); + + try { + delegate.getPolicyContext().setPolicies(policies, set_add); + } catch (InvalidPolicies iv) {} + return copy; + + }//set_policy_override + + /* + * UNIMPLEMENTED API + */ + public org.omg.CORBA.DomainManager[] _get_domain_managers( + org.omg.CORBA.Object self ) { + + throw new org.omg.CORBA.NO_IMPLEMENT(); + }//_get_domain_managers + + + /* + * DEPRECATED API + */ + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.InterfaceDef get_interface(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @deprecated Deprecated by CORBA 2.3 + */ + public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object self) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + + /* + * Utility methods used by TIDOrbJ + */ + + public void setForward(ForwardRequest fe) + { + try { + this.forwardReference = + orb.getCommunicationManager().createDelegate(fe.forward_reference); + } + catch (CommunicationException e) { + throw new INV_OBJREF("Cannot create delegate for: " + + fe.forward_reference.toString()); + } + + orb.printTrace( + Trace.DEBUG, new String[]{ + "DelegateImpl::non_exist(): ", + this.getReference().toString(), + " forwarded to: ", + this.forwardReference.toString() + } + ); + } + + /** + * Creates the PolicyContext for a request using reference + thread + ORB + * PolicyManagers + */ + public PolicyContext createRequestPolicyContext() + { + // generates effective Request context + + PolicyContext context = getPolicyContext(); + context = context.duplicate(); + Thread currentThread = Thread.currentThread(); + + // thread_context has as father ORB Context + PolicyContext thread_context = + orb.getPolicyContextManager().getThreadContext(currentThread); + + context.setFatherContext(thread_context); + return context; + } + + /* + * must use CommunicationManager to retrieve a valid delegate + * from provided ior. + * @deprecated since 6.0.1 + */ + public CommunicationDelegate fromString( TIDORB orb, String ior ) { + throw new UnsupportedOperationException(); + } + + public String toString(){ + if ( this.reference != null ) { + return this.reference.toString(); + } else { + throw new IllegalStateException( "No reference configured!" ); + } + } + + protected boolean invoke_is_a( org.omg.CORBA.Object self, String id ){ + // Create the request: + org.omg.CORBA.Request request = request(self, "_is_a"); + + // insert the parameter and return type + Any inputAny = request.add_named_in_arg( "repositoryIdentifier" ); + inputAny.insert_string(id); + request.set_return_type( this.orb.get_primitive_tc(TCKind.tk_boolean) ); + + // Perform the invocation: + request.invoke(); + + java.lang.Exception exception; + if ( ( exception = request.env().exception() ) != null ) { + throw (org.omg.CORBA.SystemException) exception; + } + + // Extrae el resultado y los argumentos de salida: + return request.return_value().extract_boolean(); + + }//invoke_is_a + + public org.omg.CORBA.portable.OutputStream request( + org.omg.CORBA.Object object, + String operation, + boolean responseExpected ){ + + if ( this.is_local( object ) ) { + throw new BAD_OPERATION( + "Request is only valid for remote objects" + ); + } + + org.omg.CORBA.portable.ObjectImpl target; + target = (org.omg.CORBA.portable.ObjectImpl) object; + + StreamRequestImpl request = new StreamRequestImpl( + this.orb, + target, + operation, + responseExpected + ); + + this.prepareRequest(request); + + return request.getOutputStream(); + + } + + public String get_codebase( org.omg.CORBA.Object self ){ + return null; + } + + /* + * To be implemented by concrete implementations + */ + public abstract boolean isLocal( org.omg.CORBA.Object self ); + + public abstract boolean non_existent( org.omg.CORBA.Object self ); + + public abstract org.omg.CORBA.Object duplicate( org.omg.CORBA.Object self ); + + public abstract void release( org.omg.CORBA.Object self ); + + public abstract void release_reply( + org.omg.CORBA.Object self, + org.omg.CORBA.portable.InputStream inputStream + ); + + //TODO: actually this operation is performed by the 'old' commLayer itself + public abstract void prepareRequest( StreamRequestImpl request ); + + public abstract void onewayRequest( RequestImpl request ); + + public abstract void invoke( RequestImpl request ); + + // AMI callback operations + public abstract void asyncRequest( RequestImpl request, Object ami_handler ); + + public abstract org.omg.CORBA.portable.InputStream invoke( + org.omg.CORBA.Object object, + org.omg.CORBA.portable.OutputStream stream ) + throws + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException ; + + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/CommunicationException.java b/source/es/tid/TIDorbj/core/comm/CommunicationException.java new file mode 100644 index 0000000..07f024e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/CommunicationException.java @@ -0,0 +1,71 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +/** + * + * Generic excetion thrown from communications infraestructure. TODO: this + * should be concreted upon refactoring evolution + * + * @author jprojas + * + */ +public class CommunicationException extends Exception { + + public CommunicationException(){ + super(); + } + + public CommunicationException( String message ){ + super( message ); + } + + public CommunicationException( String message, Throwable cause ){ + super( message, cause ); + } + + public CommunicationException( Throwable cause ){ + super( cause ); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/CommunicationLayer.java b/source/es/tid/TIDorbj/core/comm/CommunicationLayer.java new file mode 100644 index 0000000..c4785be --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/CommunicationLayer.java @@ -0,0 +1,249 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision: 274 $ + * Date: $Date: 2008-04-12 16:33:40 +0200 (Sat, 12 Apr 2008) $ + * Last modified by: $Author: avega $ + * + * (C) Copyright 2004 Telefónica Investigación y Desarrollo + * S.A.Unipersonal (Telefónica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ + +package es.tid.TIDorbj.core.comm; + + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +; + +/** + * The interface of every CommunicationLayer implementation. + * + * @see CommunicationManager + */ +public interface CommunicationLayer { + + + public abstract void setORB( TIDORB orb ); + public abstract TIDORB getORB(); + + public void setServerModeEnabled( boolean value ) throws CommunicationException; + public boolean isServerModeEnabled(); + + public void shutdown( boolean waitForCompletion ); + + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the given URL. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + * @param url the URL of the service to which to connect + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(String url) throws CommunicationException; + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the given URL. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + *

The java.util.Properties argument can be used to pass + * arbitrary string tag/value pairs as connection arguments. + * + * @param url the URL of the service to which to connect + * @param info a list of arbitrary string tag/value pairs as arguments. + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(String url, java.util.Properties info) + throws CommunicationException; + + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the service identified by the given reference. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + * @param url the URL of the service to which to connect + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(IOR ior) throws CommunicationException; + + /** + * Attempts to make a connection to the given service. + * The layer should return "null" if it realizes it is the wrong kind + * of layer to connect to the service identified by the given reference. + * + *

The layer may throw a CommunicationException if it is the right + * layer to connect to the given URL but has trouble connecting to + * the desired destination. + * + *

The java.util.Properties argument can be used to pass + * arbitrary string tag/value pairs as connection arguments. + * + * @param ior the IOR of the service to which to connect + * @param info a list of arbitrary string tag/value pairs as + * connection arguments. + * + * @return a CommunicationDelegate object which will manage + * requests to the service referenced. + * @exception CommunicationException if an error occurs + */ + CommunicationDelegate createDelegate(IOR ior, java.util.Properties info) + throws CommunicationException; + + /** + * Retrieves whether the driver thinks that it can open a connection + * to the resource identified by the given URL. + * + * @param url the URL of the desired resource + * @return true if this driver understands the given URL; + * false otherwise + * @exception CommunicationException if a database access error occurs + */ + boolean accepts(String url) throws CommunicationException; + + + /** + * Retrieves whether the driver thinks that it can open a connection + * to the resource identified by the given URL. + * + * @param ior the IOR associated with the desired service + * @return true if this driver understands the given URL; + * false otherwise + * @exception CommunicationException if a database access error occurs + */ + boolean accepts(IOR ior) throws CommunicationException; + + /** + * Creates an base ior containing the information regarding the + * communication's configuration (ie, prototol, version, host & port used) + * @return an ior filled with the communications info available for + * current layer. + * @throws CommunicationException + */ + IOR createIOR( String repositoryId, ObjectKey key, TaggedComponent[] components ) + throws CommunicationException; + + /** + * Creates an base url containing the information regarding the + * communication's configuration (ie, prototol, version, host & port used) + * @return an String filled with the communications info available for + * current layer. + * @throws CommunicationException + */ + String createURL( String repositoryId, ObjectKey key ) throws CommunicationException; + + + //TODO: check the convenience of these method + public String getInitialReference( IOR ior ) throws CommunicationException; + public String getInitialReference( String url ) throws CommunicationException; + + + public boolean isLocal( IOR ior ) throws CommunicationException; + public boolean isLocal( String url ) throws CommunicationException; + + + /** + * Gets information about the possible properties for this driver. + *

+ * The getPropertyInfo method is intended to allow a generic + * GUI tool to discover what properties it should prompt + * a human for in order to get + * enough information to connect to a certain service. Note that depending on + * the values the human has supplied so far, additional values may become + * necessary, so it may be necessary to iterate though several calls + * to the getPropertyInfo method. + * + * @param url the URL of the database to which to connect + * @param info a proposed list of tag/value pairs that will be sent on + * connect open + * @return an array of DriverPropertyInfo objects describing + * possible properties. This array may be an empty array if + * no properties are required. + * @exception CommunicationException if some error occurs + */ + PropertyInfo[] getPropertiesInfo(); + PropertyInfo getPropertyInfo( String name ); + + + /** + * Retrieves the Layer's major version number. Initially this should be 1. + * + * @return this Layer's major version number + */ + int getMajorVersion(); + + /** + * Gets the Layer's minor version number. Initially this should be 0. + * @return this Layers's minor version number + */ + int getMinorVersion(); + + /** + * Gets the Layers identification string. + */ + String getId(); + + /** + * Gets the Layers identification string. + */ + void dump(java.io.PrintWriter writer); + + +} diff --git a/source/es/tid/TIDorbj/core/comm/CommunicationManager.java b/source/es/tid/TIDorbj/core/comm/CommunicationManager.java new file mode 100644 index 0000000..6ea73c1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/CommunicationManager.java @@ -0,0 +1,725 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision: 478 $ + * Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ + * Last modified by: $Author: avega $ + * + * (C) Copyright 2004 Telefnica Investigacin y Desarrollo + * S.A.Unipersonal (Telefnica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm; + +import java.util.Hashtable; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.util.Trace; + +/** + * Based on the jdbc interface and driver registry implementation, + * CommunicationManager will provide a way to uncouple the underlying + * communications infraestructure from the logic regarding the processing, + * execution and result retrieval of incoming and outgoing requests. + * + * Through the CommunicationManager, ORB will be able to obtain a + * concrete CommunicationDelegate depending on the URL / IOR + * provided, so that the actual communication process will be managed by the + * underlying implementation + * + * From the internal side of each CommunicationLayer, it will + * provide a reference to a RequestDispatcher object that will hold + * the process of request enqueual into ORB's infraestructure + * + * @author Juan Pablo Rojas + * + * + */ +public class CommunicationManager { + + + private boolean offline; + + /** + * Attempts to establish a connection to the given database URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered layers. + * + * @param url + * a service url of the form + * protocol:subprotocol:subname + * @return a connection to the URL + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate(String url) + throws CommunicationException { + + java.util.Properties info = new java.util.Properties(); + + return ( createDelegate( url, info ) ); + } + + /** + * Attempts to create a delegate for the given URL. The + * CommunicationManager attempts to select the appropriate + * CommunicationLayer from the set of registered layers. + * + * @param ior a service ior + * + * @return a CommunicationDelegate to the desired service + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( IOR ior ) + throws CommunicationException { + + java.util.Properties info = new java.util.Properties(); + + return ( createDelegate( ior, info ) ); + } + + /** + * Attempts to locate a layer that understands the given URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered layers. + * + * @param url + * a URL of the form + * :: + * @return a CommunicationsLayer object representing a layer that can + * connect to the given service + * @exception CommunicationException + * if an error occurs + */ + public synchronized CommunicationLayer getLayer(String url) + throws CommunicationException { + println("CommunicationManager.getLayer(\"" + url + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + try { + println(" trying " + li); + if (li.layer.accepts(url)) { + // Success! + println("getLayer returning " + li); + return (li.layer); + } + } catch (CommunicationException ex) { + // Drop through and try the next driver. + } + } + + println("getLayer: no suitable layer"); + throw new CommunicationException("No suitable layer"); + } + + + + /** + * Attempts to locate a layer that matches the given Id. . + * + * @param id + * + * @return a CommunicationsLayer object representing a layer + * identified as id, or null if the layer wasn't found + */ + public CommunicationLayer getLayerById( String id ) { + + // TODO trace it + // println("CommunicationManager.getLayerById(\"" + id + "\")"); + + if (!initialized) { + initialize(); + } + CommunicationLayer desiredLayer = null; + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + //println( " trying " + li ); + if (li.layer.getId().equals( id )) { + // Success! + // println( "getLayer returning " + li ); + desiredLayer = li.layer; + } + + } + return desiredLayer; + }//getLayerById + + + /** + * Attempts to locate a layer that can connect to the service bound to the + * IOR object passed as an argument. The CommunicationManager + * attempts to select an appropriate layer from the set of registered communication + * layers. + * + * @param ior + * a service IOR + * @return a CommunicationLayer object representing a driver that can + * connect to the given URL + * @exception CommunicationException + * if a database access error occurs + */ + public synchronized CommunicationLayer getLayer( IOR ior ) + throws CommunicationException { + + println("CommunicationManager.getDriver(\"" + ior + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to locate someone + // who understands the given URL. + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + try { + println( " trying " + li ); + if (li.layer.accepts( ior )) { + // Success! + println( "getLayer returning " + li ); + return ( li.layer ); + } + } catch ( CommunicationException ex ) { + // Drop through and try the next driver. + } + } + + println( "getLayer: no suitable layer" ); + throw new CommunicationException( "No suitable layer" ); + } + + /** + * Registers the given layer with the CommunicationManager. + * A newly-loaded driver class should call the method + * registerDriver to make itself known to the + * CommunicationManager. + * + * @param layer + * the new CommunicationLayer that is to be registered with the + * CommunicationManager + * @exception CommunicationException + * if an error occurs + */ + public synchronized void registerLayer(CommunicationLayer layer) + throws CommunicationException { + + if (!initialized) { + initialize(); + } + + LayerInfo li = new LayerInfo(); + li.layer = layer; + li.layerClass = layer.getClass(); + li.layerClassName = li.layerClass.getName(); + availableLayers.addElement(li); + println( "registerLayer: " + li ); + } + + /** + * Drops a layer from the CommunicationManager's list. + * Applets can only deregister availableLayers from their own classloaders. + * + * @param layer + * the CommunicationLayer to drop + * @exception CommunicationException + * if an error occurs + */ + public synchronized void deregisterLayer(CommunicationLayer layer) + throws CommunicationException { + + println( "CommunicationManager.deregisterLayer: " + layer ); + + // Walk through the loaded availableLayers. + int i; + LayerInfo li = null; + for (i = 0; i < availableLayers.size(); i++) { + li = (LayerInfo) availableLayers.elementAt(i); + if (li.layer == layer) { + break; + } + } + // If we can't find the driver just return. + if (i >= availableLayers.size()) { + println(" couldn't find driver to unload"); + return; + } + + // Remove the layer. Other entries in availableLayers get shuffled down. + availableLayers.removeElementAt(i); + }//deregisterLayer + + /** + * Prints a message to the current log stream. + * + * @param message + * a log or tracing message + */ + public void println( String message ) { + if ( this.orb != null ){ + if ( this.orb.m_trace != null ){ + this.orb.m_trace.print( Trace.DEEP_DEBUG, message ); + } + } + } + + public void println( String msg, Throwable th ){ + if ( this.orb != null ){ + if ( this.orb.m_trace != null ){ + this.orb.m_trace.printStackTrace( Trace.DEEP_DEBUG, msg, th ); + } + } + } + + //------------------------------------------------------------------------ + //Initialization stuff + + private void loadInitialLayers() { + String layers; + try { + //if (this.orb.m_conf. + layers = this.orb.m_conf.comm_layers; + } catch (Exception ex) { + layers = null; + } + println("CommunicationManager.initialize: = " + ConfORB.comm_layers_name + ": " + layers ); + if (layers == null) { + return; + } + while (layers.length() != 0) { + int x = layers.indexOf(':'); + String layer; + if (x < 0) { + layer = layers; + layers = ""; + } else { + layer = layers.substring(0, x); + layers = layers.substring(x + 1); + } + if (layer.length() == 0) { + continue; + } + try { + println("CommunicationManager.Initialize: loading " + layer); + Class currentLayerClass = Class.forName(layer); + //Class currentLayerClass = Class.forName(layer, true, ClassLoader.getSystemClassLoader()); + if ( currentLayerClass != null ){ + CommunicationLayer currentLayer; + currentLayer = (CommunicationLayer) currentLayerClass.newInstance(); + + LayerInfo li = new LayerInfo(); + li.layerClassName = layer; + li.layerClass = currentLayerClass; + li.layer = currentLayer; + availableLayers.add( li ); + //TODO: modify apis to provide a reference to it's own layer + //as soon as possible, at this moment, they access it's pare + //nt layer through communicationManager, so it must be added + //prior to initialization (performed at setOrb's). + currentLayer.setORB( this.orb ); + + currentLayer.dump(this.orb.m_trace.getLog()); + + } + } catch (Exception ex) { + println("CommunicationManager.Initialize: load failed: " + ex, ex); + } + } + } + + /** + * Attempts to establish a connection to the given service URL. The + * CommunicationManager attempts to select an appropriate + * driver from the set of registered JDBC availableLayers. + * + * @param url + * a service url of the form + * :: + * @param info + * a list of arbitrary string tag/value pairs as connection + * arguments; + * @return a CommunicationDelegate instance which will manage + * requests to the specified service + * @exception SQLException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( + String url, + java.util.Properties info) + throws CommunicationException { + + if (url == null) { + throw new CommunicationException( "Parameter 'url' cannot be null" ); + } + + println("CommunicationManager.connect(\"" + url + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to make a connection. + // Remember the first exception that gets raised so we can reraise it. + Exception reason = null; + CommunicationLayer commLayer; + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + // If the caller does not have permission to load the driver then + // skip it. + try { + println( " trying " + li ); + if ( li.layer.accepts( url ) ){ + CommunicationDelegate result = li.layer.createDelegate(url, info); + if (result != null) { + // Success! + println( "connect returning " + li ); + return (result); + } + } + } catch (CommunicationException ce ){ + if ( reason != null ){ + reason = ce; + } + } + } + + // if we got here nobody could connect. + if (reason != null) { + println( "connect failed: " + reason ); + throw new CommunicationException( "connect failed", reason ); + } + + println( "connect: no suitable driver" ); + throw new CommunicationException( "No suitable driver" ); + } + + /** + * Attempts to establish a connection to the given service IOR. The + * CommunicationManager attempts to select an appropriate + * CommunicationLayer from the set of registered layers. + * + * @param ior the service IOR + * + * :: + * @param info + * a list of arbitrary string tag/value pairs as connection + * arguments; + * @return a CommunicationDelegate instance which will manage + * requests to the specified service + * @exception SQLException + * if a database access error occurs + */ + public synchronized CommunicationDelegate createDelegate( + IOR ior, + java.util.Properties info) + throws CommunicationException { + + if (ior == null) { + throw new CommunicationException( "Parameter 'ior' cannot be null" ); + } + + println("CommunicationManager.connect(\"" + ior + "\")"); + + if (!initialized) { + initialize(); + } + + // Walk through the loaded availableLayers attempting to make a connection. + // Remember the first exception that gets raised so we can reraise it. + Exception reason = null; + CommunicationLayer commLayer; + for (int i = 0; i < availableLayers.size(); i++) { + LayerInfo li = (LayerInfo) availableLayers.elementAt(i); + + // If the caller does not have permission to load the driver then + // skip it. + try { + println( " trying " + li ); + if ( li.layer.accepts( ior ) ){ + CommunicationDelegate result = li.layer.createDelegate(ior, info); + if (result != null) { + // Success! + println( "connect returning " + li ); + return (result); + } + } + } catch (CommunicationException ce ){ + if ( reason != null ){ + reason = ce; + } + } + } + + // if we got here nobody could connect. + if (reason != null) { + println( "connect failed: " + reason ); + throw new CommunicationException( "connect failed", reason ); + } + + println( "connect: no suitable driver" ); + throw new CommunicationException( "No suitable layer" ); + } + + //TODO: check the convenience of these method + public String getInitialReference( IOR ior ) throws CommunicationException { + if (!initialized) { + initialize(); + } + + String initialReference; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( ior ); + if ( peerLayer != null ){ + initialReference = peerLayer.getInitialReference( ior ); + } else { + initialReference = null; + } + return initialReference; + } + + public String getInitialReference( String url ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + String initialReference; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( url ); + if ( peerLayer != null ){ + initialReference = peerLayer.getInitialReference( url ); + } else { + initialReference = null; + } + return initialReference; + } + + + public boolean isLocal( IOR ior ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + boolean isLocal; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( ior ); + if ( peerLayer != null ){ + isLocal = peerLayer.isLocal( ior ); + } else { + throw new CommunicationException( "Invalid ior: no suitable layer" ); + } + return isLocal; + } + + + public boolean isLocal( String url ) throws CommunicationException{ + + if (!initialized) { + initialize(); + } + + boolean isLocal; + CommunicationLayer peerLayer; + peerLayer = this.getLayer( url ); + if ( peerLayer != null ){ + isLocal = peerLayer.isLocal( url ); + } else { + throw new CommunicationException( "Invalid url: no suitable layer" ); + } + return isLocal; + } + + /** + * @param b + */ + public synchronized void setServerModeEnabled( boolean b ) throws CommunicationException { + + if (!initialized) { + initialize(); + } + + if ( this.offline ) { + + this.getLayerById( IIOPCommunicationLayer.ID ).setServerModeEnabled( + b + ); + + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.setServerModeEnabled( b ); + } + this.offline = false; + } + }//setServerModeEnabled + + + /** + * @param waitForCompletion + */ + public synchronized void shutdown( boolean waitForCompletion ) { + + if (!initialized) { + initialize(); + } + + if ( !this.offline ) { + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.shutdown( waitForCompletion ); + } + this.offline = true; + } + } + + /** + * + */ + public void destroy() { + + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i = layersCount - 1; i >= 0; i-- ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + actualLayerInfo.layer.shutdown(false); + } + + } + + public synchronized RequestDispatcher getRequestDispatcher() { + if ( this.dispatcher == null ){ + this.dispatcher = new RequestDispatcher( this.orb ); + } + return this.dispatcher; + }//getRequestDispatcher + + + public static synchronized CommunicationManager getInstance( TIDORB orb ){ + if ( CommunicationManager.instances == null ){ + CommunicationManager.instances = new Hashtable(); + } + if ( orb != null ){ + CommunicationManager manager; + manager = ( CommunicationManager )CommunicationManager.instances.get( orb ); + if ( manager == null ){ + manager = new CommunicationManager( orb ); + CommunicationManager.instances.put( orb, manager ); + } + return manager; + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setOrb + + public synchronized String toString(){ + StringBuffer toString; + toString = new StringBuffer(); + int layersCount = this.availableLayers.size(); + LayerInfo actualLayerInfo; + for ( int i=0; i < layersCount; i++ ){ + actualLayerInfo = ( LayerInfo )this.availableLayers.get( i ); + toString.append( actualLayerInfo.layer); + if ( i < layersCount - 1 ){ + toString.append( ' ' ); + } + } + return toString.toString(); + } + + private CommunicationManager( TIDORB orb ){ + this.orb = orb; + } + + public TIDORB getORB(){ + return this.orb; + } + + // Class initialization. + private void initialize() { + if (initialized) { + return; + } + initialized = true; + this.loadInitialLayers(); + this.offline = true; + println(" CommunicationManager initialized"); + } + + + private TIDORB orb = null; + + private RequestDispatcher dispatcher = null; + + private java.util.Vector availableLayers = new java.util.Vector(); + + private static Hashtable instances; + + private boolean initialized = false; + + + +} + +// LayerInfo is a package-private support class. + +class LayerInfo { + CommunicationLayer layer; + + Class layerClass; + + String layerClassName; + + public String toString() { + return ("driver[className=" + layerClassName + "," + layer + "]"); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/Connection.java b/source/es/tid/TIDorbj/core/comm/Connection.java new file mode 100644 index 0000000..ae884af --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/Connection.java @@ -0,0 +1,2047 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import java.io.IOException; +import java.net.Socket; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.comm.ssliop.*; + +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb IIOP IIOPConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +abstract public class Connection extends ORBComponent implements RemovableObject { + //public class IIOPConnection extends Connection { + + /** + * Client connection mode. + */ + public final static int CLIENT_MODE = 0; + + /** + * Server connection mode. + */ + public final static int SERVER_MODE = 1; + + /** + * Bidirectional connection mode. + */ + public final static int BIDIRECTIONAL_MODE = 2; + + /** + * IIOPConnection mode. + */ + protected int m_mode; + + /** + * IIOPConnection state. + */ + protected ConnectionState m_state; + + /** + * Pending requests in POA. + */ + protected Counter m_requests_in_POA; + + /** + * Actual id count. The ids will be given sequentialy. + */ + private Counter id_count; + + /** + * IIOPConnection identifier: the local port related to the connection socket. + */ + + protected int my_port = 0; + + /** + * Server Object Listen Points assitiated. + */ + + protected java.util.Hashtable m_addresses; + + /** + * First client address; + */ + + protected ListenPoint m_initial_point; + + /** + * The IIOPConnectionManager. + */ + + protected IIOPConnectionManager m_manager; + + /** + * Lock list where the pending requests are waiting for response. + */ + + protected LockList m_lock_list; + + /** + * Lock list where the pending asynchronous requests are waiting for response. + */ + + protected AMILockList m_ami_lock_list; + + /** + * Table with the uncompleted messages that has more fragments. + */ + + protected UseTable m_uncompleted_messages; + + /** + * Maintains the actual request id for fragmented message in GIOP 1.1 + */ + + RequestId m_current_request_id; + + /** + * Bidirectional Service Context. It will be sent in the next + * Request/Response. + */ + + protected ServiceContextList m_bidirectional_service; + + /** + * Says if the bidirecitonal context has to been sent or not. + */ + + protected boolean m_send_bidirectional_service; + + /** + * Write messages in socket monitor. + */ + + protected ConnectionWriteMonitor m_write_monitor; + + /** + * IIOPConnection buffer for writting headers. + */ + byte[] m_send_header_buffer; + + /** + * IIOPConnection buffer for receiving headers. + */ + byte[] m_receive_header_buffer; + + /** + * The toString() return value. + */ + protected String m_str = null; + + /** + * Register the connection at the connection manager and initialize the + * connection socket with the ORB configuration values. + * + * @see es.tid.TIDorbj.core.ConfORB + */ + +// private boolean tcpNoDelay; +// private int soTimeout; +// private int soLinger; + private int maxUncompletedMessages; +// private int socketWriteTimeout; + private GIOPVersion giopVersion; + private int giopFragmentSize; + private boolean ipv6; + + /** + * Says if QoS is enabled not. + */ + long max_response_blocked_time; + + /** + * Says if QoS is enabled not. + */ + boolean qos_enabled; + + /** + * Says if the client can sssume that server uses ziop or not. + */ + boolean assume_ziop_server; + + protected Connection(IIOPConnectionManager mngr) + { + super(mngr.orb()); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + maxUncompletedMessages = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.MAX_UNCOMPLETED_MESSAGES ) + .getInt(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + + giopFragmentSize = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.FRAGMENT_SIZE ) + .getInt(); + + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + if (this.ipv6 == true) + { + System.setProperty("java.net.preferIPv6Address","true"); + System.setProperty("java.net.preferIPv4Stack","false"); + } + + max_response_blocked_time = m_orb.m_conf.max_blocked_time; + qos_enabled = m_orb.m_conf.qos_enabled; + assume_ziop_server = m_orb.m_conf.assume_ziop_server; + + m_state = new ConnectionState(); + + m_requests_in_POA = new Counter(); + + id_count = new Counter(); + + m_current_request_id = null; + + m_lock_list = new LockList(); + + m_ami_lock_list = m_orb.getAMIManager().getAMILockList(); + + m_uncompleted_messages = new UseTable( maxUncompletedMessages ); + + m_send_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + m_receive_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + + } + + /** + * Start the connection thread execution. + */ + public void init() + { + try { + ConnectionThread conn_thread = new ConnectionThread(this); + conn_thread.setDaemon(false); + conn_thread.start(); + } + catch (Throwable thw) { + throw new org.omg.CORBA.NO_RESOURCES( + "Can't create thread: " + thw.toString() ); + } + + } + + /** + * IIOPConnection hash code. + */ + public abstract int hashCode(); + + public abstract boolean equals(Object obj); + + public abstract String toString(); + + + /** + * Add a new listen point for whose this connection can be uses to sending + * request. This will be usefull if this connection is bidirectional. + * + * @param listen_point + * the new listen point of an bidirectional connection + */ + public void addListenPoint(ListenPoint listen_point) + { + m_addresses.put(listen_point, listen_point); + } + + /** + * @return the listen points associated to this connection + */ + public Enumeration getListenPoints() + { + return m_addresses.elements(); + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects that a referenced object is defined in a + * "Bidirectional POA". The contest will be sent in the next response. + * + * @param context + * the list containing the BiDirServiceContext + */ + public void setBidirectionalMode(ServiceContextList context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + m_bidirectional_service = context; + + m_send_bidirectional_service = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, toString() + + ": Setting Bidirectional Mode."); + } + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects a bidirectional context in a request or + * response sent by the peer. + * + * @param context + * the bidirectional context + */ + + public void setBidirectionalModeByPeer(BiDirServiceContext context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + if (m_orb.m_trace != null) { + m_orb + .printTrace( + Trace.DEBUG, + toString() + + ": Setting Bidirectional Mode by Peer."); + } + + for (int i = 0; i < context.m_listen_points.length; i++) { + addListenPoint(context.m_listen_points[i]); + m_manager.addBidirectionalConnection(context.m_listen_points[i], + (es.tid.TIDorbj.core.comm.Connection)this); + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + toString() + + " will be connected to" + + context.m_listen_points[i].toString()); + } + } + + } + + /** + * Test whether the connection is still opened or not. + * + * @return true if open or false if not. + */ + + public boolean isOpen() + { + return m_state.isOpen(); + } + + /** + * @return the communication error (if exits) + */ + public COMM_FAILURE getConnectionError() + { + return m_state.getError(); + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isClientConnection() + { + return m_mode == CLIENT_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isServerConnection() + { + return m_mode == SERVER_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isBidirectionalConnection() + { + return m_mode == BIDIRECTIONAL_MODE; + } + + /** + * The connection has recived a close connection. + */ + public void closeByPair() + { + if (m_state.setClosing()) { + m_manager.closing(this); + close(); + } + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, toString() + " closed by pair"); + } + + /** + * The connection will be closed by the connection manager. + * + * @see es.tid.TIDorbj.core.comm.iiop.IIOPConnectionManager + */ + + public void closeByManager() + { + if (m_state.setClosing()) { + if (m_mode != CLIENT_MODE) + sendClose(); + + if (m_lock_list.size() != 0) + m_state.seterror( + new COMM_FAILURE("IIOPConnection Closed because the max. " + + "connection number has been reached.", + 0, + CompletionStatus.COMPLETED_NO)); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " closed by IIOPConnection Manager"); + } + } + + /** + * The connection is closed due to the socket is broken. + * + * @param error + * the broken communication error + */ + + public void closeByBrokenConnection(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + public void closeByError(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + protected abstract void close(); + + public void sendClose() + { + try { + GIOPHeader header; + header = new GIOPHeader( giopVersion, MsgType.CloseConnection); + + sendMessage(header); + } + catch (Exception e) {} + } + + public void sendError() { + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, toString() + " : sending a GIOP Message error." + ); + } + + GIOPHeader error; + error = new GIOPHeader( giopVersion , MsgType.MessageError); + sendMessage(error); + } + + public void sendHeader(GIOPHeader header) { + header.toByteArray(m_send_header_buffer); + write(m_send_header_buffer); + } + + protected GIOPHeader receiveHeader() { + read(m_receive_header_buffer); + return GIOPHeader.fromByteArray(m_receive_header_buffer); + } + + protected void sendMessage(GIOPHeader header) { + try { + m_write_monitor.initWrite(); + } catch (WriteTimeout to) { + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + sendHeader(header); + + m_write_monitor.endWrite(); + } + + public void sendMessage(GIOPMessage message) { + if (m_state.isOpen()) { + m_manager.use(this); + } + + message.send(this); + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + ": ", + message.toString(), + " has been sent!" + } + ); + } + } + + public void receiveMessage() { + while (true) { + + if (m_state.isOpen()) { + m_manager.use(this); + } else { + break; + } + + try { + + // wait for reply + GIOPHeader header = receiveHeader(); + + + // Attend for compressed messages + if (header.getCompressed()){ + ZIOPMessage ziop_message = new ZIOPMessage(header, giopFragmentSize); + + ziop_message.receiveBody(this, m_receive_header_buffer); + + ziop_message.connect_GIOPMessage(this); + continue; + } + + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (message.hasBody()) { + message.receiveBody(this, m_receive_header_buffer); + } + + if (m_orb.m_trace != null){ + m_orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + m_orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + switch (header.getMsgType().m_value) + { + + case MsgType._Request: + manageMessage((GIOPRequestMessage) message); + break; + case MsgType._Reply: + manageMessage((GIOPReplyMessage) message); + break; + case MsgType._CancelRequest: + manageMessage((GIOPCancelRequestMessage) message); + break; + case MsgType._LocateRequest: + manageMessage((GIOPLocateRequestMessage) message); + break; + case MsgType._LocateReply: + manageMessage((GIOPLocateReplyMessage) message); + break; + case MsgType._Fragment: + manageMessage((GIOPFragmentMessage) message); + break; + case MsgType._CloseConnection: + closeByPair(); + return; + case MsgType._MessageError: + closeByError( + new COMM_FAILURE("IIOPConnection closed due to pair " + + "message error.")); + return; + } + + } + catch (org.omg.CORBA.COMM_FAILURE comm) { + closeByError(comm); + return; + } + catch (Throwable excp) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.ERROR, toString(), excp); + + closeByError(new COMM_FAILURE(excp.toString())); + return; + } + } + } + + public void manageMessage(GIOPFragmentMessage message) + { + RequestId id = null; + + if (GIOPVersion.VERSION_1_2.equals(message.getHeader().getVersion())) + id = message.getRequestId(); + else if (m_current_request_id == null) { // unexpected fragment message + closeByError(new COMM_FAILURE("Unexpected fragment message.", 0, + CompletionStatus.COMPLETED_NO)); + return; + } else + id = m_current_request_id; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + toString() + " : GIOP Fragment Message has received." + ); + } + + FragmentedMessageHolder holder = + (FragmentedMessageHolder) m_uncompleted_messages.get(id); + + if (holder == null) { + // discard message + return; + } + + GIOPFragmentedMessage fragmented_message = holder.m_message; + + fragmented_message.addFragment(message); + + if (!message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received. + + m_uncompleted_messages.remove(id); + + switch (fragmented_message.getHeader().getMsgType().m_value) + { + case MsgType._Request: + dispatchRequest((GIOPRequestMessage) fragmented_message); + break; + case MsgType._LocateRequest: + dispatchRequest((GIOPLocateRequestMessage) fragmented_message); + break; + // CLIENT MESSAGES + case MsgType._Reply: + serviceContextReceived( + ((GIOPReplyMessage) + fragmented_message).getServiceContextList()); + case MsgType._LocateReply: + { + m_current_request_id = null; + Lock lock = m_lock_list.get(id); + AMILock ami_lock = m_ami_lock_list.get(id); + if (lock != null) { // the lock has not been discarded + lock.setMessage(fragmented_message); + lock.setCompleted(); + } else if (ami_lock != null) { + ami_lock.setMessage(fragmented_message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + } + } + + public void manageMessage(GIOPReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("Reply has been received by Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) { + return; // discard + } + + if (message.getHeader().hasMoreFragments()) { + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE("Fragment message expeted, " + + "but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + + } + } else { + serviceContextReceived(message.getServiceContextList()); + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPLocateReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("LocateReply has been received by " + + "Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) + return; // the lock hast expired, discard the message + + if (message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateReply can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else { + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPCancelRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "CancelRequest has been received by Client IIOPConnection")); + return; + } + + m_uncompleted_messages.remove(message.getRequestId()); + } + + public void manageMessage(GIOPLocateRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateRequest can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + protected abstract void dispatchRequest(GIOPLocateRequestMessage message); + + + protected abstract void dispatchRequest(GIOPRequestMessage message); + + + /** + * Try to resolve the url received in a Request ObjectKey + */ + + protected org.omg.CORBA.Object resolveURL(String url) { + try { + // Backward compatibility, ObjectId now expected + + if (url.startsWith("corbaloc:tidorbj:")) { + return m_orb.string_to_object(url); + } else { + + String object_id = null; + + if (url.startsWith("corbaloc:ssliop:")) { + object_id = SSLIOPCorbaloc.getObjectId(url); + } else if ((url.startsWith("corbaloc:iiop:")) + || (url.startsWith("corbaloc::"))) { + object_id = IIOPCorbaloc.getObjectId(url); + } else { + // standard version + object_id = url; + } + + return m_orb.resolve_initial_references(object_id); + } + } + catch (Throwable th) {} + + return null; + } + + public void manageMessage(GIOPRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + if (m_orb.m_trace != null) + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE( + "Fragment message expeted, but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + public boolean sendLocateRequest(IIOPIOR ior, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + return sendLocateRequest(ior, AddressingDisposition.KeyAddr, + policy_context); + } + + private boolean sendLocateRequest(IIOPIOR ior, + AddressingDisposition disposition, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + RequestId id = generateId(); + + GIOPLocateRequestMessage message = + new GIOPLocateRequestMessage(profile.getVersion(), + id, + giopFragmentSize ); + + // create the reply lock + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + + ": sending LocationRequest " + + id.toString()); + + switch (disposition.value()) + { + case AddressingDisposition._KeyAddr: + message.insertAddress(m_manager.orb(), + ior.toObjectKeyAddress()); + break; + case AddressingDisposition._ProfileAddr: + message.insertAddress(m_manager.orb(), + ior.toProfileAddress()); + break; + case AddressingDisposition._ReferenceAddr: + message.insertAddress(m_manager.orb(), + ior.toIORAddress()); + } + + sendMessage(message); + + // block the thread waiting for response + + lock.waitForCompletion(timeout); + + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No LocateReply message", 0, + CompletionStatus.COMPLETED_NO); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._LocateReply) { + throw new MARSHAL("No LocateReply message received", 0, + CompletionStatus.COMPLETED_NO); + } + + GIOPLocateReplyMessage reply_message = + (GIOPLocateReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case LocateReplyStatusType._UNKNOWN_OBJECT: + return false; + case LocateReplyStatusType._OBJECT_HERE: + return true; + case LocateReplyStatusType._OBJECT_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._OBJECT_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._LOC_SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case LocateReplyStatusType._LOC_NEEDS_ADDRESSING_MODE: + return sendLocateRequest( + ior, + reply_message.extractAddressingDisposition(), + policy_context); + } + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + return false; + } + + public void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE + { + sendOnewayRequestAsync(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE + { + // verify if the request can be sent + m_state.verifyForRequest(); + + request.setId(generateId()); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + } + + public void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendOnewayRequestSync(request, ior, AddressingDisposition.KeyAddr); + + } + + private void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + // verify if the request can be sent + m_state.verifyForRequest(); + + Lock lock = new Lock(); + + lock.requestId(request.getId()); + m_lock_list.put(lock); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + + } + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) + throw new INTERNAL("No Reply message"); + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) + throw new MARSHAL("No LocateReply message received"); + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: // traza + case ReplyStatusType._USER_EXCEPTION: // traza + case ReplyStatusType._SYSTEM_EXCEPTION: // traza + break; // nothing to do, it is a oneway request + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendOnewayRequestSync( + request, + ior, + reply_message.extractAddressingDisposition()); + } + } + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendRequest(request, ior, AddressingDisposition.KeyAddr); + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = + new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + setServiceContextList(policy_context, message); + + message.insertRequest(request, ior, disposition); + + try { + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + sendMessage(message); + } + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + // block the thread waiting for response + + + lock.waitForCompletion(timeout); + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + request.setCompletedYes(); + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + reply_message.extractArguments(request); + break; + case ReplyStatusType._USER_EXCEPTION: + request.setUserException( + reply_message.extractUserException( + request.exceptions())); + break; + case ReplyStatusType._SYSTEM_EXCEPTION: + request.setSystemException( + reply_message.extractSystemException()); + break; + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendRequest(request, ior, + reply_message.extractAddressingDisposition()); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + public org.omg.CORBA.portable.InputStream + sendRequest(es.tid.TIDorbj.core.iop.IOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest, + org.omg.CORBA.portable.RemarshalException, + org.omg.CORBA.portable.ApplicationException + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // write operation context: o conxtests + stream.write_ulong(0); + + es.tid.TIDorbj.core.cdr.CDRInputStream header_input = + new es.tid.TIDorbj.core.cdr.CDRInputStream(null, + stream.getBuffer()); + + GIOPHeader header = new GIOPHeader(); + + header.read(header_input); + + header_input = null; + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (!(message instanceof GIOPRequestMessage)) + throw new BAD_OPERATION("No Request message in stream"); + + message.setMessageBuffer(stream.getBuffer()); + message.setMessageCompleted(true); + + GIOPRequestMessage request_msg = (GIOPRequestMessage) message; + + ServerRequestImpl srv_request = request_msg.extractRequest(m_orb); + + RequestId id = srv_request.getId(); + + if (!srv_request.withResponse()) { + if (m_orb.m_trace != null) { + String[] msg = { toString(), + ": Sending Oneway Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + sendMessage(message); + + } else { + + Lock lock = new Lock(); + + lock.requestId(id); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { toString(), ": Sending Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + try { + sendMessage(message); + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + // block the thread waiting for response + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + return input; + } + case ReplyStatusType._USER_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + String excp_id = input.read_string(); + input.rewind(); + throw new ApplicationException( + excp_id, + reply_message.getDataInput()); + } + case ReplyStatusType._SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + throw new org.omg.CORBA.portable.RemarshalException(); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + return null; + } + + public void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) //*opc1*, Object ami_handler) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendAsyncRequest(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, //*opc1* Object ami_handler, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + PolicyContext policy_context = request.getPolicyContext(); + + long timeout = QoS.checkRequestTime(this.m_orb, policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + + AMILock ami_lock = new AMILock(); + ami_lock.requestId(message.getRequestId()); + ami_lock.setHandler(request.get_ami_handler()); + ami_lock.setRequest(request); + ami_lock.setIor(ior); + + m_ami_lock_list.put(ami_lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Asynchronous Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + setServiceContextList(policy_context, message); + + try { + message.insertRequest(request, ior, disposition); + sendMessage(message); + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + + /* hacerlo dentro de thread k mira tiempo de las peticiones as�ncronas + } else { + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + request.setCompletedMaybe(); + throw new RECOVERABLE_COMM_FAILURE( + new COMM_FAILURE("IIOPConnection closed by pair")); + + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(); + } + }*/ + } + + + public void prepareRequest( StreamRequestImpl request, IIOPIOR ior ) { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) + ver = orb_ver; + + GIOPRequestMessage message = new GIOPRequestMessage(ver, + request.getId(), + giopFragmentSize); + + message.prepareRequest(request, ior, AddressingDisposition.KeyAddr); + + } + + public void sendReply(ServerRequestImpl request, PolicyContext policy_context) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPReplyMessage message = new GIOPReplyMessage(request.getVersion(), + request.getId(), + giopFragmentSize); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + message.insertResultRequest(m_orb, request); + + CompressorIdLevel compressor = request.get_compressor(); + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + + int low_value = 0; + float min_ratio = 0; + + + if (policy_context != null) { + low_value = ZIOP.getLowValue(policy_context); + min_ratio = ZIOP.getMinRatio(policy_context); + + compressor.compression_level = + ZIOP.getLevelCompressor(compressor.compressor_id, + policy_context); + } + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + + } else { + sendMessage(message); + } + } + + public void sendLocateReply(GIOPVersion version, RequestId id, boolean here) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + if (here) + message.insertObjectHere(m_orb); + else + message.insertUnknownObject(m_orb); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + org.omg.CORBA.Object obj) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + message.insertForward(m_orb, obj); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + SystemException excep) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize); + + message.insertSystemException(m_orb, excep); + + sendMessage(message); + } + + protected void setServiceContextList(PolicyContext policy_context, + GIOPRequestMessage message) + { + Vector contexts = new Vector(); + + // Invocation Service Context + + InvocationPoliciesContext invocationPolicies = null; + if (policy_context != null) { + invocationPolicies = policy_context.getInvocationPolicyServiceContext(); + } + if(invocationPolicies != null) { + contexts.add(invocationPolicies); + } + + // Bidirectional Service context + if (m_send_bidirectional_service) { + + contexts.add(m_bidirectional_service.m_components[0]); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + int num_services = contexts.size(); + if ( num_services > 0) { + + ServiceContextList services = new ServiceContextList(num_services); + + contexts.toArray(services.m_components); + + message.setServiceContextList(services); + } + } + + protected void serviceContextReceived(ServiceContextList services) + { + if (services == null) + return; + + for (int i = 0; i < services.m_components.length; i++) { + if ((services.m_components[i] != null) + && (services.m_components[i].m_context_id + == org.omg.IOP.BI_DIR_IIOP.value)) { + setBidirectionalModeByPeer( + (BiDirServiceContext) services.m_components[i]); + } + } + } + + /** + * RemovableObject interface method + */ + + public boolean canBeRemoved() + { + return !hasPendingRequests(); + } + + public synchronized boolean hasPendingRequests() + { + if (m_mode == CLIENT_MODE) { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0)); + } else { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0) + || (m_requests_in_POA.isNonZero())); + } + } + + public RequestId generateId() + { + return new RequestId(id_count.postInc()); + } + + public void read(byte[] buffer) + { + read(buffer, 0, buffer.length); + } + + public abstract void read(byte[] buffer, int offset, int length); + + protected abstract void write(byte[] buffer); + + protected abstract void write(byte[] buffer, int offset, int length); + + /* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAMBIAR PARA MANDAR UN MENSAJE CON + * VARIOS CHUNKS + */ + public void writeVersion1_0(BufferCDR buffer) + {/* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * if(num_chunks > 1) throw new MARSHAL("GIOP 1.0 does not allow + * fragmentation"); + * + * ChunkCDR chunk = null; + * + * synchronized(write_mutex) { chunk = buffer.getChunk(0); + * write(chunk.getBuffer(),0,chunk.getAvailable()); } + */ + writeVersion1_1(buffer); // the buffer is only one message + } + + public void writeVersion1_1(BufferCDR buffer) + { + int num_chunks = buffer.getNumAvailableChunks(); + + ChunkCDR chunk = null; + + // Check write Monitor + try { + m_write_monitor.initWrite(); + } + catch (WriteTimeout wt) { // WriteTimeout: close this connection + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + // write loop + + for (int i = 0; i < num_chunks; i++) { + chunk = buffer.getChunk(i); + write(chunk.getBuffer(), 0, chunk.getAvailable()); + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DUMP, "GIOP message chunk sent - HEXDUMP " + + chunk.getAvailable() + " bytes"); + m_orb.printDump(Trace.DUMP, + chunk.getBuffer(), + chunk.getAvailable()); + } + + } + // free write monitor + + m_write_monitor.endWrite(); + } + + public void writeVersion1_2(BufferCDR buffer) + { + writeVersion1_1(buffer); + /* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * ChunkCDR chunk = null; + * + * for(int i = 0; i < num_chunks; i++) { chunk = buffer.getChunk(i); + * + * synchronized(write_mutex) { + * write(chunk.getBuffer(),0,chunk.getAvailable()); } } + */ + } +} diff --git a/source/es/tid/TIDorbj/core/comm/Connection.java~ b/source/es/tid/TIDorbj/core/comm/Connection.java~ new file mode 100644 index 0000000..a172752 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/Connection.java~ @@ -0,0 +1,2035 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import java.io.IOException; +import java.net.Socket; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.comm.ssliop.*; + +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb IIOP IIOPConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +abstract public class Connection extends ORBComponent implements RemovableObject { + //public class IIOPConnection extends Connection { + + /** + * Client connection mode. + */ + public final static int CLIENT_MODE = 0; + + /** + * Server connection mode. + */ + public final static int SERVER_MODE = 1; + + /** + * Bidirectional connection mode. + */ + public final static int BIDIRECTIONAL_MODE = 2; + + /** + * IIOPConnection mode. + */ + protected int m_mode; + + /** + * IIOPConnection state. + */ + protected ConnectionState m_state; + + /** + * Pending requests in POA. + */ + protected Counter m_requests_in_POA; + + /** + * Actual id count. The ids will be given sequentialy. + */ + private Counter id_count; + + /** + * IIOPConnection identifier: the local port related to the connection socket. + */ + + protected int my_port = 0; + + /** + * Server Object Listen Points assitiated. + */ + + protected java.util.Hashtable m_addresses; + + /** + * First client address; + */ + + protected ListenPoint m_initial_point; + + /** + * The IIOPConnectionManager. + */ + + protected IIOPConnectionManager m_manager; + + /** + * Lock list where the pending requests are waiting for response. + */ + + protected LockList m_lock_list; + + /** + * Lock list where the pending asynchronous requests are waiting for response. + */ + + protected AMILockList m_ami_lock_list; + + /** + * Table with the uncompleted messages that has more fragments. + */ + + protected UseTable m_uncompleted_messages; + + /** + * Maintains the actual request id for fragmented message in GIOP 1.1 + */ + + RequestId m_current_request_id; + + /** + * Bidirectional Service Context. It will be sent in the next + * Request/Response. + */ + + protected ServiceContextList m_bidirectional_service; + + /** + * Says if the bidirecitonal context has to been sent or not. + */ + + protected boolean m_send_bidirectional_service; + + /** + * Write messages in socket monitor. + */ + + protected ConnectionWriteMonitor m_write_monitor; + + /** + * IIOPConnection buffer for writting headers. + */ + byte[] m_send_header_buffer; + + /** + * IIOPConnection buffer for receiving headers. + */ + byte[] m_receive_header_buffer; + + /** + * The toString() return value. + */ + protected String m_str = null; + + /** + * Register the connection at the connection manager and initialize the + * connection socket with the ORB configuration values. + * + * @see es.tid.TIDorbj.core.ConfORB + */ + +// private boolean tcpNoDelay; +// private int soTimeout; +// private int soLinger; + private int maxUncompletedMessages; +// private int socketWriteTimeout; + private GIOPVersion giopVersion; + private int giopFragmentSize; + + /** + * Says if QoS is enabled not. + */ + long max_response_blocked_time; + + /** + * Says if QoS is enabled not. + */ + boolean qos_enabled; + + /** + * Says if the client can sssume that server uses ziop or not. + */ + boolean assume_ziop_server; + + protected Connection(IIOPConnectionManager mngr) + { + super(mngr.orb()); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + maxUncompletedMessages = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.MAX_UNCOMPLETED_MESSAGES ) + .getInt(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getValue() + ); + + giopFragmentSize = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.FRAGMENT_SIZE ) + .getInt(); + + max_response_blocked_time = m_orb.m_conf.max_blocked_time; + qos_enabled = m_orb.m_conf.qos_enabled; + assume_ziop_server = m_orb.m_conf.assume_ziop_server; + + m_state = new ConnectionState(); + + m_requests_in_POA = new Counter(); + + id_count = new Counter(); + + m_current_request_id = null; + + m_lock_list = new LockList(); + + m_ami_lock_list = m_orb.getAMIManager().getAMILockList(); + + m_uncompleted_messages = new UseTable( maxUncompletedMessages ); + + m_send_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + m_receive_header_buffer = new byte[GIOPHeader.HEADER_SIZE]; + + } + + /** + * Start the connection thread execution. + */ + public void init() + { + try { + ConnectionThread conn_thread = new ConnectionThread(this); + conn_thread.setDaemon(false); + conn_thread.start(); + } + catch (Throwable thw) { + throw new org.omg.CORBA.NO_RESOURCES( + "Can't create thread: " + thw.toString() ); + } + + } + + /** + * IIOPConnection hash code. + */ + public abstract int hashCode(); + + public abstract boolean equals(Object obj); + + public abstract String toString(); + + + /** + * Add a new listen point for whose this connection can be uses to sending + * request. This will be usefull if this connection is bidirectional. + * + * @param listen_point + * the new listen point of an bidirectional connection + */ + public void addListenPoint(ListenPoint listen_point) + { + m_addresses.put(listen_point, listen_point); + } + + /** + * @return the listen points associated to this connection + */ + public Enumeration getListenPoints() + { + return m_addresses.elements(); + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects that a referenced object is defined in a + * "Bidirectional POA". The contest will be sent in the next response. + * + * @param context + * the list containing the BiDirServiceContext + */ + public void setBidirectionalMode(ServiceContextList context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + m_bidirectional_service = context; + + m_send_bidirectional_service = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, toString() + + ": Setting Bidirectional Mode."); + } + } + + /** + * Changes the connection mode to BIDIRECTIONAL_MODE. This method is called + * by the connection if it detects a bidirectional context in a request or + * response sent by the peer. + * + * @param context + * the bidirectional context + */ + + public void setBidirectionalModeByPeer(BiDirServiceContext context) + { + if (m_mode != BIDIRECTIONAL_MODE) { + m_mode = BIDIRECTIONAL_MODE; + m_str = null; // reset the string + } + + if (m_orb.m_trace != null) { + m_orb + .printTrace( + Trace.DEBUG, + toString() + + ": Setting Bidirectional Mode by Peer."); + } + + for (int i = 0; i < context.m_listen_points.length; i++) { + addListenPoint(context.m_listen_points[i]); + m_manager.addBidirectionalConnection(context.m_listen_points[i], + (es.tid.TIDorbj.core.comm.Connection)this); + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + toString() + + " will be connected to" + + context.m_listen_points[i].toString()); + } + } + + } + + /** + * Test whether the connection is still opened or not. + * + * @return true if open or false if not. + */ + + public boolean isOpen() + { + return m_state.isOpen(); + } + + /** + * @return the communication error (if exits) + */ + public COMM_FAILURE getConnectionError() + { + return m_state.getError(); + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isClientConnection() + { + return m_mode == CLIENT_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isServerConnection() + { + return m_mode == SERVER_MODE; + } + + /** + * @return true if the communication is running in client + * mode + */ + public boolean isBidirectionalConnection() + { + return m_mode == BIDIRECTIONAL_MODE; + } + + /** + * The connection has recived a close connection. + */ + public void closeByPair() + { + if (m_state.setClosing()) { + m_manager.closing(this); + close(); + } + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, toString() + " closed by pair"); + } + + /** + * The connection will be closed by the connection manager. + * + * @see es.tid.TIDorbj.core.comm.iiop.IIOPConnectionManager + */ + + public void closeByManager() + { + if (m_state.setClosing()) { + if (m_mode != CLIENT_MODE) + sendClose(); + + if (m_lock_list.size() != 0) + m_state.seterror( + new COMM_FAILURE("IIOPConnection Closed because the max. " + + "connection number has been reached.", + 0, + CompletionStatus.COMPLETED_NO)); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " closed by IIOPConnection Manager"); + } + } + + /** + * The connection is closed due to the socket is broken. + * + * @param error + * the broken communication error + */ + + public void closeByBrokenConnection(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + public void closeByError(COMM_FAILURE error) + { + if (m_state.seterror(error)) { + m_manager.closing(this); + close(); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + toString() + + " is closing due to: " + error); + } + } + + protected abstract void close(); + + public void sendClose() + { + try { + GIOPHeader header; + header = new GIOPHeader( giopVersion, MsgType.CloseConnection); + + sendMessage(header); + } + catch (Exception e) {} + } + + public void sendError() { + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, toString() + " : sending a GIOP Message error." + ); + } + + GIOPHeader error; + error = new GIOPHeader( giopVersion , MsgType.MessageError); + sendMessage(error); + } + + public void sendHeader(GIOPHeader header) { + header.toByteArray(m_send_header_buffer); + write(m_send_header_buffer); + } + + protected GIOPHeader receiveHeader() { + read(m_receive_header_buffer); + return GIOPHeader.fromByteArray(m_receive_header_buffer); + } + + protected void sendMessage(GIOPHeader header) { + try { + m_write_monitor.initWrite(); + } catch (WriteTimeout to) { + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + sendHeader(header); + + m_write_monitor.endWrite(); + } + + public void sendMessage(GIOPMessage message) { + if (m_state.isOpen()) { + m_manager.use(this); + } + + message.send(this); + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + ": ", + message.toString(), + " has been sent!" + } + ); + } + } + + public void receiveMessage() { + while (true) { + + if (m_state.isOpen()) { + m_manager.use(this); + } else { + break; + } + + try { + + // wait for reply + GIOPHeader header = receiveHeader(); + + + // Attend for compressed messages + if (header.getCompressed()){ + ZIOPMessage ziop_message = new ZIOPMessage(header, giopFragmentSize); + + ziop_message.receiveBody(this, m_receive_header_buffer); + + ziop_message.connect_GIOPMessage(this); + continue; + } + + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (message.hasBody()) { + message.receiveBody(this, m_receive_header_buffer); + } + + if (m_orb.m_trace != null){ + m_orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + m_orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + switch (header.getMsgType().m_value) + { + + case MsgType._Request: + manageMessage((GIOPRequestMessage) message); + break; + case MsgType._Reply: + manageMessage((GIOPReplyMessage) message); + break; + case MsgType._CancelRequest: + manageMessage((GIOPCancelRequestMessage) message); + break; + case MsgType._LocateRequest: + manageMessage((GIOPLocateRequestMessage) message); + break; + case MsgType._LocateReply: + manageMessage((GIOPLocateReplyMessage) message); + break; + case MsgType._Fragment: + manageMessage((GIOPFragmentMessage) message); + break; + case MsgType._CloseConnection: + closeByPair(); + return; + case MsgType._MessageError: + closeByError( + new COMM_FAILURE("IIOPConnection closed due to pair " + + "message error.")); + return; + } + + } + catch (org.omg.CORBA.COMM_FAILURE comm) { + closeByError(comm); + return; + } + catch (Throwable excp) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.ERROR, toString(), excp); + + closeByError(new COMM_FAILURE(excp.toString())); + return; + } + } + } + + public void manageMessage(GIOPFragmentMessage message) + { + RequestId id = null; + + if (GIOPVersion.VERSION_1_2.equals(message.getHeader().getVersion())) + id = message.getRequestId(); + else if (m_current_request_id == null) { // unexpected fragment message + closeByError(new COMM_FAILURE("Unexpected fragment message.", 0, + CompletionStatus.COMPLETED_NO)); + return; + } else + id = m_current_request_id; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + toString() + " : GIOP Fragment Message has received." + ); + } + + FragmentedMessageHolder holder = + (FragmentedMessageHolder) m_uncompleted_messages.get(id); + + if (holder == null) { + // discard message + return; + } + + GIOPFragmentedMessage fragmented_message = holder.m_message; + + fragmented_message.addFragment(message); + + if (!message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received. + + m_uncompleted_messages.remove(id); + + switch (fragmented_message.getHeader().getMsgType().m_value) + { + case MsgType._Request: + dispatchRequest((GIOPRequestMessage) fragmented_message); + break; + case MsgType._LocateRequest: + dispatchRequest((GIOPLocateRequestMessage) fragmented_message); + break; + // CLIENT MESSAGES + case MsgType._Reply: + serviceContextReceived( + ((GIOPReplyMessage) + fragmented_message).getServiceContextList()); + case MsgType._LocateReply: + { + m_current_request_id = null; + Lock lock = m_lock_list.get(id); + AMILock ami_lock = m_ami_lock_list.get(id); + if (lock != null) { // the lock has not been discarded + lock.setMessage(fragmented_message); + lock.setCompleted(); + } else if (ami_lock != null) { + ami_lock.setMessage(fragmented_message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + } + } + + public void manageMessage(GIOPReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("Reply has been received by Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) { + return; // discard + } + + if (message.getHeader().hasMoreFragments()) { + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE("Fragment message expeted, " + + "but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + + } + } else { + serviceContextReceived(message.getServiceContextList()); + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPLocateReplyMessage message) + { + if (m_mode == SERVER_MODE) { + closeByError( + new COMM_FAILURE("LocateReply has been received by " + + "Server IIOPConnection")); + return; + } + + Lock lock = m_lock_list.get(message.getRequestId()); + AMILock ami_lock = m_ami_lock_list.get(message.getRequestId()); + + if (lock == null && ami_lock == null) + return; // the lock hast expired, discard the message + + if (message.getHeader().hasMoreFragments()) { + + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateReply can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else { + if (lock != null) { + lock.setMessage(message); + lock.setCompleted(); + } else { //asynchronous invocation + ami_lock.setMessage(message); + m_ami_lock_list.setCompleted(ami_lock.requestId()); + } + } + } + + public void manageMessage(GIOPCancelRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "CancelRequest has been received by Client IIOPConnection")); + return; + } + + m_uncompleted_messages.remove(message.getRequestId()); + } + + public void manageMessage(GIOPLocateRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + closeByError( + new COMM_FAILURE( + "LocateRequest can not be fragmented in GIOP 1.1.", + 0, CompletionStatus.COMPLETED_NO)); + return; + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + protected abstract void dispatchRequest(GIOPLocateRequestMessage message); + + + protected abstract void dispatchRequest(GIOPRequestMessage message); + + + /** + * Try to resolve the url received in a Request ObjectKey + */ + + protected org.omg.CORBA.Object resolveURL(String url) { + try { + // Backward compatibility, ObjectId now expected + + if (url.startsWith("corbaloc:tidorbj:")) { + return m_orb.string_to_object(url); + } else { + + String object_id = null; + + if (url.startsWith("corbaloc:ssliop:")) { + object_id = SSLIOPCorbaloc.getObjectId(url); + } else if ((url.startsWith("corbaloc:iiop:")) + || (url.startsWith("corbaloc::"))) { + object_id = IIOPCorbaloc.getObjectId(url); + } else { + // standard version + object_id = url; + } + + return m_orb.resolve_initial_references(object_id); + } + } + catch (Throwable th) {} + + return null; + } + + public void manageMessage(GIOPRequestMessage message) + { + if (m_mode == CLIENT_MODE) { + if (m_orb.m_trace != null) + closeByError( + new COMM_FAILURE( + "Request has been received by Client IIOPConnection")); + return; + } + + if (message.getHeader().hasMoreFragments()) { + //version 1.1 fragmentation: fragments are received sequentialy + if (GIOPVersion.VERSION_1_1.equals(message.getHeader().getVersion())) { + if (m_current_request_id != null) { // Fragment message was + // expected + closeByError( + new COMM_FAILURE( + "Fragment message expeted, but Reply received.", + 0, + CompletionStatus.COMPLETED_NO)); + return; + } + m_current_request_id = message.getRequestId(); + } + + try { + m_uncompleted_messages.append( + message.getRequestId(), + new FragmentedMessageHolder(message)); + } + catch (FullUseTableException fute) { + //unreachable: holder always can be removed + } + + } else + dispatchRequest(message); + } + + public boolean sendLocateRequest(IIOPIOR ior, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + return sendLocateRequest(ior, AddressingDisposition.KeyAddr, + policy_context); + } + + private boolean sendLocateRequest(IIOPIOR ior, + AddressingDisposition disposition, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + RequestId id = generateId(); + + GIOPLocateRequestMessage message = + new GIOPLocateRequestMessage(profile.getVersion(), + id, + giopFragmentSize ); + + // create the reply lock + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, toString() + + ": sending LocationRequest " + + id.toString()); + + switch (disposition.value()) + { + case AddressingDisposition._KeyAddr: + message.insertAddress(m_manager.orb(), + ior.toObjectKeyAddress()); + break; + case AddressingDisposition._ProfileAddr: + message.insertAddress(m_manager.orb(), + ior.toProfileAddress()); + break; + case AddressingDisposition._ReferenceAddr: + message.insertAddress(m_manager.orb(), + ior.toIORAddress()); + } + + sendMessage(message); + + // block the thread waiting for response + + lock.waitForCompletion(timeout); + + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No LocateReply message", 0, + CompletionStatus.COMPLETED_NO); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._LocateReply) { + throw new MARSHAL("No LocateReply message received", 0, + CompletionStatus.COMPLETED_NO); + } + + GIOPLocateReplyMessage reply_message = + (GIOPLocateReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case LocateReplyStatusType._UNKNOWN_OBJECT: + return false; + case LocateReplyStatusType._OBJECT_HERE: + return true; + case LocateReplyStatusType._OBJECT_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._OBJECT_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case LocateReplyStatusType._LOC_SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case LocateReplyStatusType._LOC_NEEDS_ADDRESSING_MODE: + return sendLocateRequest( + ior, + reply_message.extractAddressingDisposition(), + policy_context); + } + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + return false; + } + + public void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE + { + sendOnewayRequestAsync(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendOnewayRequestAsync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE + { + // verify if the request can be sent + m_state.verifyForRequest(); + + request.setId(generateId()); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + } + + public void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendOnewayRequestSync(request, ior, AddressingDisposition.KeyAddr); + + } + + private void sendOnewayRequestSync(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + // verify if the request can be sent + m_state.verifyForRequest(); + + Lock lock = new Lock(); + + lock.requestId(request.getId()); + m_lock_list.put(lock); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + + } + + GIOPRequestMessage message = + new GIOPRequestMessage(profile.getVersion(), + request.getId(), + giopFragmentSize); + + try { + + message.insertRequest(request, ior, disposition); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + + sendMessage(message); + } + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) + throw new INTERNAL("No Reply message"); + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) + throw new MARSHAL("No LocateReply message received"); + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: // traza + case ReplyStatusType._USER_EXCEPTION: // traza + case ReplyStatusType._SYSTEM_EXCEPTION: // traza + break; // nothing to do, it is a oneway request + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendOnewayRequestSync( + request, + ior, + reply_message.extractAddressingDisposition()); + } + } + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendRequest(request, ior, AddressingDisposition.KeyAddr); + } + + public void sendRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + long timeout = max_response_blocked_time; + CompressorIdLevel compressor = new CompressorIdLevel((short)0, (short)0); + PolicyContext policy_context = null; + + if (qos_enabled) { + policy_context = request.getPolicyContext(); + + timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + if (ior.is_ZIOP() || assume_ziop_server) { + PolicyContext policies_context_ior = ior.policies(); + compressor = ZIOP.getClientCompressor(policy_context, + policies_context_ior, + assume_ziop_server); + } + } + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = + new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + Lock lock = new Lock(); + + lock.requestId(message.getRequestId()); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + setServiceContextList(policy_context, message); + + message.insertRequest(request, ior, disposition); + + try { + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + int low_value = ZIOP.getLowValue(policy_context); + + float min_ratio = ZIOP.getMinRatio(policy_context); + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + } + else { + sendMessage(message); + } + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + // block the thread waiting for response + + + lock.waitForCompletion(timeout); + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + request.setCompletedYes(); + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + reply_message.extractArguments(request); + break; + case ReplyStatusType._USER_EXCEPTION: + request.setUserException( + reply_message.extractUserException( + request.exceptions())); + break; + case ReplyStatusType._SYSTEM_EXCEPTION: + request.setSystemException( + reply_message.extractSystemException()); + break; + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + sendRequest(request, ior, + reply_message.extractAddressingDisposition()); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + public org.omg.CORBA.portable.InputStream + sendRequest(es.tid.TIDorbj.core.iop.IOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + PolicyContext policy_context) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest, + org.omg.CORBA.portable.RemarshalException, + org.omg.CORBA.portable.ApplicationException + { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + // write operation context: o conxtests + stream.write_ulong(0); + + es.tid.TIDorbj.core.cdr.CDRInputStream header_input = + new es.tid.TIDorbj.core.cdr.CDRInputStream(null, + stream.getBuffer()); + + GIOPHeader header = new GIOPHeader(); + + header.read(header_input); + + header_input = null; + + GIOPMessage message = MessageFactory.fromHeader(header); + + if (!(message instanceof GIOPRequestMessage)) + throw new BAD_OPERATION("No Request message in stream"); + + message.setMessageBuffer(stream.getBuffer()); + message.setMessageCompleted(true); + + GIOPRequestMessage request_msg = (GIOPRequestMessage) message; + + ServerRequestImpl srv_request = request_msg.extractRequest(m_orb); + + RequestId id = srv_request.getId(); + + if (!srv_request.withResponse()) { + if (m_orb.m_trace != null) { + String[] msg = { toString(), + ": Sending Oneway Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + sendMessage(message); + + } else { + + Lock lock = new Lock(); + + lock.requestId(id); + + m_lock_list.put(lock); + + if (m_orb.m_trace != null) { + String[] msg = { toString(), ": Sending Stream Request \"", + srv_request.operation() + + " \"" + + id.toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + + } + + try { + sendMessage(message); + + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + // block the thread waiting for response + + + if(timeout > 0) { + lock.waitForCompletion(timeout); + } + + m_lock_list.remove(lock.requestId()); + + if (lock.getCompleted()) { + + GIOPFragmentedMessage fragmented_message = lock.getMessage(); + + if (fragmented_message == null) { + throw new INTERNAL("No Reply message"); + } + + if (fragmented_message.getHeader().getMsgType().m_value + != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = + (GIOPReplyMessage) fragmented_message; + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + return input; + } + case ReplyStatusType._USER_EXCEPTION: + { + CDRInputStream input = reply_message.getDataInput(); + input.fixStarting(); + String excp_id = input.read_string(); + input.rewind(); + throw new ApplicationException( + excp_id, + reply_message.getDataInput()); + } + case ReplyStatusType._SYSTEM_EXCEPTION: + throw reply_message.extractSystemException(); + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + throw new org.omg.CORBA.portable.RemarshalException(); + } + + } else { + + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection closed by pair", 0, CompletionStatus.COMPLETED_MAYBE); + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(0, CompletionStatus.COMPLETED_MAYBE); + } + } + } + + return null; + } + + public void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) //*opc1*, Object ami_handler) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + { + sendAsyncRequest(request, ior, AddressingDisposition.KeyAddr); + } + + private void sendAsyncRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior, //*opc1* Object ami_handler, + AddressingDisposition disposition) + throws RECOVERABLE_COMM_FAILURE, ForwardRequest + + { + PolicyContext policy_context = request.getPolicyContext(); + + long timeout = QoS.checkRequestTime(this.m_orb, policy_context); + + // verify if the request can be sent + m_state.verifyForRequest(); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) { + ver = orb_ver; + } + + GIOPRequestMessage message = new GIOPRequestMessage(ver, request.getId(), giopFragmentSize ); + + ////////////////////// + ////////////////////// + + + AMILock ami_lock = new AMILock(); + ami_lock.requestId(message.getRequestId()); + ami_lock.setHandler(request.get_ami_handler()); + ami_lock.setRequest(request); + ami_lock.setIor(ior); + + m_ami_lock_list.put(ami_lock); + + if (m_orb.m_trace != null) { + String[] msg = { + toString(), + ": Sending Asynchronous Request \"", + request.operation() + + " \"" + + request.getId().toString() }; + + m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + + setServiceContextList(policy_context, message); + + try { + message.insertRequest(request, ior, disposition); + sendMessage(message); + } + catch (COMM_FAILURE comm) { + throw new RECOVERABLE_COMM_FAILURE(comm); + } + + request.setCompletedMaybe(); + + + /* hacerlo dentro de thread k mira tiempo de las peticiones as�ncronas + } else { + switch (m_state.getValue()) + { + case ConnectionState.CLOSING_STATE: + request.setCompletedMaybe(); + throw new RECOVERABLE_COMM_FAILURE( + new COMM_FAILURE("IIOPConnection closed by pair")); + + case ConnectionState.ERROR_STATE: + throw m_state.getError(); + default: + throw new NO_RESPONSE(); + } + }*/ + } + + + public void prepareRequest( StreamRequestImpl request, IIOPIOR ior ) { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + request.setId(generateId()); + + //////////////////////////// + /////////////////////// + + GIOPVersion ver = profile.getVersion(); + GIOPVersion orb_ver = giopVersion; + + if (orb_ver.getMinor() < ver.getMinor()) + ver = orb_ver; + + GIOPRequestMessage message = new GIOPRequestMessage(ver, + request.getId(), + giopFragmentSize); + + message.prepareRequest(request, ior, AddressingDisposition.KeyAddr); + + } + + public void sendReply(ServerRequestImpl request, PolicyContext policy_context) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPReplyMessage message = new GIOPReplyMessage(request.getVersion(), + request.getId(), + giopFragmentSize); + + if (m_send_bidirectional_service) { + message.setServiceContextList(m_bidirectional_service); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + message.insertResultRequest(m_orb, request); + + CompressorIdLevel compressor = request.get_compressor(); + + if (compressor.compressor_id != COMPRESSORID_NONE.value) { + + int low_value = 0; + float min_ratio = 0; + + + if (policy_context != null) { + low_value = ZIOP.getLowValue(policy_context); + min_ratio = ZIOP.getMinRatio(policy_context); + + compressor.compression_level = + ZIOP.getLevelCompressor(compressor.compressor_id, + policy_context); + } + + ZIOPMessage ziop_message = new ZIOPMessage(message, giopFragmentSize); + + if (ziop_message.perform_compression(m_orb, compressor, + low_value, min_ratio)) + sendMessage(ziop_message); + else + sendMessage(message); + + } else { + sendMessage(message); + } + } + + public void sendLocateReply(GIOPVersion version, RequestId id, boolean here) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + if (here) + message.insertObjectHere(m_orb); + else + message.insertUnknownObject(m_orb); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + org.omg.CORBA.Object obj) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize ); + + message.insertForward(m_orb, obj); + + sendMessage(message); + } + + public void sendLocateReply(GIOPVersion version, RequestId id, + SystemException excep) + { + m_requests_in_POA.dec(); + + // verify if the request can be sent + m_state.verifyForReply(); + + GIOPLocateReplyMessage message = + new GIOPLocateReplyMessage(version, id, giopFragmentSize); + + message.insertSystemException(m_orb, excep); + + sendMessage(message); + } + + protected void setServiceContextList(PolicyContext policy_context, + GIOPRequestMessage message) + { + Vector contexts = new Vector(); + + // Invocation Service Context + + InvocationPoliciesContext invocationPolicies = + policy_context.getInvocationPolicyServiceContext(); + + if(invocationPolicies != null) { + contexts.add(invocationPolicies); + } + + // Bidirectional Service context + if (m_send_bidirectional_service) { + + contexts.add(m_bidirectional_service.m_components[0]); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + } + + int num_services = contexts.size(); + if ( num_services > 0) { + + ServiceContextList services = new ServiceContextList(num_services); + + contexts.toArray(services.m_components); + + message.setServiceContextList(services); + } + } + + protected void serviceContextReceived(ServiceContextList services) + { + if (services == null) + return; + + for (int i = 0; i < services.m_components.length; i++) { + if ((services.m_components[i] != null) + && (services.m_components[i].m_context_id + == org.omg.IOP.BI_DIR_IIOP.value)) { + setBidirectionalModeByPeer( + (BiDirServiceContext) services.m_components[i]); + } + } + } + + /** + * RemovableObject interface method + */ + + public boolean canBeRemoved() + { + return !hasPendingRequests(); + } + + public synchronized boolean hasPendingRequests() + { + if (m_mode == CLIENT_MODE) { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0)); + } else { + return ((m_lock_list.size() > 0) + || (m_uncompleted_messages.getSize() > 0) + || (m_requests_in_POA.isNonZero())); + } + } + + public RequestId generateId() + { + return new RequestId(id_count.postInc()); + } + + public void read(byte[] buffer) + { + read(buffer, 0, buffer.length); + } + + public abstract void read(byte[] buffer, int offset, int length); + + protected abstract void write(byte[] buffer); + + protected abstract void write(byte[] buffer, int offset, int length); + + /* + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAMBIAR PARA MANDAR UN MENSAJE CON + * VARIOS CHUNKS + */ + public void writeVersion1_0(BufferCDR buffer) + {/* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * if(num_chunks > 1) throw new MARSHAL("GIOP 1.0 does not allow + * fragmentation"); + * + * ChunkCDR chunk = null; + * + * synchronized(write_mutex) { chunk = buffer.getChunk(0); + * write(chunk.getBuffer(),0,chunk.getAvailable()); } + */ + writeVersion1_1(buffer); // the buffer is only one message + } + + public void writeVersion1_1(BufferCDR buffer) + { + int num_chunks = buffer.getNumAvailableChunks(); + + ChunkCDR chunk = null; + + // Check write Monitor + try { + m_write_monitor.initWrite(); + } + catch (WriteTimeout wt) { // WriteTimeout: close this connection + closeByError(m_write_monitor.getException()); + throw m_write_monitor.getException(); + } + + // write loop + + for (int i = 0; i < num_chunks; i++) { + chunk = buffer.getChunk(i); + write(chunk.getBuffer(), 0, chunk.getAvailable()); + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DUMP, "GIOP message chunk sent - HEXDUMP " + + chunk.getAvailable() + " bytes"); + m_orb.printDump(Trace.DUMP, + chunk.getBuffer(), + chunk.getAvailable()); + } + + } + // free write monitor + + m_write_monitor.endWrite(); + } + + public void writeVersion1_2(BufferCDR buffer) + { + writeVersion1_1(buffer); + /* + * int num_chunks = buffer.getNumAvailableChunks(); + * + * ChunkCDR chunk = null; + * + * for(int i = 0; i < num_chunks; i++) { chunk = buffer.getChunk(i); + * + * synchronized(write_mutex) { + * write(chunk.getBuffer(),0,chunk.getAvailable()); } } + */ + } +} diff --git a/source/es/tid/TIDorbj/core/comm/ForwardRequest.java b/source/es/tid/TIDorbj/core/comm/ForwardRequest.java new file mode 100644 index 0000000..711f22e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ForwardRequest.java @@ -0,0 +1,19 @@ +package es.tid.TIDorbj.core.comm; + +import es.tid.TIDorbj.core.iop.IOR; + +/** + * @author caceres + * + */ + +public class ForwardRequest extends Exception +{ + public IOR forward_reference; + + public ForwardRequest(IOR forward_reference) + { + this.forward_reference = forward_reference; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/LocateResponseHandler.java b/source/es/tid/TIDorbj/core/comm/LocateResponseHandler.java new file mode 100644 index 0000000..5f45b6e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/LocateResponseHandler.java @@ -0,0 +1,64 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +/** + * Base interface used to return the response upon Request arrival. + * In this case, it provides an aditional method to support returning the result + * of the Locate operation. + * + * Actually, a CommunicationLayer implementation must provide an instance of + * type QueuedLocateResponseHandler, which extends this interface. Upon + * refactoring proccess completes, this should be done just implementing this + * one... TODO: Maybe a delegation aproach should work + * + * @author Juan Pablo Rojas + * + */ + +//TODO: maybe these should be called RequestHandlers? +public interface LocateResponseHandler extends ResponseHandler { + + public abstract void submitResponse( boolean value ); + +} diff --git a/source/es/tid/TIDorbj/core/comm/PropertyInfo.java b/source/es/tid/TIDorbj/core/comm/PropertyInfo.java new file mode 100644 index 0000000..daa14cf --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/PropertyInfo.java @@ -0,0 +1,155 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.comm; + +/** + *

CommunicationLayer properties for making a connection. The + * PropertyInfo could be used by automatic code generation ides to + * interact with CommunicationManager and retrieve each registered + * layer's available properties. + * + * @author Juan Pablo Rojas + */ + +public class PropertyInfo { + + /** + * Constructs a CommunicationLayerPropertyInfo object with a name and value; + * other members default to their initial values. + * + * @param name the name of the property + * @param value the current value, which may be null + */ + public PropertyInfo(String name, String value) { + this.name = name; + this.value = value; + } + + /** + * The name of the property. + */ + private String name; + public void setName( String name ){ + this.name = name; + } + public String getName(){ + return this.name; + } + + + /** + * A brief description of the property, which may be null. + */ + private String description = null; + public void setDescription( String description ){ + this.description = description; + } + public String getDescription(){ + return this.description; + } + + /** + * The required field is true if a value must be + * supplied for this property and false otherwise. + */ + private boolean required = false; + public void setRequired( boolean value ){ + this.required = value; + } + public boolean isRequired(){ + return this.required; + } + + /** + * The value field specifies the current value of + * the property, based on a combination of the information + * supplied to the method. + */ + public String value = null; + public void setValue( String value ){ + this.value = value; + } + public String getValue(){ + return this.value; + } + public String getString(){ + return this.value; + } + public int getInt(){ + if ( this.value != null ) { + return Integer.parseInt( this.value ); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + public boolean getBoolean(){ + if ( this.value != null ){ + return Boolean.valueOf( this.value ).booleanValue(); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + public byte[] getBytes(){ + if ( this.value != null ){ + return this.value.getBytes(); + } else { + throw new NullPointerException( this.name + " is null." ); + } + } + + /** + * An array of possible values if the value for the field + * DriverPropertyInfo.value may be selected + * from a particular set of values; otherwise null. + */ + private String[] choices = null; + public void setChoices( String[] choices ){ + this.choices = choices; + } + public String[] getChoices(){ + return this.choices; + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/RequestDispatcher.java b/source/es/tid/TIDorbj/core/comm/RequestDispatcher.java new file mode 100644 index 0000000..32fa8a8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/RequestDispatcher.java @@ -0,0 +1,188 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 67 $ +* Date: $Date: 2007-05-10 12:05:13 +0200 (Thu, 10 May 2007) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.UNKNOWN; +import org.omg.PortableServer.ForwardRequest; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.poa.POAImpl; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.poa.POAManagerImpl; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.poa.QueuedRequest; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.util.Trace; + + +/** + * RequestDispather provides methods to each CommunicationLayer + * implementation to enable Request processing and Response submission, allowing + * disacoupling the implementation from the ORB's request processing implementa- + * tion. + * + * @author Juan Pablo Rojas + * + */ +public class RequestDispatcher { + + /* + * The orb instance + */ + private TIDORB orb; + private POAImpl rootPOA; + private POAManagerImpl rootPOAManager; + private CommunicationManager communicationManager; + + /** + * @param orb + */ + public RequestDispatcher(TIDORB orb ) { + if ( orb != null ){ + this.orb = orb; + this.rootPOA = this.orb.initPOA(); + this.rootPOAManager = ( POAManagerImpl )this.rootPOA.the_POAManager(); + this.communicationManager = CommunicationManager.getInstance( this.orb ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//RequestDispatcher + + + /** + * @param responseHandler + */ + + //TODO: Queued stuff should be only known here... see how to make a + //queue delegate to use from ExecThread + public void dispatchRequest( QueuedLocateResponseHandler locateResponseHandler ) { + if ( locateResponseHandler != null ){ + + setPOAKey(locateResponseHandler); + + if ( this.orb.m_trace != null) { + this.orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + "Dispatching LocateRequest ", + locateResponseHandler.getObjectKey().toString() + } + ); + } + this.rootPOAManager.put( locateResponseHandler ); + } else { + //TODO: ask juan about the exception conventions inside TIDORB + throw new BAD_PARAM( "null response handler" ); + } + }//dispatchRequest + + public void dispatchRequest( QueuedResponseHandler responseHandler ) { + if ( responseHandler != null ){ + + if(setPOAKey(responseHandler)) { + + this.rootPOAManager.put( responseHandler ); + + if ( this.orb.m_trace != null) { + ServerRequest request = responseHandler.getServerRequest(); + this.orb.printTrace( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Dispatching ", + responseHandler.toString() + } + ); + } + } + } else { + throw new BAD_PARAM( "null response handler" ); + } + }//dispatchRequest + + /** + * Search the POAKey to the request + * @param request + * @return true if the key has been set + */ + private boolean setPOAKey(QueuedRequest request) { + + ObjectKey objectKey; + objectKey = request.getObjectKey(); + + POAKey poaKey; + try { + poaKey = orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + request.setPOAKey( poaKey ); + return true; + } catch (ForwardRequest fr) { + request.submitResponse(fr.forward_reference); + } catch (SystemException one) { + if ( this.orb.m_trace != null) { + this.orb.printTrace(Trace.DEEP_DEBUG, + "Submitting a system exception in request", + one); + } + request.submitResponse(one); + } catch ( Throwable th ){ + if ( this.orb.m_trace != null) { + this.orb.printTrace(Trace.DEEP_DEBUG, + "Submitting a CORBA UNKNOWN exception in request"); + } + request.submitResponse(new UNKNOWN()); + } + return false; + } + + public void dispose(){ + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ResponseHandler.java b/source/es/tid/TIDorbj/core/comm/ResponseHandler.java new file mode 100644 index 0000000..e42c37e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ResponseHandler.java @@ -0,0 +1,94 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm; + +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Base interface used to return the response upon Request arrival. + * In this case, it provides methods for accesing the incoming requests field's + * necessary for it's correct execution, and methods to communicate the + * invocation result to the origin. + * + * Actually, a CommunicationLayer implementation must provide an instance of + * type QueuedResponseHandler, which extends this interface. Upon + * refactoring proccess is completed, this should be done just implementing this + * one... TODO: Maybe a delegation aproach should work + * + * @author Juan Pablo Rojas + */ +public interface ResponseHandler { + + + + /* + * Methods included for local request's optimization + */ + public abstract PolicyContext getPolicyContext(); + + /* + * Response origin ( read only -- implementation dependent ) + **/ + public abstract ObjectKey getObjectKey(); + + public abstract ServerRequest getServerRequest(); + + + /* + * Related request invocation result + * */ + + public abstract void submitResponse( Object reference ); + + public abstract void submitResponse( SystemException e ); + + public abstract void submitResponse(); + + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/all-wcprops b/source/es/tid/TIDorbj/core/comm/giop/.svn/all-wcprops new file mode 100644 index 0000000..27e0d13 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/all-wcprops @@ -0,0 +1,143 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop +END +GIOPFragmentedMessage.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.java +END +ReplyStatusType.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.java +END +ServiceContextList.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ServiceContextList.java +END +GIOPMessage.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPMessage.java +END +GIOPVersion.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPVersion.java +END +GIOPLocateRequestMessage.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.java +END +RequestId.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/RequestId.java +END +ServiceContext.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ServiceContext.java +END +InvocationPoliciesContext.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.java +END +GIOPLocateReplyMessage.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.java +END +GIOPHeader.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPHeader.java +END +AddressingDisposition.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.java +END +MessageFactory.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/MessageFactory.java +END +GIOPRequestMessage.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.java +END +ServiceId.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ServiceId.java +END +GIOPReplyMessage.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.java +END +BiDirServiceContext.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.java +END +GIOPCancelRequestMessage.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.java +END +ZIOPMessage.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.java +END +GIOPFragmentMessage.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.java +END +MsgType.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/MsgType.java +END +ServiceContextReader.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.java +END +LocateReplyStatusType.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.java +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/entries b/source/es/tid/TIDorbj/core/comm/giop/.svn/entries new file mode 100644 index 0000000..07bac00 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/entries @@ -0,0 +1,819 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/giop +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + + + +() + +GIOPFragmentedMessage.java +file +478 + + + +2011-04-29T14:42:47.000000Z +4087bcf7ffb550a0d36b7d96a87fe2a8 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +9622 + +ReplyStatusType.java +file + + + + +2009-05-27T12:24:01.000000Z +e00bc6a7d60c6329f5212e02ea2d4639 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4171 + +ServiceContextList.java +file + + + + +2009-05-27T12:24:01.000000Z +afd376e61aaa0fb25ca66b21ee2aee60 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2988 + +GIOPMessage.java +file +478 + + + +2011-04-29T14:42:47.000000Z +9ca3a26f480c2326e58b821a8ae7ee17 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +6781 + +GIOPVersion.java +file + + + + +2009-05-27T12:24:01.000000Z +4f18d9c8d1a6312cbcaeae5423e3a680 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4862 + +GIOPLocateRequestMessage.java +file + + + + +2009-05-27T12:24:01.000000Z +5f870fb1401347a42793a9580d378ae6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4000 + +RequestId.java +file + + + + +2009-05-27T12:24:01.000000Z +502ea9a377ce51e12c1fb6c440ad3518 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2177 + +ServiceContext.java +file + + + + +2009-05-27T12:24:01.000000Z +b6dc6a4ae4ad435e5e29640badd32635 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2811 + +InvocationPoliciesContext.java +file + + + + +2009-05-27T12:24:01.000000Z +28c37301515af69a3880effb5a3bfbda +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2764 + +GIOPLocateReplyMessage.java +file + + + + +2009-05-27T12:24:01.000000Z +424b216abb85494a013991d7d4d59d24 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7134 + +GIOPHeader.java +file + + + + +2009-05-27T14:10:33.000000Z +0ed130725d2526ff7e65a915b256ccb0 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +6539 + +AddressingDisposition.java +file + + + + +2009-05-27T12:24:01.000000Z +516c89eb8e6d9ddb1b1ee66b34492a1f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2752 + +MessageFactory.java +file + + + + +2009-05-27T12:24:01.000000Z +0cd362c290ca3f34555775ed0064bc26 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2683 + +GIOPRequestMessage.java +file + + + + +2010-04-26T12:11:01.000000Z +5f48d4490f218a2c20bf5a3249e06187 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +16931 + +ServiceId.java +file + + + + +2009-05-27T12:24:01.000000Z +36bb9e0e408f89378dcf17a7636ed58d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2239 + +GIOPReplyMessage.java +file +478 + + + +2011-04-29T14:42:47.000000Z +e602561341bcc0ee2e5291b248eff059 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +14493 + +BiDirServiceContext.java +file + + + + +2009-05-27T12:24:01.000000Z +de9117a19a61752581749f30f73379e5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3071 + +GIOPCancelRequestMessage.java +file + + + + +2009-05-27T12:24:01.000000Z +b261fae6f0602d39d9cbb422bbc30b56 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4266 + +ZIOPMessage.java +file +478 + + + +2011-03-25T12:58:50.000000Z +7e1a073b480f9786c3be8cddddf5d3d1 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +15295 + +GIOPFragmentMessage.java +file + + + + +2009-05-27T12:24:01.000000Z +d897e67fb75f46595ddf30ef67f4d9f1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4202 + +MsgType.java +file + + + + +2009-05-27T12:24:01.000000Z +96a77eb5bc40e2d0b551960690b49c86 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4132 + +ServiceContextReader.java +file + + + + +2009-05-27T12:24:01.000000Z +c3af730bf4db5087c7e9d43d6fc93619 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2546 + +LocateReplyStatusType.java +file + + + + +2009-05-27T12:24:01.000000Z +1a8b69e9b3f67fd3c847c42d4efd01d8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5081 + diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/AddressingDisposition.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/AddressingDisposition.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/AddressingDisposition.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/BiDirServiceContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/BiDirServiceContext.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/BiDirServiceContext.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPCancelRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPCancelRequestMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPCancelRequestMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentedMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentedMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPFragmentedMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPHeader.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPHeader.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPHeader.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateReplyMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateReplyMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateReplyMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateRequestMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPLocateRequestMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPReplyMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPReplyMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPReplyMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPRequestMessage.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPRequestMessage.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPVersion.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPVersion.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/GIOPVersion.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/InvocationPoliciesContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/InvocationPoliciesContext.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/InvocationPoliciesContext.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/LocateReplyStatusType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/LocateReplyStatusType.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/LocateReplyStatusType.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MessageFactory.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MessageFactory.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MessageFactory.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MsgType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MsgType.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/MsgType.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ReplyStatusType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ReplyStatusType.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ReplyStatusType.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/RequestId.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/RequestId.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/RequestId.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContext.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContext.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextList.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextReader.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextReader.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceContextReader.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceId.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceId.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ServiceId.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ZIOPMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ZIOPMessage.java.svn-base new file mode 100644 index 0000000..3160658 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/prop-base/ZIOPMessage.java.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mergeinfo +V 0 + +END diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/AddressingDisposition.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/AddressingDisposition.java.svn-base new file mode 100644 index 0000000..ab733c8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/AddressingDisposition.java.svn-base @@ -0,0 +1,97 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * AddressingDisposition structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AddressingDisposition +{ + + public short m_value; + + private AddressingDisposition(short val) + { + m_value = val; + } + + public short value() + { + return m_value; + } + + public static AddressingDisposition from_short(short type) + { + switch (type) + { + case _KeyAddr: + return KeyAddr; + case _ProfileAddr: + return ProfileAddr; + case _ReferenceAddr: + return ReferenceAddr; + default: + return null; + } + } + + public static final short _KeyAddr = 0; + + public static final AddressingDisposition KeyAddr = + new AddressingDisposition(_KeyAddr); + + public static final short _ProfileAddr = 1; + + public static final AddressingDisposition ProfileAddr = + new AddressingDisposition(_ProfileAddr); + + public static final short _ReferenceAddr = 2; + + public static final AddressingDisposition ReferenceAddr = + new AddressingDisposition(_ReferenceAddr); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/BiDirServiceContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/BiDirServiceContext.java.svn-base new file mode 100644 index 0000000..b4d2750 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/BiDirServiceContext.java.svn-base @@ -0,0 +1,104 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import es.tid.TIDorbj.core.comm.iiop.ListenPoint; + +/** + * BiDirServiceContext structure defined in the IIOP module. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class BiDirServiceContext extends ServiceContext +{ + + public ListenPoint[] m_listen_points; + + protected BiDirServiceContext() + { + super(org.omg.IOP.BI_DIR_IIOP.value); + m_listen_points = null; + } + + public BiDirServiceContext(int size) + { + super(org.omg.IOP.BI_DIR_IIOP.value); + this.m_listen_points = new ListenPoint[size]; + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + int size = input.read_ulong(); + if (size < 0) + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + + m_listen_points = new ListenPoint[size]; + for (int i = 0; i < size; i++) { + m_listen_points[i] = ListenPoint.read(input); + } + input.exitEncapsulation(); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + + output.write_ulong(m_context_id); + + output.enterEncapsulation(); + + if (m_listen_points == null) + output.write_ulong(0); + else { + output.write_ulong(m_listen_points.length); + for (int i = 0; i < m_listen_points.length; i++) + ListenPoint.write(output, m_listen_points[i]); + } + + output.exitEncapsulation(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPCancelRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPCancelRequestMessage.java.svn-base new file mode 100644 index 0000000..2fb42bd --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPCancelRequestMessage.java.svn-base @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version CancelRequest messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPCancelRequestMessage extends GIOPMessage +{ + + /** + * Header member. + */ + private RequestId m_request_id; + + /** + * Constructor used for message sending. + */ + + public GIOPCancelRequestMessage(GIOPVersion version, RequestId id) + { + super(new GIOPHeader(version, MsgType.CancelRequest)); + m_request_id = id; + } + + /** + * Constructor used in message reception. First, the message header is + * readed, and then the message object is created. + * + * @param header + * the cancel request header. + */ + + public GIOPCancelRequestMessage(GIOPHeader header) + { + super(header); + } + + public RequestId getRequestId() + { + return m_request_id; + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_buffer) + { + super.receiveBody(conn, header_buffer); + + CDRInputStream id_in = new CDRInputStream(null, m_message_buffer); + id_in.setByteOrder(m_header.getByteOrder()); + m_request_id = new RequestId(id_in.read_ulong()); + try { + id_in.close(); + } + catch (Exception e) {} + id_in = null; + } + + public BufferCDR getMessageBuffer() + { + if (!m_message_completed) { + if (m_header.getVersion() == GIOPVersion.VERSION_1_2) { + m_message_buffer = + new BufferCDR(new byte[GIOPHeader.HEADER_SIZE + + CDR.ULONG_SIZE]); + + // write header + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + m_header.write(out); + //write + out.write_ulong(m_request_id.value()); + + try { + out.close(); + } + catch (Exception e) {} + + out = null; + m_message_completed = true; + m_headers_marshaled = true; + } else { + super.writeHeaders(); + m_message_completed = true; + } + } + + return m_message_buffer; + } + + public boolean hasBody() + { + return m_header.getVersion() == GIOPVersion.VERSION_1_2; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentMessage.java.svn-base new file mode 100644 index 0000000..2b2cfea --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentMessage.java.svn-base @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; + +/** + * Represents the 1.1 and 1.2 GIOP FragmentRequest version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPFragmentMessage extends GIOPMessage +{ + + public static int FRAGMENT_HEADER_SIZE_1_1 = GIOPHeader.HEADER_SIZE; + + public static int FRAGMENT_HEADER_SIZE_1_2 = GIOPHeader.HEADER_SIZE + + CDR.ULONG_SIZE; + + private RequestId m_request_id; + + public GIOPFragmentMessage(GIOPVersion version, RequestId id) + { + super(new GIOPHeader(version, MsgType.Fragment)); + m_request_id = id; + } + + public GIOPFragmentMessage(GIOPHeader header) + { + super(header); + } + + public String toString() + { + return m_header.toString() + " (ID: " + m_request_id + ")"; + } + + public RequestId getRequestId() + { + return m_request_id; + } + + public boolean hasBody() + { + return true; + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + if (m_header.getVersion().minor == 2) { + CDRInputStream id_in = new CDRInputStream(null, m_message_buffer); + id_in.setByteOrder(m_header.getByteOrder()); + id_in.skip(GIOPHeader.HEADER_SIZE); + m_request_id = new RequestId(id_in.read_ulong()); + id_in = null; + } + } + + public static void writeHeader(es.tid.TIDorbj.core.cdr.CDROutputStream out, + GIOPHeader header, RequestId request_id) + { + header.write(out); + + if (header.getVersion().minor == 2) { + out.write_ulong(request_id.value()); + out.alignment(CDR.LONGLONG_SIZE); // force alingment to 8 + } + } + + public void send(IIOPConnection conn) + { + throw new INTERNAL("Fragment message can not be send as itself"); + } + + public static void skipFragmentHeader1_2(CDRInputStream in) + { + //skip request_id (ulong) + in.skipUlong(); + // force alingment to 8 + // in.alignment(CDR.LONGLONG_SIZE); + + } + + public static void skipFragmentHeader1_2(CDROutputStream out) + { + //skip request_id (ulong) + out.skip(CDR.LONG_SIZE); + // force alingment to 8 + // out.alignment(CDR.LONGLONG_SIZE); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentedMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentedMessage.java.svn-base new file mode 100644 index 0000000..5a15330 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPFragmentedMessage.java.svn-base @@ -0,0 +1,326 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Base class for fragmented messages in 1.1 and 1.2 GIOP versions. + * + * @see es.tid.TIDorbj.core.comm.iiop.GIOPMessage + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class GIOPFragmentedMessage extends GIOPMessage +{ + + /** + * the request id, it can be needed by 1.1 and 1.2 GIOP version messages. + */ + protected RequestId m_request_id; + + /** + * InputStream where the message body is marshaled. It manages the body + * buffer, defined in the GIOPMessage class. + */ + protected CDRInputStream m_message_buffer_in; + + /** + * OutputStream where the message message_buffer can be marshaled. It + * manages the message_buffer buffer, defined in the + * GIOPMessage class. + */ + protected CDROutputStream m_message_buffer_out; + + private int fragmentSize; + + /** + * Creates a new fragmented message for GIOP 1.0 and 1.1 + */ + protected GIOPFragmentedMessage(GIOPHeader header) + { + super(header); + m_request_id = null; + } + + /** + * Creates a new fragmented message for GIOP 1.2 + */ + protected GIOPFragmentedMessage(GIOPHeader header, RequestId request_id, int fragmentSize ) + { + super(header); + this.m_request_id = request_id; + this.fragmentSize = fragmentSize; + } + + public String toString() + { + return m_header.toString() + " (" + m_request_id + ")"; + } + + public RequestId getRequestId() + { + return m_request_id; + } + + /** + * Initialize the message_buffer_out member. + * + * @param orb + * needed for internal CDR stream creation. + */ + + protected void createMessageBufferOutput(es.tid.TIDorbj.core.TIDORB orb) + { + if (m_message_buffer == null) + m_message_buffer = new BufferCDR( this.fragmentSize ); + else + m_message_buffer.recycle(); + + m_message_buffer_out = new CDROutputStream(orb, m_message_buffer); + + m_message_buffer_out.setVersion(m_header.getVersion()); + + m_message_buffer_out.setMessage(true); + + // set message skips also the GIOP HEADER + // message_buffer_out.skip(GIOPHeader.HEADER_SIZE); + + // writes the request id + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_message_buffer_out.write_ulong(m_request_id.value()); + } + } + + /** + * Initialize the message_buffer_out member. + * + * @param orb + * needed for internal CDR stream creation. + */ + + protected void createMessageBufferInput(es.tid.TIDorbj.core.TIDORB orb) + { + if (m_message_buffer_in != null) + return; + + if (m_message_buffer == null) + throw new INTERNAL("Cannot create buffer input"); + + m_message_buffer_in = new CDRInputStream(orb, m_message_buffer); + + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + + m_message_buffer_in.setMessage(true); + + // set message skips also the GIOP HEADER + // message_buffer_in.skip(GIOPHeader.HEADER_SIZE); + + // lectura adelantada del request_id para comprobar despues los + // fragmentos + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + } + + /** + * Reads the message message_buffer in the connection. The header has yet + * been read by the connection. + * + * @param conn + * the active IIOP connection. + */ + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(Connection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + this.createMessageBufferInput(conn.orb()); + + m_message_completed = !m_header.hasMoreFragments(); + } + + + + public void setBody(BufferCDR buf, CDRInputStream input) + { + super.setBody(buf); + + m_message_buffer_in = input; + + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + + m_message_buffer_in.setMessage(true); + + + // lectura adelantada del request_id para comprobar despues los + // fragmentos + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + m_message_completed = !m_header.hasMoreFragments(); + } + + + /** + * Complete writing of the message in the connection. + */ + + public void writeHeaders() + { + + if (!m_headers_marshaled) { + CDROutputStream out = new CDROutputStream(null, m_message_buffer); + + out.setVersion(m_header.getVersion()); + + // write message size = buffer size - 12 octets from header + + m_header.setSize(m_message_buffer.getAvailable() + - GIOPHeader.HEADER_SIZE); + + m_header.setMoreFragments(false); + + m_header.write(out); + + out = null; + m_headers_marshaled = true; + } + } + + /* + * public void write_headers() { if (message_buffer == null) throw new + * INTERNAL("Cannot write message headers"); + * + * switch(header.getVersion().getMinor()) { case 0: write_headers_1_0(); + * break; default: write_headers_1_1(); } } + * + * public void write_headers_1_0() { + * + * if (!headers_marshaled) { CDROutputStream out = new CDROutputStream(null, + * message_buffer); + * + * out.set_version(header.getVersion()); // write message size = buffer size - + * 12 octets from header + * + * header.setSize(message_buffer.getChunk(0).getAvailable() - + * GIOPHeader.HEADER_SIZE); + * + * header.setMoreFragments(false); + * + * header.write(out); + * + * out = null; headers_marshaled = true; } } + * + * public void write_headers_1_1() { + * + * if (!headers_marshaled) { CDROutputStream out = new CDROutputStream(null, + * message_buffer); + * + * out.set_version(header.getVersion()); // write message size = buffer size - + * 12 octets from header + * + * header.setSize(message_buffer.getChunk(0).getAvailable() - + * GIOPHeader.HEADER_SIZE); // write chunks as fragments + * + * int num_chunks = message_buffer.getNumAvailableChunks(); + * + * boolean has_more_fragments = num_chunks > 1; + * + * header.setMoreFragments(has_more_fragments); + * + * header.write(out); + * + * if(has_more_fragments) { + * + * out.set_message(true); + * + * GIOPHeader fragment_header = new GIOPHeader(header.getVersion(), + * MsgType.Fragment); + * + * fragment_header.setByteOrder(header.getByteOrder()); + * + * for(int i = 1; i < num_chunks; i++) { out.getNextFragmentHeader(); + * fragment_header.setMoreFragments(i < num_chunks - 1); + * fragment_header.setSize( message_buffer.getChunk(i).getAvailable() - + * GIOPHeader.HEADER_SIZE); + * + * GIOPFragmentMessage.write_header(out,fragment_header,request_id); } } + * + * out = null; headers_marshaled = true; } } + */ + + /** + * Adds the next fragment to the Message. + */ + public void addFragment(GIOPFragmentMessage fragment) + { + if (m_message_completed) + throw new org.omg.CORBA.MARSHAL("Unexpected Fragment"); + + if (m_message_buffer == null) + throw new org.omg.CORBA.INTERNAL("Unexpected Fragment"); + + if (m_message_buffer != null) + m_message_buffer.addChunk(fragment.getMessageBuffer().getChunk(0)); + + m_message_completed = !fragment.getHeader().hasMoreFragments(); + + } +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPHeader.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPHeader.java.svn-base new file mode 100644 index 0000000..b7d7b71 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPHeader.java.svn-base @@ -0,0 +1,246 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version message headers. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPHeader +{ + + GIOPVersion m_version; + + boolean m_byte_order; + + boolean m_more_fragments; + + MsgType m_message_type; + + int message_size; + + String m_str = null; + + boolean m_compressed; + + public final static int HEADER_SIZE = 12; + + public GIOPHeader() + {} + + public GIOPHeader(GIOPVersion ver, MsgType type) + { + m_version = ver; + m_byte_order = CDR.LOCAL_BYTE_ORDER; + m_more_fragments = false; + m_message_type = type; + message_size = 0; + m_compressed = false; + } + + public static GIOPHeader fromByteArray(byte[] array) + throws org.omg.CORBA.MARSHAL + { + GIOPHeader header = new GIOPHeader(); + if (array.length < HEADER_SIZE) + return null; + CDRInputStream input = new CDRInputStream(null, array); + header.read(input); + input = null; + return header; + } + + public GIOPVersion getVersion() + { + return m_version; + } + + public MsgType getMsgType() + { + return m_message_type; + } + + public void setByteOrder(boolean order) + { + m_byte_order = order; + } + + public boolean getByteOrder() + { + return m_byte_order; + } + + public void setMoreFragments(boolean more) + { + m_more_fragments = more; + } + + public boolean hasMoreFragments() + { + if (m_version.minor == 0) + return false; + else + return m_more_fragments; + } + + public void setSize(int size) + { + message_size = size; + } + + public int getSize() + { + return message_size; + } + + public void setCompressed(boolean compressed) + { + m_compressed = compressed; + } + + public boolean getCompressed() + { + return m_compressed; + } + + public void toByteArray(byte[] header_buffer) + { + CDROutputStream output = new CDROutputStream(null, header_buffer); + write(output); + output = null; + } + + public void write(org.omg.CORBA.portable.OutputStream output) + { + if (m_compressed) + output.write_octet((byte) 'Z'); + else + output.write_octet((byte) 'G'); + output.write_octet((byte) 'I'); + output.write_octet((byte) 'O'); + output.write_octet((byte) 'P'); + + output.write_octet((byte) m_version.major); + output.write_octet((byte) m_version.minor); + + if (m_version.minor == 0) + output.write_boolean(m_byte_order); + else { + int flag = 0; + if (m_byte_order) + flag |= 0x1; + if (m_more_fragments) + flag |= 0x2; + output.write_octet((byte) flag); + } + + output.write_octet((byte) m_message_type.m_value); + output.write_ulong(message_size); + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + byte first_magic_char = input.read_octet(); + + if ( ( (first_magic_char != (byte) 'G') && (first_magic_char != (byte) 'Z')) + || (input.read_octet() != (byte) 'I') + || (input.read_octet() != (byte) 'O') + || (input.read_octet() != (byte) 'P')) + + throw new + MARSHAL("Bad GIOP Message header: Invalid header identifier.", + 0, CompletionStatus.COMPLETED_NO); + + m_compressed = (first_magic_char == 'Z'); + + m_version = GIOPVersion.read(input); + + if (m_version == null) + throw new + MARSHAL("Bad GIOP Message header: Invalid version number.", + 0, CompletionStatus.COMPLETED_NO); + + byte flag = input.read_octet(); + + if (m_version.minor == 0) + m_byte_order = (flag != 0); + else { + m_byte_order = ((flag & 0x1) != 0); + m_more_fragments = ((flag & 0x2) != 0); + } + + input.setByteOrder(m_byte_order); + m_message_type = MsgType.from_int(input.read_octet()); + + if (m_message_type == null) + throw new MARSHAL("Bad GIOP Message header: Invalid message type.", + 0, CompletionStatus.COMPLETED_NO); + + message_size = input.read_ulong(); + + } + + public String toString() + { + if (m_str == null) + m_str = MsgType.msgName(m_message_type.m_value) + " (" + + m_version.toString() + ") " + + ((m_more_fragments) ? "[FRAGMENTED] " : "") + + ((m_byte_order) ? "[LITTLE_ENDIAN] " : "[BIG_ENDIAN] ") + + "[SIZE: " + message_size + "]"; + + return m_str; + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateReplyMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateReplyMessage.java.svn-base new file mode 100644 index 0000000..49953eb --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateReplyMessage.java.svn-base @@ -0,0 +1,245 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.exception.SystemExceptionEncoder; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP LocateReply version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPLocateReplyMessage extends GIOPFragmentedMessage +{ + + LocateReplyStatusType m_reply_status; + + public GIOPLocateReplyMessage(GIOPHeader header) + { + super(header); + m_reply_status = null; + } + + public GIOPLocateReplyMessage(GIOPVersion version, RequestId id, int fragmentSize) + { + super(new GIOPHeader(version, MsgType.LocateReply), id, fragmentSize ); + m_reply_status = null; + } + + public String toString() + { + return super.toString() + " (" + m_reply_status.toString() + ")"; + } + + private void reset() + { + m_reply_status = null; + m_message_completed = false; + m_headers_marshaled = false; + } + + public LocateReplyStatusType replyStatus() + { + return m_reply_status; + } + + public void insertUnknownObject(TIDORB orb) + { + reset(); + m_reply_status = LocateReplyStatusType.UNKNOWN_OBJECT; + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public void insertObjectHere(TIDORB orb) + { + reset(); + m_reply_status = LocateReplyStatusType.OBJECT_HERE; + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public void insertSystemException(TIDORB orb, + org.omg.CORBA.SystemException exception) + { + reset(); + m_reply_status = LocateReplyStatusType.LOC_SYSTEM_EXCEPTION; + SystemExceptionEncoder.write(m_message_buffer_out, exception); + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public org.omg.CORBA.SystemException extractSystemException() + { + if (m_reply_status.value() + != LocateReplyStatusType._LOC_SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, " + + "SYSTEM_EXCEPTION is not the reply status"); + + return SystemExceptionEncoder.read(m_message_buffer_in); + } + + public void insertForward(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + + m_reply_status = LocateReplyStatusType.OBJECT_FORWARD; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForward() + { + if (m_reply_status.value() != LocateReplyStatusType._OBJECT_FORWARD) + throw new INTERNAL("Unexpected extract_arguments, " + + "OBJECT_FORWARD is not the reply status"); + + IOR forward_ior = new DefaultIOR(); + forward_ior.read(m_message_buffer_in); + return forward_ior; + } + + public void insertForwardPerm(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + m_reply_status = LocateReplyStatusType.OBJECT_FORWARD_PERM; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + + } + + public IOR extractForwardPerm() + { + if (m_reply_status.value() + != LocateReplyStatusType._OBJECT_FORWARD_PERM) + throw new INTERNAL("Unexpected extract_arguments, " + + "OBJECT_FORWARD_PERM is not the reply status"); + + IOR forward_ior = new DefaultIOR(); + forward_ior.read(m_message_buffer_in); + return forward_ior; + } + + public void insertNeedsAddressingMode(TIDORB orb, + AddressingDisposition disposition) + { + reset(); + + m_reply_status = LocateReplyStatusType.LOC_NEEDS_ADDRESSING_MODE; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_ushort(disposition.value()); + + m_message_completed = true; + } + + public AddressingDisposition extractAddressingDisposition() + { + return m_reply_status.extractAddressingDisposition(this); + } + + public void createMessageBufferOutput(es.tid.TIDorbj.core.TIDORB orb) + { + + if (m_reply_status == null) + throw new INTERNAL("Unitialized request"); + + super.createMessageBufferOutput(orb); + + // header + // request_id marshaled with father create_message_buffer_output() in + // version 1.2 + + if (!m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_message_buffer_out.write_ulong(m_request_id.value()); + } + + // status + m_message_buffer_out.write_ulong(m_reply_status.m_value); + + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + // request_id has been readen in father's method in version 1.2 + if (!m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + // reply_status + + m_reply_status = + LocateReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid LocateReplyStatus value."); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateRequestMessage.java.svn-base new file mode 100644 index 0000000..42f9983 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPLocateRequestMessage.java.svn-base @@ -0,0 +1,127 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP LocateRequest version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPLocateRequestMessage extends GIOPFragmentedMessage +{ + + public GIOPLocateRequestMessage(GIOPHeader header) + { + super(header); + } + + public GIOPLocateRequestMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.LocateRequest), id, fragmentSize ); + } + + public TargetAddress extractAddress() + { + if (!m_message_completed) + throw new INTERNAL("Uncompleted message."); + + TargetAddress target = new TargetAddress(); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + // request_id has been readed by father's receive_body + + target.read(m_message_buffer_in); + } else { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + ObjectKey key = new ObjectKey(); + key.read(m_message_buffer_in); + target.setObjectKey(key); + } + return target; + } + + public void insertAddress(es.tid.TIDorbj.core.TIDORB orb, ObjectKey key) + { + createMessageBufferOutput(orb); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + TargetAddress target = new TargetAddress(); + target.setObjectKey(key); + target.write(m_message_buffer_out); + } else { + m_message_buffer_out.write_ulong(m_request_id.value()); + key.write(m_message_buffer_out); + } + + m_message_completed = true; + } + + public void insertAddress(es.tid.TIDorbj.core.TIDORB orb, + TargetAddress target) + { + createMessageBufferOutput(orb); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + // request_id marshaled in create_message_buffer_output() + target.write(m_message_buffer_out); + } else { + m_message_buffer_out.write_ulong(m_request_id.value()); + ObjectKey key = target.getObjectKey(); + + if (key == null) + throw new INTERNAL("Invalid Object Key"); + + key.write(m_message_buffer_out); + } + + m_message_completed = true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPMessage.java.svn-base new file mode 100644 index 0000000..4ff302e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPMessage.java.svn-base @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.Compression.CompressorIdLevel; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version messages used in a IIOP + * connection. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPMessage +{ + + /** + * Message Header + */ + GIOPHeader m_header; + + /** + * Message Buffer, including the message headers. + */ + BufferCDR m_message_buffer; + + /** + * Indicates if the message is ready to be send. + */ + boolean m_message_completed; + + boolean m_headers_marshaled; + + CompressorIdLevel m_compressor; + + protected GIOPMessage(GIOPHeader header) + { + m_header = header; + m_message_buffer = null; + m_headers_marshaled = false; + + switch (header.getMsgType().m_value) + { + case MsgType._MessageError: + case MsgType._CloseConnection: + m_message_completed = true; + break; + default: + m_message_completed = false; + } + m_compressor = new CompressorIdLevel((short)0, (short)0); + } + + public String toString() + { + return m_header.toString(); + } + + public GIOPHeader getHeader() + { + return m_header; + } + + /** + * @return the message buffer including the message headers + */ + + public BufferCDR getMessageBuffer() + { + if (!m_message_completed) + return null; + + if (!m_headers_marshaled) + writeHeaders(); + + return m_message_buffer; + } + + /** + * Sets the message_buffer where the message will be marshalled. + */ + public void setMessageBuffer(BufferCDR cdr) + { + m_message_buffer = cdr; + } + + public void setMessageCompleted(boolean value) + { + m_message_completed = value; + } + + public boolean hasBody() + { + switch (m_header.getMsgType().m_value) + { + case MsgType._MessageError: + return false; + case MsgType._CloseConnection: + return false; + default: + return true; + } + } + + //TODO: giop should not know anything about IIOPConnections!! + public static ChunkCDR receiveChunk(Connection conn, GIOPHeader header, + byte[] header_bytes) + { + // the buffer has also the header + + int body_size = header.getSize(); + + byte[] buffer = new byte[body_size + GIOPHeader.HEADER_SIZE]; + + // copy the header + + System.arraycopy(header_bytes, 0, buffer, 0, GIOPHeader.HEADER_SIZE); + + conn.read(buffer, GIOPHeader.HEADER_SIZE, body_size); + + return new ChunkCDR(buffer); + + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(Connection conn, byte[] header_bytes) + { + m_message_buffer = + new BufferCDR(receiveChunk(conn, m_header, header_bytes)); + + m_message_completed = true; + m_headers_marshaled = true; + } + + + public void setBody(BufferCDR buf) + { + m_message_buffer = buf; + m_message_completed = true; + m_headers_marshaled = true; + } + + /** + * Writes the header into the Message Chunks + */ + protected void writeHeaders() + { + if (hasBody()) { + if (!m_message_completed) + throw new INTERNAL("Uncompleted Message: no body"); + + if (!m_headers_marshaled) { + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + + out.setVersion(m_header.getVersion()); + + // write message size = buffer size - 12 octets from header + + m_header.setSize(m_message_buffer.getAvailable() + - GIOPHeader.HEADER_SIZE); + + m_header.write(out); + + out = null; + + m_headers_marshaled = true; + } + + } else { + if (!m_headers_marshaled) //header message + { + m_message_buffer = + new BufferCDR(new byte[GIOPHeader.HEADER_SIZE]); + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + m_header.write(out); + out = null; + m_headers_marshaled = true; + + } + } + } + + /** + * Sends the message + */ + public void send(Connection conn) + { + + GIOPVersion header_version = m_header.getVersion(); + + if (header_version == GIOPVersion.VERSION_1_2) + conn.writeVersion1_2(getMessageBuffer()); + else if (header_version == GIOPVersion.VERSION_1_1) + conn.writeVersion1_1(getMessageBuffer()); + else + conn.writeVersion1_0(getMessageBuffer()); + } + + public CompressorIdLevel get_compressor() + { + return m_compressor; + } + + public void set_compressor(CompressorIdLevel compressor) + { + m_compressor = compressor; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPReplyMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPReplyMessage.java.svn-base new file mode 100644 index 0000000..27578c4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPReplyMessage.java.svn-base @@ -0,0 +1,511 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ExceptionList; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.Messaging._ExceptionHolder; + +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.exception.SystemExceptionEncoder; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP Reply version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPReplyMessage extends GIOPFragmentedMessage +{ + + ReplyStatusType m_reply_status; + + ServiceContextList m_service_context_list; + + public GIOPReplyMessage(GIOPVersion version) + { + super(new GIOPHeader(version, MsgType.Reply)); + m_reply_status = null; + } + + public GIOPReplyMessage(GIOPHeader header) + { + super(header); + m_reply_status = null; + m_service_context_list = null; + } + + public GIOPReplyMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.Reply), id, fragmentSize ); + m_reply_status = null; + m_service_context_list = null; + } + + public String toString() + { + if (m_reply_status == null) + return super.toString() + " ( no reply status defined! )"; + else + return super.toString() + " (" + m_reply_status.toString() + ")"; + } + + private void reset() + { + m_reply_status = null; + m_message_completed = false; + m_headers_marshaled = false; + m_service_context_list = null; + } + + public ReplyStatusType replyStatus() + { + return m_reply_status; + } + + public void setServiceContextList(ServiceContextList list) + { + m_service_context_list = list; + } + + public ServiceContextList getServiceContextList() + { + return m_service_context_list; + } + + public void insertResultRequest(TIDORB orb, ServerRequestImpl request) + { + switch (request.getReturnState()) + { + case ServerRequestImpl.NO_EXCEPTION: + insertArguments(orb, request); + return; + case ServerRequestImpl.USER_EXCEPTION: + insertUserException(orb, request.getException()); + return; + case ServerRequestImpl.SYSTEM_EXCEPTION: + insertSystemException(orb, request.getSystemException()); + return; + case ServerRequestImpl.LOCATION_FORWARD: + insertForward(orb, request.getForward()); + return; + } + } + + protected void insertArguments(TIDORB orb, ServerRequestImpl request) + { + reset(); + m_request_id = request.getId(); + m_reply_status = ReplyStatusType.NO_EXCEPTION; + + createMessageBufferOutput(orb); + + Any result = request.getResult(); + + if (result != null) + result.write_value(m_message_buffer_out); + NVList list = request.getParameters(); + + if (list != null) + NVListImpl.writeOutParams(list, m_message_buffer_out); + + m_message_completed = true; + } + + public void extractArguments(RequestImpl request) + { + if (m_reply_status.value() != ReplyStatusType._NO_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, NO_EXCEPTION " + +"is not the reply status"); + + request.readResult(m_message_buffer_in); + + NVList list = request.arguments(); + + if (list != null) + NVListImpl.readOutParams(list, m_message_buffer_in); + } + + protected void insertUserException(TIDORB orb, Any exception) + { + reset(); + m_reply_status = ReplyStatusType.USER_EXCEPTION; + + createMessageBufferOutput(orb); + + exception.write_value(m_message_buffer_out); + + m_message_completed = true; + } + + public Any extractUserException(ExceptionList list) + { + if (m_reply_status.value() != ReplyStatusType._USER_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, USER_EXCEPTION " + +"is not the reply status"); + + // lectura adelantada del repository_id de la excepcion + + m_message_buffer_in.fixStarting(); + + String name = m_message_buffer_in.read_string(); + + m_message_buffer_in.rewind(); + + // busqueda del typecode y lectura de sus componentes + + if (list != null) { + + int count = list.count(); + + try { + for (int i = 0; i < count; i++) { + if (name.equals(list.item(i).id())) { + Any any = m_message_buffer_in.orb().create_any(); + any.read_value(m_message_buffer_in, list.item(i)); + return any; + } + } + } + catch (org.omg.CORBA.Bounds bds) {} + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + } + + throw new org.omg.CORBA.UNKNOWN("Unkown user exception"); + + } + + protected void + insertSystemException(TIDORB orb, + org.omg.CORBA.SystemException exception) + { + reset(); + m_reply_status = ReplyStatusType.SYSTEM_EXCEPTION; + + createMessageBufferOutput(orb); + + SystemExceptionEncoder.write(m_message_buffer_out, exception); + + m_message_completed = true; + } + + public org.omg.CORBA.SystemException extractSystemException() + { + if (m_reply_status.value() != ReplyStatusType._SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, SYSTEM_EXCEPTION " + +"is not the reply status"); + + return SystemExceptionEncoder.read(m_message_buffer_in); + } + + public void insertForward(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + + m_reply_status = ReplyStatusType.LOCATION_FORWARD; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForward() + { + if (m_reply_status.value() != ReplyStatusType._LOCATION_FORWARD) + throw new INTERNAL("Unexpected extract_arguments, LOCAL_FORWARD " + + "is not the reply status"); + + IOR ior = new DefaultIOR(); + ior.read(m_message_buffer_in); + return ior; + } + + public void inserForwardPerm(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + m_reply_status = ReplyStatusType.LOCATION_FORWARD_PERM; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForwardPerm() + { + if (m_reply_status.value() != ReplyStatusType._LOCATION_FORWARD_PERM) + throw new + INTERNAL("Unexpected extract_arguments, LOCAL_FORWARD_PERM " + + "is not the reply status"); + + IOR ior = new DefaultIOR(); + ior.read(m_message_buffer_in); + return ior; + } + + public void insertNeedsAddressingMode(TIDORB orb, + AddressingDisposition disposition) + { + reset(); + + m_reply_status = ReplyStatusType.NEEDS_ADDRESSING_MODE; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_ushort(disposition.value()); + + m_message_completed = true; + } + + public es.tid.TIDorbj.core.cdr.CDRInputStream getDataInput() + { + return m_message_buffer_in.copy(); + } + + public AddressingDisposition extractAddressingDisposition() + { + if (m_reply_status.value() != ReplyStatusType._NEEDS_ADDRESSING_MODE) + throw new + INTERNAL("Unexpected extract_arguments, NEEDS_ADDRESSING_MODE" + + "is not the reply status"); + + short value = m_message_buffer_in.read_ushort(); + + AddressingDisposition disposition = + AddressingDisposition.from_short(value); + + if (disposition == null) + throw new MARSHAL("Invalid AddressingDisposition value."); + + return disposition; + } + + public void createMessageBufferOutput(TIDORB orb) + { + super.createMessageBufferOutput(orb); + + switch (m_header.getVersion().getMinor()) + { + case 0: + case 1: + marshalReplyHeader1_1(); + break; + case 2: + marshalReplyHeader1_2(); + break; + } + } + + /** + * Marshals the reply header in GIOP 1.1 and 1.0 version. + */ + + protected void marshalReplyHeader1_1() + { + // Service Context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // reply_status + + m_message_buffer_out.write_ulong(m_reply_status.value()); + + } + + /** + * Marshals the reply header in GIOP 1.2 version. + */ + + protected void marshalReplyHeader1_2() + { + + // request_id marshaled with father create_body() + + // message_buffer_out.write_ulong(request_id); + + // reply_status + + m_message_buffer_out.write_ulong(m_reply_status.value()); + + // Service Context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // aligment to 8 in version 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + } + + public void receiveBody(Connection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + switch (m_header.getVersion().getMinor()) + { + case 0: + case 1: + unmarshalReplyHeader1_1(); + break; + case 2: + unmarshalReplyHeader1_2(); + break; + } + + m_message_buffer_in.fixStarting(); + + } + + /** + * Marshals the reply header in GIOP 1.1 version. + */ + + protected void unmarshalReplyHeader1_1() + { + // Service Context + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // reply_status + + m_reply_status = + ReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid ReplyStatus value."); + if (m_reply_status.value() > ReplyStatusType._LOCATION_FORWARD) + throw new MARSHAL("GIOPVersion 1.0 or 1.1: Invalid ReplyStatus value."); + + } + + /** + * Marshals the reply header in GIOP 1.2 version. + */ + + protected void unmarshalReplyHeader1_2() + { + // request_id unmarshaled in father's receive_body() + + // request_id = new RequestId(message_buffer_in.read_ulong()); + + // reply_status + + m_reply_status = + ReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid ReplyStatus value."); + + // Service Context + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // VERSION 1.2 aligment to 8 + try { + m_message_buffer_in.goNextAlignedPosition(CDR.LONGLONG_SIZE); + } + catch (org.omg.CORBA.MARSHAL M) { + + } + + } + + // AMI operations + + public void extractArgumentsForReplyHandler(RequestImpl request) + { + if (m_reply_status.value() != ReplyStatusType._NO_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, NO_EXCEPTION " + +"is not the reply status"); + + request.readResult(m_message_buffer_in); + + NVList list = request.arguments(); + + if (list != null) + NVListImpl.readInParams(list, m_message_buffer_in); + } + + public void extractUserException(es.tid.TIDorbj.core.messaging._ExceptionHolderImpl excepHolder) + { + if (m_reply_status.value() != ReplyStatusType._USER_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, USER_EXCEPTION " + +"is not the reply status"); + + excepHolder.read(m_message_buffer_in); + + } + + public void extractSystemException(_ExceptionHolder excepHolder) + { + if (m_reply_status.value() != ReplyStatusType._SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, SYSTEM_EXCEPTION " + +"is not the reply status"); + + excepHolder._read(m_message_buffer_in); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPRequestMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPRequestMessage.java.svn-base new file mode 100644 index 0000000..f6a2499 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPRequestMessage.java.svn-base @@ -0,0 +1,607 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.IOP.INVOCATION_POLICIES; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP Request version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPRequestMessage extends GIOPFragmentedMessage +{ + + ServiceContextList m_service_context_list; + + public GIOPRequestMessage(GIOPHeader header) + { + super(header); + m_service_context_list = null; + } + + public GIOPRequestMessage(GIOPVersion ver) + { + super(new GIOPHeader(ver, MsgType.Request)); + m_service_context_list = null; + } + + public GIOPRequestMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.Request), id, fragmentSize ); + m_service_context_list = null; + } + + public void setServiceContextList(ServiceContextList list) + { + m_service_context_list = list; + } + + public ServiceContextList getServiceContextList() + { + return m_service_context_list; + } + + public ServerRequestImpl extractRequest(es.tid.TIDorbj.core.TIDORB orb) + { + if (!m_message_completed) + throw new INTERNAL("Uncompleted message: no message_buffer."); + + this.createMessageBufferInput(orb); + + ServerRequestImpl request = null; + switch (m_header.getVersion().getMinor()) + { + case 0: + return extractRequest1_0(); + case 1: + return extractRequest1_1(); + case 2: + return extractRequest1_2(); + default: + return null; + } + + } + + /** + * Get the Request Invocation policies sended by the Client. See QoS. + * @return + */ + public PolicyContext getRequestInvocationPolicies() + { + if(this.m_service_context_list != null) { + for(int i = 0; i < this.m_service_context_list.m_components.length; i++) { + if(m_service_context_list.m_components[i].m_context_id + == INVOCATION_POLICIES.value ){ + InvocationPoliciesContext context = (InvocationPoliciesContext) + m_service_context_list.m_components[i]; + + return context.getPolicies(); + } + + } + } + return null; + } + + public void insertRequest(RequestImpl request, IOR ior, + AddressingDisposition disposition) + { + m_request_id = request.getId(); + + super.createMessageBufferOutput(request.orb()); + + switch (m_header.getVersion().getMinor()) + { + case 0: + insertRequestHeader1_0(request, ior); + break; + case 1: + insertRequestHeader1_1(request, ior); + break; + case 2: + insertRequestHeader1_2(request, ior, disposition); + break; + } + + // in parmeters + + request.writeInParams(m_message_buffer_out); + + // context + + m_message_buffer_out.write_Context(request.ctx(), request.contexts()); + + m_message_completed = true; + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request, + IOR ior, AddressingDisposition disposition) + { + m_request_id = request.getId(); + + super.createMessageBufferOutput(request.orb()); + + switch (m_header.getVersion().getMinor()) + { + case 0: + insertRequestHeader1_0(request, ior); + break; + case 1: + insertRequestHeader1_1(request, ior); + break; + case 2: + insertRequestHeader1_2(request, ior, disposition); + break; + } + + m_message_completed = true; + + // make insert the message header + + this.getMessageBuffer(); + + request.setOutputStream(m_message_buffer_out); + + m_message_buffer_out = null; + + } + + /** + * Marshals the request header in GIOP 1.0 version. + */ + + protected void insertRequestHeader1_0(RequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + } + + /** + * Marshals the request header in GIOP 1.1 version. + */ + + protected void insertRequestHeader1_1(RequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + + } + + protected void insertRequestHeader1_2(RequestImpl request, IOR ior, + AddressingDisposition disposition) + { + + // request_id marshaled in father create_message_buffer_out + + // message_buffer_out.write_ulong(request.get_id().value()); + + // with response ? + + byte response_octet; + + if (request.withResponse() || request.reliableOneway()) + response_octet = (byte) 0x03; // Fix to bug #545 (changed from 0x01) + else + response_octet = (byte) 0x00; + + m_message_buffer_out.write_octet(response_octet); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // target object + + switch (disposition.value()) + { + //TODO: IIOPIOR... buff... + case AddressingDisposition._KeyAddr: + ior.toObjectKeyAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ProfileAddr: + ior.toProfileAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ReferenceAddr: + ior.toIORAddress().write(m_message_buffer_out); + } + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // service context list + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // parameters aligment for GIOPVersion 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + + } + + /** + * Marshals the request header in GIOP 1.0 version. + */ + + protected void insertRequestHeader1_0(StreamRequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + } + + /** + * Marshals the request header in GIOP 1.1 version. + */ + + protected void insertRequestHeader1_1(StreamRequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + + } + + protected void insertRequestHeader1_2(StreamRequestImpl request, IOR ior, + AddressingDisposition disposition) + { + + // request_id marshaled in father create_message_buffer_out + + // message_buffer_out.write_ulong(request.get_id().value()); + + // with response ? + + byte response_octet; + + if (request.withResponse()) + response_octet = (byte) 0x03; // Fix to bug #545 (changed from 0x01) + else + response_octet = (byte) 0x00; + + m_message_buffer_out.write_octet(response_octet); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // target object + + switch (disposition.value()) + { + case AddressingDisposition._KeyAddr: + ior.toObjectKeyAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ProfileAddr: + ior.toProfileAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ReferenceAddr: + ior.toIORAddress().write(m_message_buffer_out); + } + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // service context list + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // parameters aligment for GIOPVersion 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + + } + + /** + * Unmarshals the request header in GIOP 1.0 version. + */ + + protected ServerRequestImpl extractRequest1_0() + { + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // with response ? + + boolean with_response = m_message_buffer_in.read_boolean(); + + // object key + + TargetAddress target = new TargetAddress(); + + ObjectKey key = new ObjectKey(); + + key.read(m_message_buffer_in); + + target.setObjectKey(key); + + // operation name + + String operation = m_message_buffer_in.read_string(); + +// principal: not implemented + + int principal_length = m_message_buffer_in.read_ulong(); + + if(principal_length > 0) { + m_message_buffer_in.skip(principal_length); + } + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_0, + m_request_id, + operation, + m_message_buffer_in, + target); + + request.withResponse(with_response); + + return request; + } + + /** + * Unmarshals the request header in GIOP 1.1 version. + */ + + protected ServerRequestImpl extractRequest1_1() + { + + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // with response ? + + boolean with_response = m_message_buffer_in.read_boolean(); + + // reserved octets + + m_message_buffer_in.skipOctetArray(3); + + // object key + + TargetAddress target = new TargetAddress(); + + ObjectKey key = new ObjectKey(); + + key.read(m_message_buffer_in); + + target.setObjectKey(key); + + // operation name + + String operation = m_message_buffer_in.read_string(); + + // principal: not implemented + + int principal_length = m_message_buffer_in.read_ulong(); + + if(principal_length > 0) { + m_message_buffer_in.skip(principal_length); + } + + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_1, + m_request_id, + operation, + m_message_buffer_in, + target); + + request.withResponse(with_response); + + return request; + } + + /** + * Unmarshals the request in GIOP 1.2 version. + */ + + protected ServerRequestImpl extractRequest1_2() + { + // request_id extracted in father receive_message_buffer + + // request_id = new RequestId(message_buffer_in.read_ulong()); + + // with response ? + + byte response_octet = m_message_buffer_in.read_octet(); + + boolean with_response = (response_octet & 0x01) != 0; + + // reserved octets + + m_message_buffer_in.skipOctetArray(3); + + // object key + + TargetAddress target = new TargetAddress(); + + target.read(m_message_buffer_in); + + // operation name + + String operation = m_message_buffer_in.read_string(); + + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + try { + m_message_buffer_in.goNextAlignedPosition(CDR.LONGLONG_SIZE); + } + catch (org.omg.CORBA.MARSHAL M) {} + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_2, + m_request_id, + operation, + m_message_buffer_in, + target); + request.set_compressor(this.get_compressor()); + request.withResponse(with_response); + + return request; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPVersion.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPVersion.java.svn-base new file mode 100644 index 0000000..43480aa --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/GIOPVersion.java.svn-base @@ -0,0 +1,171 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import java.util.HashMap; + +/** + * GIOPVersion structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: GIOPVersion == GIOPVersion?? +public class GIOPVersion +{ + public int major; + + public int minor; + + private GIOPVersion(int maj, int min) + { + major = maj; + minor = min; + } + + public int getMajor() + { + return major; + } + + public int getMinor() + { + return minor; + } + + public boolean equal(GIOPVersion ver) + { + return (major == ver.major) && (minor == ver.minor); + } + + private static HashMap versionMap; + public static GIOPVersion fromString( String version ){ + //jprojas: hehehe + synchronized( GIOPVersion.class ){ + if ( versionMap == null ){ + versionMap = new HashMap( 3, 1 ); + versionMap.put( "1.0", VERSION_1_0 ); + versionMap.put( "1.1", VERSION_1_1 ); + versionMap.put( "1.2", VERSION_1_2 ); + } + } + //Hope casting doesn't cost too much + return (GIOPVersion)versionMap.get( version ); + + /* + GIOPVersion iiopVersion; + StringTokenizer st = new StringTokenizer( version, ".", false ); + if ( st.countTokens() == 2 ){ + try { + int major = Integer.parseInt( st.nextToken() ); + int minor = Integer.parseInt( st.nextToken() ); + iiopVersion = fromInts( major, minor ); + } catch ( NumberFormatException nfe ){ + //Nothing can be done + iiopVersion = null; + } + } else { + iiopVersion = null; + } + return iiopVersion; + */ + } + + public static GIOPVersion fromInts(int major, int minor) + { + if (major != 1) + return null; + if (minor == 0) + return VERSION_1_0; + if (minor == 1) + return VERSION_1_1; + if (minor == 2) + return VERSION_1_2; + return null; + } + + public static GIOPVersion read(org.omg.CORBA.portable.InputStream input) + { + int major = input.read_octet(); + int minor = input.read_octet(); + if (major != 1) + return null; + if (minor == 0) + return VERSION_1_0; + if (minor == 1) + return VERSION_1_1; + if (minor == 2) + return VERSION_1_2; + return null; + } + + public void write(org.omg.CORBA.portable.OutputStream output) + { + output.write_octet((byte) major); + output.write_octet((byte) minor); + } + + public String toString() + { + if (minor == 0) + return VERSION_1_0_NAME; + if (minor == 1) + return VERSION_1_1_NAME; + else + return VERSION_1_2_NAME; + } + + public final static GIOPVersion VERSION_1_0 = new GIOPVersion(1, 0); + + public final static String VERSION_1_0_NAME = "GIOPVersion(1.0)"; + + public final static GIOPVersion VERSION_1_1 = new GIOPVersion(1, 1); + + public final static String VERSION_1_1_NAME = "GIOPVersion(1.1)"; + + public final static GIOPVersion VERSION_1_2 = new GIOPVersion(1, 2); + + public final static String VERSION_1_2_NAME = "GIOPVersion(1.2)"; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/InvocationPoliciesContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/InvocationPoliciesContext.java.svn-base new file mode 100644 index 0000000..5a52495 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/InvocationPoliciesContext.java.svn-base @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + + +import org.omg.IOP.INVOCATION_POLICIES; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +public class InvocationPoliciesContext extends ServiceContext +{ + + public PolicyContext m_policies; + + protected InvocationPoliciesContext() + { + super(INVOCATION_POLICIES.value); + m_policies = null; + + } + + public PolicyContext getPolicies() + { + return m_policies; + } + + public InvocationPoliciesContext(PolicyContext policies) + { + super(INVOCATION_POLICIES.value); + this.m_policies = policies ; + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_policies = new PolicyContext(null); + + input.enterEncapsulation(); + + m_policies.partialRead(input); + + input.exitEncapsulation(); + + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + + output.write_ulong(m_context_id); + + output.enterEncapsulation(); + + if(m_policies == null) { + output.write_ulong(0); + } else { + m_policies.write(output); + } + + output.exitEncapsulation(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/LocateReplyStatusType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/LocateReplyStatusType.java.svn-base new file mode 100644 index 0000000..3b75b56 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/LocateReplyStatusType.java.svn-base @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; + +/** + * LocateReplyStatusType enumeration defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class LocateReplyStatusType +{ + + public int m_value; + + private LocateReplyStatusType(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public static LocateReplyStatusType from_int(int type) + { + switch (type) + { + case _UNKNOWN_OBJECT: + return UNKNOWN_OBJECT; + case _OBJECT_HERE: + return OBJECT_HERE; + case _OBJECT_FORWARD: + return OBJECT_FORWARD; + case _OBJECT_FORWARD_PERM: + return OBJECT_FORWARD_PERM; + case _LOC_SYSTEM_EXCEPTION: + return LOC_SYSTEM_EXCEPTION; + case _LOC_NEEDS_ADDRESSING_MODE: + return LOC_NEEDS_ADDRESSING_MODE; + default: + return null; + } + } + + public String toString() + { + switch (m_value) + { + case _UNKNOWN_OBJECT: + return "LocateReplyStatusType: UNKNOWN_OBJECT"; + case _OBJECT_HERE: + return "LocateReplyStatusType: OBJECT_HERE"; + case _OBJECT_FORWARD: + return "LocateReplyStatusType: OBJECT_FORWARD"; + case _OBJECT_FORWARD_PERM: + return "LocateReplyStatusType: OBJECT_FORWARD_PERM"; + case _LOC_SYSTEM_EXCEPTION: + return "LocateReplyStatusType: LOC_SYSTEM_EXCEPTION"; + case _LOC_NEEDS_ADDRESSING_MODE: + return "LocateReplyStatusType: LOC_NEEDS_ADDRESSING_MODE"; + default: + return ""; + } + } + + public static final int _UNKNOWN_OBJECT = 0; + + public static final LocateReplyStatusType UNKNOWN_OBJECT = + new LocateReplyStatusType(_UNKNOWN_OBJECT); + + public static final int _OBJECT_HERE = 1; + + public static final LocateReplyStatusType OBJECT_HERE = + new LocateReplyStatusType(_OBJECT_HERE); + + public static final int _OBJECT_FORWARD = 2; + + public static final LocateReplyStatusType OBJECT_FORWARD = + new LocateReplyStatusType(_OBJECT_FORWARD); + + public static final int _OBJECT_FORWARD_PERM = 3; + + public static final LocateReplyStatusType OBJECT_FORWARD_PERM = + new LocateReplyStatusType(_OBJECT_FORWARD_PERM); + + public static final int _LOC_SYSTEM_EXCEPTION = 4; + + public static final LocateReplyStatusType LOC_SYSTEM_EXCEPTION = + new LocateReplyStatusType(_LOC_SYSTEM_EXCEPTION); + + public static final int _LOC_NEEDS_ADDRESSING_MODE = 5; + + public static final LocateReplyStatusType LOC_NEEDS_ADDRESSING_MODE = + new LocateReplyStatusType(_LOC_NEEDS_ADDRESSING_MODE); + + public AddressingDisposition + extractAddressingDisposition(GIOPLocateReplyMessage reply_message) + { + if (value() != LocateReplyStatusType._LOC_NEEDS_ADDRESSING_MODE) + throw new + INTERNAL("Unexpected extract_arguments, NEEDS_ADDRESSING_MODE " + + "is not the reply status"); + + short value = reply_message.m_message_buffer_in.read_ushort(); + AddressingDisposition disposition = + AddressingDisposition.from_short(value); + if (disposition == null) + throw new MARSHAL("Invalid AddressingDisposition value."); + return disposition; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MessageFactory.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MessageFactory.java.svn-base new file mode 100644 index 0000000..bd2ba46 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MessageFactory.java.svn-base @@ -0,0 +1,79 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * Factory to create GIOP Messages taking a GIOP Header. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class MessageFactory +{ + + public static GIOPMessage fromHeader(GIOPHeader header) + { + switch (header.getMsgType().m_value) + { + case MsgType._Request: + return new GIOPRequestMessage(header); + case MsgType._Reply: + return new GIOPReplyMessage(header); + case MsgType._CancelRequest: + return new GIOPCancelRequestMessage(header); + case MsgType._LocateRequest: + return new GIOPLocateRequestMessage(header); + case MsgType._LocateReply: + return new GIOPLocateReplyMessage(header); + case MsgType._CloseConnection: + return new GIOPMessage(header); + case MsgType._MessageError: + return new GIOPMessage(header); + case MsgType._Fragment: + return new GIOPFragmentMessage(header); + default: + return null; // unreachable + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MsgType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MsgType.java.svn-base new file mode 100644 index 0000000..487c654 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/MsgType.java.svn-base @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * MsgType structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class MsgType +{ + + public int m_value; + + private MsgType(int val) + { + m_value = val; + } + + public static MsgType from_int(int type) + { + switch (type) + { + case _Request: + return Request; + case _Reply: + return Reply; + case _CancelRequest: + return CancelRequest; + case _LocateRequest: + return LocateRequest; + case _LocateReply: + return LocateReply; + case _CloseConnection: + return CloseConnection; + case _MessageError: + return MessageError; + case _Fragment: + return Fragment; + default: + return null; + } + } + + public static String msgName(int type) + { + switch (type) + { + case _Request: + return "Request"; + case _Reply: + return "Reply"; + case _CancelRequest: + return "CancelRequest"; + case _LocateRequest: + return "LocateRequest"; + case _LocateReply: + return "LocateReply"; + case _CloseConnection: + return "CloseConnection"; + case _MessageError: + return "MessageError"; + case _Fragment: + return "Fragment"; + default: + return null; + } + } + + public static final int _Request = 0; + + public static final MsgType Request = new MsgType(_Request); + + public static final int _Reply = 1; + + public static final MsgType Reply = new MsgType(_Reply); + + public static final int _CancelRequest = 2; + + public static final MsgType CancelRequest = new MsgType(_CancelRequest); + + public static final int _LocateRequest = 3; + + public static final MsgType LocateRequest = new MsgType(_LocateRequest); + + public static final int _LocateReply = 4; + + public static final MsgType LocateReply = new MsgType(_LocateReply); + + public static final int _CloseConnection = 5; + + public static final MsgType CloseConnection = new MsgType(_CloseConnection); + + public static final int _MessageError = 6; + + public static final MsgType MessageError = new MsgType(_MessageError); + + public static final int _Fragment = 7; + + public static final MsgType Fragment = new MsgType(_Fragment); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ReplyStatusType.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ReplyStatusType.java.svn-base new file mode 100644 index 0000000..23a7c0e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ReplyStatusType.java.svn-base @@ -0,0 +1,136 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ReplyStatusType class defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ReplyStatusType +{ + + public int m_value; + + private ReplyStatusType(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public static ReplyStatusType from_int(int type) + { + switch (type) + { + case _NO_EXCEPTION: + return NO_EXCEPTION; + case _USER_EXCEPTION: + return USER_EXCEPTION; + case _SYSTEM_EXCEPTION: + return SYSTEM_EXCEPTION; + case _LOCATION_FORWARD: + return LOCATION_FORWARD; + case _LOCATION_FORWARD_PERM: + return LOCATION_FORWARD_PERM; + case _NEEDS_ADDRESSING_MODE: + return NEEDS_ADDRESSING_MODE; + default: + return null; + } + } + + public String toString() + { + switch (m_value) + { + case _NO_EXCEPTION: + return "ReplyStatusType: NO_EXCEPTION"; + case _USER_EXCEPTION: + return "ReplyStatusType:USER_EXCEPTION"; + case _SYSTEM_EXCEPTION: + return "ReplyStatusType:SYSTEM_EXCEPTION"; + case _LOCATION_FORWARD: + return "ReplyStatusType:LOCATION_FORWARD"; + case _LOCATION_FORWARD_PERM: + return "ReplyStatusType:LOCATION_FORWARD_PERM"; + case _NEEDS_ADDRESSING_MODE: + return "ReplyStatusType:NEEDS_ADDRESSING_MODE"; + } + return ""; + } + + public static final int _NO_EXCEPTION = 0; + + public static final ReplyStatusType NO_EXCEPTION = + new ReplyStatusType(_NO_EXCEPTION); + + public static final int _USER_EXCEPTION = 1; + + public static final ReplyStatusType USER_EXCEPTION = + new ReplyStatusType(_USER_EXCEPTION); + + public static final int _SYSTEM_EXCEPTION = 2; + + public static final ReplyStatusType SYSTEM_EXCEPTION = + new ReplyStatusType(_SYSTEM_EXCEPTION); + + public static final int _LOCATION_FORWARD = 3; + + public static final ReplyStatusType LOCATION_FORWARD = + new ReplyStatusType(_LOCATION_FORWARD); + + public static final int _LOCATION_FORWARD_PERM = 4; + + public static final ReplyStatusType LOCATION_FORWARD_PERM = + new ReplyStatusType(_LOCATION_FORWARD_PERM); + + public static final int _NEEDS_ADDRESSING_MODE = 5; + + public static final ReplyStatusType NEEDS_ADDRESSING_MODE = + new ReplyStatusType(_NEEDS_ADDRESSING_MODE); +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/RequestId.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/RequestId.java.svn-base new file mode 100644 index 0000000..9b26dc6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/RequestId.java.svn-base @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * RequestId defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class RequestId +{ + protected int m_value; + + public RequestId(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public int hashCode() + { + return m_value; + } + + public boolean equals(Object obj) + { + if (obj instanceof RequestId) + return m_value == ((RequestId) obj).m_value; + + return false; + + } + + public String toString() + { + return "RequestId: " + m_value; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContext.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContext.java.svn-base new file mode 100644 index 0000000..4bfeac6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContext.java.svn-base @@ -0,0 +1,94 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ServiceContext structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContext +{ + + public int m_context_id; + + public es.tid.TIDorbj.core.cdr.Encapsulation m_context_data; + + public ServiceContext(int context_id) + { + this.m_context_id = context_id; + m_context_data = null; + } + + public ServiceContext(int context_id, + es.tid.TIDorbj.core.cdr.Encapsulation context_data) + { + this.m_context_id = context_id; + this.m_context_data = context_data; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_context_id); + output.writeEncapsulation(m_context_data); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_context_data = input.readEncapsulation(); + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUlong(); // skip context_id + input.skipEncapsulation(); + } + + public static void partialSkip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + //skip encapusulation + input.skipEncapsulation(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextList.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextList.java.svn-base new file mode 100644 index 0000000..43cc30a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextList.java.svn-base @@ -0,0 +1,98 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ServiceContextList sequence defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContextList +{ + + public ServiceContext[] m_components; + + public ServiceContextList(int count) + { + m_components = new ServiceContext[count]; + } + + public static ServiceContextList + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int count = input.read_ulong(); + + if (count == 0) + return null; + + if (count < 0) + throw new org.omg.CORBA.MARSHAL("Invalid ServiceContext size"); + + ServiceContextList list = new ServiceContextList(count); + + for (int i = 0; i < count; i++) + list.m_components[i] = ServiceContextReader.read(input); + + return list; + } + + public static void write(ServiceContextList list, + es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (list == null) + output.write_ulong(0); + else { + output.write_ulong(list.m_components.length); + for (int i = 0; i < list.m_components.length; i++) + list.m_components[i].write(output); + } + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int count = input.read_ulong(); + for (int i = 0; i < count; i++) + ServiceContext.skip(input); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextReader.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextReader.java.svn-base new file mode 100644 index 0000000..7cd5d36 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceContextReader.java.svn-base @@ -0,0 +1,79 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.IOP.INVOCATION_POLICIES; + + +/** + * Helper class for read ServiceContext structures. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContextReader +{ + + public static ServiceContext + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int id = input.read_ulong(); + ServiceContext serv_ctx = null; + switch (id) + { + // Standart CORBA Service Contexts + case org.omg.IOP.BI_DIR_IIOP.value: + serv_ctx = new BiDirServiceContext(); + serv_ctx.partialRead(input); + return serv_ctx; + case INVOCATION_POLICIES.value: + serv_ctx = new InvocationPoliciesContext(); + serv_ctx.partialRead(input); + return serv_ctx; + default: + serv_ctx = new ServiceContext(id); + serv_ctx.partialRead(input); + return serv_ctx; + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceId.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceId.java.svn-base new file mode 100644 index 0000000..1241323 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ServiceId.java.svn-base @@ -0,0 +1,72 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * Constant values related with ServiceId GIOP definitions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public interface ServiceId +{ + public static final int TransactionService = 0; + + public static final int CodeSets = 1; + + public static final int ChainBypassCheck = 2; + + public static final int ChainBypassInfo = 3; + + public static final int LogicalThreadId = 4; + + public static final int BI_DIR_IIOP = 5; + + public static final int SendingContextRunTime = 6; + + public static final int INVOCATION_POLICIES = 7; + + public static final int FORWARDED_ENTITY = 8; + + public static final int UnkownExceptionInfo = 9; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ZIOPMessage.java.svn-base b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ZIOPMessage.java.svn-base new file mode 100644 index 0000000..1258ce1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/.svn/text-base/ZIOPMessage.java.svn-base @@ -0,0 +1,406 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; // ziop?? + +import org.omg.CORBA.INTERNAL; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.Compressor; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; + +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; + +import org.omg.CORBA.COMM_FAILURE; + +public class ZIOPMessage + extends GIOPMessage +{ + BufferCDR m_original_message_buffer; + + CDRInputStream m_message_buffer_in; + + CDROutputStream m_message_buffer_out; + + int m_fragment_size; + + int m_original_length; + + public ZIOPMessage(GIOPMessage giop_message, int fragment_size) + { + super(giop_message.getHeader()); + m_original_message_buffer = giop_message.getMessageBuffer(); + m_message_buffer_in = null; + m_message_buffer_out = null; + m_fragment_size = fragment_size; + } + + public ZIOPMessage(GIOPHeader header, int fragment_size) + { + super(header); + m_original_message_buffer = null; + m_message_buffer_in = null; + m_message_buffer_out = null; + m_fragment_size = fragment_size; + } + + + public void receiveBody(Connection conn, + byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + m_message_buffer_in = new CDRInputStream(conn.orb(), m_message_buffer); + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + m_message_buffer_in.setMessage(true); + + m_message_completed = !(m_header.hasMoreFragments()); + + byte[] compressed = new byte[0]; + int compressed_length; + compressed_length = m_header.getSize() - 8; // CompressionData without data buffer + compressed = new byte[compressed_length]; + + // Read CompressionData + int original_length; + m_compressor.compressor_id = m_message_buffer_in.read_ushort(); + original_length = m_message_buffer_in.read_ulong(); + m_message_buffer_in.read_octet_array(compressed, 0, compressed_length); + + Compressor compressor_ptr = null; + try { + compressor_ptr = + conn.orb().getCompressionManager().get_compressor(m_compressor.compressor_id, + (short)0); + } catch (org.omg.Compression.UnknownCompressorId ex) { + return; + } + + org.omg.CORBA.OctetSeqHolder uncompressed = new org.omg.CORBA.OctetSeqHolder(); + + try { + compressor_ptr.decompress(compressed, uncompressed); + } catch (org.omg.Compression.CompressionException ex) { + return; + } + + if (conn.orb().m_trace != null) { + String[] msg = { + "Uncompressing ZIOP message ", + " from " + compressed.length + " bytes ", + " to " + uncompressed.value.length + " bytes ", + "using compressor " + m_compressor.compressor_id }; + conn.orb().printTrace(Trace.USER, msg); + } + + + // From uncompressed to CDRInputStream + ChunkCDR chunk = + new ChunkCDR(uncompressed.value.length); + + System.arraycopy(uncompressed.value, 0, chunk.getBuffer(), 0, uncompressed.value.length); + + chunk.setAvailable(uncompressed.value.length); + m_original_message_buffer = new BufferCDR(chunk); + + } + + public int get_fragment_size(TIDORB orb) + { + return m_fragment_size; + } + + public boolean perform_compression(TIDORB orb, + CompressorIdLevel compressor, + int low_value, + float min_ratio) + { + this.createMessageBufferOutput(orb); + + this.getHeader().setCompressed(true); + + + Compressor compressor_ptr = null; + try { + compressor_ptr = + orb.getCompressionManager().get_compressor(compressor.compressor_id, + compressor.compression_level); + } catch (org.omg.Compression.UnknownCompressorId ex) { + return false; + } + + + // Write 'body_buffer_out' bufferCDR into 'source' OctetSeq + byte[] source = new byte[0]; + int source_length = 0; + BufferCDR buffer = m_original_message_buffer; + int num_chunks = buffer.getNumAvailableChunks(); + ChunkCDR chunk = null; + for(int i = 0; i < num_chunks; i++) { + chunk = buffer.getChunk(i); + int current_length = source_length; + source_length += chunk.getAvailable(); + byte[] aux_buffer = new byte[source_length]; + if (source_length > 0) + System.arraycopy(source, 0, aux_buffer, 0, current_length); + System.arraycopy(chunk.getBuffer(), 0, aux_buffer, current_length, + chunk.getAvailable()); + source = aux_buffer; + } + + // Check (source_length > CompressorLowValue) to apply or not compression + if (source.length < low_value) { + return false; + } + + // Apply compression to source + org.omg.CORBA.OctetSeqHolder compressed = new org.omg.CORBA.OctetSeqHolder(); + try { + compressor_ptr.compress(source, compressed); + } catch (org.omg.Compression.CompressionException ex) { + return false; + } + + // Write compressed OctetSeq into message_buffer_out + m_message_buffer_out.write_ushort(compressor.compressor_id); + m_message_buffer_out.write_ulong(source.length); + + // Check min ratio + float ratio = ((float)1 - ((float)compressed.value.length / (float)source.length)); + if ( ratio < min_ratio ) { + return false; + } + + m_message_buffer_out.write_octet_array(compressed.value, 0 , compressed.value.length); + + m_message_completed = true; + + if (orb.m_trace != null) { + String[] msg = { + "Compressing GIOP message ", + "from " + source.length + " bytes ", + "to " + compressed.value.length + " bytes ", + "using compressor " + compressor.compressor_id, + " with level " + compressor.compression_level, + " achieving ratio " + (ratio*100) + " %" + }; + orb.printTrace(Trace.USER, msg); + } + + m_header.setSize(m_message_buffer.getAvailable() - + GIOPHeader.HEADER_SIZE); + m_headers_marshaled = false; + + return true; + } + + public void connect_GIOPMessage(Connection conn) + { + TIDORB _orb = conn.orb(); + + switch (m_header.getMsgType().m_value) + { + case MsgType._Request: + { + GIOPRequestMessage message = new GIOPRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + message.set_compressor(m_compressor); + + if (_orb.m_trace != null){ + _orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + _orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + _orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + conn.manageMessage((GIOPRequestMessage) message); + break; + } + case MsgType._Reply: + { + GIOPReplyMessage message = new GIOPReplyMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + // Skip GIOP Reply header + switch (m_header.getVersion().getMinor()) { + case 0: + case 1: + message.unmarshalReplyHeader1_1(); + break; + case 2: + message.unmarshalReplyHeader1_2(); + break; + } + + if (_orb.m_trace != null){ + _orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + _orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + _orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + conn.manageMessage((GIOPReplyMessage) message); + break; + } + case MsgType._CancelRequest: + { + GIOPCancelRequestMessage message = new GIOPCancelRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer); + + conn.manageMessage((GIOPCancelRequestMessage) message); + break; + } + case MsgType._LocateRequest: + { + GIOPLocateRequestMessage message = new GIOPLocateRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + conn.manageMessage((GIOPLocateRequestMessage) message); + break; + } + case MsgType._LocateReply: + { + GIOPLocateReplyMessage message = new GIOPLocateReplyMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + conn.manageMessage((GIOPLocateReplyMessage) message); + break; + } + case MsgType._Fragment: + { + GIOPFragmentMessage message = new GIOPFragmentMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer); + + conn.manageMessage((GIOPFragmentMessage) message); + break; + } + case MsgType._CloseConnection: + conn.closeByPair(); + return; + case MsgType._MessageError: + conn.closeByError(new COMM_FAILURE("Connection closed due to pair " + + "message error.")); + return; + } + + } + + public void createMessageBufferOutput(TIDORB orb) + { + if (m_message_buffer == null) + m_message_buffer = new BufferCDR( this.get_fragment_size(orb) ); + else + m_message_buffer.recycle(); + + m_message_buffer_out = new CDROutputStream(orb, m_message_buffer); + + m_message_buffer_out.setVersion(m_header.getVersion()); + + m_message_buffer_out.setMessage(true); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.java b/source/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.java new file mode 100644 index 0000000..4b60d6f --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/AddressingDisposition.java @@ -0,0 +1,97 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * AddressingDisposition structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AddressingDisposition +{ + + public short m_value; + + private AddressingDisposition(short val) + { + m_value = val; + } + + public short value() + { + return m_value; + } + + public static AddressingDisposition from_short(short type) + { + switch (type) + { + case _KeyAddr: + return KeyAddr; + case _ProfileAddr: + return ProfileAddr; + case _ReferenceAddr: + return ReferenceAddr; + default: + return null; + } + } + + public static final short _KeyAddr = 0; + + public static final AddressingDisposition KeyAddr = + new AddressingDisposition(_KeyAddr); + + public static final short _ProfileAddr = 1; + + public static final AddressingDisposition ProfileAddr = + new AddressingDisposition(_ProfileAddr); + + public static final short _ReferenceAddr = 2; + + public static final AddressingDisposition ReferenceAddr = + new AddressingDisposition(_ReferenceAddr); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.java b/source/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.java new file mode 100644 index 0000000..bdc9777 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/BiDirServiceContext.java @@ -0,0 +1,104 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import es.tid.TIDorbj.core.comm.iiop.ListenPoint; + +/** + * BiDirServiceContext structure defined in the IIOP module. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class BiDirServiceContext extends ServiceContext +{ + + public ListenPoint[] m_listen_points; + + protected BiDirServiceContext() + { + super(org.omg.IOP.BI_DIR_IIOP.value); + m_listen_points = null; + } + + public BiDirServiceContext(int size) + { + super(org.omg.IOP.BI_DIR_IIOP.value); + this.m_listen_points = new ListenPoint[size]; + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + int size = input.read_ulong(); + if (size < 0) + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + + m_listen_points = new ListenPoint[size]; + for (int i = 0; i < size; i++) { + m_listen_points[i] = ListenPoint.read(input); + } + input.exitEncapsulation(); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + + output.write_ulong(m_context_id); + + output.enterEncapsulation(); + + if (m_listen_points == null) + output.write_ulong(0); + else { + output.write_ulong(m_listen_points.length); + for (int i = 0; i < m_listen_points.length; i++) + ListenPoint.write(output, m_listen_points[i]); + } + + output.exitEncapsulation(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.java new file mode 100644 index 0000000..dda12af --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPCancelRequestMessage.java @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version CancelRequest messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPCancelRequestMessage extends GIOPMessage +{ + + /** + * Header member. + */ + private RequestId m_request_id; + + /** + * Constructor used for message sending. + */ + + public GIOPCancelRequestMessage(GIOPVersion version, RequestId id) + { + super(new GIOPHeader(version, MsgType.CancelRequest)); + m_request_id = id; + } + + /** + * Constructor used in message reception. First, the message header is + * readed, and then the message object is created. + * + * @param header + * the cancel request header. + */ + + public GIOPCancelRequestMessage(GIOPHeader header) + { + super(header); + } + + public RequestId getRequestId() + { + return m_request_id; + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_buffer) + { + super.receiveBody(conn, header_buffer); + + CDRInputStream id_in = new CDRInputStream(null, m_message_buffer); + id_in.setByteOrder(m_header.getByteOrder()); + m_request_id = new RequestId(id_in.read_ulong()); + try { + id_in.close(); + } + catch (Exception e) {} + id_in = null; + } + + public BufferCDR getMessageBuffer() + { + if (!m_message_completed) { + if (m_header.getVersion() == GIOPVersion.VERSION_1_2) { + m_message_buffer = + new BufferCDR(new byte[GIOPHeader.HEADER_SIZE + + CDR.ULONG_SIZE]); + + // write header + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + m_header.write(out); + //write + out.write_ulong(m_request_id.value()); + + try { + out.close(); + } + catch (Exception e) {} + + out = null; + m_message_completed = true; + m_headers_marshaled = true; + } else { + super.writeHeaders(); + m_message_completed = true; + } + } + + return m_message_buffer; + } + + public boolean hasBody() + { + return m_header.getVersion() == GIOPVersion.VERSION_1_2; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.java new file mode 100644 index 0000000..2858e93 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentMessage.java @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; + +/** + * Represents the 1.1 and 1.2 GIOP FragmentRequest version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPFragmentMessage extends GIOPMessage +{ + + public static int FRAGMENT_HEADER_SIZE_1_1 = GIOPHeader.HEADER_SIZE; + + public static int FRAGMENT_HEADER_SIZE_1_2 = GIOPHeader.HEADER_SIZE + + CDR.ULONG_SIZE; + + private RequestId m_request_id; + + public GIOPFragmentMessage(GIOPVersion version, RequestId id) + { + super(new GIOPHeader(version, MsgType.Fragment)); + m_request_id = id; + } + + public GIOPFragmentMessage(GIOPHeader header) + { + super(header); + } + + public String toString() + { + return m_header.toString() + " (ID: " + m_request_id + ")"; + } + + public RequestId getRequestId() + { + return m_request_id; + } + + public boolean hasBody() + { + return true; + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + if (m_header.getVersion().minor == 2) { + CDRInputStream id_in = new CDRInputStream(null, m_message_buffer); + id_in.setByteOrder(m_header.getByteOrder()); + id_in.skip(GIOPHeader.HEADER_SIZE); + m_request_id = new RequestId(id_in.read_ulong()); + id_in = null; + } + } + + public static void writeHeader(es.tid.TIDorbj.core.cdr.CDROutputStream out, + GIOPHeader header, RequestId request_id) + { + header.write(out); + + if (header.getVersion().minor == 2) { + out.write_ulong(request_id.value()); + out.alignment(CDR.LONGLONG_SIZE); // force alingment to 8 + } + } + + public void send(IIOPConnection conn) + { + throw new INTERNAL("Fragment message can not be send as itself"); + } + + public static void skipFragmentHeader1_2(CDRInputStream in) + { + //skip request_id (ulong) + in.skipUlong(); + // force alingment to 8 + // in.alignment(CDR.LONGLONG_SIZE); + + } + + public static void skipFragmentHeader1_2(CDROutputStream out) + { + //skip request_id (ulong) + out.skip(CDR.LONG_SIZE); + // force alingment to 8 + // out.alignment(CDR.LONGLONG_SIZE); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.java new file mode 100644 index 0000000..1de7c34 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPFragmentedMessage.java @@ -0,0 +1,326 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Base class for fragmented messages in 1.1 and 1.2 GIOP versions. + * + * @see es.tid.TIDorbj.core.comm.iiop.GIOPMessage + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class GIOPFragmentedMessage extends GIOPMessage +{ + + /** + * the request id, it can be needed by 1.1 and 1.2 GIOP version messages. + */ + protected RequestId m_request_id; + + /** + * InputStream where the message body is marshaled. It manages the body + * buffer, defined in the GIOPMessage class. + */ + protected CDRInputStream m_message_buffer_in; + + /** + * OutputStream where the message message_buffer can be marshaled. It + * manages the message_buffer buffer, defined in the + * GIOPMessage class. + */ + protected CDROutputStream m_message_buffer_out; + + private int fragmentSize; + + /** + * Creates a new fragmented message for GIOP 1.0 and 1.1 + */ + protected GIOPFragmentedMessage(GIOPHeader header) + { + super(header); + m_request_id = null; + } + + /** + * Creates a new fragmented message for GIOP 1.2 + */ + protected GIOPFragmentedMessage(GIOPHeader header, RequestId request_id, int fragmentSize ) + { + super(header); + this.m_request_id = request_id; + this.fragmentSize = fragmentSize; + } + + public String toString() + { + return m_header.toString() + " (" + m_request_id + ")"; + } + + public RequestId getRequestId() + { + return m_request_id; + } + + /** + * Initialize the message_buffer_out member. + * + * @param orb + * needed for internal CDR stream creation. + */ + + protected void createMessageBufferOutput(es.tid.TIDorbj.core.TIDORB orb) + { + if (m_message_buffer == null) + m_message_buffer = new BufferCDR( this.fragmentSize ); + else + m_message_buffer.recycle(); + + m_message_buffer_out = new CDROutputStream(orb, m_message_buffer); + + m_message_buffer_out.setVersion(m_header.getVersion()); + + m_message_buffer_out.setMessage(true); + + // set message skips also the GIOP HEADER + // message_buffer_out.skip(GIOPHeader.HEADER_SIZE); + + // writes the request id + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_message_buffer_out.write_ulong(m_request_id.value()); + } + } + + /** + * Initialize the message_buffer_out member. + * + * @param orb + * needed for internal CDR stream creation. + */ + + protected void createMessageBufferInput(es.tid.TIDorbj.core.TIDORB orb) + { + if (m_message_buffer_in != null) + return; + + if (m_message_buffer == null) + throw new INTERNAL("Cannot create buffer input"); + + m_message_buffer_in = new CDRInputStream(orb, m_message_buffer); + + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + + m_message_buffer_in.setMessage(true); + + // set message skips also the GIOP HEADER + // message_buffer_in.skip(GIOPHeader.HEADER_SIZE); + + // lectura adelantada del request_id para comprobar despues los + // fragmentos + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + } + + /** + * Reads the message message_buffer in the connection. The header has yet + * been read by the connection. + * + * @param conn + * the active IIOP connection. + */ + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(Connection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + this.createMessageBufferInput(conn.orb()); + + m_message_completed = !m_header.hasMoreFragments(); + } + + + + public void setBody(BufferCDR buf, CDRInputStream input) + { + super.setBody(buf); + + m_message_buffer_in = input; + + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + + m_message_buffer_in.setMessage(true); + + + // lectura adelantada del request_id para comprobar despues los + // fragmentos + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + m_message_completed = !m_header.hasMoreFragments(); + } + + + /** + * Complete writing of the message in the connection. + */ + + public void writeHeaders() + { + + if (!m_headers_marshaled) { + CDROutputStream out = new CDROutputStream(null, m_message_buffer); + + out.setVersion(m_header.getVersion()); + + // write message size = buffer size - 12 octets from header + + m_header.setSize(m_message_buffer.getAvailable() + - GIOPHeader.HEADER_SIZE); + + m_header.setMoreFragments(false); + + m_header.write(out); + + out = null; + m_headers_marshaled = true; + } + } + + /* + * public void write_headers() { if (message_buffer == null) throw new + * INTERNAL("Cannot write message headers"); + * + * switch(header.getVersion().getMinor()) { case 0: write_headers_1_0(); + * break; default: write_headers_1_1(); } } + * + * public void write_headers_1_0() { + * + * if (!headers_marshaled) { CDROutputStream out = new CDROutputStream(null, + * message_buffer); + * + * out.set_version(header.getVersion()); // write message size = buffer size - + * 12 octets from header + * + * header.setSize(message_buffer.getChunk(0).getAvailable() - + * GIOPHeader.HEADER_SIZE); + * + * header.setMoreFragments(false); + * + * header.write(out); + * + * out = null; headers_marshaled = true; } } + * + * public void write_headers_1_1() { + * + * if (!headers_marshaled) { CDROutputStream out = new CDROutputStream(null, + * message_buffer); + * + * out.set_version(header.getVersion()); // write message size = buffer size - + * 12 octets from header + * + * header.setSize(message_buffer.getChunk(0).getAvailable() - + * GIOPHeader.HEADER_SIZE); // write chunks as fragments + * + * int num_chunks = message_buffer.getNumAvailableChunks(); + * + * boolean has_more_fragments = num_chunks > 1; + * + * header.setMoreFragments(has_more_fragments); + * + * header.write(out); + * + * if(has_more_fragments) { + * + * out.set_message(true); + * + * GIOPHeader fragment_header = new GIOPHeader(header.getVersion(), + * MsgType.Fragment); + * + * fragment_header.setByteOrder(header.getByteOrder()); + * + * for(int i = 1; i < num_chunks; i++) { out.getNextFragmentHeader(); + * fragment_header.setMoreFragments(i < num_chunks - 1); + * fragment_header.setSize( message_buffer.getChunk(i).getAvailable() - + * GIOPHeader.HEADER_SIZE); + * + * GIOPFragmentMessage.write_header(out,fragment_header,request_id); } } + * + * out = null; headers_marshaled = true; } } + */ + + /** + * Adds the next fragment to the Message. + */ + public void addFragment(GIOPFragmentMessage fragment) + { + if (m_message_completed) + throw new org.omg.CORBA.MARSHAL("Unexpected Fragment"); + + if (m_message_buffer == null) + throw new org.omg.CORBA.INTERNAL("Unexpected Fragment"); + + if (m_message_buffer != null) + m_message_buffer.addChunk(fragment.getMessageBuffer().getChunk(0)); + + m_message_completed = !fragment.getHeader().hasMoreFragments(); + + } +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPHeader.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPHeader.java new file mode 100644 index 0000000..f68e719 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPHeader.java @@ -0,0 +1,246 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version message headers. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPHeader +{ + + GIOPVersion m_version; + + boolean m_byte_order; + + boolean m_more_fragments; + + MsgType m_message_type; + + int message_size; + + String m_str = null; + + boolean m_compressed; + + public final static int HEADER_SIZE = 12; + + public GIOPHeader() + {} + + public GIOPHeader(GIOPVersion ver, MsgType type) + { + m_version = ver; + m_byte_order = CDR.LOCAL_BYTE_ORDER; + m_more_fragments = false; + m_message_type = type; + message_size = 0; + m_compressed = false; + } + + public static GIOPHeader fromByteArray(byte[] array) + throws org.omg.CORBA.MARSHAL + { + GIOPHeader header = new GIOPHeader(); + if (array.length < HEADER_SIZE) + return null; + CDRInputStream input = new CDRInputStream(null, array); + header.read(input); + input = null; + return header; + } + + public GIOPVersion getVersion() + { + return m_version; + } + + public MsgType getMsgType() + { + return m_message_type; + } + + public void setByteOrder(boolean order) + { + m_byte_order = order; + } + + public boolean getByteOrder() + { + return m_byte_order; + } + + public void setMoreFragments(boolean more) + { + m_more_fragments = more; + } + + public boolean hasMoreFragments() + { + if (m_version.minor == 0) + return false; + else + return m_more_fragments; + } + + public void setSize(int size) + { + message_size = size; + } + + public int getSize() + { + return message_size; + } + + public void setCompressed(boolean compressed) + { + m_compressed = compressed; + } + + public boolean getCompressed() + { + return m_compressed; + } + + public void toByteArray(byte[] header_buffer) + { + CDROutputStream output = new CDROutputStream(null, header_buffer); + write(output); + output = null; + } + + public void write(org.omg.CORBA.portable.OutputStream output) + { + if (m_compressed) + output.write_octet((byte) 'Z'); + else + output.write_octet((byte) 'G'); + output.write_octet((byte) 'I'); + output.write_octet((byte) 'O'); + output.write_octet((byte) 'P'); + + output.write_octet((byte) m_version.major); + output.write_octet((byte) m_version.minor); + + if (m_version.minor == 0) + output.write_boolean(m_byte_order); + else { + int flag = 0; + if (m_byte_order) + flag |= 0x1; + if (m_more_fragments) + flag |= 0x2; + output.write_octet((byte) flag); + } + + output.write_octet((byte) m_message_type.m_value); + output.write_ulong(message_size); + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + byte first_magic_char = input.read_octet(); + + if ( ( (first_magic_char != (byte) 'G') && (first_magic_char != (byte) 'Z')) + || (input.read_octet() != (byte) 'I') + || (input.read_octet() != (byte) 'O') + || (input.read_octet() != (byte) 'P')) + + throw new + MARSHAL("Bad GIOP Message header: Invalid header identifier.", + 0, CompletionStatus.COMPLETED_NO); + + m_compressed = (first_magic_char == 'Z'); + + m_version = GIOPVersion.read(input); + + if (m_version == null) + throw new + MARSHAL("Bad GIOP Message header: Invalid version number.", + 0, CompletionStatus.COMPLETED_NO); + + byte flag = input.read_octet(); + + if (m_version.minor == 0) + m_byte_order = (flag != 0); + else { + m_byte_order = ((flag & 0x1) != 0); + m_more_fragments = ((flag & 0x2) != 0); + } + + input.setByteOrder(m_byte_order); + m_message_type = MsgType.from_int(input.read_octet()); + + if (m_message_type == null) + throw new MARSHAL("Bad GIOP Message header: Invalid message type.", + 0, CompletionStatus.COMPLETED_NO); + + message_size = input.read_ulong(); + + } + + public String toString() + { + if (m_str == null) + m_str = MsgType.msgName(m_message_type.m_value) + " (" + + m_version.toString() + ") " + + ((m_more_fragments) ? "[FRAGMENTED] " : "") + + ((m_byte_order) ? "[LITTLE_ENDIAN] " : "[BIG_ENDIAN] ") + + "[SIZE: " + message_size + "]"; + + return m_str; + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.java new file mode 100644 index 0000000..5d8a134 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateReplyMessage.java @@ -0,0 +1,245 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.exception.SystemExceptionEncoder; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP LocateReply version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPLocateReplyMessage extends GIOPFragmentedMessage +{ + + LocateReplyStatusType m_reply_status; + + public GIOPLocateReplyMessage(GIOPHeader header) + { + super(header); + m_reply_status = null; + } + + public GIOPLocateReplyMessage(GIOPVersion version, RequestId id, int fragmentSize) + { + super(new GIOPHeader(version, MsgType.LocateReply), id, fragmentSize ); + m_reply_status = null; + } + + public String toString() + { + return super.toString() + " (" + m_reply_status.toString() + ")"; + } + + private void reset() + { + m_reply_status = null; + m_message_completed = false; + m_headers_marshaled = false; + } + + public LocateReplyStatusType replyStatus() + { + return m_reply_status; + } + + public void insertUnknownObject(TIDORB orb) + { + reset(); + m_reply_status = LocateReplyStatusType.UNKNOWN_OBJECT; + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public void insertObjectHere(TIDORB orb) + { + reset(); + m_reply_status = LocateReplyStatusType.OBJECT_HERE; + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public void insertSystemException(TIDORB orb, + org.omg.CORBA.SystemException exception) + { + reset(); + m_reply_status = LocateReplyStatusType.LOC_SYSTEM_EXCEPTION; + SystemExceptionEncoder.write(m_message_buffer_out, exception); + + createMessageBufferOutput(orb); + + m_message_completed = true; + } + + public org.omg.CORBA.SystemException extractSystemException() + { + if (m_reply_status.value() + != LocateReplyStatusType._LOC_SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, " + + "SYSTEM_EXCEPTION is not the reply status"); + + return SystemExceptionEncoder.read(m_message_buffer_in); + } + + public void insertForward(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + + m_reply_status = LocateReplyStatusType.OBJECT_FORWARD; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForward() + { + if (m_reply_status.value() != LocateReplyStatusType._OBJECT_FORWARD) + throw new INTERNAL("Unexpected extract_arguments, " + + "OBJECT_FORWARD is not the reply status"); + + IOR forward_ior = new DefaultIOR(); + forward_ior.read(m_message_buffer_in); + return forward_ior; + } + + public void insertForwardPerm(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + m_reply_status = LocateReplyStatusType.OBJECT_FORWARD_PERM; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + + } + + public IOR extractForwardPerm() + { + if (m_reply_status.value() + != LocateReplyStatusType._OBJECT_FORWARD_PERM) + throw new INTERNAL("Unexpected extract_arguments, " + + "OBJECT_FORWARD_PERM is not the reply status"); + + IOR forward_ior = new DefaultIOR(); + forward_ior.read(m_message_buffer_in); + return forward_ior; + } + + public void insertNeedsAddressingMode(TIDORB orb, + AddressingDisposition disposition) + { + reset(); + + m_reply_status = LocateReplyStatusType.LOC_NEEDS_ADDRESSING_MODE; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_ushort(disposition.value()); + + m_message_completed = true; + } + + public AddressingDisposition extractAddressingDisposition() + { + return m_reply_status.extractAddressingDisposition(this); + } + + public void createMessageBufferOutput(es.tid.TIDorbj.core.TIDORB orb) + { + + if (m_reply_status == null) + throw new INTERNAL("Unitialized request"); + + super.createMessageBufferOutput(orb); + + // header + // request_id marshaled with father create_message_buffer_output() in + // version 1.2 + + if (!m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_message_buffer_out.write_ulong(m_request_id.value()); + } + + // status + m_message_buffer_out.write_ulong(m_reply_status.m_value); + + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(IIOPConnection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + // request_id has been readen in father's method in version 1.2 + if (!m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + } + + // reply_status + + m_reply_status = + LocateReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid LocateReplyStatus value."); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.java new file mode 100644 index 0000000..e7851d9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPLocateRequestMessage.java @@ -0,0 +1,127 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP LocateRequest version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPLocateRequestMessage extends GIOPFragmentedMessage +{ + + public GIOPLocateRequestMessage(GIOPHeader header) + { + super(header); + } + + public GIOPLocateRequestMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.LocateRequest), id, fragmentSize ); + } + + public TargetAddress extractAddress() + { + if (!m_message_completed) + throw new INTERNAL("Uncompleted message."); + + TargetAddress target = new TargetAddress(); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + // request_id has been readed by father's receive_body + + target.read(m_message_buffer_in); + } else { + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + ObjectKey key = new ObjectKey(); + key.read(m_message_buffer_in); + target.setObjectKey(key); + } + return target; + } + + public void insertAddress(es.tid.TIDorbj.core.TIDORB orb, ObjectKey key) + { + createMessageBufferOutput(orb); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + TargetAddress target = new TargetAddress(); + target.setObjectKey(key); + target.write(m_message_buffer_out); + } else { + m_message_buffer_out.write_ulong(m_request_id.value()); + key.write(m_message_buffer_out); + } + + m_message_completed = true; + } + + public void insertAddress(es.tid.TIDorbj.core.TIDORB orb, + TargetAddress target) + { + createMessageBufferOutput(orb); + + if (m_header.getVersion().equal(GIOPVersion.VERSION_1_2)) { + // request_id marshaled in create_message_buffer_output() + target.write(m_message_buffer_out); + } else { + m_message_buffer_out.write_ulong(m_request_id.value()); + ObjectKey key = target.getObjectKey(); + + if (key == null) + throw new INTERNAL("Invalid Object Key"); + + key.write(m_message_buffer_out); + } + + m_message_completed = true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPMessage.java new file mode 100644 index 0000000..5d7b2a6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPMessage.java @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.Compression.CompressorIdLevel; + +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP version messages used in a IIOP + * connection. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPMessage +{ + + /** + * Message Header + */ + GIOPHeader m_header; + + /** + * Message Buffer, including the message headers. + */ + BufferCDR m_message_buffer; + + /** + * Indicates if the message is ready to be send. + */ + boolean m_message_completed; + + boolean m_headers_marshaled; + + CompressorIdLevel m_compressor; + + protected GIOPMessage(GIOPHeader header) + { + m_header = header; + m_message_buffer = null; + m_headers_marshaled = false; + + switch (header.getMsgType().m_value) + { + case MsgType._MessageError: + case MsgType._CloseConnection: + m_message_completed = true; + break; + default: + m_message_completed = false; + } + m_compressor = new CompressorIdLevel((short)0, (short)0); + } + + public String toString() + { + return m_header.toString(); + } + + public GIOPHeader getHeader() + { + return m_header; + } + + /** + * @return the message buffer including the message headers + */ + + public BufferCDR getMessageBuffer() + { + if (!m_message_completed) + return null; + + if (!m_headers_marshaled) + writeHeaders(); + + return m_message_buffer; + } + + /** + * Sets the message_buffer where the message will be marshalled. + */ + public void setMessageBuffer(BufferCDR cdr) + { + m_message_buffer = cdr; + } + + public void setMessageCompleted(boolean value) + { + m_message_completed = value; + } + + public boolean hasBody() + { + switch (m_header.getMsgType().m_value) + { + case MsgType._MessageError: + return false; + case MsgType._CloseConnection: + return false; + default: + return true; + } + } + + //TODO: giop should not know anything about IIOPConnections!! + public static ChunkCDR receiveChunk(Connection conn, GIOPHeader header, + byte[] header_bytes) + { + // the buffer has also the header + + int body_size = header.getSize(); + + byte[] buffer = new byte[body_size + GIOPHeader.HEADER_SIZE]; + + // copy the header + + System.arraycopy(header_bytes, 0, buffer, 0, GIOPHeader.HEADER_SIZE); + + conn.read(buffer, GIOPHeader.HEADER_SIZE, body_size); + + return new ChunkCDR(buffer); + + } + + //TODO: giop should not know anything about IIOPConnections!! + public void receiveBody(Connection conn, byte[] header_bytes) + { + m_message_buffer = + new BufferCDR(receiveChunk(conn, m_header, header_bytes)); + + m_message_completed = true; + m_headers_marshaled = true; + } + + + public void setBody(BufferCDR buf) + { + m_message_buffer = buf; + m_message_completed = true; + m_headers_marshaled = true; + } + + /** + * Writes the header into the Message Chunks + */ + protected void writeHeaders() + { + if (hasBody()) { + if (!m_message_completed) + throw new INTERNAL("Uncompleted Message: no body"); + + if (!m_headers_marshaled) { + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + + out.setVersion(m_header.getVersion()); + + // write message size = buffer size - 12 octets from header + + m_header.setSize(m_message_buffer.getAvailable() + - GIOPHeader.HEADER_SIZE); + + m_header.write(out); + + out = null; + + m_headers_marshaled = true; + } + + } else { + if (!m_headers_marshaled) //header message + { + m_message_buffer = + new BufferCDR(new byte[GIOPHeader.HEADER_SIZE]); + CDROutputStream out = + new CDROutputStream(null, m_message_buffer); + m_header.write(out); + out = null; + m_headers_marshaled = true; + + } + } + } + + /** + * Sends the message + */ + public void send(Connection conn) + { + + GIOPVersion header_version = m_header.getVersion(); + + if (header_version == GIOPVersion.VERSION_1_2) + conn.writeVersion1_2(getMessageBuffer()); + else if (header_version == GIOPVersion.VERSION_1_1) + conn.writeVersion1_1(getMessageBuffer()); + else + conn.writeVersion1_0(getMessageBuffer()); + } + + public CompressorIdLevel get_compressor() + { + return m_compressor; + } + + public void set_compressor(CompressorIdLevel compressor) + { + m_compressor = compressor; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.java new file mode 100644 index 0000000..71a6056 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPReplyMessage.java @@ -0,0 +1,511 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.ExceptionList; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NVList; +import org.omg.Messaging._ExceptionHolder; + +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.exception.SystemExceptionEncoder; + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP Reply version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPReplyMessage extends GIOPFragmentedMessage +{ + + ReplyStatusType m_reply_status; + + ServiceContextList m_service_context_list; + + public GIOPReplyMessage(GIOPVersion version) + { + super(new GIOPHeader(version, MsgType.Reply)); + m_reply_status = null; + } + + public GIOPReplyMessage(GIOPHeader header) + { + super(header); + m_reply_status = null; + m_service_context_list = null; + } + + public GIOPReplyMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.Reply), id, fragmentSize ); + m_reply_status = null; + m_service_context_list = null; + } + + public String toString() + { + if (m_reply_status == null) + return super.toString() + " ( no reply status defined! )"; + else + return super.toString() + " (" + m_reply_status.toString() + ")"; + } + + private void reset() + { + m_reply_status = null; + m_message_completed = false; + m_headers_marshaled = false; + m_service_context_list = null; + } + + public ReplyStatusType replyStatus() + { + return m_reply_status; + } + + public void setServiceContextList(ServiceContextList list) + { + m_service_context_list = list; + } + + public ServiceContextList getServiceContextList() + { + return m_service_context_list; + } + + public void insertResultRequest(TIDORB orb, ServerRequestImpl request) + { + switch (request.getReturnState()) + { + case ServerRequestImpl.NO_EXCEPTION: + insertArguments(orb, request); + return; + case ServerRequestImpl.USER_EXCEPTION: + insertUserException(orb, request.getException()); + return; + case ServerRequestImpl.SYSTEM_EXCEPTION: + insertSystemException(orb, request.getSystemException()); + return; + case ServerRequestImpl.LOCATION_FORWARD: + insertForward(orb, request.getForward()); + return; + } + } + + protected void insertArguments(TIDORB orb, ServerRequestImpl request) + { + reset(); + m_request_id = request.getId(); + m_reply_status = ReplyStatusType.NO_EXCEPTION; + + createMessageBufferOutput(orb); + + Any result = request.getResult(); + + if (result != null) + result.write_value(m_message_buffer_out); + NVList list = request.getParameters(); + + if (list != null) + NVListImpl.writeOutParams(list, m_message_buffer_out); + + m_message_completed = true; + } + + public void extractArguments(RequestImpl request) + { + if (m_reply_status.value() != ReplyStatusType._NO_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, NO_EXCEPTION " + +"is not the reply status"); + + request.readResult(m_message_buffer_in); + + NVList list = request.arguments(); + + if (list != null) + NVListImpl.readOutParams(list, m_message_buffer_in); + } + + protected void insertUserException(TIDORB orb, Any exception) + { + reset(); + m_reply_status = ReplyStatusType.USER_EXCEPTION; + + createMessageBufferOutput(orb); + + exception.write_value(m_message_buffer_out); + + m_message_completed = true; + } + + public Any extractUserException(ExceptionList list) + { + if (m_reply_status.value() != ReplyStatusType._USER_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, USER_EXCEPTION " + +"is not the reply status"); + + // lectura adelantada del repository_id de la excepcion + + m_message_buffer_in.fixStarting(); + + String name = m_message_buffer_in.read_string(); + + m_message_buffer_in.rewind(); + + // busqueda del typecode y lectura de sus componentes + + if (list != null) { + + int count = list.count(); + + try { + for (int i = 0; i < count; i++) { + if (name.equals(list.item(i).id())) { + Any any = m_message_buffer_in.orb().create_any(); + any.read_value(m_message_buffer_in, list.item(i)); + return any; + } + } + } + catch (org.omg.CORBA.Bounds bds) {} + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + } + + throw new org.omg.CORBA.UNKNOWN("Unkown user exception"); + + } + + protected void + insertSystemException(TIDORB orb, + org.omg.CORBA.SystemException exception) + { + reset(); + m_reply_status = ReplyStatusType.SYSTEM_EXCEPTION; + + createMessageBufferOutput(orb); + + SystemExceptionEncoder.write(m_message_buffer_out, exception); + + m_message_completed = true; + } + + public org.omg.CORBA.SystemException extractSystemException() + { + if (m_reply_status.value() != ReplyStatusType._SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, SYSTEM_EXCEPTION " + +"is not the reply status"); + + return SystemExceptionEncoder.read(m_message_buffer_in); + } + + public void insertForward(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + + m_reply_status = ReplyStatusType.LOCATION_FORWARD; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForward() + { + if (m_reply_status.value() != ReplyStatusType._LOCATION_FORWARD) + throw new INTERNAL("Unexpected extract_arguments, LOCAL_FORWARD " + + "is not the reply status"); + + IOR ior = new DefaultIOR(); + ior.read(m_message_buffer_in); + return ior; + } + + public void inserForwardPerm(TIDORB orb, org.omg.CORBA.Object obj) + { + reset(); + m_reply_status = ReplyStatusType.LOCATION_FORWARD_PERM; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_Object(obj); + + m_message_completed = true; + } + + public IOR extractForwardPerm() + { + if (m_reply_status.value() != ReplyStatusType._LOCATION_FORWARD_PERM) + throw new + INTERNAL("Unexpected extract_arguments, LOCAL_FORWARD_PERM " + + "is not the reply status"); + + IOR ior = new DefaultIOR(); + ior.read(m_message_buffer_in); + return ior; + } + + public void insertNeedsAddressingMode(TIDORB orb, + AddressingDisposition disposition) + { + reset(); + + m_reply_status = ReplyStatusType.NEEDS_ADDRESSING_MODE; + + createMessageBufferOutput(orb); + + m_message_buffer_out.write_ushort(disposition.value()); + + m_message_completed = true; + } + + public es.tid.TIDorbj.core.cdr.CDRInputStream getDataInput() + { + return m_message_buffer_in.copy(); + } + + public AddressingDisposition extractAddressingDisposition() + { + if (m_reply_status.value() != ReplyStatusType._NEEDS_ADDRESSING_MODE) + throw new + INTERNAL("Unexpected extract_arguments, NEEDS_ADDRESSING_MODE" + + "is not the reply status"); + + short value = m_message_buffer_in.read_ushort(); + + AddressingDisposition disposition = + AddressingDisposition.from_short(value); + + if (disposition == null) + throw new MARSHAL("Invalid AddressingDisposition value."); + + return disposition; + } + + public void createMessageBufferOutput(TIDORB orb) + { + super.createMessageBufferOutput(orb); + + switch (m_header.getVersion().getMinor()) + { + case 0: + case 1: + marshalReplyHeader1_1(); + break; + case 2: + marshalReplyHeader1_2(); + break; + } + } + + /** + * Marshals the reply header in GIOP 1.1 and 1.0 version. + */ + + protected void marshalReplyHeader1_1() + { + // Service Context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // reply_status + + m_message_buffer_out.write_ulong(m_reply_status.value()); + + } + + /** + * Marshals the reply header in GIOP 1.2 version. + */ + + protected void marshalReplyHeader1_2() + { + + // request_id marshaled with father create_body() + + // message_buffer_out.write_ulong(request_id); + + // reply_status + + m_message_buffer_out.write_ulong(m_reply_status.value()); + + // Service Context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // aligment to 8 in version 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + } + + public void receiveBody(Connection conn, byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + switch (m_header.getVersion().getMinor()) + { + case 0: + case 1: + unmarshalReplyHeader1_1(); + break; + case 2: + unmarshalReplyHeader1_2(); + break; + } + + m_message_buffer_in.fixStarting(); + + } + + /** + * Marshals the reply header in GIOP 1.1 version. + */ + + protected void unmarshalReplyHeader1_1() + { + // Service Context + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // reply_status + + m_reply_status = + ReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid ReplyStatus value."); + if (m_reply_status.value() > ReplyStatusType._LOCATION_FORWARD) + throw new MARSHAL("GIOPVersion 1.0 or 1.1: Invalid ReplyStatus value."); + + } + + /** + * Marshals the reply header in GIOP 1.2 version. + */ + + protected void unmarshalReplyHeader1_2() + { + // request_id unmarshaled in father's receive_body() + + // request_id = new RequestId(message_buffer_in.read_ulong()); + + // reply_status + + m_reply_status = + ReplyStatusType.from_int(m_message_buffer_in.read_ulong()); + + if (m_reply_status == null) + throw new MARSHAL("Invalid ReplyStatus value."); + + // Service Context + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // VERSION 1.2 aligment to 8 + try { + m_message_buffer_in.goNextAlignedPosition(CDR.LONGLONG_SIZE); + } + catch (org.omg.CORBA.MARSHAL M) { + + } + + } + + // AMI operations + + public void extractArgumentsForReplyHandler(RequestImpl request) + { + if (m_reply_status.value() != ReplyStatusType._NO_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, NO_EXCEPTION " + +"is not the reply status"); + + request.readResult(m_message_buffer_in); + + NVList list = request.arguments(); + + if (list != null) + NVListImpl.readInParams(list, m_message_buffer_in); + } + + public void extractUserException(es.tid.TIDorbj.core.messaging._ExceptionHolderImpl excepHolder) + { + if (m_reply_status.value() != ReplyStatusType._USER_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, USER_EXCEPTION " + +"is not the reply status"); + + excepHolder.read(m_message_buffer_in); + + } + + public void extractSystemException(_ExceptionHolder excepHolder) + { + if (m_reply_status.value() != ReplyStatusType._SYSTEM_EXCEPTION) + throw new INTERNAL("Unexpected extract_arguments, SYSTEM_EXCEPTION " + +"is not the reply status"); + + excepHolder._read(m_message_buffer_in); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.java new file mode 100644 index 0000000..1ad3cad --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPRequestMessage.java @@ -0,0 +1,607 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.IOP.INVOCATION_POLICIES; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Represents the 1.0, 1.1 and 1.2 GIOP Request version messages. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class GIOPRequestMessage extends GIOPFragmentedMessage +{ + + ServiceContextList m_service_context_list; + + public GIOPRequestMessage(GIOPHeader header) + { + super(header); + m_service_context_list = null; + } + + public GIOPRequestMessage(GIOPVersion ver) + { + super(new GIOPHeader(ver, MsgType.Request)); + m_service_context_list = null; + } + + public GIOPRequestMessage(GIOPVersion ver, RequestId id, int fragmentSize ) + { + super(new GIOPHeader(ver, MsgType.Request), id, fragmentSize ); + m_service_context_list = null; + } + + public void setServiceContextList(ServiceContextList list) + { + m_service_context_list = list; + } + + public ServiceContextList getServiceContextList() + { + return m_service_context_list; + } + + public ServerRequestImpl extractRequest(es.tid.TIDorbj.core.TIDORB orb) + { + if (!m_message_completed) + throw new INTERNAL("Uncompleted message: no message_buffer."); + + this.createMessageBufferInput(orb); + + ServerRequestImpl request = null; + switch (m_header.getVersion().getMinor()) + { + case 0: + return extractRequest1_0(); + case 1: + return extractRequest1_1(); + case 2: + return extractRequest1_2(); + default: + return null; + } + + } + + /** + * Get the Request Invocation policies sended by the Client. See QoS. + * @return + */ + public PolicyContext getRequestInvocationPolicies() + { + if(this.m_service_context_list != null) { + for(int i = 0; i < this.m_service_context_list.m_components.length; i++) { + if(m_service_context_list.m_components[i].m_context_id + == INVOCATION_POLICIES.value ){ + InvocationPoliciesContext context = (InvocationPoliciesContext) + m_service_context_list.m_components[i]; + + return context.getPolicies(); + } + + } + } + return null; + } + + public void insertRequest(RequestImpl request, IOR ior, + AddressingDisposition disposition) + { + m_request_id = request.getId(); + + super.createMessageBufferOutput(request.orb()); + + switch (m_header.getVersion().getMinor()) + { + case 0: + insertRequestHeader1_0(request, ior); + break; + case 1: + insertRequestHeader1_1(request, ior); + break; + case 2: + insertRequestHeader1_2(request, ior, disposition); + break; + } + + // in parmeters + + request.writeInParams(m_message_buffer_out); + + // context + + m_message_buffer_out.write_Context(request.ctx(), request.contexts()); + + m_message_completed = true; + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request, + IOR ior, AddressingDisposition disposition) + { + m_request_id = request.getId(); + + super.createMessageBufferOutput(request.orb()); + + switch (m_header.getVersion().getMinor()) + { + case 0: + insertRequestHeader1_0(request, ior); + break; + case 1: + insertRequestHeader1_1(request, ior); + break; + case 2: + insertRequestHeader1_2(request, ior, disposition); + break; + } + + m_message_completed = true; + + // make insert the message header + + this.getMessageBuffer(); + + request.setOutputStream(m_message_buffer_out); + + m_message_buffer_out = null; + + } + + /** + * Marshals the request header in GIOP 1.0 version. + */ + + protected void insertRequestHeader1_0(RequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + } + + /** + * Marshals the request header in GIOP 1.1 version. + */ + + protected void insertRequestHeader1_1(RequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + + } + + protected void insertRequestHeader1_2(RequestImpl request, IOR ior, + AddressingDisposition disposition) + { + + // request_id marshaled in father create_message_buffer_out + + // message_buffer_out.write_ulong(request.get_id().value()); + + // with response ? + + byte response_octet; + + if (request.withResponse() || request.reliableOneway()) + response_octet = (byte) 0x03; // Fix to bug #545 (changed from 0x01) + else + response_octet = (byte) 0x00; + + m_message_buffer_out.write_octet(response_octet); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // target object + + switch (disposition.value()) + { + //TODO: IIOPIOR... buff... + case AddressingDisposition._KeyAddr: + ior.toObjectKeyAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ProfileAddr: + ior.toProfileAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ReferenceAddr: + ior.toIORAddress().write(m_message_buffer_out); + } + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // service context list + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // parameters aligment for GIOPVersion 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + + } + + /** + * Marshals the request header in GIOP 1.0 version. + */ + + protected void insertRequestHeader1_0(StreamRequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + } + + /** + * Marshals the request header in GIOP 1.1 version. + */ + + protected void insertRequestHeader1_1(StreamRequestImpl request, IOR ior) + { + // service context + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // request_id + + m_message_buffer_out.write_ulong(m_request_id.value()); + + // with response ? + + m_message_buffer_out.write_boolean(request.withResponse()); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // object key + + ior.getObjectKey().write(m_message_buffer_out); + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // principal: not implemented + + m_message_buffer_out.write_string(""); + + } + + protected void insertRequestHeader1_2(StreamRequestImpl request, IOR ior, + AddressingDisposition disposition) + { + + // request_id marshaled in father create_message_buffer_out + + // message_buffer_out.write_ulong(request.get_id().value()); + + // with response ? + + byte response_octet; + + if (request.withResponse()) + response_octet = (byte) 0x03; // Fix to bug #545 (changed from 0x01) + else + response_octet = (byte) 0x00; + + m_message_buffer_out.write_octet(response_octet); + + // reserved[3] + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + m_message_buffer_out.write_octet((byte) 0); + + // target object + + switch (disposition.value()) + { + case AddressingDisposition._KeyAddr: + ior.toObjectKeyAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ProfileAddr: + ior.toProfileAddress().write(m_message_buffer_out); + break; + case AddressingDisposition._ReferenceAddr: + ior.toIORAddress().write(m_message_buffer_out); + } + + // operation name + + m_message_buffer_out.write_string(request.operation()); + + // service context list + + ServiceContextList.write(m_service_context_list, m_message_buffer_out); + + // parameters aligment for GIOPVersion 1.2 + + m_message_buffer_out.fixNextAlignedPosition(CDR.LONGLONG_SIZE); + + } + + /** + * Unmarshals the request header in GIOP 1.0 version. + */ + + protected ServerRequestImpl extractRequest1_0() + { + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // with response ? + + boolean with_response = m_message_buffer_in.read_boolean(); + + // object key + + TargetAddress target = new TargetAddress(); + + ObjectKey key = new ObjectKey(); + + key.read(m_message_buffer_in); + + target.setObjectKey(key); + + // operation name + + String operation = m_message_buffer_in.read_string(); + +// principal: not implemented + + int principal_length = m_message_buffer_in.read_ulong(); + + if(principal_length > 0) { + m_message_buffer_in.skip(principal_length); + } + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_0, + m_request_id, + operation, + m_message_buffer_in, + target); + + request.withResponse(with_response); + + return request; + } + + /** + * Unmarshals the request header in GIOP 1.1 version. + */ + + protected ServerRequestImpl extractRequest1_1() + { + + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + // request_id + + m_request_id = new RequestId(m_message_buffer_in.read_ulong()); + + // with response ? + + boolean with_response = m_message_buffer_in.read_boolean(); + + // reserved octets + + m_message_buffer_in.skipOctetArray(3); + + // object key + + TargetAddress target = new TargetAddress(); + + ObjectKey key = new ObjectKey(); + + key.read(m_message_buffer_in); + + target.setObjectKey(key); + + // operation name + + String operation = m_message_buffer_in.read_string(); + + // principal: not implemented + + int principal_length = m_message_buffer_in.read_ulong(); + + if(principal_length > 0) { + m_message_buffer_in.skip(principal_length); + } + + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_1, + m_request_id, + operation, + m_message_buffer_in, + target); + + request.withResponse(with_response); + + return request; + } + + /** + * Unmarshals the request in GIOP 1.2 version. + */ + + protected ServerRequestImpl extractRequest1_2() + { + // request_id extracted in father receive_message_buffer + + // request_id = new RequestId(message_buffer_in.read_ulong()); + + // with response ? + + byte response_octet = m_message_buffer_in.read_octet(); + + boolean with_response = (response_octet & 0x01) != 0; + + // reserved octets + + m_message_buffer_in.skipOctetArray(3); + + // object key + + TargetAddress target = new TargetAddress(); + + target.read(m_message_buffer_in); + + // operation name + + String operation = m_message_buffer_in.read_string(); + + // service_context_list + + m_service_context_list = ServiceContextList.read(m_message_buffer_in); + + try { + m_message_buffer_in.goNextAlignedPosition(CDR.LONGLONG_SIZE); + } + catch (org.omg.CORBA.MARSHAL M) {} + + m_message_buffer_in.fixStarting(); + + ServerRequestImpl request = new ServerRequestImpl(GIOPVersion.VERSION_1_2, + m_request_id, + operation, + m_message_buffer_in, + target); + request.set_compressor(this.get_compressor()); + request.withResponse(with_response); + + return request; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/GIOPVersion.java b/source/es/tid/TIDorbj/core/comm/giop/GIOPVersion.java new file mode 100644 index 0000000..34c0849 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/GIOPVersion.java @@ -0,0 +1,171 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import java.util.HashMap; + +/** + * GIOPVersion structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: GIOPVersion == GIOPVersion?? +public class GIOPVersion +{ + public int major; + + public int minor; + + private GIOPVersion(int maj, int min) + { + major = maj; + minor = min; + } + + public int getMajor() + { + return major; + } + + public int getMinor() + { + return minor; + } + + public boolean equal(GIOPVersion ver) + { + return (major == ver.major) && (minor == ver.minor); + } + + private static HashMap versionMap; + public static GIOPVersion fromString( String version ){ + //jprojas: hehehe + synchronized( GIOPVersion.class ){ + if ( versionMap == null ){ + versionMap = new HashMap( 3, 1 ); + versionMap.put( "1.0", VERSION_1_0 ); + versionMap.put( "1.1", VERSION_1_1 ); + versionMap.put( "1.2", VERSION_1_2 ); + } + } + //Hope casting doesn't cost too much + return (GIOPVersion)versionMap.get( version ); + + /* + GIOPVersion iiopVersion; + StringTokenizer st = new StringTokenizer( version, ".", false ); + if ( st.countTokens() == 2 ){ + try { + int major = Integer.parseInt( st.nextToken() ); + int minor = Integer.parseInt( st.nextToken() ); + iiopVersion = fromInts( major, minor ); + } catch ( NumberFormatException nfe ){ + //Nothing can be done + iiopVersion = null; + } + } else { + iiopVersion = null; + } + return iiopVersion; + */ + } + + public static GIOPVersion fromInts(int major, int minor) + { + if (major != 1) + return null; + if (minor == 0) + return VERSION_1_0; + if (minor == 1) + return VERSION_1_1; + if (minor == 2) + return VERSION_1_2; + return null; + } + + public static GIOPVersion read(org.omg.CORBA.portable.InputStream input) + { + int major = input.read_octet(); + int minor = input.read_octet(); + if (major != 1) + return null; + if (minor == 0) + return VERSION_1_0; + if (minor == 1) + return VERSION_1_1; + if (minor == 2) + return VERSION_1_2; + return null; + } + + public void write(org.omg.CORBA.portable.OutputStream output) + { + output.write_octet((byte) major); + output.write_octet((byte) minor); + } + + public String toString() + { + if (minor == 0) + return VERSION_1_0_NAME; + if (minor == 1) + return VERSION_1_1_NAME; + else + return VERSION_1_2_NAME; + } + + public final static GIOPVersion VERSION_1_0 = new GIOPVersion(1, 0); + + public final static String VERSION_1_0_NAME = "GIOPVersion(1.0)"; + + public final static GIOPVersion VERSION_1_1 = new GIOPVersion(1, 1); + + public final static String VERSION_1_1_NAME = "GIOPVersion(1.1)"; + + public final static GIOPVersion VERSION_1_2 = new GIOPVersion(1, 2); + + public final static String VERSION_1_2_NAME = "GIOPVersion(1.2)"; + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.java b/source/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.java new file mode 100644 index 0000000..cbdfb1d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/InvocationPoliciesContext.java @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + + +import org.omg.IOP.INVOCATION_POLICIES; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +public class InvocationPoliciesContext extends ServiceContext +{ + + public PolicyContext m_policies; + + protected InvocationPoliciesContext() + { + super(INVOCATION_POLICIES.value); + m_policies = null; + + } + + public PolicyContext getPolicies() + { + return m_policies; + } + + public InvocationPoliciesContext(PolicyContext policies) + { + super(INVOCATION_POLICIES.value); + this.m_policies = policies ; + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_policies = new PolicyContext(null); + + input.enterEncapsulation(); + + m_policies.partialRead(input); + + input.exitEncapsulation(); + + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + + output.write_ulong(m_context_id); + + output.enterEncapsulation(); + + if(m_policies == null) { + output.write_ulong(0); + } else { + m_policies.write(output); + } + + output.exitEncapsulation(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.java b/source/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.java new file mode 100644 index 0000000..6db4266 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/LocateReplyStatusType.java @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; + +/** + * LocateReplyStatusType enumeration defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class LocateReplyStatusType +{ + + public int m_value; + + private LocateReplyStatusType(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public static LocateReplyStatusType from_int(int type) + { + switch (type) + { + case _UNKNOWN_OBJECT: + return UNKNOWN_OBJECT; + case _OBJECT_HERE: + return OBJECT_HERE; + case _OBJECT_FORWARD: + return OBJECT_FORWARD; + case _OBJECT_FORWARD_PERM: + return OBJECT_FORWARD_PERM; + case _LOC_SYSTEM_EXCEPTION: + return LOC_SYSTEM_EXCEPTION; + case _LOC_NEEDS_ADDRESSING_MODE: + return LOC_NEEDS_ADDRESSING_MODE; + default: + return null; + } + } + + public String toString() + { + switch (m_value) + { + case _UNKNOWN_OBJECT: + return "LocateReplyStatusType: UNKNOWN_OBJECT"; + case _OBJECT_HERE: + return "LocateReplyStatusType: OBJECT_HERE"; + case _OBJECT_FORWARD: + return "LocateReplyStatusType: OBJECT_FORWARD"; + case _OBJECT_FORWARD_PERM: + return "LocateReplyStatusType: OBJECT_FORWARD_PERM"; + case _LOC_SYSTEM_EXCEPTION: + return "LocateReplyStatusType: LOC_SYSTEM_EXCEPTION"; + case _LOC_NEEDS_ADDRESSING_MODE: + return "LocateReplyStatusType: LOC_NEEDS_ADDRESSING_MODE"; + default: + return ""; + } + } + + public static final int _UNKNOWN_OBJECT = 0; + + public static final LocateReplyStatusType UNKNOWN_OBJECT = + new LocateReplyStatusType(_UNKNOWN_OBJECT); + + public static final int _OBJECT_HERE = 1; + + public static final LocateReplyStatusType OBJECT_HERE = + new LocateReplyStatusType(_OBJECT_HERE); + + public static final int _OBJECT_FORWARD = 2; + + public static final LocateReplyStatusType OBJECT_FORWARD = + new LocateReplyStatusType(_OBJECT_FORWARD); + + public static final int _OBJECT_FORWARD_PERM = 3; + + public static final LocateReplyStatusType OBJECT_FORWARD_PERM = + new LocateReplyStatusType(_OBJECT_FORWARD_PERM); + + public static final int _LOC_SYSTEM_EXCEPTION = 4; + + public static final LocateReplyStatusType LOC_SYSTEM_EXCEPTION = + new LocateReplyStatusType(_LOC_SYSTEM_EXCEPTION); + + public static final int _LOC_NEEDS_ADDRESSING_MODE = 5; + + public static final LocateReplyStatusType LOC_NEEDS_ADDRESSING_MODE = + new LocateReplyStatusType(_LOC_NEEDS_ADDRESSING_MODE); + + public AddressingDisposition + extractAddressingDisposition(GIOPLocateReplyMessage reply_message) + { + if (value() != LocateReplyStatusType._LOC_NEEDS_ADDRESSING_MODE) + throw new + INTERNAL("Unexpected extract_arguments, NEEDS_ADDRESSING_MODE " + + "is not the reply status"); + + short value = reply_message.m_message_buffer_in.read_ushort(); + AddressingDisposition disposition = + AddressingDisposition.from_short(value); + if (disposition == null) + throw new MARSHAL("Invalid AddressingDisposition value."); + return disposition; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/MessageFactory.java b/source/es/tid/TIDorbj/core/comm/giop/MessageFactory.java new file mode 100644 index 0000000..ff4bbce --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/MessageFactory.java @@ -0,0 +1,79 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * Factory to create GIOP Messages taking a GIOP Header. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class MessageFactory +{ + + public static GIOPMessage fromHeader(GIOPHeader header) + { + switch (header.getMsgType().m_value) + { + case MsgType._Request: + return new GIOPRequestMessage(header); + case MsgType._Reply: + return new GIOPReplyMessage(header); + case MsgType._CancelRequest: + return new GIOPCancelRequestMessage(header); + case MsgType._LocateRequest: + return new GIOPLocateRequestMessage(header); + case MsgType._LocateReply: + return new GIOPLocateReplyMessage(header); + case MsgType._CloseConnection: + return new GIOPMessage(header); + case MsgType._MessageError: + return new GIOPMessage(header); + case MsgType._Fragment: + return new GIOPFragmentMessage(header); + default: + return null; // unreachable + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/MsgType.java b/source/es/tid/TIDorbj/core/comm/giop/MsgType.java new file mode 100644 index 0000000..95a464b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/MsgType.java @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * MsgType structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class MsgType +{ + + public int m_value; + + private MsgType(int val) + { + m_value = val; + } + + public static MsgType from_int(int type) + { + switch (type) + { + case _Request: + return Request; + case _Reply: + return Reply; + case _CancelRequest: + return CancelRequest; + case _LocateRequest: + return LocateRequest; + case _LocateReply: + return LocateReply; + case _CloseConnection: + return CloseConnection; + case _MessageError: + return MessageError; + case _Fragment: + return Fragment; + default: + return null; + } + } + + public static String msgName(int type) + { + switch (type) + { + case _Request: + return "Request"; + case _Reply: + return "Reply"; + case _CancelRequest: + return "CancelRequest"; + case _LocateRequest: + return "LocateRequest"; + case _LocateReply: + return "LocateReply"; + case _CloseConnection: + return "CloseConnection"; + case _MessageError: + return "MessageError"; + case _Fragment: + return "Fragment"; + default: + return null; + } + } + + public static final int _Request = 0; + + public static final MsgType Request = new MsgType(_Request); + + public static final int _Reply = 1; + + public static final MsgType Reply = new MsgType(_Reply); + + public static final int _CancelRequest = 2; + + public static final MsgType CancelRequest = new MsgType(_CancelRequest); + + public static final int _LocateRequest = 3; + + public static final MsgType LocateRequest = new MsgType(_LocateRequest); + + public static final int _LocateReply = 4; + + public static final MsgType LocateReply = new MsgType(_LocateReply); + + public static final int _CloseConnection = 5; + + public static final MsgType CloseConnection = new MsgType(_CloseConnection); + + public static final int _MessageError = 6; + + public static final MsgType MessageError = new MsgType(_MessageError); + + public static final int _Fragment = 7; + + public static final MsgType Fragment = new MsgType(_Fragment); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.java b/source/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.java new file mode 100644 index 0000000..42d3d92 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ReplyStatusType.java @@ -0,0 +1,136 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ReplyStatusType class defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ReplyStatusType +{ + + public int m_value; + + private ReplyStatusType(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public static ReplyStatusType from_int(int type) + { + switch (type) + { + case _NO_EXCEPTION: + return NO_EXCEPTION; + case _USER_EXCEPTION: + return USER_EXCEPTION; + case _SYSTEM_EXCEPTION: + return SYSTEM_EXCEPTION; + case _LOCATION_FORWARD: + return LOCATION_FORWARD; + case _LOCATION_FORWARD_PERM: + return LOCATION_FORWARD_PERM; + case _NEEDS_ADDRESSING_MODE: + return NEEDS_ADDRESSING_MODE; + default: + return null; + } + } + + public String toString() + { + switch (m_value) + { + case _NO_EXCEPTION: + return "ReplyStatusType: NO_EXCEPTION"; + case _USER_EXCEPTION: + return "ReplyStatusType:USER_EXCEPTION"; + case _SYSTEM_EXCEPTION: + return "ReplyStatusType:SYSTEM_EXCEPTION"; + case _LOCATION_FORWARD: + return "ReplyStatusType:LOCATION_FORWARD"; + case _LOCATION_FORWARD_PERM: + return "ReplyStatusType:LOCATION_FORWARD_PERM"; + case _NEEDS_ADDRESSING_MODE: + return "ReplyStatusType:NEEDS_ADDRESSING_MODE"; + } + return ""; + } + + public static final int _NO_EXCEPTION = 0; + + public static final ReplyStatusType NO_EXCEPTION = + new ReplyStatusType(_NO_EXCEPTION); + + public static final int _USER_EXCEPTION = 1; + + public static final ReplyStatusType USER_EXCEPTION = + new ReplyStatusType(_USER_EXCEPTION); + + public static final int _SYSTEM_EXCEPTION = 2; + + public static final ReplyStatusType SYSTEM_EXCEPTION = + new ReplyStatusType(_SYSTEM_EXCEPTION); + + public static final int _LOCATION_FORWARD = 3; + + public static final ReplyStatusType LOCATION_FORWARD = + new ReplyStatusType(_LOCATION_FORWARD); + + public static final int _LOCATION_FORWARD_PERM = 4; + + public static final ReplyStatusType LOCATION_FORWARD_PERM = + new ReplyStatusType(_LOCATION_FORWARD_PERM); + + public static final int _NEEDS_ADDRESSING_MODE = 5; + + public static final ReplyStatusType NEEDS_ADDRESSING_MODE = + new ReplyStatusType(_NEEDS_ADDRESSING_MODE); +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/RequestId.java b/source/es/tid/TIDorbj/core/comm/giop/RequestId.java new file mode 100644 index 0000000..f355831 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/RequestId.java @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * RequestId defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class RequestId +{ + protected int m_value; + + public RequestId(int val) + { + m_value = val; + } + + public int value() + { + return m_value; + } + + public int hashCode() + { + return m_value; + } + + public boolean equals(Object obj) + { + if (obj instanceof RequestId) + return m_value == ((RequestId) obj).m_value; + + return false; + + } + + public String toString() + { + return "RequestId: " + m_value; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ServiceContext.java b/source/es/tid/TIDorbj/core/comm/giop/ServiceContext.java new file mode 100644 index 0000000..14f5ca7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ServiceContext.java @@ -0,0 +1,94 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ServiceContext structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContext +{ + + public int m_context_id; + + public es.tid.TIDorbj.core.cdr.Encapsulation m_context_data; + + public ServiceContext(int context_id) + { + this.m_context_id = context_id; + m_context_data = null; + } + + public ServiceContext(int context_id, + es.tid.TIDorbj.core.cdr.Encapsulation context_data) + { + this.m_context_id = context_id; + this.m_context_data = context_data; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_context_id); + output.writeEncapsulation(m_context_data); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_context_data = input.readEncapsulation(); + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUlong(); // skip context_id + input.skipEncapsulation(); + } + + public static void partialSkip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + //skip encapusulation + input.skipEncapsulation(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ServiceContextList.java b/source/es/tid/TIDorbj/core/comm/giop/ServiceContextList.java new file mode 100644 index 0000000..382e4cc --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ServiceContextList.java @@ -0,0 +1,98 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * ServiceContextList sequence defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContextList +{ + + public ServiceContext[] m_components; + + public ServiceContextList(int count) + { + m_components = new ServiceContext[count]; + } + + public static ServiceContextList + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int count = input.read_ulong(); + + if (count == 0) + return null; + + if (count < 0) + throw new org.omg.CORBA.MARSHAL("Invalid ServiceContext size"); + + ServiceContextList list = new ServiceContextList(count); + + for (int i = 0; i < count; i++) + list.m_components[i] = ServiceContextReader.read(input); + + return list; + } + + public static void write(ServiceContextList list, + es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (list == null) + output.write_ulong(0); + else { + output.write_ulong(list.m_components.length); + for (int i = 0; i < list.m_components.length; i++) + list.m_components[i].write(output); + } + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int count = input.read_ulong(); + for (int i = 0; i < count; i++) + ServiceContext.skip(input); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.java b/source/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.java new file mode 100644 index 0000000..5d25536 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ServiceContextReader.java @@ -0,0 +1,79 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +import org.omg.IOP.INVOCATION_POLICIES; + + +/** + * Helper class for read ServiceContext structures. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ServiceContextReader +{ + + public static ServiceContext + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int id = input.read_ulong(); + ServiceContext serv_ctx = null; + switch (id) + { + // Standart CORBA Service Contexts + case org.omg.IOP.BI_DIR_IIOP.value: + serv_ctx = new BiDirServiceContext(); + serv_ctx.partialRead(input); + return serv_ctx; + case INVOCATION_POLICIES.value: + serv_ctx = new InvocationPoliciesContext(); + serv_ctx.partialRead(input); + return serv_ctx; + default: + serv_ctx = new ServiceContext(id); + serv_ctx.partialRead(input); + return serv_ctx; + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ServiceId.java b/source/es/tid/TIDorbj/core/comm/giop/ServiceId.java new file mode 100644 index 0000000..51b409d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ServiceId.java @@ -0,0 +1,72 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; + +/** + * Constant values related with ServiceId GIOP definitions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public interface ServiceId +{ + public static final int TransactionService = 0; + + public static final int CodeSets = 1; + + public static final int ChainBypassCheck = 2; + + public static final int ChainBypassInfo = 3; + + public static final int LogicalThreadId = 4; + + public static final int BI_DIR_IIOP = 5; + + public static final int SendingContextRunTime = 6; + + public static final int INVOCATION_POLICIES = 7; + + public static final int FORWARDED_ENTITY = 8; + + public static final int UnkownExceptionInfo = 9; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.java b/source/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.java new file mode 100644 index 0000000..1258ce1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/giop/ZIOPMessage.java @@ -0,0 +1,406 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.giop; // ziop?? + +import org.omg.CORBA.INTERNAL; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.Compressor; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; + +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; + +import org.omg.CORBA.COMM_FAILURE; + +public class ZIOPMessage + extends GIOPMessage +{ + BufferCDR m_original_message_buffer; + + CDRInputStream m_message_buffer_in; + + CDROutputStream m_message_buffer_out; + + int m_fragment_size; + + int m_original_length; + + public ZIOPMessage(GIOPMessage giop_message, int fragment_size) + { + super(giop_message.getHeader()); + m_original_message_buffer = giop_message.getMessageBuffer(); + m_message_buffer_in = null; + m_message_buffer_out = null; + m_fragment_size = fragment_size; + } + + public ZIOPMessage(GIOPHeader header, int fragment_size) + { + super(header); + m_original_message_buffer = null; + m_message_buffer_in = null; + m_message_buffer_out = null; + m_fragment_size = fragment_size; + } + + + public void receiveBody(Connection conn, + byte[] header_bytes) + { + super.receiveBody(conn, header_bytes); + + m_message_buffer_in = new CDRInputStream(conn.orb(), m_message_buffer); + m_message_buffer_in.setByteOrder(m_header.getByteOrder()); + + m_message_buffer_in.setVersion(m_header.getVersion()); + m_message_buffer_in.setMessage(true); + + m_message_completed = !(m_header.hasMoreFragments()); + + byte[] compressed = new byte[0]; + int compressed_length; + compressed_length = m_header.getSize() - 8; // CompressionData without data buffer + compressed = new byte[compressed_length]; + + // Read CompressionData + int original_length; + m_compressor.compressor_id = m_message_buffer_in.read_ushort(); + original_length = m_message_buffer_in.read_ulong(); + m_message_buffer_in.read_octet_array(compressed, 0, compressed_length); + + Compressor compressor_ptr = null; + try { + compressor_ptr = + conn.orb().getCompressionManager().get_compressor(m_compressor.compressor_id, + (short)0); + } catch (org.omg.Compression.UnknownCompressorId ex) { + return; + } + + org.omg.CORBA.OctetSeqHolder uncompressed = new org.omg.CORBA.OctetSeqHolder(); + + try { + compressor_ptr.decompress(compressed, uncompressed); + } catch (org.omg.Compression.CompressionException ex) { + return; + } + + if (conn.orb().m_trace != null) { + String[] msg = { + "Uncompressing ZIOP message ", + " from " + compressed.length + " bytes ", + " to " + uncompressed.value.length + " bytes ", + "using compressor " + m_compressor.compressor_id }; + conn.orb().printTrace(Trace.USER, msg); + } + + + // From uncompressed to CDRInputStream + ChunkCDR chunk = + new ChunkCDR(uncompressed.value.length); + + System.arraycopy(uncompressed.value, 0, chunk.getBuffer(), 0, uncompressed.value.length); + + chunk.setAvailable(uncompressed.value.length); + m_original_message_buffer = new BufferCDR(chunk); + + } + + public int get_fragment_size(TIDORB orb) + { + return m_fragment_size; + } + + public boolean perform_compression(TIDORB orb, + CompressorIdLevel compressor, + int low_value, + float min_ratio) + { + this.createMessageBufferOutput(orb); + + this.getHeader().setCompressed(true); + + + Compressor compressor_ptr = null; + try { + compressor_ptr = + orb.getCompressionManager().get_compressor(compressor.compressor_id, + compressor.compression_level); + } catch (org.omg.Compression.UnknownCompressorId ex) { + return false; + } + + + // Write 'body_buffer_out' bufferCDR into 'source' OctetSeq + byte[] source = new byte[0]; + int source_length = 0; + BufferCDR buffer = m_original_message_buffer; + int num_chunks = buffer.getNumAvailableChunks(); + ChunkCDR chunk = null; + for(int i = 0; i < num_chunks; i++) { + chunk = buffer.getChunk(i); + int current_length = source_length; + source_length += chunk.getAvailable(); + byte[] aux_buffer = new byte[source_length]; + if (source_length > 0) + System.arraycopy(source, 0, aux_buffer, 0, current_length); + System.arraycopy(chunk.getBuffer(), 0, aux_buffer, current_length, + chunk.getAvailable()); + source = aux_buffer; + } + + // Check (source_length > CompressorLowValue) to apply or not compression + if (source.length < low_value) { + return false; + } + + // Apply compression to source + org.omg.CORBA.OctetSeqHolder compressed = new org.omg.CORBA.OctetSeqHolder(); + try { + compressor_ptr.compress(source, compressed); + } catch (org.omg.Compression.CompressionException ex) { + return false; + } + + // Write compressed OctetSeq into message_buffer_out + m_message_buffer_out.write_ushort(compressor.compressor_id); + m_message_buffer_out.write_ulong(source.length); + + // Check min ratio + float ratio = ((float)1 - ((float)compressed.value.length / (float)source.length)); + if ( ratio < min_ratio ) { + return false; + } + + m_message_buffer_out.write_octet_array(compressed.value, 0 , compressed.value.length); + + m_message_completed = true; + + if (orb.m_trace != null) { + String[] msg = { + "Compressing GIOP message ", + "from " + source.length + " bytes ", + "to " + compressed.value.length + " bytes ", + "using compressor " + compressor.compressor_id, + " with level " + compressor.compression_level, + " achieving ratio " + (ratio*100) + " %" + }; + orb.printTrace(Trace.USER, msg); + } + + m_header.setSize(m_message_buffer.getAvailable() - + GIOPHeader.HEADER_SIZE); + m_headers_marshaled = false; + + return true; + } + + public void connect_GIOPMessage(Connection conn) + { + TIDORB _orb = conn.orb(); + + switch (m_header.getMsgType().m_value) + { + case MsgType._Request: + { + GIOPRequestMessage message = new GIOPRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + message.set_compressor(m_compressor); + + if (_orb.m_trace != null){ + _orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + _orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + _orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + conn.manageMessage((GIOPRequestMessage) message); + break; + } + case MsgType._Reply: + { + GIOPReplyMessage message = new GIOPReplyMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + // Skip GIOP Reply header + switch (m_header.getVersion().getMinor()) { + case 0: + case 1: + message.unmarshalReplyHeader1_1(); + break; + case 2: + message.unmarshalReplyHeader1_2(); + break; + } + + if (_orb.m_trace != null){ + _orb.printTrace(Trace.DUMP, "GIOP message chunk received - HEXDUMP " + + message.getMessageBuffer().getChunk(0).getLength() + + " bytes"); + _orb.printDump(Trace.DUMP, + message.getMessageBuffer().getChunk(0).getBuffer(), + message.getMessageBuffer().getChunk(0).getLength()); + + _orb.printTrace(Trace.DEEP_DEBUG, toString() + ": " + + message.toString() + + " has been received!"); + } + + conn.manageMessage((GIOPReplyMessage) message); + break; + } + case MsgType._CancelRequest: + { + GIOPCancelRequestMessage message = new GIOPCancelRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer); + + conn.manageMessage((GIOPCancelRequestMessage) message); + break; + } + case MsgType._LocateRequest: + { + GIOPLocateRequestMessage message = new GIOPLocateRequestMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + conn.manageMessage((GIOPLocateRequestMessage) message); + break; + } + case MsgType._LocateReply: + { + GIOPLocateReplyMessage message = new GIOPLocateReplyMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer, original_buffer_in); + + conn.manageMessage((GIOPLocateReplyMessage) message); + break; + } + case MsgType._Fragment: + { + GIOPFragmentMessage message = new GIOPFragmentMessage(m_header); + + CDRInputStream original_buffer_in = + new CDRInputStream(_orb, m_original_message_buffer); + + original_buffer_in.fixStarting(); + + message.setBody(m_original_message_buffer); + + conn.manageMessage((GIOPFragmentMessage) message); + break; + } + case MsgType._CloseConnection: + conn.closeByPair(); + return; + case MsgType._MessageError: + conn.closeByError(new COMM_FAILURE("Connection closed due to pair " + + "message error.")); + return; + } + + } + + public void createMessageBufferOutput(TIDORB orb) + { + if (m_message_buffer == null) + m_message_buffer = new BufferCDR( this.get_fragment_size(orb) ); + else + m_message_buffer.recycle(); + + m_message_buffer_out = new CDROutputStream(orb, m_message_buffer); + + m_message_buffer_out.setVersion(m_header.getVersion()); + + m_message_buffer_out.setMessage(true); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/all-wcprops b/source/es/tid/TIDorbj/core/comm/iiop/.svn/all-wcprops new file mode 100644 index 0000000..a09957e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/all-wcprops @@ -0,0 +1,173 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop +END +LockEnumeration.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.java +END +ConnectionState.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ConnectionState.java +END +WriteTimeout.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.java +END +CommunicationLayer.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.java +END +IIOPCorbaloc.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.java +END +IIOPLocateResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.java +END +OpeningLock.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/OpeningLock.java +END +ListenPoint.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ListenPoint.java +END +IIOPCommLayer.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.java +END +IORAddressingInfo.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.java +END +IIOPIOR.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.java +END +IIOPConnectionManager.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.java +END +RECOVERABLE_COMM_FAILURE.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.java +END +IIOPCommunicationLayerPropertiesInfo.java +K 25 +svn:wc:ra_dav:version-url +V 126 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.java +END +ServerListener.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ServerListener.java +END +IIOPResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.java +END +FragmentedMessageHolder.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.java +END +IIOPConnection.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.java +END +IIOPProfile.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.java +END +IIOPCommunicationDelegate.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.java +END +ConnectionWriteMonitor.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.java +END +IIOPCommunicationLayer.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.java +END +LockList.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/LockList.java +END +ConnectionThread.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.java +END +CommLayer.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/CommLayer.java +END +Lock.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/Lock.java +END +ReliableOnewayThread.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.java +END +TargetAddress.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop/TargetAddress.java +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/entries b/source/es/tid/TIDorbj/core/comm/iiop/.svn/entries new file mode 100644 index 0000000..64a5185 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/entries @@ -0,0 +1,980 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/iiop +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +LockEnumeration.java +file +478 + + + +2011-04-29T14:42:47.000000Z +3a3f9c239b26a01f7fc1e9f47e67797f +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +1940 + +ConnectionState.java +file +478 + + + +2011-04-29T14:42:47.000000Z +dceff37941da545fb94f3c450c6a9986 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +4098 + +WriteTimeout.java +file +478 + + + +2011-04-29T14:42:47.000000Z +48fdedc3a1358de7ddf5b86dd30ca08a +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +1634 + +CommunicationLayer.java +file + + + + +2009-05-27T12:24:01.000000Z +6abf02afc3dce68fb3c80575dfc9e0c2 +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +3628 + +IIOPLocateResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +f6ec949aadf4ab364db530db7f3005e3 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5663 + +IIOPCorbaloc.java +file +478 + + + +2011-04-29T14:42:47.000000Z +de288cdc74a1a401767c9b1aea39ae23 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +5900 + +ListenPoint.java +file +478 + + + +2011-04-29T14:42:47.000000Z +f2dd92ebac541d92bf134869984918e9 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3152 + +OpeningLock.java +file +478 + + + +2011-04-29T14:42:47.000000Z +8d8eb5043cb8f25ecba00a096bc9c468 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3139 + +IIOPCommLayer.java +file +478 + + + +2011-04-29T14:42:47.000000Z +1ed06620182514151bd6195a56c7eedd +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +33021 + +IORAddressingInfo.java +file + + + + +2009-05-27T12:24:01.000000Z +933116c93794559641ee44929db94a79 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2984 + +IIOPIOR.java +file +478 + + + +2011-04-29T14:42:47.000000Z +3bebf720a082b9a69e9c7acbfc45c6ac +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +7087 + +IIOPConnectionManager.java +file +478 + + + +2011-04-29T14:42:47.000000Z +f96a8713fe222b70a82927e93a7c72e6 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +23485 + +RECOVERABLE_COMM_FAILURE.java +file + + + + +2009-05-27T12:24:01.000000Z +3a03be5f197268cbf9989c42b171a829 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1976 + +IIOPCommunicationLayerPropertiesInfo.java +file + + + + +2010-04-28T10:47:58.000000Z +eadb01d840351bdb6c82f0adacbcb50c +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +16122 + +ServerListener.java +file + + + + +2011-03-25T16:13:23.000000Z +c82e32836512dcc3845e3b5384715163 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +12763 + +IIOPResponseHandler.java +file + + + + +2009-05-27T14:10:34.000000Z +bfba1cddb455f7fa98a32b502578298c +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +5911 + +FragmentedMessageHolder.java +file + + + + +2009-05-27T12:24:01.000000Z +d2ee7b3d3a29afd667c9c0a1b64434ae +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2245 + +IIOPConnection.java +file +478 + + + +2011-04-29T14:42:47.000000Z +eedc2f6717ad25fc758f75fa424b8d92 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +16344 + +IIOPCommunicationDelegate.java +file + + + + +2010-04-28T10:50:46.000000Z +66bd971a5ab3f1968d28de900841cbe5 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +11255 + +IIOPProfile.java +file +478 + + + +2011-04-29T14:42:47.000000Z +24c3d0e1b32d37c31cffbb4a383f714c +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +12024 + +ConnectionWriteMonitor.java +file +478 + + + +2011-04-29T14:42:47.000000Z +cb16790466e88de016ce91ba4ac1048f +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2869 + +IIOPCommunicationLayer.java +file +478 + + + +2011-04-29T14:42:47.000000Z +889f9c135c15f502e479ab05e6934918 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +11236 + +LockList.java +file +478 + + + +2011-04-29T14:42:47.000000Z +74b33d894a278ee9885982cc84f13e22 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2235 + +ConnectionThread.java +file +478 + + + +2011-04-29T14:42:47.000000Z +f59a5fddaed526f0f3721e693b274f15 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2063 + +CommLayer.java +file +478 + + + +2011-04-29T14:42:47.000000Z +55b47af9dbf225aafd258eeab5845e4c +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +6964 + +Lock.java +file +478 + + + +2011-04-29T14:42:47.000000Z +1da05f7aced2824e4bb95842bd3f216a +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3427 + +ReliableOnewayThread.java +file +478 + + + +2011-04-29T14:42:47.000000Z +158a808cd942d8d78cecbfed685fa974 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2027 + +TargetAddress.java +file + + + + +2009-05-27T12:24:01.000000Z +467029c03ff7849d722c26b0f93de885 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5981 + diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommunicationLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/CommunicationLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionState.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionState.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionState.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionThread.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionThread.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionThread.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionWriteMonitor.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionWriteMonitor.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ConnectionWriteMonitor.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/FragmentedMessageHolder.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/FragmentedMessageHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/FragmentedMessageHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationDelegate.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationDelegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationDelegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnection.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnection.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnection.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnectionManager.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnectionManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPConnectionManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCorbaloc.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCorbaloc.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPCorbaloc.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPIOR.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPIOR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPIOR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPLocateResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPProfile.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPProfile.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPProfile.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IIOPResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IORAddressingInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IORAddressingInfo.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/IORAddressingInfo.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ListenPoint.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ListenPoint.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ListenPoint.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/Lock.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/Lock.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/Lock.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockEnumeration.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockEnumeration.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockEnumeration.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockList.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/LockList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/OpeningLock.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/OpeningLock.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/OpeningLock.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/RECOVERABLE_COMM_FAILURE.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/RECOVERABLE_COMM_FAILURE.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/RECOVERABLE_COMM_FAILURE.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ReliableOnewayThread.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ReliableOnewayThread.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ReliableOnewayThread.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ServerListener.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ServerListener.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/ServerListener.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/TargetAddress.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/TargetAddress.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/TargetAddress.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/WriteTimeout.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/WriteTimeout.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/prop-base/WriteTimeout.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommLayer.java.svn-base new file mode 100644 index 0000000..c80d707 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommLayer.java.svn-base @@ -0,0 +1,248 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.comm.local.LocalCommLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommLayer; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Communication Layer. It will manage requests, dispatching these to the local + * or the internet communication layers. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @see es.tid.TIDorbj.core.comm.local.LocalCommLayer + * @see es.tid.TIDorbj.core.comm.iiopCommLayer + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +// TODO: move comm.iiop.CommLayer to comm.CommLayer + +public class CommLayer extends CommunicationLayer +{ + /** + * the internet layer for sending remote request + */ + IIOPCommLayer m_external_layer; + + /** + * the local layer for sending request to local objects. + */ + es.tid.TIDorbj.core.comm.local.LocalCommLayer m_internal_layer; + + public CommLayer(es.tid.TIDorbj.core.TIDORB orb) + { + super(orb); + + if ( orb.m_conf.comm_layers.indexOf("es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer" ) > -1 ) { + m_external_layer = new SSLIOPCommLayer(orb); + } else { + m_external_layer = new IIOPCommLayer(orb); + } + + m_internal_layer = new LocalCommLayer(orb); + } + + /** + * Sends a request. + * + * @param request + * the CORBA request. + */ + public void request( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + // check policy context + + try { + + if (isLocal(ior)) { + // si es local + m_internal_layer.request(request, ior); + } else { + m_external_layer.request(request, ior); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Sends a oneway request. + * + * @param request + * the CORBA request. + */ + public void onewayRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + try { + if (isLocal(ior)) { + // si es local + m_internal_layer.onewayRequest(request, ior); + } else { + m_external_layer.onewayRequest(request, ior); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + // AMI callback operations + + /** + * Sends a asynchronous request. + * + * @param request + * the CORBA request. + */ + public void asyncRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) //*opc1*, Object ami_handler) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + // check policy context + + try { + + if (isLocal(ior)) { + // si es local + m_internal_layer.asyncRequest(request, ior); //*opc1*, ami_handler); + } else { + m_external_layer.asyncRequest(request, ior); //*opc1*, ami_handler); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Sends a object existence request using the local or the IIOP + * communication layers. + * + * @param ior + * the object IOR. + */ + + public boolean objectExists( IIOPIOR ior, + PolicyContext policy_context) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + + try { + if (isLocal(ior)) { + return m_internal_layer.objectExists(ior, policy_context); + } else { + return m_external_layer.objectExists(ior, policy_context); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Test whether an ior is local to the ORB or not. + * + * @param ior + * the object IOR. + */ + public boolean isLocal( IIOPIOR ior) + { + return m_external_layer.isLocal(ior); + } + + public void shutdown() + { + m_external_layer.shutdown(); + } + + public void destroy() + { + m_external_layer.destroy(); + } + + public IIOPCommLayer getExternalLayer() + { + return m_external_layer; + } + + /** + * Prepare a stream based request. + * + * @param request + * the CORBA request. + */ + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + m_external_layer.prepareRequest(request); + } + + public org.omg.CORBA.portable.InputStream + request(IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + PolicyContext policy_context) + throws es.tid.TIDorbj.core.comm.ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException + { + return m_external_layer.request(ior, stream, policy_context); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommunicationLayer.java.svn-base new file mode 100644 index 0000000..ae82478 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/CommunicationLayer.java.svn-base @@ -0,0 +1,124 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.comm.ForwardRequest; + +/** + * Base class for the ORB communications layers. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class CommunicationLayer extends es.tid.TIDorbj.core.ORBComponent +{ + public CommunicationLayer(es.tid.TIDorbj.core.TIDORB orb) + { + super(orb); + } + + /** + * Sends a request. + * + * @param request + * the CORBA request. + */ + public abstract void request( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) + throws ForwardRequest; + + /** + * Sends a oneway request. + * + * @param request + * the CORBA request. + */ + public abstract void onewayRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior); + + /** + * Sends a asynchronous request. + * + * @param request + * the CORBA request. + */ + public abstract void asyncRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior /* *opc1* , Object ami_handler*/) throws ForwardRequest; + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + * + */ + public abstract boolean + objectExists( + IIOPIOR ior, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws ForwardRequest; + + /** + * Prepare a stream based request. + * + * @param request + * the CORBA request. + */ + public abstract void prepareRequest( + es.tid.TIDorbj.core.StreamRequestImpl request ); + + public abstract org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionState.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionState.java.svn-base new file mode 100644 index 0000000..0aa5f7b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionState.java.svn-base @@ -0,0 +1,163 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +/** + * TIDorb IIOP IIOPConnection State. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class ConnectionState +{ + + /** + * Open connection state. + */ + public final static short OPEN_STATE = 0; + + /** + * Open connection state. + */ + public final static short CLOSING_STATE = 1; + + /** + * Open connection state. + */ + public final static short ERROR_STATE = 2; + + /** + * IIOPConnection state. + */ + private short m_state; + + /** + * IIOPConnection error that unhabilitates the connection. + */ + protected COMM_FAILURE m_connection_error; + + public ConnectionState() + { + m_state = OPEN_STATE; + m_connection_error = null; + } + + synchronized public boolean setClosing() + { + if (m_state != OPEN_STATE) + return false; + + m_state = CLOSING_STATE; + + return true; + } + + synchronized public boolean isOpen() + { + return m_state == OPEN_STATE; + } + + synchronized public boolean seterror(COMM_FAILURE error) + { + if (m_state == ERROR_STATE) { + return false; + } else if (m_state == CLOSING_STATE) { + m_state = ERROR_STATE; + m_connection_error = error; + return false; + } else { // OPEN_STATE + m_state = ERROR_STATE; + m_connection_error = error; + return true; + } + } + + synchronized public short getValue() + { + return m_state; + } + + public COMM_FAILURE getError() + { + return m_connection_error; + } + + /** + * Verify if the reply can be sent. + */ + synchronized public void verifyForReply() + { + switch (m_state) + { + case OPEN_STATE: + return; + case CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection is closed."); + case ERROR_STATE: + throw m_connection_error; + } + } + + /** + * Verify if the request can be sent. + */ + synchronized public void verifyForRequest() + throws RECOVERABLE_COMM_FAILURE + { + switch (m_state) + { + case OPEN_STATE: + return; + case CLOSING_STATE: + throw new RECOVERABLE_COMM_FAILURE( + new COMM_FAILURE("IIOPConnection is closed.")); + case ERROR_STATE: + throw new RECOVERABLE_COMM_FAILURE(m_connection_error); + } + } + +} + diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionThread.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionThread.java.svn-base new file mode 100644 index 0000000..e7c104a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionThread.java.svn-base @@ -0,0 +1,70 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + + +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Thread that receives messages in the connection. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +// TODO: move comm.iiop.ConnectionThread to comm.ConnectionThread + +public class ConnectionThread extends java.lang.Thread +{ + Connection m_connection; + + public ConnectionThread(Connection conn) + { + m_connection = conn; + } + + public void run() + { + m_connection.receiveMessage(); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionWriteMonitor.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionWriteMonitor.java.svn-base new file mode 100644 index 0000000..b0e0321 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ConnectionWriteMonitor.java.svn-base @@ -0,0 +1,115 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision$ + * Date: $Date$ + * Last modified by: $Author$ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +public class ConnectionWriteMonitor +{ + final static int FREE = 0; + + final static int WRITTING = 1; + + final static int ERROR = 2; + + int m_status; + + int m_timeout; + + COMM_FAILURE m_exception; + + public ConnectionWriteMonitor(int timeout) + { + m_timeout = timeout; + m_status = FREE; + m_exception = null; + } + + public synchronized void initWrite() + throws WriteTimeout + { + long t0 = new java.util.Date().getTime();//msegs + long t1; + long dif = 0; + + while ( m_status==WRITTING && dif < m_timeout){ + try { + wait(m_timeout); + } + catch (java.lang.InterruptedException ie) {} + + t1 = new java.util.Date().getTime(); + dif = t1-t0; + } + + if (m_status == WRITTING) { + m_status = ERROR; + m_exception = new COMM_FAILURE("Socket write timeout"); + throw new WriteTimeout(); + } + + if (m_status == ERROR) + throw m_exception; + + if (m_status == FREE) + m_status = WRITTING; + } + + public synchronized void endWrite() + { + m_status = FREE; + notify(); + } + + public COMM_FAILURE getException() + { + return m_exception; + } + + public synchronized void setException(COMM_FAILURE cf) + { + m_exception = cf; + notifyAll(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/FragmentedMessageHolder.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/FragmentedMessageHolder.java.svn-base new file mode 100644 index 0000000..0777d6b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/FragmentedMessageHolder.java.svn-base @@ -0,0 +1,77 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.util.RemovableObject; + +/** + * Adapter class for maintaining an uncompleted fragmented message in a + * UseTable. + * + * @see es.tid.TIDorbj.core.util.UseTable + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class FragmentedMessageHolder + implements RemovableObject +{ + + public GIOPFragmentedMessage m_message; + + public FragmentedMessageHolder(GIOPFragmentedMessage msg) + { + m_message = msg; + } + + /** + * The message will always can be removed. + */ + public boolean canBeRemoved() + { + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommLayer.java.svn-base new file mode 100644 index 0000000..9b8075c --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommLayer.java.svn-base @@ -0,0 +1,1047 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESOURCES; +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * IIOP Communications layer. It will manage the request for a remote object + * using the IIOP Protocol. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IIOPCommLayer extends es.tid.TIDorbj.core.comm.iiop.CommunicationLayer +{ + /** + * The ORB has been destroyed. + */ + + public boolean m_destroyed; + + /** + * Server Socket listening thread. + */ + protected ServerListener m_server_listener; + + /** + * Conection manager. + */ + protected IIOPConnectionManager m_connection_manager; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + protected ServiceContextList m_bidirectional_service; + + protected int max_recover_count; + protected int recover_time; + protected boolean reliable_oneway; + protected GIOPVersion giopVersion; + + //TODO: remove ORB's from here if possible, and get CommunicationLayer + public IIOPCommLayer(TIDORB orb) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb); + m_destroyed = false; + m_connection_manager = new IIOPConnectionManager(orb, this); + m_bidirectional_service = null; + m_server_listener = null; + + max_recover_count = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.MAX_COMM_RECOVERING_TRIES + ).getInt(); + + recover_time = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.COMM_RECOVERING_TIME + ).getInt(); + + reliable_oneway = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY + ).getBoolean(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + } + + public IIOPCommLayer(TIDORB orb, SSLIOPCommLayer ssliop_layer) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb); + m_destroyed = false; + m_connection_manager = new IIOPConnectionManager(orb, ssliop_layer); + m_bidirectional_service = null; + m_server_listener = null; + + max_recover_count = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.MAX_COMM_RECOVERING_TRIES + ).getInt(); + + recover_time = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.COMM_RECOVERING_TIME + ).getInt(); + + reliable_oneway = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY + ).getBoolean(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + } + + public boolean isLocal( IIOPIOR ior) + { + if (m_server_listener == null) // no object adaptor initialized + return false; + + // Check matching between IOR ListenPoint and server_listener ListenPoints + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + int i = 0; + + while (i < listen_points.size() ) { + if ( ((ListenPoint)listen_points.elementAt(i)).equals(ior.profileIIOP() + .getListenPoint())) + return true; + i++; + } + return false; + } + + public boolean hasServerListener() + { + return (m_server_listener != null); + } + + /** + * Sends a request (with response) allocating an active connection with the + * corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + protected void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + PolicyContext policy_context = request.getPolicyContext(); + + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendRequest(request, ior); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * Sends a request using the IIOP protocol. + * + * @param request + * the CORBA request. + */ + public void request(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws ForwardRequest + { + request.withResponse(true); + sendRequest(request, ior); + } + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void onewayRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + if ( reliable_oneway ) { + try { + ReliableOnewayThread th = + new ReliableOnewayThread(this, request, ior); + th.start(); + return; + } + catch (Throwable thw) { + throw new NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } else { + + try { + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + + conn = + m_connection_manager + .getClientConnection(profile.getListenPoint(), + request.getPolicyContext()); + + conn.sendOnewayRequestAsync(request, ior); + + } + catch (Throwable th) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + "Exception in oneway remote invocation", + th); + } + } + } + + /** + * Sends a asynchronous request using the IIOP protocol allocating an active + * connection with the corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + public void asyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) //*opc1*, Object ami_handler) + throws ForwardRequest + { + + request.withResponse(true); + + PolicyContext policy_context = request.getPolicyContext(); + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendAsyncRequest(request, ior); //*opc1*, ami_handler); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void reliableOnewayRun( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + PolicyContext policy_context = + request.getPolicyContext(); + + request.reliableOneway(true); + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + + conn = + m_connection_manager + .getClientConnection(profile.getListenPoint(), + policy_context); + + conn.sendOnewayRequestSync(request, ior); + + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) + throw rcf.m_comm_failure; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication" + +" recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + + recover_count--; + + if (m_orb.m_trace != null) { + String[] msg = { "Communication forwarded: ", + fr.forward_reference.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + } + } + } + catch (Throwable e) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Exception in reliable remote oneway invocation :", + e); + } + } + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + */ + public boolean objectExists(IIOPIOR ior, + PolicyContext policy_context) + throws ForwardRequest + { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendLocateRequest(ior, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + org.omg.CORBA.portable.ObjectImpl obj = request.getTarget(); + es.tid.TIDorbj.core.comm.CommunicationDelegate delegate = + (es.tid.TIDorbj.core.comm.CommunicationDelegate) obj + ._get_delegate(); + es.tid.TIDorbj.core.iop.IOR ior = delegate.getReference(); + + IIOPIOR iiopIOR; + if ( ior instanceof IIOPIOR ){ + iiopIOR = ( IIOPIOR )ior; + } else { + throw new org.omg.CORBA.INTERNAL("Not an IIOP IOR."); + } + + PolicyContext policy_context = + delegate.createRequestPolicyContext(); + + IIOPProfile profile; + profile = iiopIOR.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + } + + IIOPConnection conn = null; + int recover_count = max_recover_count; + + while (conn == null) { + + try { + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + } + + conn.prepareRequest(request, iiopIOR); + + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + CDROutputStream stream, + PolicyContext policy_context + ) throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn = null; + int recover_count = max_recover_count; + + while (true) { + try { + + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendRequest(ior, stream, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * ORB Server IIOPConnection part shutdown. + */ + public synchronized void shutdown() + { + try { + if (m_server_listener != null) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "Shutdown IIOPCommLayer .ServerListener"); + } + m_server_listener.shutdown(); + m_server_listener = null; + } + } + catch (Throwable e) {} + } + + /** + * IIOP Layer close. + */ + public synchronized void destroy() + { + if (!m_destroyed) { + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, "Destroying IIOPCommLayer"); + } + + try { + if (m_server_listener != null) { + m_server_listener.shutdown(); + m_server_listener = null; + } + } + catch (Throwable e) {} + + try { + if (m_connection_manager != null) { + m_connection_manager.destroy(); + m_connection_manager = null; + } + } + catch (Throwable e) {} + + m_bidirectional_service = null; + + m_destroyed = true; + } + } + + public synchronized void initServerListener() + { + if (m_server_listener == null) { + m_server_listener = new ServerListener(m_connection_manager); + m_server_listener.setDaemon(false); + try { + + m_server_listener.start(); + + } + catch (Throwable thw) { + m_server_listener = null; + throw new org.omg.CORBA.NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } + } + + public synchronized IOR createIOR(String id, + POAKey key, + TaggedComponent[] extraComponents) + { + if (m_server_listener == null) + throw new org.omg.CORBA.INTERNAL("ServerListener not initialized"); + + // return m_server_listener.createIOR(id, key, components); + + TaggedProfile[] profiles = new TaggedProfile[1]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + int i = 0; + while (i < listen_points.size() ) { + profiles[i] = new IIOPProfile( + this.giopVersion, + (ListenPoint)listen_points.elementAt(i), + key, + components + ); + i++; + } + return new IIOPIOR(id, profiles); + + + } + + public synchronized IOR createIOR(String id, + ObjectKey key, + TaggedComponent[] extraComponents) + { + if (m_server_listener == null) + throw new org.omg.CORBA.INTERNAL("ServerListener not initialized"); + + // return m_server_listener.createIOR(id, key, components); + + + + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + TaggedProfile[] profiles = new TaggedProfile[listen_points.size()]; + int i = 0; + + while (i < listen_points.size() ) { + profiles[i] = new IIOPProfile( + this.giopVersion, + //m_server_listener.getListenPoint(), + (ListenPoint)listen_points.elementAt(i), + key, + components + ); + i++; + } + return new IIOPIOR(id, profiles); + + } + + + public synchronized ServiceContextList getBidirectionalService() + { + if (m_destroyed) + throw new org.omg.CORBA.BAD_INV_ORDER("ORB is destroying"); + + if (m_bidirectional_service == null) { + if (m_server_listener == null) + throw new INTERNAL("Trying to create a bidirectional context " + + "without ListenPoint"); + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + BiDirServiceContext bidir_context = new BiDirServiceContext(listen_points.size()); + + for (int i = 0; i < listen_points.size(); i++) { + bidir_context.m_listen_points[i] = + (ListenPoint)listen_points.elementAt(i); + } + + m_bidirectional_service = new ServiceContextList(1); + m_bidirectional_service.m_components[0] = bidir_context; + + } + + return m_bidirectional_service; + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationDelegate.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationDelegate.java.svn-base new file mode 100644 index 0000000..6c7be9c --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationDelegate.java.svn-base @@ -0,0 +1,364 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * @author jprojas + * + */ +public class IIOPCommunicationDelegate extends CommunicationDelegate { + + private IIOPIOR iiopReference; + private IIOPCommunicationLayer communicationLayer; + + /** + * + */ + public IIOPCommunicationDelegate( IIOPCommunicationLayer communicationLayer ) { + super(); + if ( communicationLayer != null ){ + super.setORB( communicationLayer.getORB() ); + this.communicationLayer = communicationLayer; + this.forwardReference = null; + } else { + throw new IllegalArgumentException( + "Parameter 'commLayer' cannot be null" + ); + } + } + + public void setReference(IOR ior) { + IIOPIOR iiopIOR = null; + if(! (ior instanceof IIOPIOR) ) { + iiopIOR = new IIOPIOR(ior); + + } else { + iiopIOR = (IIOPIOR) ior; + } + + super.setReference(iiopIOR); + + IIOPProfile profile = iiopIOR.profileIIOP(); + + PoliciesComponent policiesComponent = profile.getPoliciesComponent(); + + if(policiesComponent != null) { + this.setPolicyContext(policiesComponent.getPolicies()); + } + + + + }//setReference + + + public synchronized IIOPIOR getIIOPReference(){ + if ( this.iiopReference == null ){ + this.iiopReference = new IIOPIOR(); + this.iiopReference.assign( super.reference ); + } + return this.iiopReference; + } + + + public IOR getReference(){ + return getIIOPReference(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#isLocal(org.omg.CORBA.Object) + */ + public boolean isLocal( org.omg.CORBA.Object self) { + + if ( super.getORB() == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO ); + } + + try { + if ( this.forwardReference == null) { + return this.communicationLayer.isLocal( this.getIIOPReference() ); + } else { + return this.forwardReference.is_local(null); + } + } catch ( CommunicationException ce ) { + return false; + } + }//isLocal + + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#non_existent(org.omg.CORBA.Object) + */ + public boolean non_existent(org.omg.CORBA.Object self){ + TIDORB orb = super.getORB(); + if ( orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + PolicyContext request_policy_context = createRequestPolicyContext(); + + CommunicationLayer comm_layer = this.communicationLayer.getCommLayer(); + + try { + + if ( this.forwardReference == null) { + return !comm_layer.objectExists( + this.getIIOPReference(), + request_policy_context); + } else { // there is forwards + boolean non_existent = true; + try { + non_existent = this.forwardReference.non_existent(null); + } + catch (org.omg.CORBA.COMM_FAILURE cf) { + non_existent = true; + } + catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + non_existent = false; + } + + if (non_existent) { + this.forwardReference = null; + } + + return non_existent; + } + } catch (ForwardRequest fe) { + + this.setForward(fe); + + } + + return non_existent(self); + }//non_existent + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#duplicate(org.omg.CORBA.Object) + */ + public Object duplicate(Object self) { + IIOPCommunicationDelegate delegate; + delegate = new IIOPCommunicationDelegate( this.communicationLayer ); + delegate.setReference( this.getReference() ); + + delegate.forwardReference = this.forwardReference; + + //getPolicyContext never returns null. + delegate.setPolicyContext( super.getPolicyContext().duplicate() ); + + ObjectImpl obj = new ObjectImpl(); + + obj._set_delegate(delegate); + + return obj; + }//duplicate + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release(org.omg.CORBA.Object) + */ + public void release(org.omg.CORBA.Object self) { + //Empty treatment + }//release + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release_reply(org.omg.CORBA.Object, org.omg.CORBA.portable.InputStream) + */ + public void release_reply( + org.omg.CORBA.Object object, + org.omg.CORBA.portable.InputStream inputStream ) { + //Empty treatment + }//release_reply + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl) + */ + public void prepareRequest( StreamRequestImpl request ) { + this.communicationLayer.getCommLayer().prepareRequest( request ); + }//prepareRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#onewayRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void onewayRequest(RequestImpl request) { + if ( this.forwardReference != null ) { + this.forwardReference.onewayRequest(request); + } else { + this.communicationLayer.getCommLayer().onewayRequest( request, this.getIIOPReference() ); + } + }//oneWayRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(es.tid.TIDorbj.core.RequestImpl) + */ + public void invoke(RequestImpl request) { + try { + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().request( + request, + (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.invoke(request); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + invoke(request); + + }//forwarded + }//invoke + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) + */ + public InputStream invoke( + org.omg.CORBA.Object object, + OutputStream stream + ) throws ApplicationException, + RemarshalException { + + if (is_local(object)) { + throw new BAD_OPERATION("Request is only valid for remote objects"); + } + + if (stream instanceof es.tid.TIDorbj.core.cdr.CDROutputStream) { + + es.tid.TIDorbj.core.cdr.CDROutputStream out = + (es.tid.TIDorbj.core.cdr.CDROutputStream) stream; + try { + if ( this.forwardReference == null) { + return this.communicationLayer.getCommLayer().request( + (IIOPIOR)this.getReference(), + out, + createRequestPolicyContext() + ); + } else { + return this.forwardReference.invoke(object, stream); + } + + } + catch (es.tid.TIDorbj.core.comm.ForwardRequest fr) { + this.setForward(fr); + throw new org.omg.CORBA.portable.RemarshalException(); + } + } else { + throw new org.omg.CORBA.BAD_OPERATION("Not a TIDorbJ's Stream"); + } + }//invoke stream + + // AMI callback operations + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#asyncRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void asyncRequest(RequestImpl request, Object ami_handler ) { + try { + request.set_ami_handler(ami_handler); + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().asyncRequest( + request, (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.asyncRequest(request, ami_handler); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + asyncRequest(request, ami_handler); + + }//forwarded + }//asyncRequest + + + + + +}//IIOPCommunicationLayer diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayer.java.svn-base new file mode 100644 index 0000000..059b05c --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayer.java.svn-base @@ -0,0 +1,376 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.Properties; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationLayer; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.RequestDispatcher; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +/** + * Entry point for the IIOPCommunicationLayer + * + * @author Juan Pablo Rojas + * + * */ +public class IIOPCommunicationLayer implements CommunicationLayer { + + public static String ID = "IIOPCommunicationLayer"; + + /* + * used for incoming requests notifications + */ + private RequestDispatcher dispatcher; + + /* + * the underlying ORB implementation + */ + private TIDORB orb; + + private CommLayer commLayer; + + private IIOPCommunicationLayerPropertiesInfo propertiesInfo; + + /** + * + */ + public IIOPCommunicationLayer() { + + } + + public void setORB(TIDORB orb) { + if ( orb != null ){ + if ( this.orb != null ){ + this.commLayer.shutdown(); + this.propertiesInfo = null; + this.commLayer = null; + } + this.orb = orb; + this.propertiesInfo = IIOPCommunicationLayerPropertiesInfo.getInstance(); + this.orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + ) + ); + + + this.commLayer = new CommLayer( + this.orb + ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public CommLayer getCommLayer(){ + return this.commLayer; + } + + + public void setServerModeEnabled( boolean value ){ + if ( value ){ + this.commLayer.getExternalLayer().initServerListener(); + } + } + + public boolean isServerModeEnabled(){ + return this.commLayer.getExternalLayer().hasServerListener(); + } + + public synchronized ServiceContextList getBidirectionalService() { + return this.commLayer.getExternalLayer().getBidirectionalService(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String) + */ + public CommunicationDelegate createDelegate(String url) throws CommunicationException { + + CommunicationDelegate delegate; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorb:" ) ){ + ior = Corbaloc.getIOR( url ); + } else if(url.startsWith( "corbaloc::" ) || + url.startsWith( "corbaloc:iiop:" )) { + ior = IIOPCorbaloc.getIOR( url ); + } else { + ior = IIOPIOR.fromString(this.orb, url); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + delegate = createDelegate( ior ); + } else { + delegate = null; + } + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String, java.util.Properties) + */ + public CommunicationDelegate createDelegate(String url, Properties info) throws CommunicationException { + return createDelegate( url ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR) + */ + public CommunicationDelegate createDelegate(IOR ior) throws CommunicationException { + IIOPCommunicationDelegate delegate = new IIOPCommunicationDelegate( this ); + delegate.setReference( ior ); + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR, java.util.Properties) + */ + public CommunicationDelegate createDelegate(IOR ior, Properties info) throws CommunicationException { + return createDelegate( ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(java.lang.String) + */ + public boolean accepts(String url) throws CommunicationException { + return url!= null && + ( url.startsWith( "corbaloc:iiop:" ) || + url.startsWith( "corbaloc:tidorb:" ) || + url.startsWith( "corbaloc::" ) || + ( + url.startsWith( "IOR" ) && + this.accepts( DefaultIOR.fromString( this.orb, url ) ) + ) + ); + }//accepts + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(org.omg.IOP.IOR) + */ + public boolean accepts(IOR ior) throws CommunicationException { + boolean accepted; + accepted = ior instanceof IIOPIOR; + + int profilesCount = ior.memberCount(); + for (int i = 0; !accepted && i < profilesCount; i++) { + accepted = ior.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value; + } + + return accepted; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createIOR(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public IOR createIOR(String repositoryId, + ObjectKey key, + TaggedComponent[] components) + throws CommunicationException { + return this.commLayer.getExternalLayer().createIOR( + repositoryId, + key, + components + ); + }//createIOR + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createURL(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public String createURL(String repositoryId, ObjectKey key) throws CommunicationException { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(es.tid.TIDorbj.core.iop.IOR) + */ + public String getInitialReference( IOR ior ) throws CommunicationException { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(java.lang.String) + */ + public String getInitialReference( String url ) throws CommunicationException { + String initialReference; + try { + initialReference = IIOPCorbaloc.getObjectId( url ); + } catch ( Throwable th ){ + initialReference = null; + } + return initialReference; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(es.tid.TIDorbj.core.iop.IOR) + */ + public boolean isLocal(IOR ior) throws CommunicationException { + return ior != null && this.accepts( ior ) && this.commLayer.isLocal( (IIOPIOR)ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(java.lang.String) + */ + public boolean isLocal(String url) throws CommunicationException { + boolean isLocal; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorbj:" ) ){ + ior = Corbaloc.getIOR( url ); + } else { + ior = IIOPCorbaloc.getIOR( url ); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + isLocal = this.isLocal( ior ); + } else { + isLocal = false; + } + return isLocal; + }//isLocal + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getPropertyInfo(java.lang.String, java.util.Properties) + */ + public PropertyInfo[] getPropertiesInfo() { + return ( PropertyInfo[] )this.propertiesInfo.map.entrySet().toArray( new PropertyInfo[0] ); + }//getPropertiInfo + + public PropertyInfo getPropertyInfo( String name){ + return ( PropertyInfo )this.propertiesInfo.map.get( name ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMajorVersion() + */ + public int getMajorVersion() { + return 1; + }//getMajorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMinorVersion() + */ + public int getMinorVersion() { + return 0; + }//getMinorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getId() + */ + public String getId() { + return IIOPCommunicationLayer.ID; + } + + public String toString(){ + + String hostSpec; + hostSpec = this.propertiesInfo.hostName.value; + if ( hostSpec == null ){ + hostSpec = this.propertiesInfo.hostAddress.value; + } + if ( hostSpec == null ){ + try { + hostSpec = java.net.InetAddress.getLocalHost().getHostName(); + } + catch (Exception e) {} + } + + StringBuffer toString = new StringBuffer( "[ " ) + .append( IIOPCommunicationLayer.ID ) + .append( " ( iiop://" ) + .append( hostSpec ) + .append( ':' ) + .append( this.propertiesInfo.port.value ) + .append( " )" ) + .append( " ]"); + + return toString.toString(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#shutdown(boolean) + */ + public void shutdown( boolean waitForCompletion ) { + if ( this.commLayer != null ){ + if ( waitForCompletion ){ + this.commLayer.shutdown(); + } else { + this.commLayer.destroy(); + } + this.commLayer = null; + } + } + + + /** + * PRIVATE METHODS + * @author jprojas + */ + + public void dump(java.io.PrintWriter writer){ + this.propertiesInfo.dump(writer); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base new file mode 100644 index 0000000..2fe25bd --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCommunicationLayerPropertiesInfo.java.svn-base @@ -0,0 +1,508 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import es.tid.TIDorbj.core.comm.PropertyInfo; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +//TODO:change to IIOPCommunicationLayerPropertiesInfo +public class IIOPCommunicationLayerPropertiesInfo { + + /** + * Assures that a oneway request could be forwarded. "true" or "false". + */ + public final static String RELIABLE_ONEWAY + = "es.tid.TIDorbj.iiop.reliable_oneway"; + public final static String DEFAULT_RELIABLE_ONEWAY + = "false"; + + + /** + * Fragment size Property name. + */ + public final static String FRAGMENT_SIZE + = "es.tid.TIDorbj.iiop.fragment_size"; + public final static String DEFAULT_FRAGMENT_SIZE + = "4096"; + + + /** + * GIOP version Property name. Values: "1.0", "1.1" and "1.2" + */ + public final static String GIOP_VERSION = + "es.tid.TIDorbj.iiop.GIOPVersion"; + public final static String DEFAULT_GIOP_VERSION + = "1.2"; + + /** + * ORB's maximum opened connections number. Value must be greater or equals + * to 0. Default value: 30. + */ + public final static String MAX_OPENED_CONNECTIONS + = "es.tid.TIDorbj.iiop.max_connections"; + public final static String DEFAULT_MAX_OPENED_CONNECTIONS + = "30"; + + + /** + * DefaultORB's maximum recovering a communication tries. Default value: + * 3. + * TODO: max_comm_recovering_times -> max_comm_recovering_tries, update doc + */ + public final static String MAX_COMM_RECOVERING_TRIES + = "es.tid.TIDorbj.iiop.max_comm_recovering_tries"; + public final static String DEFAULT_MAX_COMM_RECOVERING_TRIES = "3"; + + + /** + * ORB's maximum time upon recovering a communication. Values must be + * greater or equal than 0. + */ + public final static String COMM_RECOVERING_TIME + = "es.tid.TIDorbj.iiop.comm_recover_time"; + public final static String DEFAULT_COMM_RECOVERING_TIME + = "1000"; + + /** + * Maximum uncompleted messages per IIOPConnection. Default value: + * 25. + */ + public final static String MAX_UNCOMPLETED_MESSAGES = + "es.tid.TIDorbj.iiop.max_uncompleted_messages"; + public final static String DEFAULT_MAX_UNCOMPLETED_MESSAGES = "25"; + + /** + * IIOP hostname used for generated IORs and URLs. Default value: null + */ + public final static String HOST_NAME + = "es.tid.TIDorbj.iiop.host"; + public final static String DEFAULT_HOST_NAME + = null; + + /** + * IP address used for generated IORs and URLs. Default value: null + */ + public final static String HOST_ADDRESS + = "es.tid.TIDorbj.iiop.address"; + public final static String DEFAULT_HOST_ADDRESS + = null; + + /** + * IIOP port used for generated IORs and URLs. Default value: 0 + */ + public final static String PORT + = "es.tid.TIDorbj.iiop.port"; + public final static String DEFAULT_PORT + = "0"; + + + /** + * Sockets SO_LIGER property. Values must be greater or equal than -1. + * Default value -1 (no linger) + */ + public final static String SOCKET_LINGER + = "es.tid.TIDorbj.iiop.socket_linger"; + public final static String DEFAULT_SOCKET_LINGER + = "-1"; + + /** + * Sockets SO_TIMEOUT property. Values must be greater or equal than -1. + * Default value 0 (no timeout) + */ + public final static String SOCKET_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_timeout"; + public final static String DEFAULT_SOCKET_TIMEOUT + = "0"; + + + /** + * Sockets TCP_NODELAY property. Values must be "true" or "false". + */ + public final static String TCP_NODELAY + = "es.tid.TIDorbj.iiop.tcp_nodelay"; + public final static String DEFAULT_TCP_NODELAY + = "true"; + + /** + * Sockets TCP_CONNECT_TIMEOUT property. Values must be greater or equal to + * 0. Default value 1000. + */ + public final static String SOCKET_CONNECT_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_connect_timeout"; + public final static String DEFAULT_SOCKET_CONNECT_TIMEOUT + = "1000"; + + /** + * Sockets TCP_WRITE_TIMEOUT property. Values must be greater or equal to 0. + * Default value 2000. + */ + public final static String SOCKET_WRITE_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_write_timeout"; + public final static String DEFAULT_SOCKET_WRITE_TIMEOUT + = "2000"; + + /** + * Server sockets BACKLOG property. Values must be greater or equal to 0. + * Default value. 10. + */ + public final static String SERVER_SOCKET_BACKLOG + = "es.tid.TIDorbj.iiop.server_socket_backlog"; + public final static String DEFAULT_SERVER_SOCKET_BACKLOG + = "10"; + + /** + * Server sockets RECONNECT property. Values must be greater or equal to + * 0. Default value: 0 + */ + public final static String SERVER_SOCKET_RECONNECT + = "es.tid.TIDorbj.iiop.server_socket_reconnect"; + public final static String DEFAULT_SERVER_SOCKET_RECONNECT + = "0"; + + /** + * mcpg - IPV6 property. Values must be "true" or "false". + */ + public final static String IPV6 + = "es.tid.TIDorbj.iiop.ipv6"; + public final static String DEFAULT_IPV6 + = "false"; + + /** + * mcpg - IFACEo property. Only need if there are an comunication of client in TIDorbC. + */ + public final static String IFACE + = "es.tid.TIDorbj.iiop.iface"; + public final static String DEFAULT_IFACE + = "eth0"; + + + public PropertyInfo reliableOneWay; + public PropertyInfo fragmentSize; + public PropertyInfo giopVersion; + public PropertyInfo maxOpenedConnections; + public PropertyInfo maxCommRecoveringTries; + public PropertyInfo commRecoveringTime; + public PropertyInfo maxUncompletedMessages; + public PropertyInfo hostName; + public PropertyInfo hostAddress; + public PropertyInfo port; + public PropertyInfo socketLinger; + public PropertyInfo socketTimeout; + public PropertyInfo socketNoDelay; + public PropertyInfo connectTimeout; + public PropertyInfo writeTimeout; + public PropertyInfo serverSocketBacklog; + public PropertyInfo serverSocketReconnect; + + public PropertyInfo ipv6; + public PropertyInfo iface; + + public HashMap map; + + public IIOPCommunicationLayerPropertiesInfo() { + + map = new HashMap( 20 ); + + /** + * CONNECTION STUFF + */ + reliableOneWay = new PropertyInfo( + RELIABLE_ONEWAY, + DEFAULT_RELIABLE_ONEWAY + ); + reliableOneWay.setDescription( + "Whether oneway request should be reliable or not." + ); + reliableOneWay.setRequired( false ); + reliableOneWay.setChoices ( null ); + map.put( RELIABLE_ONEWAY, reliableOneWay ); + + + /** + * TRANSMISSION STUFF + */ + fragmentSize = new PropertyInfo( + FRAGMENT_SIZE, + DEFAULT_FRAGMENT_SIZE + ); + fragmentSize.setDescription( + "Maximum fragment message size. Must be > 1024 and multiple of 8." + ); + fragmentSize.setRequired( false ); + fragmentSize.setChoices ( null ); + map.put( FRAGMENT_SIZE, fragmentSize ); + + + giopVersion = new PropertyInfo( + GIOP_VERSION, + DEFAULT_GIOP_VERSION + ); + giopVersion.setDescription( + "Default GIOP version used for communications. One of " + + "1.0 1.1 or 1.2" + ); + giopVersion.setRequired( false ); + giopVersion.setChoices ( new String[]{ "1.0", "1.1", "1.2" } ); + map.put( GIOP_VERSION, giopVersion ); + + + maxOpenedConnections = new PropertyInfo( + MAX_OPENED_CONNECTIONS, + DEFAULT_MAX_OPENED_CONNECTIONS + ); + maxOpenedConnections.setDescription( + "ORB's maximum opened connections number" + ); + maxOpenedConnections.setRequired( false ); + maxOpenedConnections.setChoices ( null ); + map.put( MAX_OPENED_CONNECTIONS, maxOpenedConnections ); + + + maxCommRecoveringTries = new PropertyInfo( + MAX_COMM_RECOVERING_TRIES, + DEFAULT_MAX_COMM_RECOVERING_TRIES + ); + maxCommRecoveringTries.setDescription( + "DefaultORB's maximum communication recovering tries." + ); + maxCommRecoveringTries.setRequired( false ); + maxCommRecoveringTries.setChoices ( null ); + map.put( MAX_COMM_RECOVERING_TRIES, maxCommRecoveringTries ); + + + commRecoveringTime = new PropertyInfo( + COMM_RECOVERING_TIME, + DEFAULT_COMM_RECOVERING_TIME + ); + commRecoveringTime.setDescription( + "ORB's maximum time upon recovering a communication." + ); + commRecoveringTime.setRequired( false ); + commRecoveringTime.setChoices ( null ); + map.put( COMM_RECOVERING_TIME, commRecoveringTime ); + + + maxUncompletedMessages = new PropertyInfo( + MAX_UNCOMPLETED_MESSAGES, + DEFAULT_MAX_UNCOMPLETED_MESSAGES + ); + maxUncompletedMessages.setDescription( + "Maximum uncompleted messages allowed upon connections." + ); + maxUncompletedMessages.setRequired( false ); + maxUncompletedMessages.setChoices ( null ); + map.put( MAX_UNCOMPLETED_MESSAGES, maxUncompletedMessages ); + + + hostName = new PropertyInfo( + HOST_NAME, + DEFAULT_HOST_NAME + ); + hostName.setDescription( + "Hostname used when generating IOR's and URL's." + ); + hostName.setRequired( false ); + hostName.setChoices ( null ); + map.put( HOST_NAME, hostName ); + + + hostAddress = new PropertyInfo( + HOST_ADDRESS, + DEFAULT_HOST_ADDRESS + ); + hostAddress.setDescription( + "Address used when generating IOR's and URL's." + ); + hostAddress.setRequired( false ); + hostAddress.setChoices ( null ); + map.put( HOST_ADDRESS, hostAddress ); + + + port = new PropertyInfo( + PORT, + DEFAULT_PORT + ); + port.setDescription( + "Port used when generating IOR's and URL's." + ); + port.setRequired( false ); + port.setChoices ( null ); + map.put( PORT, port ); + + + socketLinger = new PropertyInfo( + SOCKET_LINGER, + DEFAULT_SOCKET_LINGER + ); + socketLinger.setDescription( + "Sockets SO_LIGER property." + ); + socketLinger.setRequired( false ); + socketLinger.setChoices ( null ); + map.put( SOCKET_LINGER, socketLinger ); + + + socketTimeout = new PropertyInfo( + SOCKET_TIMEOUT, + DEFAULT_SOCKET_TIMEOUT + ); + socketTimeout.setDescription( + "Sockets timeout." + ); + socketTimeout.setRequired( false ); + socketTimeout.setChoices ( null ); + map.put( SOCKET_TIMEOUT, socketTimeout ); + + + socketNoDelay = new PropertyInfo( + TCP_NODELAY, + DEFAULT_TCP_NODELAY + ); + socketNoDelay.setDescription( + "Sockets NO_DELAY property." + ); + socketNoDelay.setRequired( false ); + socketNoDelay.setChoices ( null ); + map.put( TCP_NODELAY, socketNoDelay ); + + + connectTimeout = new PropertyInfo( + SOCKET_CONNECT_TIMEOUT, + DEFAULT_SOCKET_CONNECT_TIMEOUT + ); + connectTimeout.setDescription( + "Sockets connect timeout." + ); + connectTimeout.setRequired( false ); + connectTimeout.setChoices ( null ); + map.put( SOCKET_CONNECT_TIMEOUT, connectTimeout ); + + + writeTimeout = new PropertyInfo( + SOCKET_WRITE_TIMEOUT, + DEFAULT_SOCKET_WRITE_TIMEOUT + ); + writeTimeout.setDescription( + "Sockets write timeout." + ); + writeTimeout.setRequired( false ); + writeTimeout.setChoices ( null ); + map.put( SOCKET_WRITE_TIMEOUT, writeTimeout ); + + + serverSocketBacklog = new PropertyInfo( + SERVER_SOCKET_BACKLOG, + DEFAULT_SERVER_SOCKET_BACKLOG + ); + serverSocketBacklog.setDescription( + "Server sockets BACKLOG." + ); + serverSocketBacklog.setRequired( false ); + serverSocketBacklog.setChoices ( null ); + map.put( SERVER_SOCKET_BACKLOG, serverSocketBacklog ); + + + serverSocketReconnect = new PropertyInfo( + SERVER_SOCKET_RECONNECT, + DEFAULT_SERVER_SOCKET_RECONNECT + ); + serverSocketReconnect.setDescription( + "Server sockets RECONNECT." + ); + serverSocketReconnect.setRequired( false ); + serverSocketReconnect.setChoices ( null ); + map.put( SERVER_SOCKET_RECONNECT, serverSocketReconnect ); + + ipv6 = new PropertyInfo( + IPV6, + DEFAULT_IPV6 + ); + ipv6.setDescription( + "IPV6 property." + ); + ipv6.setRequired( false ); + ipv6.setChoices ( null ); + map.put( IPV6, ipv6 ); + + //mcpg + iface = new PropertyInfo( + IFACE, + DEFAULT_IFACE + ); + iface.setDescription( + "IFACE property." + ); + iface.setRequired( false ); + iface.setChoices ( null ); + map.put( IFACE, iface ); + + } + + public static IIOPCommunicationLayerPropertiesInfo getInstance(){ + return new IIOPCommunicationLayerPropertiesInfo(); + } + + public void dump(java.io.PrintWriter writer) + { + writer.println("IIOPCommunicationLayer properties:"); + + Iterator it = map.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry e = (Map.Entry)it.next(); + writer.print('\t'); + writer.print(e.getKey()); + writer.print('='); + writer.print( ((PropertyInfo)e.getValue()).getValue()); + writer.println(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnection.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnection.java.svn-base new file mode 100644 index 0000000..e59f0e9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnection.java.svn-base @@ -0,0 +1,507 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.io.IOException; +import java.net.Socket; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; +import java.net.InetAddress; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; + +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayerPropertiesInfo; + +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb IIOP IIOPConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IIOPConnection extends Connection { + + /** + * IIOPConnection Socket. + */ + java.net.Socket m_socket; + + /** + * IIOPConnection Socket InputStream. + */ + public java.io.InputStream m_socket_in; + + /** + * IIOPConnection Socket OutputStream. + */ + public java.io.OutputStream m_socket_out; + + + private boolean tcpNoDelay; + private int soTimeout; + private int soLinger; + private int socketWriteTimeout; + + + private IIOPConnection(IIOPConnectionManager mngr, java.net.Socket socket) + { + super(mngr); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + tcpNoDelay = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.TCP_NODELAY ) + .getBoolean(); + + soTimeout = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_TIMEOUT ) + .getInt(); + + soLinger = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_LINGER ) + .getInt(); + + socketWriteTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_WRITE_TIMEOUT ) + .getInt(); + + try { + this.m_socket = socket; + + my_port = socket.getLocalPort(); + + socket.setTcpNoDelay( tcpNoDelay ); + socket.setSoTimeout( soTimeout ); + + socket.setSoLinger( soLinger != -1, soLinger ); + + m_socket_in = socket.getInputStream(); + m_socket_out = socket.getOutputStream(); + } + catch (java.io.IOException ioe) { + throw new OBJECT_NOT_EXIST(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + } + + m_write_monitor = new ConnectionWriteMonitor( socketWriteTimeout ); + } + + /** + * IIOPConnection hash code. + */ + public int hashCode() { + // return my_port; + return m_socket.hashCode(); + } + + public boolean equals(Object obj) { + return obj instanceof IIOPConnection && + ( ( IIOPConnection )obj ).my_port == my_port; + } + + public String toString() { + if (m_str == null) { + if (m_mode == CLIENT_MODE) { + m_str = "Client IIOPConnection at " + m_socket.toString(); + } else if (m_mode == SERVER_MODE) { + m_str = "Server IIOPConnection at " + m_socket.toString(); + } else { + m_str = "Bidirectional IIOPConnection at " + m_socket.toString(); + } + } + return m_str; + } + + /** + * Creates a new connection in SERVER_MODE. + * + * @param mngr + * the manager + * @param sock + * Socket created in the accept + * method in a ServerSocket object. + */ + public static IIOPConnection serverConnection(IIOPConnectionManager mngr, + java.net.Socket sock) { + IIOPConnection conn = new IIOPConnection(mngr, sock); + conn.m_mode = SERVER_MODE; + conn.init(); + + if (conn.m_orb.m_trace != null) { + conn.m_orb.printTrace(Trace.DEBUG, "Creating " + conn.toString()); + } + + return conn; + } + + /** + * Creates a new connection in CLIENT_MODE. + */ + + public static IIOPConnection clientConnection(IIOPConnectionManager mngr, + ListenPoint listen_point) + { + try { + + // create the socket + Socket socket = + new Socket(listen_point.m_host, listen_point.m_port); + IIOPConnection conn = new IIOPConnection(mngr, socket); + + conn.m_mode = CLIENT_MODE; + + conn.m_initial_point = listen_point; + + conn.addListenPoint(listen_point); + + conn.init(); + + return conn; + + } + catch (java.io.IOException ioe) { + throw new TRANSIENT(ioe.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + catch (java.lang.SecurityException sce) { + throw new NO_PERMISSION(sce.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void close() + { + try { + m_socket.close(); + } + catch (IOException ioe) {} + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, + toString() + + " client socket closed"); + + // notify the writers blocked in write_monitor + + m_write_monitor.setException(m_state.getError()); + + // notify the locks + + LockEnumeration enumer = m_lock_list.elements(); + Lock lock; + + while (enumer.hasMoreElements()) { + lock = enumer.next(); + synchronized (lock) { + lock.cancelWaiting(); + } + } + + AMILockEnumeration ami_enum = m_ami_lock_list.elements(); + AMILock ami_lock; + + while (ami_enum.hasMoreElements()) { + ami_lock = ami_enum.next(); + synchronized (ami_lock) { + ami_lock.notify(); + } + } + + if (m_addresses != null) { + m_addresses.clear(); + } + + // clear buffers + + Enumeration msgs = m_uncompleted_messages.elements(); + + while (msgs.hasMoreElements()) { + m_uncompleted_messages.remove(msgs.nextElement()); + } + + } + + protected void dispatchRequest(GIOPLocateRequestMessage message) { + + ObjectKey obj_key; + obj_key = message.extractAddress().getObjectKey(); + + IIOPLocateResponseHandler responseHandler; + responseHandler = new IIOPLocateResponseHandler( + this, + message.getHeader().getVersion(), + message.getRequestId(), + obj_key + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + m_requests_in_POA.inc(); + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + } + + protected void dispatchRequest(GIOPRequestMessage message) { + + ServerRequestImpl serverRequest; + serverRequest = message.extractRequest(m_orb); + + + String ssl_key_store_file = new String(""); + String ssl_key_store_passwd = new String(""); + + if (m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + != null) { + ssl_key_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + ssl_key_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + } + + // Check SSL: all TCP request are not dispached + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + serverRequest.setSystemException( + new NO_PERMISSION("SSL target can not dispatch TCP requests ") ); + sendReply(serverRequest, null); + //delete request; + return; + } + + + ObjectKey objectKey; + objectKey = serverRequest.getTarget().getObjectKey(); + + IIOPResponseHandler responseHandler; + responseHandler = new IIOPResponseHandler( + this, + message.getHeader().getVersion(), + serverRequest, + objectKey, + message.getRequestInvocationPolicies() + + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * TODO: ask juan: in previous code, when reference has been located, + * if it's not local just returns... which should be the + * refactoring mapping since the POAKey is resolved outside, + * under ExecThread, and there's "no way?" to acces the object + * reference to check if either it's local or not + * Previous code + if (!obj_impl._is_local()) { + // oneway request to a non local object: DISCARD + return; + } + * */ + + if (serverRequest.withResponse()) { + m_requests_in_POA.inc(); + } + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + } + + + public void read(byte[] buffer, int offset, int length) + { + + try { + int numReadNow = 0; + + while (length > 0) { + + numReadNow = m_socket_in.read(buffer, offset, length); + + if (numReadNow < 0) { + throw new COMM_FAILURE("Broken IIOPConnection", 0, + CompletionStatus.COMPLETED_NO); + } + + offset += numReadNow; + length -= numReadNow; + + } + + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer) + { + try { + + m_socket_out.write(buffer, 0, buffer.length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer, int offset, int length) + { + try { + m_socket_out.write(buffer, offset, length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnectionManager.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnectionManager.java.svn-base new file mode 100644 index 0000000..22a6370 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPConnectionManager.java.svn-base @@ -0,0 +1,746 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.net.Socket; +import javax.net.ssl.SSLSocket; + +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TRANSIENT; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.poa.POAImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.comm.ssliop.SSLConnection; + +/** + * Manages the opened connections. When a connection is needed, try to reuse an + * opened one. When there is too many connection opened or there are some + * connection that have remained idle too long, they will be closed. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + + +// TODO: move comm.iiop.IIOPConnectionManager to comm.ConnectionManager + +public class IIOPConnectionManager extends es.tid.TIDorbj.core.ORBComponent +{ + + /** + * The communication Layer. + */ + + IIOPCommLayer commLayer; + + /** + * The ORB has been destroyed. + */ + + protected boolean m_destroyed; + + /** + * Maintains a UseTable with IIOPConnection + * objects. Then, when the table removes older connections, the manager + * close them. + */ + UseTable m_connections; + + /** + * Opened client connections. This table allows reuse opened connections for + * a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_client_connections; + + /** + * Opened bidirectional connections. This table allows reuse opened + * connections for a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_bidirectional_connections; + + /** + * Connections that are opening now. Other threads that want to open a new + * connection to the same listen point must wait to not open more than one + * connection. + */ + java.util.Hashtable m_connections_opening; + + int maxOpenedConnections; + int connectTimeout; + boolean ipv6; + + + /** + * Opened SSL client connections. This table allows reuse opened connections for + * a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_ssl_client_connections; + + public IIOPConnectionManager( TIDORB orb, IIOPCommLayer commLayer ) + { + super(orb); + this.commLayer = commLayer; + m_client_connections = new java.util.Hashtable(); + m_bidirectional_connections = new java.util.Hashtable(); + m_ssl_client_connections = new java.util.Hashtable(); + + maxOpenedConnections = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.MAX_OPENED_CONNECTIONS ) + .getInt(); + + connectTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_CONNECT_TIMEOUT ) + .getInt(); + + + m_connections = new UseTable( maxOpenedConnections ); + + + m_connections_opening = new java.util.Hashtable(); + m_destroyed = false; + + //mcpg + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + if (this.ipv6 == true) + { + System.setProperty("java.net.preferIPv6Address","true"); + System.setProperty("java.net.preferIPv4Stack","false"); + } + } + + /** + * Notifies the connection use. + * + * @param conn + * the connection in use + */ + /* synchronized */ + + //public synchronized void use(IIOPConnection conn) + public synchronized void use(Connection conn) + { + if (m_destroyed) + return; + + m_connections.use(conn); + } + + /** + * The manager is Notified a connection is been closing. + * + * @param conn + * the connection that is closing. + */ + + //synchronized public void closing(IIOPConnection conn) + synchronized public void closing(Connection conn) + { + if (m_destroyed) + return; + + removeListenPoints(conn); + + m_connections.remove(conn); + } + + /** + * When a new Socket is created (a new connection has been accepted by the + * ServerSocket) a new IIOPConnection, in SERVER mode, must be + * registered. + * + * @param socket + * the new socket. + */ + + synchronized public void createServerConnection(Socket socket) + { + if (m_destroyed) { + // drop the socket + try { + socket.close(); + } + catch (java.io.IOException ioe) {} + } else { + // create the new connection and add the new connection to + // connection table + newConnection(IIOPConnection.serverConnection(this, socket)); + } + } + + + /** + * Saves the ListenPoint associated to a bidirectional + * connection to be used as a client connection when a connection to the + * listen point will be required. + * + * @param listen_point + * the ListenPoint where the connection will be + * seen as a client connection. + * @param conn + * the bidirectional connection. + */ + + synchronized public void + addBidirectionalConnection(ListenPoint listen_point, +// IIOPConnection conn) + Connection conn) + { + if (m_destroyed) + return; + + m_bidirectional_connections.put(listen_point, conn); + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public IIOPConnection getClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + //opened connection + IIOPConnection conn = null; + // check if a connection is opening now + OpeningLock opening_lock = null; + // this thread must open a connection and unlock the OpeningLock + boolean open_a_connection = false; + + synchronized (this) { + if (m_destroyed) + throw new TRANSIENT("IIOP Layer shutdown", 0, + CompletionStatus.COMPLETED_NO); + + // looks for an existing connection + + conn = (IIOPConnection) m_bidirectional_connections.get(listen_point); + + if (conn != null) + return conn; + + conn = (IIOPConnection) m_client_connections.get(listen_point); + + if (conn != null) + return conn; + + // check if is opening now + opening_lock = (OpeningLock) + m_connections_opening.get(listen_point); + + // create a lock + if (opening_lock == null) { + opening_lock = new OpeningLock(); + m_connections_opening.put(listen_point, opening_lock); + open_a_connection = true; + } + } + + if (!open_a_connection) { + try { + conn = (IIOPConnection)opening_lock.waitOpening( this.connectTimeout ); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + if (m_orb.m_trace != null) { + String[] msg = { "Socket connection timeout exceeded", + "waiting to connecting with ", + listen_point.toString(), + ". Released lock over it." }; + m_orb.printTrace(Trace.DEBUG, msg); + } + m_connections_opening.remove(listen_point); + throw new TRANSIENT(ce.toString()); + } + } + + } else { + try { + conn = openClientConnection(listen_point, policy_context); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + opening_lock.setError(ce); + m_connections_opening.remove(listen_point); + throw ce; + } + } + + synchronized (this) { + + newConnection(conn); + + // add the new connection to the client_connections + + m_client_connections.put(listen_point, conn); + + opening_lock.setOpened(conn); + m_connections_opening.remove(listen_point); + } + + if (m_orb.m_trace != null) { + String[] msg = { conn.toString(), " Opened!" }; + m_orb.printTrace(Trace.DEBUG, msg); + } + + } + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ( (!conn.isBidirectionalConnection()) + && (bidir != null) + && (bidir.value() == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode( + commLayer.getBidirectionalService() + ); + } + + return conn; + } + + private IIOPConnection + openClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + IIOPConnection conn = null; + + // create a new connection + if (m_orb.m_trace != null) { + String[] msg = { "Opening client connection with ", + listen_point.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + // create the new connection + conn = IIOPConnection.clientConnection(this, listen_point); + + // is bidirectional ??? + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ((bidir != null && bidir.value() + == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode(commLayer.getBidirectionalService()); + } else { + + es.tid.TIDorbj.core.poa.CurrentImpl poa_current = + m_orb.initPOACurrent(); + + if (poa_current.inContext()) { + try { + POAImpl current_poa = (POAImpl) poa_current.get_POA(); + + if (current_poa.isBidirectional()) + conn.setBidirectionalMode( + commLayer.getBidirectionalService()); + + } + catch (org.omg.PortableServer.CurrentPackage.NoContext nc) {} + // add the new connection to connection table + } + } + + return conn; + } + + + private SSLConnection + openSSLClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + SSLConnection conn = null; + + // create a new connection + if (m_orb.m_trace != null) { + String[] msg = { "Opening client connection with ", + listen_point.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + // create the new connection + conn = SSLConnection.clientConnection(this, listen_point); + + // is bidirectional ??? + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ((bidir != null && bidir.value() + == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode(commLayer.getBidirectionalService()); + } else { + + es.tid.TIDorbj.core.poa.CurrentImpl poa_current = + m_orb.initPOACurrent(); + + if (poa_current.inContext()) { + try { + POAImpl current_poa = (POAImpl) poa_current.get_POA(); + + if (current_poa.isBidirectional()) + conn.setBidirectionalMode( + commLayer.getBidirectionalService()); + + } + catch (org.omg.PortableServer.CurrentPackage.NoContext nc) {} + // add the new connection to connection table + } + } + + return conn; + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public void prepareClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + getClientConnection(listen_point, policy_context); + } + + /** + * Checks in a new connection for manage it. + * + * @param conn + * the bidirectional connection. + */ + protected void newConnection(IIOPConnection conn) + { + try { + + m_connections.append(conn); + + } catch (es.tid.TIDorbj.core.util.FullUseTableException f) { + conn.closeByManager(); + if (conn.isClientConnection()) { + throw new TRANSIENT( + "Maximun of Connections reached, and all are in use, try later!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + Object[] removed = m_connections.getRemovedObjects(); + + if (removed != null) { + for (int i = 0; i < removed.length; i++) { + closeConnection((IIOPConnection) removed[i]); + } + } + } + + + + /** + * Checks in a new connection for manage it. + * + * @param conn + * the bidirectional connection. + */ + protected void newConnection(SSLConnection conn) + { + try { + + m_connections.append(conn); + + } catch (es.tid.TIDorbj.core.util.FullUseTableException f) { + conn.closeByManager(); + if (conn.isClientConnection()) { + throw new TRANSIENT( + "Maximun of Connections reached, and all are in use, try later!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + Object[] removed = m_connections.getRemovedObjects(); + + if (removed != null) { + for (int i = 0; i < removed.length; i++) { + closeConnection((IIOPConnection) removed[i]); + } + } + } + + /** + * Removes from the client connection table the listen points associated to + * a connection. + * + * @param conn + * the connection. + */ + //protected void removeListenPoints(IIOPConnection conn) + protected void removeListenPoints(Connection conn) + { + java.util.Enumeration points = conn.getListenPoints(); + if (points == null) + return; + + // remove listenPoints + while (points.hasMoreElements()) { + + ListenPoint _listen_point = (ListenPoint) points.nextElement(); + + // remove from client_connections + m_client_connections.remove(_listen_point); + + // remove from bidirectional_connections if ListenPoint refers to + // the given connection + //if ((IIOPConnection) m_bidirectional_connections.get(_listen_point) + if ((Connection) m_bidirectional_connections.get(_listen_point) + == conn) + m_bidirectional_connections.remove(_listen_point); + } + } + + /** + * Close the connection due to it has been decided that it not has been used + * for a long time. + * + * @param conn + * the connection. + */ + //protected void closeConnection(IIOPConnection conn) + protected void closeConnection(Connection conn) + { + removeListenPoints(conn); + conn.closeByManager(); + } + + /** + * @return true if it has not any active connection + */ + public boolean activeConnections() + { + return m_connections.getSize() > 0; + } + + /** + * Close all connections due to an ORB close session. + */ + synchronized public void destroy() + { + if (!m_destroyed) { + java.util.Enumeration conns = m_connections.elements(); + + //IIOPConnection conn; + Connection conn; + + while (conns.hasMoreElements()) { + conn = (IIOPConnection) conns.nextElement(); + m_connections.remove(conn); + closeConnection(conn); + } + + m_destroyed = true; + } + } + + + + + /** + * When a new SSLSocket is created (a new connection has been accepted by the + * ServerSocket) a new IIOPConnection, in SERVER mode, must be + * registered. + * + * @param socket + * the new socket. + */ + + synchronized public void createSSLServerConnection(SSLSocket socket) + { + if (m_destroyed) { + // drop the socket + try { + socket.close(); + } + catch (java.io.IOException ioe) {} + } else { + // create the new connection and add the new connection to + // connection table + newConnection(SSLConnection.serverConnection(this, socket)); + } + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public SSLConnection getSSLClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + //opened connection + SSLConnection conn = null; + // check if a connection is opening now + OpeningLock opening_lock = null; + // this thread must open a connection and unlock the OpeningLock + boolean open_a_connection = false; + + synchronized (this) { + if (m_destroyed) + throw new TRANSIENT("IIOP Layer shutdown", 0, + CompletionStatus.COMPLETED_NO); + + // looks for an existing connection + +// conn = (IIOPConnection) m_bidirectional_connections.get(listen_point); + +// if (conn != null) +// return conn; + + conn = (SSLConnection) m_ssl_client_connections.get(listen_point); + + if (conn != null) + return conn; + + // check if is opening now + opening_lock = (OpeningLock) + m_connections_opening.get(listen_point); + + // create a lock + if (opening_lock == null) { + opening_lock = new OpeningLock(); + m_connections_opening.put(listen_point, opening_lock); + open_a_connection = true; + } + } + + if (!open_a_connection) { + try { + conn = (SSLConnection)opening_lock.waitOpening( this.connectTimeout ); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + if (m_orb.m_trace != null) { + String[] msg = { "Socket connection timeout exceeded", + "waiting to connecting with ", + listen_point.toString(), + ". Released lock over it." }; + m_orb.printTrace(Trace.DEBUG, msg); + } + m_connections_opening.remove(listen_point); + throw new TRANSIENT(ce.toString()); + } + } + + } else { + try { + conn = openSSLClientConnection(listen_point, policy_context); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + opening_lock.setError(ce); + m_connections_opening.remove(listen_point); + throw ce; + } + } + + synchronized (this) { + + newConnection(conn); + + // add the new connection to the client_connections + + m_ssl_client_connections.put(listen_point, conn); + + opening_lock.setOpened(conn); + m_connections_opening.remove(listen_point); + } + + if (m_orb.m_trace != null) { + String[] msg = { conn.toString(), " Opened!" }; + m_orb.printTrace(Trace.DEBUG, msg); + } + + } + +// BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + +// if ( (!conn.isBidirectionalConnection()) +// && (bidir != null) +// && (bidir.value() == org.omg.BiDirPolicy.BOTH.value) +// && (commLayer.hasServerListener())) { +// conn.setBidirectionalMode( +// commLayer.getBidirectionalService() +// ); +// } + + return conn; + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCorbaloc.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCorbaloc.java.svn-base new file mode 100644 index 0000000..26f5b55 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPCorbaloc.java.svn-base @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.StringTokenizer; + +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.Corbaloc; + +public class IIOPCorbaloc +{ + + public static String getObjectId(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, path, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:iiop:")) { + corbaloc = corbaloc_URL.substring(14); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + return corbaloc.substring(slashposition + 1); + } + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, url_key, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:iiop:")) { + corbaloc = corbaloc_URL.substring(14); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + url_key = corbaloc.substring(slashposition + 1); + + ObjectKey objectkey = createKey(url_key); + + profiles = new IIOPProfile[1]; + + profiles[0] = new IIOPProfile(version, listener, objectkey, null); + + return new IIOPIOR("", profiles); + } + + /** + * Simulates an usual ObjectKey, that is marshaled in an Encapsulation, but + * instead, the url ObjectKey is marshaled as a ulong value (the size) and + * the char array of the string (without the end of string character *. + * + * @param url + * @return + * @throws org.omg.CORBA.ORBPackage.InvalidName + */ + private static ObjectKey createKey(String url_key) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + CDROutputStream output = + new CDROutputStream(null, + new byte[url_key.length() + CDR.ULONG_SIZE]); + + char[] url_buffer = url_key.toCharArray(); + + output.write_ulong(url_buffer.length); + output.write_char_array(url_buffer, 0, url_buffer.length); + + CDRInputStream input = (CDRInputStream) output.create_input_stream(); + + Encapsulation encap = input.readEncapsulation(); + + return new ObjectKey(encap); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPIOR.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPIOR.java.svn-base new file mode 100644 index 0000000..e0ae912 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPIOR.java.svn-base @@ -0,0 +1,245 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.iiop.IORAddressingInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.util.Base16Codec; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.ziop.ZIOP; + +/** + * Representation of an Internet Object Reference (IOR). An IOR is compounded + * by; + *

    + *
  • at least one TaggedProfile + *
  • the repositoryId of the reference + *
+ * In addition, the ior has its stringified representation and its marshaled + * value. + * + * @autor Juan A. Cáceres + * @version 2.0 + */ + +public class IIOPIOR extends IOR +{ + + String toString; + + // IIOP optimizations + + boolean iiopProfileSearched; + + IIOPProfile iiopProfile; + + int iiopProfilePosition; + + int hash_code = -1; + + boolean ziopSearched; + + boolean hasZIOPPolicies; + + public IIOPIOR() { + this.toString = null; + this.iiopProfile = null; + this.iiopProfileSearched = false; + this.iiopProfilePosition = 0; + this.ziopSearched = false; + this.hasZIOPPolicies = false; + } + + public IIOPIOR(String id, TaggedProfile[] profiles) { + super( id, profiles ); + this.toString = null; + this.ziopSearched = false; + this.hasZIOPPolicies = false; + } + + public IIOPIOR( IOR ior ){ + assign( ior ); + } + + public void assign(IIOPIOR ior) { + super.profiles = ior.profiles; + super.type_id = ior.type_id; + this.toString = ior.toString; + } + + + public static IIOPIOR fromString(TIDORB orb, String ior_str) { + int length = ior_str.length(); + if (((length % 2) != 0) || (length < 14)) + throw new INV_OBJREF("IOR format error: invalid ior length.", 0, + CompletionStatus.COMPLETED_NO); + if (!ior_str.startsWith("IOR:")) + throw new INV_OBJREF("Invalid IOR format id: \"IOR:\".", 0, + CompletionStatus.COMPLETED_NO); + + byte[] buffer = new byte[(length - 4) / 2]; + char[] ior_chars = ior_str.toCharArray(); + int j = 4; + try { + for (int i = 0; i < buffer.length; i++) + buffer[i] = + (byte) (16 * (Base16Codec.getValue(ior_chars[j++])) + + Base16Codec.getValue(ior_chars[j++])); + } + catch (Exception e) { + throw new INV_OBJREF(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + // create the the ior with the new buffer + IIOPIOR ior = new IIOPIOR(); + + CDRInputStream internet_cdr = new CDRInputStream(orb, buffer); + + internet_cdr.setByteOrder(internet_cdr.read_boolean()); + + ior.read(internet_cdr); + + ior.toString = ior_str; + + return ior; + } + + + public synchronized IIOPProfile profileIIOP() { + if (iiopProfile != null) + return iiopProfile; + + if (iiopProfileSearched) + throw new org.omg.CORBA.INV_OBJREF(); + + iiopProfileSearched = true; + + int count = super.memberCount(); + + for (int i = 0; i < count; i++) { + if ( super.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value) { + iiopProfilePosition = i; + iiopProfile = ( IIOPProfile ) getProfile( i ); + return iiopProfile; + } + } + + throw new org.omg.CORBA.INV_OBJREF(); + } + + public ObjectKey getObjectKey() { + IIOPProfile profile = this.profileIIOP(); + + return profile.getObjectKey(); + } + + public TargetAddress toObjectKeyAddress() { + TargetAddress address = new TargetAddress(); + + address.setObjectKey(getObjectKey()); + + return address; + } + + public TargetAddress toProfileAddress() { + + IIOPProfile profile = profileIIOP(); + + TargetAddress address = new TargetAddress(); + + address.profile(profile); + + return address; + } + + public TargetAddress toIORAddress() { + IIOPProfile profile = profileIIOP(); + + TargetAddress address = new TargetAddress(); + + address.ior(new IORAddressingInfo(iiopProfilePosition, this)); + + return address; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.iop.IOR#toURL() + */ + public String toURL() { + return Corbaloc.toURL( this ); + } + + public boolean is_ZIOP() { + if (!ziopSearched) { + hasZIOPPolicies = ZIOP.checkCompressionEnabled(profileIIOP().getPolicies()); + ziopSearched = true; + } + return hasZIOPPolicies; + } + + public PolicyContext policies() { + IIOPProfile profile = profileIIOP(); + return profile.getPolicies(); + } + + public org.omg.SSLIOP.SSL get_SSL() { + if (!this.iiopProfileSearched) + return this.profileIIOP().getSSLComponent().getSSL(); + else + throw new org.omg.CORBA.INV_OBJREF("No SSL Component found in IOR", 0, + CompletionStatus.COMPLETED_NO); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..1a7d6f2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPLocateResponseHandler.java.svn-base @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.LocateResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + */ +public class IIOPLocateResponseHandler extends QueuedLocateResponseHandler implements LocateResponseHandler { + + private IIOPConnection conn; + private GIOPVersion version; + private RequestId requestId; + private ObjectKey objectKey; + + + public IIOPLocateResponseHandler( IIOPConnection conn, + GIOPVersion version, + RequestId requestId, + ObjectKey objectKey) + { + setConnection( conn ); + setVersion ( version ); + setRequestId ( requestId ); + setObjectKey ( objectKey ); + } + + public void setConnection( IIOPConnection conn ){ + this.conn = conn; + } + + public IIOPConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setRequestId( RequestId requestId ){ + this.requestId = requestId; + } + + public RequestId getRequestId(){ + return this.requestId; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + throw new INTERNAL("Not supported"); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, reference ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, e ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#setResponseValue(boolean) + */ + public void submitResponse( boolean value ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, value ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPProfile.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPProfile.java.svn-base new file mode 100644 index 0000000..9a673e5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPProfile.java.svn-base @@ -0,0 +1,402 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.IOP.TAG_INTERNET_IOP; +import org.omg.IOP.TAG_ORB_TYPE; +import org.omg.IOP.TAG_POLICIES; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.iop.ORBComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.security.CSIComponent; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedComponentReader; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * IIOPProfile defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class IIOPProfile extends TaggedProfile { + + private GIOPVersion m_version; + + private ListenPoint m_listen_point; + + private ObjectKey m_object_key; + + private TaggedComponent[] m_components; + + private CDRInputStream m_profile_data; + + public IIOPProfile() + { + super(TAG_INTERNET_IOP.value); + + m_version = null; + m_listen_point = null; + m_object_key = null; + m_components = null; + m_profile_data = null; + } + + public IIOPProfile(GIOPVersion version, ListenPoint listen_point) + { + super(TAG_INTERNET_IOP.value); + this.m_version = version; + this.m_listen_point = listen_point; + m_object_key = null; + m_components = null; + m_profile_data = null; + } + + public IIOPProfile(GIOPVersion version, + ListenPoint listen_point, + ObjectKey object_key, + TaggedComponent[] tagged_components) + { + super(TAG_INTERNET_IOP.value); + this.m_version = version; + this.m_listen_point = listen_point; + this.m_object_key = object_key; + m_components = tagged_components; + m_profile_data = null; + } + + public GIOPVersion getVersion() + { + if (m_version == null) + extractMembers(); + return m_version; + + } + + public ListenPoint getListenPoint() + { + if (m_listen_point == null) + extractMembers(); + + // Remove %interface from host string + int pos = m_listen_point.m_host.indexOf("%"); + if (pos != -1) { + String only_host_string; + only_host_string = m_listen_point.m_host.substring(0,pos); + m_listen_point.m_host = only_host_string; + } + + return m_listen_point; + } + + public ObjectKey getObjectKey() + { + if (m_object_key == null) + extractMembers(); + return m_object_key; + } + + public TaggedComponent[] getTaggedComponents() + { + if (m_components == null) + extractMembers(); + return m_components; + } + + public boolean equal( Object profile) + { + if (m_profile_data != null) + extractMembers(); + + IIOPProfile iiopProfile; + if ( profile instanceof IIOPProfile ){ + iiopProfile = ( IIOPProfile )profile; + } else { + iiopProfile = null; + } + + return iiopProfile != null && + getVersion() .equal ( iiopProfile.getVersion() ) && + getListenPoint().equals( iiopProfile.getListenPoint() ) && + getObjectKey() .equal ( iiopProfile.getObjectKey() ); + } + + public void partialRead( es.tid.TIDorbj.core.cdr.CDRInputStream input ) { + m_profile_data = input.copy(); + input.skipEncapsulation(); + } + + synchronized protected void extractMembers() { + if (m_version != null) // has the members + return; + + if (m_profile_data == null) + throw new org.omg.CORBA.INTERNAL("Empty Profile"); + + m_profile_data.enterEncapsulation(); + + m_version = GIOPVersion.read(m_profile_data); + + m_listen_point = ListenPoint.read(m_profile_data); + + m_object_key = new ObjectKey(); + m_object_key.read( m_profile_data ); + if (m_version.minor != 0) { + int size = m_profile_data.read_ulong(); + if (size < 0) { + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + } else { + m_components = new TaggedComponent[size]; + for (int i = 0; i < size; i++) { + + TaggedComponent comp = + TaggedComponentReader.read(m_profile_data); + + m_components[i] = comp; + + // Check tag + + if (comp.m_tag == TAG_POLICIES.value) { + PoliciesComponent policies_component = (PoliciesComponent) comp; + //m_policies = policies_component.getPolicies(); + } + if (comp.m_tag == TAG_SSL_SEC_TRANS.value) { + SSLComponent ssl_component = (SSLComponent) comp; + m_listen_point.m_ssl_port = ssl_component.getSSLPort(); + // m_ssl = ssl_component.getSSL(); + } + if (comp.m_tag == TAG_CSI_SEC_MECH_LIST.value) { + CSIComponent csi_component = (CSIComponent) comp; + + } + + } + } + } + + m_profile_data = null; + } + + public void write(CDROutputStream out) + { + extractMembers(); + + // write tag + out.write_ulong(tag); + + // write profile data + + out.enterEncapsulation(); + + m_version.write(out); + ListenPoint.write(out, m_listen_point); + m_object_key.write(out); + + if (m_version.minor != 0) { + if (m_components == null) + out.write_ulong(0); + else { + out.write_ulong(m_components.length); + for (int i = 0; i < m_components.length; i++) + m_components[i].write(out); + } + } + + out.exitEncapsulation(); + } + + public String toString() + { + if (m_profile_data != null) + extractMembers(); + + boolean from_tidorb = false; + + if (m_components != null) + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_ORB_TYPE.value) { + if (((ORBComponent) m_components[i]).m_orb_type + == ConfORB.ORB_TYPE.m_orb_type) { + from_tidorb = true; + break; + } + } + + StringBuffer buffer = new StringBuffer(); + + buffer.append("Profile: { "); + buffer.append('\n'); + buffer.append('\t'); + buffer.append(getVersion().toString()); + buffer.append(", "); + buffer.append('\n'); + buffer.append('\t'); + buffer.append(getListenPoint().toString()); + buffer.append(", "); + + ORBComponent orb_component = getORBComponent(); + if (orb_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_ORB_TYPE: "); + buffer.append(orb_component.toString()); + } + + PoliciesComponent policies_component = getPoliciesComponent(); + if (policies_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_POLICIES: "); + buffer.append(policies_component.toString()); + } + + + SSLComponent ssl_component = getSSLComponent(); + if (ssl_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_SSL_SEC_TRANS: "); + buffer.append(ssl_component.toString()); + } + + CSIComponent csi_component = getCSIComponent(); + if (csi_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_CSI_SEC_MECH_LIST: "); + buffer.append(csi_component.toString()); + } + + buffer.append('\n'); + buffer.append('\t'); + + if ( from_tidorb ) { + POAKey key; + try { + key = POAKey.createKey( getObjectKey().getMarshaledKey() ); + buffer.append( key.toString() ); + } catch ( Throwable th ) { + buffer.append( "ObjectKey[OPAQUE]" ); + } + + } else { + buffer.append("ObjectKey[OPAQUE]"); + } + buffer.append('\n'); + buffer.append('}'); + + return buffer.toString(); + } + + /** + * @return + */ + public PoliciesComponent getPoliciesComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_POLICIES.value) { + return (PoliciesComponent) m_components[i]; + } + } + + return null; + } + + + public ORBComponent getORBComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_ORB_TYPE.value) { + return (ORBComponent) m_components[i]; + } + } + + return null; + } + + public SSLComponent getSSLComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_SSL_SEC_TRANS.value) { + return (SSLComponent) m_components[i]; + } + } + return null; + } + + + public CSIComponent getCSIComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_CSI_SEC_MECH_LIST.value) { + return (CSIComponent) m_components[i]; + } + } + return null; + } + + + public PolicyContext getPolicies() + { + PoliciesComponent policies_component = this.getPoliciesComponent(); + if (policies_component != null) + return policies_component.getPolicies(); + else + return null; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPResponseHandler.java.svn-base new file mode 100644 index 0000000..505a642 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IIOPResponseHandler.java.svn-base @@ -0,0 +1,193 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + + +/** + * ResponseHandler implementation for the IIOPCommunicationLayer + * + * @author jprojas + * + */ +public class IIOPResponseHandler extends QueuedResponseHandler implements ResponseHandler { + + private IIOPConnection conn; + private GIOPVersion version; + private ServerRequestImpl serverRequest; + private ObjectKey objectKey; + private PolicyContext policySupplier; + + public IIOPResponseHandler( IIOPConnection conn, + GIOPVersion version, + ServerRequestImpl + serverRequest, + ObjectKey objectKey, + PolicyContext policySupplier){ + setConnection( conn ); + setVersion( version ); + setServerRequest( serverRequest ); + setObjectKey( objectKey ); + setPolicyContext( policySupplier ); + } + + public void setConnection( IIOPConnection conn ){ + this.conn = conn; + } + + public IIOPConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setServerRequest( ServerRequestImpl serverRequest ){ + this.serverRequest = serverRequest; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + /** + * @param policySupplier The policySupplier to set. + */ + public void setPolicyContext(PolicyContext policySupplier) + { + this.policySupplier = policySupplier; + } + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + return this.policySupplier; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.serverRequest.setForward( reference ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + if( this.serverRequest.withResponse() ) { + this.serverRequest.setSystemException( e ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.conn.sendReply( this.serverRequest, this.policySupplier ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /** + * remove from here + * @author jprojas + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IORAddressingInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IORAddressingInfo.java.svn-base new file mode 100644 index 0000000..5180293 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/IORAddressingInfo.java.svn-base @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +/** + * IORAddressingInfo structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class IORAddressingInfo { + + public int m_selected_profile_index; + + public IOR m_ior; + + public IIOPProfile getProfileIIOP() + { + if (m_selected_profile_index == -1) + return null; + else + return (IIOPProfile) m_ior.getProfile(m_selected_profile_index); + } + + public IORAddressingInfo(int selected_profile_index, IOR ior) + { + this.m_selected_profile_index = selected_profile_index; + this.m_ior = ior; + } + + public static IORAddressingInfo + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int index; + + index = input.read_ulong(); + + IOR ior = new DefaultIOR(); + + ior.read(input); + + if (index >= ior.memberCount()) + throw new MARSHAL("Invalid selected Profile Number: " + index, + 0, + CompletionStatus.COMPLETED_NO); + + return new IORAddressingInfo(index, ior); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_selected_profile_index); + m_ior.write(output); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ListenPoint.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ListenPoint.java.svn-base new file mode 100644 index 0000000..f7e6a45 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ListenPoint.java.svn-base @@ -0,0 +1,110 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +/** + * ListenPoint structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ListenPoint +{ + private String m_str; + + public String m_host; + + public int m_port; + + public int m_ssl_port; + + public ListenPoint(String host, int port) + { + m_str = null; + m_host = host; + m_port = port; + m_ssl_port = 0; + } + + public boolean equals(Object obj) + { + if (obj instanceof ListenPoint) { + ListenPoint other = (ListenPoint) obj; + return (m_port == other.m_port) && (m_host.equals(other.m_host)); + } + + return false; + } + + public int hashCode() + { + return m_host.hashCode() + m_port; + } + + public static ListenPoint read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + return new ListenPoint(input.read_string(), + 0xffff & input.read_ushort()); + } + + public static void write(es.tid.TIDorbj.core.cdr.CDROutputStream output, + ListenPoint point) + { + output.write_string(point.m_host); + output.write_ushort((short) point.m_port); + } + + public String toString() + { + if (m_str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("ListenPoint("); + buffer.append(String.valueOf(m_port)); + buffer.append('@'); + buffer.append(m_host); + buffer.append(')'); + m_str = buffer.toString(); + } + return m_str; + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/Lock.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/Lock.java.svn-base new file mode 100644 index 0000000..a61d5d8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/Lock.java.svn-base @@ -0,0 +1,133 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.util.OperationCompletion; + +/** + * Lock where the the threads that have invoked a request must be locket until + * the complete response has been replied or the response timeout has expired. + * + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class Lock +{ + + /** + * The Operation Completion Status. + */ + OperationCompletion m_state; + + /** + * Request identifier. This identifier will be the key for the connection + * thread to + */ + + RequestId m_request_id; + + GIOPFragmentedMessage message; + + public Lock() + { + m_request_id = null; + message = null; + m_state = new OperationCompletion(); + } + + public RequestId requestId() + { + return m_request_id; + } + + public void requestId(RequestId id) + { + m_request_id = id; + } + + public boolean getCompleted() + { + return m_state.isCompleted(); + } + + public void setCompleted() + { + m_state.setCompleted(); + } + + public void setMessage(GIOPFragmentedMessage msg) + { + message = msg; + } + + public GIOPFragmentedMessage getMessage() + { + return message; + } + + public void waitForCompletion(long how_long) + { + try { + m_state.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + public void cancelWaiting() + { + m_state.interruptWaiting(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockEnumeration.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockEnumeration.java.svn-base new file mode 100644 index 0000000..bea3bf2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockEnumeration.java.svn-base @@ -0,0 +1,63 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +public class LockEnumeration +{ + java.util.Enumeration m_elements; + + public LockEnumeration(java.util.Enumeration elements) + { + m_elements = elements; + } + + public boolean hasMoreElements() + { + return m_elements.hasMoreElements(); + } + + public Lock next() + { + return (Lock) m_elements.nextElement(); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockList.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockList.java.svn-base new file mode 100644 index 0000000..9e386ff --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/LockList.java.svn-base @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.giop.RequestId; + +public class LockList +{ + + java.util.Hashtable m_table; + + public LockList() + { + m_table = new java.util.Hashtable(); + } + + public void put(Lock lock) + { + m_table.put(lock.requestId(), lock); + } + + public Lock get(RequestId request_id) + { + return (Lock) m_table.get(request_id); + } + + public void remove(RequestId request_id) + { + m_table.remove(request_id); + } + + public int size() + { + return m_table.size(); + } + + public LockEnumeration elements() + { + return new LockEnumeration(m_table.elements()); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/OpeningLock.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/OpeningLock.java.svn-base new file mode 100644 index 0000000..562764e --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/OpeningLock.java.svn-base @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.Connection; + +/** + * + * Maintains the connection opening lock. + * + * @author Juan A. Caceres + * @version 1.0 + */ + +class OpeningLock +{ + + public final static int OPENING = 0; + + public final static int OPENED = 1; + + public final static int ERROR = 2; + + private int m_status; + + //private IIOPConnection m_opened_connection; + private Connection m_opened_connection; + + private org.omg.CORBA.COMM_FAILURE m_error; + + public OpeningLock() + { + m_status = OPENING; + m_opened_connection = null; + m_error = null; + } + + //public synchronized IIOPConnection waitOpening(long time) + public synchronized Connection waitOpening(long time) + { + if (m_status == OPENING) { + try { + wait(time); + } + catch (InterruptedException ioe) {} + } + + if (m_status == OPENED) + return m_opened_connection; + + else if (m_status == ERROR) + throw m_error; + else + //throw new org.omg.CORBA.COMM_FAILURE("IIOPConnection timout"); + throw new org.omg.CORBA.COMM_FAILURE("Connection timout"); + } + + //public synchronized void setOpened(IIOPConnection conn) + public synchronized void setOpened(Connection conn) + { + m_status = OPENED; + m_opened_connection = conn; + notifyAll(); + } + + public synchronized void setError(org.omg.CORBA.COMM_FAILURE failure) + { + m_status = ERROR; + m_error = failure; + notifyAll(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/RECOVERABLE_COMM_FAILURE.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/RECOVERABLE_COMM_FAILURE.java.svn-base new file mode 100644 index 0000000..e7c7c97 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/RECOVERABLE_COMM_FAILURE.java.svn-base @@ -0,0 +1,63 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +/** + * Failure thrown in connection that can be recovered for resending requests. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class RECOVERABLE_COMM_FAILURE extends Exception +{ + + public org.omg.CORBA.COMM_FAILURE m_comm_failure; + + public RECOVERABLE_COMM_FAILURE(COMM_FAILURE failure) + { + m_comm_failure = failure; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ReliableOnewayThread.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ReliableOnewayThread.java.svn-base new file mode 100644 index 0000000..feb5481 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ReliableOnewayThread.java.svn-base @@ -0,0 +1,67 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.RequestImpl; + + +public class ReliableOnewayThread extends java.lang.Thread +{ + IIOPCommLayer m_comm; + + RequestImpl m_request; + + IIOPIOR m_ior; + + public ReliableOnewayThread(IIOPCommLayer comm, RequestImpl req, IIOPIOR ior) + { + this.m_comm = comm; + m_request = req; + this.m_ior = ior; + } + + public void run() + { + m_comm.reliableOnewayRun(m_request, m_ior); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ServerListener.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ServerListener.java.svn-base new file mode 100644 index 0000000..3112b48 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/ServerListener.java.svn-base @@ -0,0 +1,376 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.Trace; + +public class ServerListener extends Thread +{ + + /** + * ServerSocket state + */ + + boolean m_shutdowned; + + boolean m_connected; + + /** + * ServerSocket where the communication layer will accept connections. This + * socket will be only avalilable when a the ORB's run method + * had been invoked. + */ + ServerSocket m_server_socket; + + /** + * Conection manager. + */ + IIOPConnectionManager m_manager; + + /** + * Listen points where the ServerSocket will be listening. This + * Vector { point(host,port) } will be used to create de local IOR's. + */ + java.util.Vector m_listen_points; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + ServiceContextList m_bidirectional_service; + + es.tid.TIDorbj.core.TIDORB m_orb; + + String hostAddress; + String hostName; + int port; + int backlog; + int reconnect; + GIOPVersion giopVersion; + boolean ipv6; + String iface; + String m_listen_points_string; + + public ServerListener(IIOPConnectionManager manager) + { + m_shutdowned = true; + m_connected = false; + + this.m_manager = manager; + m_orb = manager.orb(); + + m_listen_points = new java.util.Vector(); + InetAddress inet; + + + this.hostAddress = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS ) + .getValue(); + this.hostName = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_NAME ) + .getValue(); + this.port = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.PORT ) + .getInt(); + this.backlog = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_BACKLOG ) + .getInt(); + this.reconnect = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_RECONNECT ) + .getInt(); + this.giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + this.iface = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IFACE ) + .getString(); + + + try { + if ( hostAddress == null) { + m_server_socket = new ServerSocket( this.port , this.backlog ); + } else { + m_server_socket = new ServerSocket( + this.port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + + if (this.hostName != null) { + m_listen_points.addElement(new ListenPoint(this.hostName, + m_server_socket.getLocalPort())); + } else { + + if (this.ipv6) { + if ( hostAddress == null) { + inet = InetAddress.getByName("::1"); //ip6-localhost"); + } + else { + inet = InetAddress.getByName(hostAddress); + } + m_listen_points.addElement(new ListenPoint( + inet.getHostAddress(), + m_server_socket.getLocalPort())); + } + + inet = InetAddress.getLocalHost(); + m_listen_points.addElement(new ListenPoint( + inet.getHostAddress()+ "%" + iface, + m_server_socket.getLocalPort())); + } + + m_shutdowned = false; + m_connected = true; + + } + catch (java.io.IOException e) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open ServerSocket: " + e.toString() + ); + } + + m_listen_points_string = ""; + for (int i = 0; i < m_listen_points.size(); i++) { + m_listen_points_string += m_listen_points.elementAt(i).toString(); + m_listen_points_string += " "; + } + + + m_orb.printTrace( + Trace.DEBUG, "ServerListener connected at: " + m_listen_points_string + ); + } + + public java.util.Vector getListenPoints() { + return m_listen_points; + } + + public synchronized void shutdown() { + if (!m_shutdowned) { + m_shutdowned = true; + try { + m_server_socket.close(); + } catch (Throwable th) {} + + m_server_socket = null; + + m_orb.printTrace( + Trace.DEBUG, "ServerListener at " + m_listen_points_string + " shutdown!" + ); + } + } + + public synchronized void resetServerSocket() { + if (!m_shutdowned) { + try { + if (m_server_socket != null) + m_server_socket.close(); + } + catch (Throwable th) {} + + try { + if ( this.hostAddress == null) { + m_server_socket = new ServerSocket( + ((ListenPoint)m_listen_points.elementAt(0)).m_port, + this.backlog + ); + } else { + m_server_socket = new ServerSocket( + ((ListenPoint)m_listen_points.elementAt(0)).m_port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + } catch (Throwable th) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open ServerSocket: " + th.toString() + ); + } + } + } + + public void run() + { + while (!m_shutdowned) { + while (m_connected) { + + Socket client_socket = null; + try { + client_socket = m_server_socket.accept(); + } catch (Throwable se) { + + if ( m_shutdowned ){ + return; + } + + m_connected = false; + + m_orb.printTrace( + Trace.ERROR, "Error in ServerSocket.accept(): ", se + ); + } + + try { + if (client_socket != null) { + m_manager.createServerConnection(client_socket); + } + } catch (Throwable e) { + try { + client_socket.close(); + } catch (Throwable t) {} + + m_orb.printTrace( + Trace.ERROR, "Error creating ServerConnection: ", e + ); + } + } + + if ((!m_connected) && (!m_shutdowned)) { + + // RECONNECT + + //printTrace will check for a trace handler existence + m_orb.printTrace( Trace.DEBUG, "Trying to reconnect server socket "); + + try { + resetServerSocket(); + m_connected = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, "ServerSocket reconnected" + ); + } + } catch (Throwable th) { + m_orb.printTrace( + Trace.ERROR, "ServerSocket reconnect error: ", th + ); + try { + Thread.sleep( this.reconnect ); + } catch (InterruptedException e) {} + } + } + } + } + + public IOR createIOR(String id, POAKey key, + TaggedComponent[] extraComponents) { + + TaggedProfile[] profiles = new TaggedProfile[m_listen_points.size()]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + for (int i = 0; i < m_listen_points.size(); i++) { + profiles[i] = new IIOPProfile(this.giopVersion, + (ListenPoint)m_listen_points.elementAt(i), + key, + components); + } + + return new IIOPIOR(id, profiles); + }//createIOR + + public IOR createIOR(String id, ObjectKey key, + TaggedComponent[] extraComponents) { + + TaggedProfile[] profiles = new TaggedProfile[m_listen_points.size()]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + for (int i = 0; i < m_listen_points.size(); i++) { + profiles[i] = new IIOPProfile(this.giopVersion, + (ListenPoint)m_listen_points.elementAt(i), + key, + components); + } + + return new IIOPIOR(id, profiles); + }//createIOR + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/TargetAddress.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/TargetAddress.java.svn-base new file mode 100644 index 0000000..cf2c8ac --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/TargetAddress.java.svn-base @@ -0,0 +1,206 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.iop.TaggedProfileReader; + +/** + * Union TargetAddress defined in GIOP module (version 1.2). + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: jprojas: should be refactored to use a generic profile and moved to giop +//package +public class TargetAddress +{ + + short m_discriminator; + + protected ObjectKey m_object_key; + + protected IIOPProfile m_profile; + + protected IORAddressingInfo m_ior; + + public TargetAddress() + { + reset(); + } + + public short setObjectKey(ObjectKey value) + { + reset(); + m_discriminator = AddressingDisposition._KeyAddr; + m_object_key = value; + return m_discriminator; + } + + public IIOPProfile profile() + { + return m_profile; + } + + public short profile(IIOPProfile value) + { + reset(); + m_discriminator = AddressingDisposition._ProfileAddr; + m_profile = value; + return m_discriminator; + } + + public IORAddressingInfo ior() + { + return m_ior; + } + + public short ior(IORAddressingInfo value) + { + reset(); + m_discriminator = AddressingDisposition._ReferenceAddr; + m_ior = value; + return m_discriminator; + } + + public short discriminator() + { + return m_discriminator; + } + + private void reset() + { + m_discriminator = -1; + m_object_key = null; + m_profile = null; + m_ior = null; + } + + public ObjectKey getObjectKey() + { + if (m_discriminator < 0) + return null; + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + return m_object_key; + case AddressingDisposition._ProfileAddr: + return m_profile.getObjectKey(); + case AddressingDisposition._ReferenceAddr: + TaggedProfile tag_profile; + tag_profile = + m_ior.m_ior.getProfile(m_ior.m_selected_profile_index); + if (tag_profile instanceof IIOPProfile) + return ((IIOPProfile) tag_profile).getObjectKey(); + else + return null; // I can not know how select get the object key + default: + return null; + } + } + + public boolean write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + if (m_discriminator < 0) + return false; + out.write_short(m_discriminator); + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + m_object_key.write(out); + break; + case AddressingDisposition._ProfileAddr: + m_profile.write(out); + break; + case AddressingDisposition._ReferenceAddr: + m_ior.write(out); + break; + default: + return false; + } + return true; + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream in) + { + reset(); + AddressingDisposition disposition = + AddressingDisposition.from_short(in.read_short()); + + if (disposition == null) { + throw new MARSHAL("Invalid TargetAddress discriminator", + 0, + CompletionStatus.COMPLETED_NO); + } + + m_discriminator = disposition.value(); + + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + m_object_key = new ObjectKey(); + m_object_key.read(in); + break; + case AddressingDisposition._ProfileAddr: + TaggedProfile tag_profile = TaggedProfileReader.read(in); + if (tag_profile instanceof IIOPProfile) + m_profile = (IIOPProfile) tag_profile; + else + throw new MARSHAL("IIOP Profile expected.", + 0, + CompletionStatus.COMPLETED_NO); + + break; + case AddressingDisposition._ReferenceAddr: + m_ior = IORAddressingInfo.read(in); + break; + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/WriteTimeout.java.svn-base b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/WriteTimeout.java.svn-base new file mode 100644 index 0000000..1c33b21 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/.svn/text-base/WriteTimeout.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +public class WriteTimeout extends Exception +{} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/CommLayer.java b/source/es/tid/TIDorbj/core/comm/iiop/CommLayer.java new file mode 100644 index 0000000..9bfe6ac --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/CommLayer.java @@ -0,0 +1,248 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.comm.local.LocalCommLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommLayer; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Communication Layer. It will manage requests, dispatching these to the local + * or the internet communication layers. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @see es.tid.TIDorbj.core.comm.local.LocalCommLayer + * @see es.tid.TIDorbj.core.comm.iiopCommLayer + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +// TODO: move comm.iiop.CommLayer to comm.CommLayer + +public class CommLayer extends CommunicationLayer +{ + /** + * the internet layer for sending remote request + */ + IIOPCommLayer m_external_layer; + + /** + * the local layer for sending request to local objects. + */ + es.tid.TIDorbj.core.comm.local.LocalCommLayer m_internal_layer; + + public CommLayer(es.tid.TIDorbj.core.TIDORB orb) + { + super(orb); + + if ( orb.m_conf.comm_layers.indexOf("es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer" ) > -1 ) { + m_external_layer = new SSLIOPCommLayer(orb); + } else { + m_external_layer = new IIOPCommLayer(orb); + } + + m_internal_layer = new LocalCommLayer(orb); + } + + /** + * Sends a request. + * + * @param request + * the CORBA request. + */ + public void request( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + // check policy context + + try { + + if (isLocal(ior)) { + // si es local + m_internal_layer.request(request, ior); + } else { + m_external_layer.request(request, ior); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Sends a oneway request. + * + * @param request + * the CORBA request. + */ + public void onewayRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + try { + if (isLocal(ior)) { + // si es local + m_internal_layer.onewayRequest(request, ior); + } else { + m_external_layer.onewayRequest(request, ior); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + // AMI callback operations + + /** + * Sends a asynchronous request. + * + * @param request + * the CORBA request. + */ + public void asyncRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) //*opc1*, Object ami_handler) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + // check policy context + + try { + + if (isLocal(ior)) { + // si es local + m_internal_layer.asyncRequest(request, ior); //*opc1*, ami_handler); + } else { + m_external_layer.asyncRequest(request, ior); //*opc1*, ami_handler); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Sends a object existence request using the local or the IIOP + * communication layers. + * + * @param ior + * the object IOR. + */ + + public boolean objectExists( IIOPIOR ior, + PolicyContext policy_context) + throws es.tid.TIDorbj.core.comm.ForwardRequest + { + + try { + if (isLocal(ior)) { + return m_internal_layer.objectExists(ior, policy_context); + } else { + return m_external_layer.objectExists(ior, policy_context); + } + } + catch (java.lang.OutOfMemoryError ome) { + throw new org.omg.CORBA.NO_MEMORY(); + } + } + + /** + * Test whether an ior is local to the ORB or not. + * + * @param ior + * the object IOR. + */ + public boolean isLocal( IIOPIOR ior) + { + return m_external_layer.isLocal(ior); + } + + public void shutdown() + { + m_external_layer.shutdown(); + } + + public void destroy() + { + m_external_layer.destroy(); + } + + public IIOPCommLayer getExternalLayer() + { + return m_external_layer; + } + + /** + * Prepare a stream based request. + * + * @param request + * the CORBA request. + */ + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + m_external_layer.prepareRequest(request); + } + + public org.omg.CORBA.portable.InputStream + request(IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + PolicyContext policy_context) + throws es.tid.TIDorbj.core.comm.ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException + { + return m_external_layer.request(ior, stream, policy_context); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.java b/source/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.java new file mode 100644 index 0000000..9d6ece0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/CommunicationLayer.java @@ -0,0 +1,124 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 8 $ +* Date: $Date: 2006-01-24 17:36:46 +0100 (Tue, 24 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.comm.ForwardRequest; + +/** + * Base class for the ORB communications layers. + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class CommunicationLayer extends es.tid.TIDorbj.core.ORBComponent +{ + public CommunicationLayer(es.tid.TIDorbj.core.TIDORB orb) + { + super(orb); + } + + /** + * Sends a request. + * + * @param request + * the CORBA request. + */ + public abstract void request( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) + throws ForwardRequest; + + /** + * Sends a oneway request. + * + * @param request + * the CORBA request. + */ + public abstract void onewayRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior); + + /** + * Sends a asynchronous request. + * + * @param request + * the CORBA request. + */ + public abstract void asyncRequest( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior /* *opc1* , Object ami_handler*/) throws ForwardRequest; + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + * + */ + public abstract boolean + objectExists( + IIOPIOR ior, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws ForwardRequest; + + /** + * Prepare a stream based request. + * + * @param request + * the CORBA request. + */ + public abstract void prepareRequest( + es.tid.TIDorbj.core.StreamRequestImpl request ); + + public abstract org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ConnectionState.java b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionState.java new file mode 100644 index 0000000..5954e97 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionState.java @@ -0,0 +1,163 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +/** + * TIDorb IIOP IIOPConnection State. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class ConnectionState +{ + + /** + * Open connection state. + */ + public final static short OPEN_STATE = 0; + + /** + * Open connection state. + */ + public final static short CLOSING_STATE = 1; + + /** + * Open connection state. + */ + public final static short ERROR_STATE = 2; + + /** + * IIOPConnection state. + */ + private short m_state; + + /** + * IIOPConnection error that unhabilitates the connection. + */ + protected COMM_FAILURE m_connection_error; + + public ConnectionState() + { + m_state = OPEN_STATE; + m_connection_error = null; + } + + synchronized public boolean setClosing() + { + if (m_state != OPEN_STATE) + return false; + + m_state = CLOSING_STATE; + + return true; + } + + synchronized public boolean isOpen() + { + return m_state == OPEN_STATE; + } + + synchronized public boolean seterror(COMM_FAILURE error) + { + if (m_state == ERROR_STATE) { + return false; + } else if (m_state == CLOSING_STATE) { + m_state = ERROR_STATE; + m_connection_error = error; + return false; + } else { // OPEN_STATE + m_state = ERROR_STATE; + m_connection_error = error; + return true; + } + } + + synchronized public short getValue() + { + return m_state; + } + + public COMM_FAILURE getError() + { + return m_connection_error; + } + + /** + * Verify if the reply can be sent. + */ + synchronized public void verifyForReply() + { + switch (m_state) + { + case OPEN_STATE: + return; + case CLOSING_STATE: + throw new COMM_FAILURE("IIOPConnection is closed."); + case ERROR_STATE: + throw m_connection_error; + } + } + + /** + * Verify if the request can be sent. + */ + synchronized public void verifyForRequest() + throws RECOVERABLE_COMM_FAILURE + { + switch (m_state) + { + case OPEN_STATE: + return; + case CLOSING_STATE: + throw new RECOVERABLE_COMM_FAILURE( + new COMM_FAILURE("IIOPConnection is closed.")); + case ERROR_STATE: + throw new RECOVERABLE_COMM_FAILURE(m_connection_error); + } + } + +} + diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.java b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.java new file mode 100644 index 0000000..ac59088 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionThread.java @@ -0,0 +1,70 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + + +import es.tid.TIDorbj.core.comm.Connection; + +/** + * Thread that receives messages in the connection. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +// TODO: move comm.iiop.ConnectionThread to comm.ConnectionThread + +public class ConnectionThread extends java.lang.Thread +{ + Connection m_connection; + + public ConnectionThread(Connection conn) + { + m_connection = conn; + } + + public void run() + { + m_connection.receiveMessage(); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.java b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.java new file mode 100644 index 0000000..db05129 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ConnectionWriteMonitor.java @@ -0,0 +1,115 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision: 478 $ + * Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ + * Last modified by: $Author: avega $ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +public class ConnectionWriteMonitor +{ + final static int FREE = 0; + + final static int WRITTING = 1; + + final static int ERROR = 2; + + int m_status; + + int m_timeout; + + COMM_FAILURE m_exception; + + public ConnectionWriteMonitor(int timeout) + { + m_timeout = timeout; + m_status = FREE; + m_exception = null; + } + + public synchronized void initWrite() + throws WriteTimeout + { + long t0 = new java.util.Date().getTime();//msegs + long t1; + long dif = 0; + + while ( m_status==WRITTING && dif < m_timeout){ + try { + wait(m_timeout); + } + catch (java.lang.InterruptedException ie) {} + + t1 = new java.util.Date().getTime(); + dif = t1-t0; + } + + if (m_status == WRITTING) { + m_status = ERROR; + m_exception = new COMM_FAILURE("Socket write timeout"); + throw new WriteTimeout(); + } + + if (m_status == ERROR) + throw m_exception; + + if (m_status == FREE) + m_status = WRITTING; + } + + public synchronized void endWrite() + { + m_status = FREE; + notify(); + } + + public COMM_FAILURE getException() + { + return m_exception; + } + + public synchronized void setException(COMM_FAILURE cf) + { + m_exception = cf; + notifyAll(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.java b/source/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.java new file mode 100644 index 0000000..ff43202 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/FragmentedMessageHolder.java @@ -0,0 +1,77 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.util.RemovableObject; + +/** + * Adapter class for maintaining an uncompleted fragmented message in a + * UseTable. + * + * @see es.tid.TIDorbj.core.util.UseTable + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class FragmentedMessageHolder + implements RemovableObject +{ + + public GIOPFragmentedMessage m_message; + + public FragmentedMessageHolder(GIOPFragmentedMessage msg) + { + m_message = msg; + } + + /** + * The message will always can be removed. + */ + public boolean canBeRemoved() + { + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.java new file mode 100644 index 0000000..8b7a96b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommLayer.java @@ -0,0 +1,1047 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESOURCES; +import org.omg.CORBA.Object; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayerPropertiesInfo; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * IIOP Communications layer. It will manage the request for a remote object + * using the IIOP Protocol. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IIOPCommLayer extends es.tid.TIDorbj.core.comm.iiop.CommunicationLayer +{ + /** + * The ORB has been destroyed. + */ + + public boolean m_destroyed; + + /** + * Server Socket listening thread. + */ + protected ServerListener m_server_listener; + + /** + * Conection manager. + */ + protected IIOPConnectionManager m_connection_manager; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + protected ServiceContextList m_bidirectional_service; + + protected int max_recover_count; + protected int recover_time; + protected boolean reliable_oneway; + protected GIOPVersion giopVersion; + + //TODO: remove ORB's from here if possible, and get CommunicationLayer + public IIOPCommLayer(TIDORB orb) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb); + m_destroyed = false; + m_connection_manager = new IIOPConnectionManager(orb, this); + m_bidirectional_service = null; + m_server_listener = null; + + max_recover_count = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.MAX_COMM_RECOVERING_TRIES + ).getInt(); + + recover_time = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.COMM_RECOVERING_TIME + ).getInt(); + + reliable_oneway = orb.getCommunicationManager().getLayerById( + IIOPCommunicationLayer.ID + ).getPropertyInfo( + IIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY + ).getBoolean(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + } + + public IIOPCommLayer(TIDORB orb, SSLIOPCommLayer ssliop_layer) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb); + m_destroyed = false; + m_connection_manager = new IIOPConnectionManager(orb, ssliop_layer); + m_bidirectional_service = null; + m_server_listener = null; + + max_recover_count = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.MAX_COMM_RECOVERING_TRIES + ).getInt(); + + recover_time = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.COMM_RECOVERING_TIME + ).getInt(); + + reliable_oneway = orb.getCommunicationManager().getLayerById( + SSLIOPCommunicationLayer.ID + ).getPropertyInfo( + SSLIOPCommunicationLayerPropertiesInfo.RELIABLE_ONEWAY + ).getBoolean(); + + giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + } + + public boolean isLocal( IIOPIOR ior) + { + if (m_server_listener == null) // no object adaptor initialized + return false; + + // Check matching between IOR ListenPoint and server_listener ListenPoints + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + int i = 0; + + while (i < listen_points.size() ) { + if ( ((ListenPoint)listen_points.elementAt(i)).equals(ior.profileIIOP() + .getListenPoint())) + return true; + i++; + } + return false; + } + + public boolean hasServerListener() + { + return (m_server_listener != null); + } + + /** + * Sends a request (with response) allocating an active connection with the + * corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + protected void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + PolicyContext policy_context = request.getPolicyContext(); + + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendRequest(request, ior); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * Sends a request using the IIOP protocol. + * + * @param request + * the CORBA request. + */ + public void request(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws ForwardRequest + { + request.withResponse(true); + sendRequest(request, ior); + } + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void onewayRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + if ( reliable_oneway ) { + try { + ReliableOnewayThread th = + new ReliableOnewayThread(this, request, ior); + th.start(); + return; + } + catch (Throwable thw) { + throw new NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } else { + + try { + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + + conn = + m_connection_manager + .getClientConnection(profile.getListenPoint(), + request.getPolicyContext()); + + conn.sendOnewayRequestAsync(request, ior); + + } + catch (Throwable th) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + "Exception in oneway remote invocation", + th); + } + } + } + + /** + * Sends a asynchronous request using the IIOP protocol allocating an active + * connection with the corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + public void asyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) //*opc1*, Object ami_handler) + throws ForwardRequest + { + + request.withResponse(true); + + PolicyContext policy_context = request.getPolicyContext(); + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendAsyncRequest(request, ior); //*opc1*, ami_handler); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void reliableOnewayRun( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + PolicyContext policy_context = + request.getPolicyContext(); + + request.reliableOneway(true); + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + + conn = + m_connection_manager + .getClientConnection(profile.getListenPoint(), + policy_context); + + conn.sendOnewayRequestSync(request, ior); + + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) + throw rcf.m_comm_failure; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication" + +" recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + + recover_count--; + + if (m_orb.m_trace != null) { + String[] msg = { "Communication forwarded: ", + fr.forward_reference.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + } + } + } + catch (Throwable e) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Exception in reliable remote oneway invocation :", + e); + } + } + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + */ + public boolean objectExists(IIOPIOR ior, + PolicyContext policy_context) + throws ForwardRequest + { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendLocateRequest(ior, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + org.omg.CORBA.portable.ObjectImpl obj = request.getTarget(); + es.tid.TIDorbj.core.comm.CommunicationDelegate delegate = + (es.tid.TIDorbj.core.comm.CommunicationDelegate) obj + ._get_delegate(); + es.tid.TIDorbj.core.iop.IOR ior = delegate.getReference(); + + IIOPIOR iiopIOR; + if ( ior instanceof IIOPIOR ){ + iiopIOR = ( IIOPIOR )ior; + } else { + throw new org.omg.CORBA.INTERNAL("Not an IIOP IOR."); + } + + PolicyContext policy_context = + delegate.createRequestPolicyContext(); + + IIOPProfile profile; + profile = iiopIOR.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + } + + IIOPConnection conn = null; + int recover_count = max_recover_count; + + while (conn == null) { + + try { + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + } + + conn.prepareRequest(request, iiopIOR); + + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + CDROutputStream stream, + PolicyContext policy_context + ) throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + IIOPConnection conn = null; + int recover_count = max_recover_count; + + while (true) { + try { + + conn = + m_connection_manager.getClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendRequest(ior, stream, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * ORB Server IIOPConnection part shutdown. + */ + public synchronized void shutdown() + { + try { + if (m_server_listener != null) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "Shutdown IIOPCommLayer .ServerListener"); + } + m_server_listener.shutdown(); + m_server_listener = null; + } + } + catch (Throwable e) {} + } + + /** + * IIOP Layer close. + */ + public synchronized void destroy() + { + if (!m_destroyed) { + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, "Destroying IIOPCommLayer"); + } + + try { + if (m_server_listener != null) { + m_server_listener.shutdown(); + m_server_listener = null; + } + } + catch (Throwable e) {} + + try { + if (m_connection_manager != null) { + m_connection_manager.destroy(); + m_connection_manager = null; + } + } + catch (Throwable e) {} + + m_bidirectional_service = null; + + m_destroyed = true; + } + } + + public synchronized void initServerListener() + { + if (m_server_listener == null) { + m_server_listener = new ServerListener(m_connection_manager); + m_server_listener.setDaemon(false); + try { + + m_server_listener.start(); + + } + catch (Throwable thw) { + m_server_listener = null; + throw new org.omg.CORBA.NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } + } + + public synchronized IOR createIOR(String id, + POAKey key, + TaggedComponent[] extraComponents) + { + if (m_server_listener == null) + throw new org.omg.CORBA.INTERNAL("ServerListener not initialized"); + + // return m_server_listener.createIOR(id, key, components); + + TaggedProfile[] profiles = new TaggedProfile[1]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + int i = 0; + while (i < listen_points.size() ) { + profiles[i] = new IIOPProfile( + this.giopVersion, + (ListenPoint)listen_points.elementAt(i), + key, + components + ); + i++; + } + return new IIOPIOR(id, profiles); + + + } + + public synchronized IOR createIOR(String id, + ObjectKey key, + TaggedComponent[] extraComponents) + { + if (m_server_listener == null) + throw new org.omg.CORBA.INTERNAL("ServerListener not initialized"); + + // return m_server_listener.createIOR(id, key, components); + + + + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + TaggedProfile[] profiles = new TaggedProfile[listen_points.size()]; + int i = 0; + + while (i < listen_points.size() ) { + profiles[i] = new IIOPProfile( + this.giopVersion, + //m_server_listener.getListenPoint(), + (ListenPoint)listen_points.elementAt(i), + key, + components + ); + i++; + } + return new IIOPIOR(id, profiles); + + } + + + public synchronized ServiceContextList getBidirectionalService() + { + if (m_destroyed) + throw new org.omg.CORBA.BAD_INV_ORDER("ORB is destroying"); + + if (m_bidirectional_service == null) { + if (m_server_listener == null) + throw new INTERNAL("Trying to create a bidirectional context " + + "without ListenPoint"); + + java.util.Vector listen_points = m_server_listener.getListenPoints(); + + BiDirServiceContext bidir_context = new BiDirServiceContext(listen_points.size()); + + for (int i = 0; i < listen_points.size(); i++) { + bidir_context.m_listen_points[i] = + (ListenPoint)listen_points.elementAt(i); + } + + m_bidirectional_service = new ServiceContextList(1); + m_bidirectional_service.m_components[0] = bidir_context; + + } + + return m_bidirectional_service; + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.java new file mode 100644 index 0000000..5df3b43 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationDelegate.java @@ -0,0 +1,364 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * @author jprojas + * + */ +public class IIOPCommunicationDelegate extends CommunicationDelegate { + + private IIOPIOR iiopReference; + private IIOPCommunicationLayer communicationLayer; + + /** + * + */ + public IIOPCommunicationDelegate( IIOPCommunicationLayer communicationLayer ) { + super(); + if ( communicationLayer != null ){ + super.setORB( communicationLayer.getORB() ); + this.communicationLayer = communicationLayer; + this.forwardReference = null; + } else { + throw new IllegalArgumentException( + "Parameter 'commLayer' cannot be null" + ); + } + } + + public void setReference(IOR ior) { + IIOPIOR iiopIOR = null; + if(! (ior instanceof IIOPIOR) ) { + iiopIOR = new IIOPIOR(ior); + + } else { + iiopIOR = (IIOPIOR) ior; + } + + super.setReference(iiopIOR); + + IIOPProfile profile = iiopIOR.profileIIOP(); + + PoliciesComponent policiesComponent = profile.getPoliciesComponent(); + + if(policiesComponent != null) { + this.setPolicyContext(policiesComponent.getPolicies()); + } + + + + }//setReference + + + public synchronized IIOPIOR getIIOPReference(){ + if ( this.iiopReference == null ){ + this.iiopReference = new IIOPIOR(); + this.iiopReference.assign( super.reference ); + } + return this.iiopReference; + } + + + public IOR getReference(){ + return getIIOPReference(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#isLocal(org.omg.CORBA.Object) + */ + public boolean isLocal( org.omg.CORBA.Object self) { + + if ( super.getORB() == null) { + throw new BAD_OPERATION( + "ORB Singleton", 0, CompletionStatus.COMPLETED_NO ); + } + + try { + if ( this.forwardReference == null) { + return this.communicationLayer.isLocal( this.getIIOPReference() ); + } else { + return this.forwardReference.is_local(null); + } + } catch ( CommunicationException ce ) { + return false; + } + }//isLocal + + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#non_existent(org.omg.CORBA.Object) + */ + public boolean non_existent(org.omg.CORBA.Object self){ + TIDORB orb = super.getORB(); + if ( orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + PolicyContext request_policy_context = createRequestPolicyContext(); + + CommunicationLayer comm_layer = this.communicationLayer.getCommLayer(); + + try { + + if ( this.forwardReference == null) { + return !comm_layer.objectExists( + this.getIIOPReference(), + request_policy_context); + } else { // there is forwards + boolean non_existent = true; + try { + non_existent = this.forwardReference.non_existent(null); + } + catch (org.omg.CORBA.COMM_FAILURE cf) { + non_existent = true; + } + catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + non_existent = false; + } + + if (non_existent) { + this.forwardReference = null; + } + + return non_existent; + } + } catch (ForwardRequest fe) { + + this.setForward(fe); + + } + + return non_existent(self); + }//non_existent + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#duplicate(org.omg.CORBA.Object) + */ + public Object duplicate(Object self) { + IIOPCommunicationDelegate delegate; + delegate = new IIOPCommunicationDelegate( this.communicationLayer ); + delegate.setReference( this.getReference() ); + + delegate.forwardReference = this.forwardReference; + + //getPolicyContext never returns null. + delegate.setPolicyContext( super.getPolicyContext().duplicate() ); + + ObjectImpl obj = new ObjectImpl(); + + obj._set_delegate(delegate); + + return obj; + }//duplicate + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release(org.omg.CORBA.Object) + */ + public void release(org.omg.CORBA.Object self) { + //Empty treatment + }//release + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release_reply(org.omg.CORBA.Object, org.omg.CORBA.portable.InputStream) + */ + public void release_reply( + org.omg.CORBA.Object object, + org.omg.CORBA.portable.InputStream inputStream ) { + //Empty treatment + }//release_reply + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl) + */ + public void prepareRequest( StreamRequestImpl request ) { + this.communicationLayer.getCommLayer().prepareRequest( request ); + }//prepareRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#onewayRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void onewayRequest(RequestImpl request) { + if ( this.forwardReference != null ) { + this.forwardReference.onewayRequest(request); + } else { + this.communicationLayer.getCommLayer().onewayRequest( request, this.getIIOPReference() ); + } + }//oneWayRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(es.tid.TIDorbj.core.RequestImpl) + */ + public void invoke(RequestImpl request) { + try { + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().request( + request, + (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.invoke(request); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + invoke(request); + + }//forwarded + }//invoke + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) + */ + public InputStream invoke( + org.omg.CORBA.Object object, + OutputStream stream + ) throws ApplicationException, + RemarshalException { + + if (is_local(object)) { + throw new BAD_OPERATION("Request is only valid for remote objects"); + } + + if (stream instanceof es.tid.TIDorbj.core.cdr.CDROutputStream) { + + es.tid.TIDorbj.core.cdr.CDROutputStream out = + (es.tid.TIDorbj.core.cdr.CDROutputStream) stream; + try { + if ( this.forwardReference == null) { + return this.communicationLayer.getCommLayer().request( + (IIOPIOR)this.getReference(), + out, + createRequestPolicyContext() + ); + } else { + return this.forwardReference.invoke(object, stream); + } + + } + catch (es.tid.TIDorbj.core.comm.ForwardRequest fr) { + this.setForward(fr); + throw new org.omg.CORBA.portable.RemarshalException(); + } + } else { + throw new org.omg.CORBA.BAD_OPERATION("Not a TIDorbJ's Stream"); + } + }//invoke stream + + // AMI callback operations + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#asyncRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void asyncRequest(RequestImpl request, Object ami_handler ) { + try { + request.set_ami_handler(ami_handler); + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().asyncRequest( + request, (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.asyncRequest(request, ami_handler); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + asyncRequest(request, ami_handler); + + }//forwarded + }//asyncRequest + + + + + +}//IIOPCommunicationLayer diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.java new file mode 100644 index 0000000..aa5014d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayer.java @@ -0,0 +1,376 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.Properties; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationLayer; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.RequestDispatcher; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +/** + * Entry point for the IIOPCommunicationLayer + * + * @author Juan Pablo Rojas + * + * */ +public class IIOPCommunicationLayer implements CommunicationLayer { + + public static String ID = "IIOPCommunicationLayer"; + + /* + * used for incoming requests notifications + */ + private RequestDispatcher dispatcher; + + /* + * the underlying ORB implementation + */ + private TIDORB orb; + + private CommLayer commLayer; + + private IIOPCommunicationLayerPropertiesInfo propertiesInfo; + + /** + * + */ + public IIOPCommunicationLayer() { + + } + + public void setORB(TIDORB orb) { + if ( orb != null ){ + if ( this.orb != null ){ + this.commLayer.shutdown(); + this.propertiesInfo = null; + this.commLayer = null; + } + this.orb = orb; + this.propertiesInfo = IIOPCommunicationLayerPropertiesInfo.getInstance(); + this.orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + ) + ); + + + this.commLayer = new CommLayer( + this.orb + ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public CommLayer getCommLayer(){ + return this.commLayer; + } + + + public void setServerModeEnabled( boolean value ){ + if ( value ){ + this.commLayer.getExternalLayer().initServerListener(); + } + } + + public boolean isServerModeEnabled(){ + return this.commLayer.getExternalLayer().hasServerListener(); + } + + public synchronized ServiceContextList getBidirectionalService() { + return this.commLayer.getExternalLayer().getBidirectionalService(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String) + */ + public CommunicationDelegate createDelegate(String url) throws CommunicationException { + + CommunicationDelegate delegate; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorb:" ) ){ + ior = Corbaloc.getIOR( url ); + } else if(url.startsWith( "corbaloc::" ) || + url.startsWith( "corbaloc:iiop:" )) { + ior = IIOPCorbaloc.getIOR( url ); + } else { + ior = IIOPIOR.fromString(this.orb, url); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + delegate = createDelegate( ior ); + } else { + delegate = null; + } + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String, java.util.Properties) + */ + public CommunicationDelegate createDelegate(String url, Properties info) throws CommunicationException { + return createDelegate( url ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR) + */ + public CommunicationDelegate createDelegate(IOR ior) throws CommunicationException { + IIOPCommunicationDelegate delegate = new IIOPCommunicationDelegate( this ); + delegate.setReference( ior ); + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR, java.util.Properties) + */ + public CommunicationDelegate createDelegate(IOR ior, Properties info) throws CommunicationException { + return createDelegate( ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(java.lang.String) + */ + public boolean accepts(String url) throws CommunicationException { + return url!= null && + ( url.startsWith( "corbaloc:iiop:" ) || + url.startsWith( "corbaloc:tidorb:" ) || + url.startsWith( "corbaloc::" ) || + ( + url.startsWith( "IOR" ) && + this.accepts( DefaultIOR.fromString( this.orb, url ) ) + ) + ); + }//accepts + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(org.omg.IOP.IOR) + */ + public boolean accepts(IOR ior) throws CommunicationException { + boolean accepted; + accepted = ior instanceof IIOPIOR; + + int profilesCount = ior.memberCount(); + for (int i = 0; !accepted && i < profilesCount; i++) { + accepted = ior.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value; + } + + return accepted; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createIOR(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public IOR createIOR(String repositoryId, + ObjectKey key, + TaggedComponent[] components) + throws CommunicationException { + return this.commLayer.getExternalLayer().createIOR( + repositoryId, + key, + components + ); + }//createIOR + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createURL(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public String createURL(String repositoryId, ObjectKey key) throws CommunicationException { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(es.tid.TIDorbj.core.iop.IOR) + */ + public String getInitialReference( IOR ior ) throws CommunicationException { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(java.lang.String) + */ + public String getInitialReference( String url ) throws CommunicationException { + String initialReference; + try { + initialReference = IIOPCorbaloc.getObjectId( url ); + } catch ( Throwable th ){ + initialReference = null; + } + return initialReference; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(es.tid.TIDorbj.core.iop.IOR) + */ + public boolean isLocal(IOR ior) throws CommunicationException { + return ior != null && this.accepts( ior ) && this.commLayer.isLocal( (IIOPIOR)ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(java.lang.String) + */ + public boolean isLocal(String url) throws CommunicationException { + boolean isLocal; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorbj:" ) ){ + ior = Corbaloc.getIOR( url ); + } else { + ior = IIOPCorbaloc.getIOR( url ); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + isLocal = this.isLocal( ior ); + } else { + isLocal = false; + } + return isLocal; + }//isLocal + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getPropertyInfo(java.lang.String, java.util.Properties) + */ + public PropertyInfo[] getPropertiesInfo() { + return ( PropertyInfo[] )this.propertiesInfo.map.entrySet().toArray( new PropertyInfo[0] ); + }//getPropertiInfo + + public PropertyInfo getPropertyInfo( String name){ + return ( PropertyInfo )this.propertiesInfo.map.get( name ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMajorVersion() + */ + public int getMajorVersion() { + return 1; + }//getMajorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMinorVersion() + */ + public int getMinorVersion() { + return 0; + }//getMinorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getId() + */ + public String getId() { + return IIOPCommunicationLayer.ID; + } + + public String toString(){ + + String hostSpec; + hostSpec = this.propertiesInfo.hostName.value; + if ( hostSpec == null ){ + hostSpec = this.propertiesInfo.hostAddress.value; + } + if ( hostSpec == null ){ + try { + hostSpec = java.net.InetAddress.getLocalHost().getHostName(); + } + catch (Exception e) {} + } + + StringBuffer toString = new StringBuffer( "[ " ) + .append( IIOPCommunicationLayer.ID ) + .append( " ( iiop://" ) + .append( hostSpec ) + .append( ':' ) + .append( this.propertiesInfo.port.value ) + .append( " )" ) + .append( " ]"); + + return toString.toString(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#shutdown(boolean) + */ + public void shutdown( boolean waitForCompletion ) { + if ( this.commLayer != null ){ + if ( waitForCompletion ){ + this.commLayer.shutdown(); + } else { + this.commLayer.destroy(); + } + this.commLayer = null; + } + } + + + /** + * PRIVATE METHODS + * @author jprojas + */ + + public void dump(java.io.PrintWriter writer){ + this.propertiesInfo.dump(writer); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.java new file mode 100644 index 0000000..0d128cb --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCommunicationLayerPropertiesInfo.java @@ -0,0 +1,508 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import es.tid.TIDorbj.core.comm.PropertyInfo; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +//TODO:change to IIOPCommunicationLayerPropertiesInfo +public class IIOPCommunicationLayerPropertiesInfo { + + /** + * Assures that a oneway request could be forwarded. "true" or "false". + */ + public final static String RELIABLE_ONEWAY + = "es.tid.TIDorbj.iiop.reliable_oneway"; + public final static String DEFAULT_RELIABLE_ONEWAY + = "false"; + + + /** + * Fragment size Property name. + */ + public final static String FRAGMENT_SIZE + = "es.tid.TIDorbj.iiop.fragment_size"; + public final static String DEFAULT_FRAGMENT_SIZE + = "4096"; + + + /** + * GIOP version Property name. Values: "1.0", "1.1" and "1.2" + */ + public final static String GIOP_VERSION = + "es.tid.TIDorbj.iiop.GIOPVersion"; + public final static String DEFAULT_GIOP_VERSION + = "1.2"; + + /** + * ORB's maximum opened connections number. Value must be greater or equals + * to 0. Default value: 30. + */ + public final static String MAX_OPENED_CONNECTIONS + = "es.tid.TIDorbj.iiop.max_connections"; + public final static String DEFAULT_MAX_OPENED_CONNECTIONS + = "30"; + + + /** + * DefaultORB's maximum recovering a communication tries. Default value: + * 3. + * TODO: max_comm_recovering_times -> max_comm_recovering_tries, update doc + */ + public final static String MAX_COMM_RECOVERING_TRIES + = "es.tid.TIDorbj.iiop.max_comm_recovering_tries"; + public final static String DEFAULT_MAX_COMM_RECOVERING_TRIES = "3"; + + + /** + * ORB's maximum time upon recovering a communication. Values must be + * greater or equal than 0. + */ + public final static String COMM_RECOVERING_TIME + = "es.tid.TIDorbj.iiop.comm_recover_time"; + public final static String DEFAULT_COMM_RECOVERING_TIME + = "1000"; + + /** + * Maximum uncompleted messages per IIOPConnection. Default value: + * 25. + */ + public final static String MAX_UNCOMPLETED_MESSAGES = + "es.tid.TIDorbj.iiop.max_uncompleted_messages"; + public final static String DEFAULT_MAX_UNCOMPLETED_MESSAGES = "25"; + + /** + * IIOP hostname used for generated IORs and URLs. Default value: null + */ + public final static String HOST_NAME + = "es.tid.TIDorbj.iiop.host"; + public final static String DEFAULT_HOST_NAME + = null; + + /** + * IP address used for generated IORs and URLs. Default value: null + */ + public final static String HOST_ADDRESS + = "es.tid.TIDorbj.iiop.address"; + public final static String DEFAULT_HOST_ADDRESS + = null; + + /** + * IIOP port used for generated IORs and URLs. Default value: 0 + */ + public final static String PORT + = "es.tid.TIDorbj.iiop.port"; + public final static String DEFAULT_PORT + = "0"; + + + /** + * Sockets SO_LIGER property. Values must be greater or equal than -1. + * Default value -1 (no linger) + */ + public final static String SOCKET_LINGER + = "es.tid.TIDorbj.iiop.socket_linger"; + public final static String DEFAULT_SOCKET_LINGER + = "-1"; + + /** + * Sockets SO_TIMEOUT property. Values must be greater or equal than -1. + * Default value 0 (no timeout) + */ + public final static String SOCKET_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_timeout"; + public final static String DEFAULT_SOCKET_TIMEOUT + = "0"; + + + /** + * Sockets TCP_NODELAY property. Values must be "true" or "false". + */ + public final static String TCP_NODELAY + = "es.tid.TIDorbj.iiop.tcp_nodelay"; + public final static String DEFAULT_TCP_NODELAY + = "true"; + + /** + * Sockets TCP_CONNECT_TIMEOUT property. Values must be greater or equal to + * 0. Default value 1000. + */ + public final static String SOCKET_CONNECT_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_connect_timeout"; + public final static String DEFAULT_SOCKET_CONNECT_TIMEOUT + = "1000"; + + /** + * Sockets TCP_WRITE_TIMEOUT property. Values must be greater or equal to 0. + * Default value 2000. + */ + public final static String SOCKET_WRITE_TIMEOUT + = "es.tid.TIDorbj.iiop.socket_write_timeout"; + public final static String DEFAULT_SOCKET_WRITE_TIMEOUT + = "2000"; + + /** + * Server sockets BACKLOG property. Values must be greater or equal to 0. + * Default value. 10. + */ + public final static String SERVER_SOCKET_BACKLOG + = "es.tid.TIDorbj.iiop.server_socket_backlog"; + public final static String DEFAULT_SERVER_SOCKET_BACKLOG + = "10"; + + /** + * Server sockets RECONNECT property. Values must be greater or equal to + * 0. Default value: 0 + */ + public final static String SERVER_SOCKET_RECONNECT + = "es.tid.TIDorbj.iiop.server_socket_reconnect"; + public final static String DEFAULT_SERVER_SOCKET_RECONNECT + = "0"; + + /** + * mcpg - IPV6 property. Values must be "true" or "false". + */ + public final static String IPV6 + = "es.tid.TIDorbj.iiop.ipv6"; + public final static String DEFAULT_IPV6 + = "false"; + + /** + * mcpg - IFACEo property. Only need if there are an comunication of client in TIDorbC. + */ + public final static String IFACE + = "es.tid.TIDorbj.iiop.iface"; + public final static String DEFAULT_IFACE + = "eth0"; + + + public PropertyInfo reliableOneWay; + public PropertyInfo fragmentSize; + public PropertyInfo giopVersion; + public PropertyInfo maxOpenedConnections; + public PropertyInfo maxCommRecoveringTries; + public PropertyInfo commRecoveringTime; + public PropertyInfo maxUncompletedMessages; + public PropertyInfo hostName; + public PropertyInfo hostAddress; + public PropertyInfo port; + public PropertyInfo socketLinger; + public PropertyInfo socketTimeout; + public PropertyInfo socketNoDelay; + public PropertyInfo connectTimeout; + public PropertyInfo writeTimeout; + public PropertyInfo serverSocketBacklog; + public PropertyInfo serverSocketReconnect; + + public PropertyInfo ipv6; + public PropertyInfo iface; + + public HashMap map; + + public IIOPCommunicationLayerPropertiesInfo() { + + map = new HashMap( 20 ); + + /** + * CONNECTION STUFF + */ + reliableOneWay = new PropertyInfo( + RELIABLE_ONEWAY, + DEFAULT_RELIABLE_ONEWAY + ); + reliableOneWay.setDescription( + "Whether oneway request should be reliable or not." + ); + reliableOneWay.setRequired( false ); + reliableOneWay.setChoices ( null ); + map.put( RELIABLE_ONEWAY, reliableOneWay ); + + + /** + * TRANSMISSION STUFF + */ + fragmentSize = new PropertyInfo( + FRAGMENT_SIZE, + DEFAULT_FRAGMENT_SIZE + ); + fragmentSize.setDescription( + "Maximum fragment message size. Must be > 1024 and multiple of 8." + ); + fragmentSize.setRequired( false ); + fragmentSize.setChoices ( null ); + map.put( FRAGMENT_SIZE, fragmentSize ); + + + giopVersion = new PropertyInfo( + GIOP_VERSION, + DEFAULT_GIOP_VERSION + ); + giopVersion.setDescription( + "Default GIOP version used for communications. One of " + + "1.0 1.1 or 1.2" + ); + giopVersion.setRequired( false ); + giopVersion.setChoices ( new String[]{ "1.0", "1.1", "1.2" } ); + map.put( GIOP_VERSION, giopVersion ); + + + maxOpenedConnections = new PropertyInfo( + MAX_OPENED_CONNECTIONS, + DEFAULT_MAX_OPENED_CONNECTIONS + ); + maxOpenedConnections.setDescription( + "ORB's maximum opened connections number" + ); + maxOpenedConnections.setRequired( false ); + maxOpenedConnections.setChoices ( null ); + map.put( MAX_OPENED_CONNECTIONS, maxOpenedConnections ); + + + maxCommRecoveringTries = new PropertyInfo( + MAX_COMM_RECOVERING_TRIES, + DEFAULT_MAX_COMM_RECOVERING_TRIES + ); + maxCommRecoveringTries.setDescription( + "DefaultORB's maximum communication recovering tries." + ); + maxCommRecoveringTries.setRequired( false ); + maxCommRecoveringTries.setChoices ( null ); + map.put( MAX_COMM_RECOVERING_TRIES, maxCommRecoveringTries ); + + + commRecoveringTime = new PropertyInfo( + COMM_RECOVERING_TIME, + DEFAULT_COMM_RECOVERING_TIME + ); + commRecoveringTime.setDescription( + "ORB's maximum time upon recovering a communication." + ); + commRecoveringTime.setRequired( false ); + commRecoveringTime.setChoices ( null ); + map.put( COMM_RECOVERING_TIME, commRecoveringTime ); + + + maxUncompletedMessages = new PropertyInfo( + MAX_UNCOMPLETED_MESSAGES, + DEFAULT_MAX_UNCOMPLETED_MESSAGES + ); + maxUncompletedMessages.setDescription( + "Maximum uncompleted messages allowed upon connections." + ); + maxUncompletedMessages.setRequired( false ); + maxUncompletedMessages.setChoices ( null ); + map.put( MAX_UNCOMPLETED_MESSAGES, maxUncompletedMessages ); + + + hostName = new PropertyInfo( + HOST_NAME, + DEFAULT_HOST_NAME + ); + hostName.setDescription( + "Hostname used when generating IOR's and URL's." + ); + hostName.setRequired( false ); + hostName.setChoices ( null ); + map.put( HOST_NAME, hostName ); + + + hostAddress = new PropertyInfo( + HOST_ADDRESS, + DEFAULT_HOST_ADDRESS + ); + hostAddress.setDescription( + "Address used when generating IOR's and URL's." + ); + hostAddress.setRequired( false ); + hostAddress.setChoices ( null ); + map.put( HOST_ADDRESS, hostAddress ); + + + port = new PropertyInfo( + PORT, + DEFAULT_PORT + ); + port.setDescription( + "Port used when generating IOR's and URL's." + ); + port.setRequired( false ); + port.setChoices ( null ); + map.put( PORT, port ); + + + socketLinger = new PropertyInfo( + SOCKET_LINGER, + DEFAULT_SOCKET_LINGER + ); + socketLinger.setDescription( + "Sockets SO_LIGER property." + ); + socketLinger.setRequired( false ); + socketLinger.setChoices ( null ); + map.put( SOCKET_LINGER, socketLinger ); + + + socketTimeout = new PropertyInfo( + SOCKET_TIMEOUT, + DEFAULT_SOCKET_TIMEOUT + ); + socketTimeout.setDescription( + "Sockets timeout." + ); + socketTimeout.setRequired( false ); + socketTimeout.setChoices ( null ); + map.put( SOCKET_TIMEOUT, socketTimeout ); + + + socketNoDelay = new PropertyInfo( + TCP_NODELAY, + DEFAULT_TCP_NODELAY + ); + socketNoDelay.setDescription( + "Sockets NO_DELAY property." + ); + socketNoDelay.setRequired( false ); + socketNoDelay.setChoices ( null ); + map.put( TCP_NODELAY, socketNoDelay ); + + + connectTimeout = new PropertyInfo( + SOCKET_CONNECT_TIMEOUT, + DEFAULT_SOCKET_CONNECT_TIMEOUT + ); + connectTimeout.setDescription( + "Sockets connect timeout." + ); + connectTimeout.setRequired( false ); + connectTimeout.setChoices ( null ); + map.put( SOCKET_CONNECT_TIMEOUT, connectTimeout ); + + + writeTimeout = new PropertyInfo( + SOCKET_WRITE_TIMEOUT, + DEFAULT_SOCKET_WRITE_TIMEOUT + ); + writeTimeout.setDescription( + "Sockets write timeout." + ); + writeTimeout.setRequired( false ); + writeTimeout.setChoices ( null ); + map.put( SOCKET_WRITE_TIMEOUT, writeTimeout ); + + + serverSocketBacklog = new PropertyInfo( + SERVER_SOCKET_BACKLOG, + DEFAULT_SERVER_SOCKET_BACKLOG + ); + serverSocketBacklog.setDescription( + "Server sockets BACKLOG." + ); + serverSocketBacklog.setRequired( false ); + serverSocketBacklog.setChoices ( null ); + map.put( SERVER_SOCKET_BACKLOG, serverSocketBacklog ); + + + serverSocketReconnect = new PropertyInfo( + SERVER_SOCKET_RECONNECT, + DEFAULT_SERVER_SOCKET_RECONNECT + ); + serverSocketReconnect.setDescription( + "Server sockets RECONNECT." + ); + serverSocketReconnect.setRequired( false ); + serverSocketReconnect.setChoices ( null ); + map.put( SERVER_SOCKET_RECONNECT, serverSocketReconnect ); + + ipv6 = new PropertyInfo( + IPV6, + DEFAULT_IPV6 + ); + ipv6.setDescription( + "IPV6 property." + ); + ipv6.setRequired( false ); + ipv6.setChoices ( null ); + map.put( IPV6, ipv6 ); + + //mcpg + iface = new PropertyInfo( + IFACE, + DEFAULT_IFACE + ); + iface.setDescription( + "IFACE property." + ); + iface.setRequired( false ); + iface.setChoices ( null ); + map.put( IFACE, iface ); + + } + + public static IIOPCommunicationLayerPropertiesInfo getInstance(){ + return new IIOPCommunicationLayerPropertiesInfo(); + } + + public void dump(java.io.PrintWriter writer) + { + writer.println("IIOPCommunicationLayer properties:"); + + Iterator it = map.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry e = (Map.Entry)it.next(); + writer.print('\t'); + writer.print(e.getKey()); + writer.print('='); + writer.print( ((PropertyInfo)e.getValue()).getValue()); + writer.println(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.java new file mode 100644 index 0000000..22aa2d3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnection.java @@ -0,0 +1,507 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.io.IOException; +import java.net.Socket; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; +import java.net.InetAddress; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; + +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayer; +import es.tid.TIDorbj.core.comm.ssliop.SSLIOPCommunicationLayerPropertiesInfo; + +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb IIOP IIOPConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class IIOPConnection extends Connection { + + /** + * IIOPConnection Socket. + */ + java.net.Socket m_socket; + + /** + * IIOPConnection Socket InputStream. + */ + public java.io.InputStream m_socket_in; + + /** + * IIOPConnection Socket OutputStream. + */ + public java.io.OutputStream m_socket_out; + + + private boolean tcpNoDelay; + private int soTimeout; + private int soLinger; + private int socketWriteTimeout; + + + private IIOPConnection(IIOPConnectionManager mngr, java.net.Socket socket) + { + super(mngr); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + tcpNoDelay = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.TCP_NODELAY ) + .getBoolean(); + + soTimeout = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_TIMEOUT ) + .getInt(); + + soLinger = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_LINGER ) + .getInt(); + + socketWriteTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_WRITE_TIMEOUT ) + .getInt(); + + try { + this.m_socket = socket; + + my_port = socket.getLocalPort(); + + socket.setTcpNoDelay( tcpNoDelay ); + socket.setSoTimeout( soTimeout ); + + socket.setSoLinger( soLinger != -1, soLinger ); + + m_socket_in = socket.getInputStream(); + m_socket_out = socket.getOutputStream(); + } + catch (java.io.IOException ioe) { + throw new OBJECT_NOT_EXIST(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + } + + m_write_monitor = new ConnectionWriteMonitor( socketWriteTimeout ); + } + + /** + * IIOPConnection hash code. + */ + public int hashCode() { + // return my_port; + return m_socket.hashCode(); + } + + public boolean equals(Object obj) { + return obj instanceof IIOPConnection && + ( ( IIOPConnection )obj ).my_port == my_port; + } + + public String toString() { + if (m_str == null) { + if (m_mode == CLIENT_MODE) { + m_str = "Client IIOPConnection at " + m_socket.toString(); + } else if (m_mode == SERVER_MODE) { + m_str = "Server IIOPConnection at " + m_socket.toString(); + } else { + m_str = "Bidirectional IIOPConnection at " + m_socket.toString(); + } + } + return m_str; + } + + /** + * Creates a new connection in SERVER_MODE. + * + * @param mngr + * the manager + * @param sock + * Socket created in the accept + * method in a ServerSocket object. + */ + public static IIOPConnection serverConnection(IIOPConnectionManager mngr, + java.net.Socket sock) { + IIOPConnection conn = new IIOPConnection(mngr, sock); + conn.m_mode = SERVER_MODE; + conn.init(); + + if (conn.m_orb.m_trace != null) { + conn.m_orb.printTrace(Trace.DEBUG, "Creating " + conn.toString()); + } + + return conn; + } + + /** + * Creates a new connection in CLIENT_MODE. + */ + + public static IIOPConnection clientConnection(IIOPConnectionManager mngr, + ListenPoint listen_point) + { + try { + + // create the socket + Socket socket = + new Socket(listen_point.m_host, listen_point.m_port); + IIOPConnection conn = new IIOPConnection(mngr, socket); + + conn.m_mode = CLIENT_MODE; + + conn.m_initial_point = listen_point; + + conn.addListenPoint(listen_point); + + conn.init(); + + return conn; + + } + catch (java.io.IOException ioe) { + throw new TRANSIENT(ioe.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + catch (java.lang.SecurityException sce) { + throw new NO_PERMISSION(sce.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + } + + protected void close() + { + try { + m_socket.close(); + } + catch (IOException ioe) {} + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, + toString() + + " client socket closed"); + + // notify the writers blocked in write_monitor + + m_write_monitor.setException(m_state.getError()); + + // notify the locks + + LockEnumeration enumer = m_lock_list.elements(); + Lock lock; + + while (enumer.hasMoreElements()) { + lock = enumer.next(); + synchronized (lock) { + lock.cancelWaiting(); + } + } + + AMILockEnumeration ami_enum = m_ami_lock_list.elements(); + AMILock ami_lock; + + while (ami_enum.hasMoreElements()) { + ami_lock = ami_enum.next(); + synchronized (ami_lock) { + ami_lock.notify(); + } + } + + if (m_addresses != null) { + m_addresses.clear(); + } + + // clear buffers + + Enumeration msgs = m_uncompleted_messages.elements(); + + while (msgs.hasMoreElements()) { + m_uncompleted_messages.remove(msgs.nextElement()); + } + + } + + protected void dispatchRequest(GIOPLocateRequestMessage message) { + + ObjectKey obj_key; + obj_key = message.extractAddress().getObjectKey(); + + IIOPLocateResponseHandler responseHandler; + responseHandler = new IIOPLocateResponseHandler( + this, + message.getHeader().getVersion(), + message.getRequestId(), + obj_key + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + m_requests_in_POA.inc(); + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + } + + protected void dispatchRequest(GIOPRequestMessage message) { + + ServerRequestImpl serverRequest; + serverRequest = message.extractRequest(m_orb); + + + String ssl_key_store_file = new String(""); + String ssl_key_store_passwd = new String(""); + + if (m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + != null) { + ssl_key_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + ssl_key_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + } + + // Check SSL: all TCP request are not dispached + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + serverRequest.setSystemException( + new NO_PERMISSION("SSL target can not dispatch TCP requests ") ); + sendReply(serverRequest, null); + //delete request; + return; + } + + + ObjectKey objectKey; + objectKey = serverRequest.getTarget().getObjectKey(); + + IIOPResponseHandler responseHandler; + responseHandler = new IIOPResponseHandler( + this, + message.getHeader().getVersion(), + serverRequest, + objectKey, + message.getRequestInvocationPolicies() + + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * TODO: ask juan: in previous code, when reference has been located, + * if it's not local just returns... which should be the + * refactoring mapping since the POAKey is resolved outside, + * under ExecThread, and there's "no way?" to acces the object + * reference to check if either it's local or not + * Previous code + if (!obj_impl._is_local()) { + // oneway request to a non local object: DISCARD + return; + } + * */ + + if (serverRequest.withResponse()) { + m_requests_in_POA.inc(); + } + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + } + + + public void read(byte[] buffer, int offset, int length) + { + + try { + int numReadNow = 0; + + while (length > 0) { + + numReadNow = m_socket_in.read(buffer, offset, length); + + if (numReadNow < 0) { + throw new COMM_FAILURE("Broken IIOPConnection", 0, + CompletionStatus.COMPLETED_NO); + } + + offset += numReadNow; + length -= numReadNow; + + } + + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer) + { + try { + + m_socket_out.write(buffer, 0, buffer.length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer, int offset, int length) + { + try { + m_socket_out.write(buffer, offset, length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.java new file mode 100644 index 0000000..feaccc8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPConnectionManager.java @@ -0,0 +1,746 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.net.Socket; +import javax.net.ssl.SSLSocket; + +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TRANSIENT; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.poa.POAImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.comm.ssliop.SSLConnection; + +/** + * Manages the opened connections. When a connection is needed, try to reuse an + * opened one. When there is too many connection opened or there are some + * connection that have remained idle too long, they will be closed. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + + +// TODO: move comm.iiop.IIOPConnectionManager to comm.ConnectionManager + +public class IIOPConnectionManager extends es.tid.TIDorbj.core.ORBComponent +{ + + /** + * The communication Layer. + */ + + IIOPCommLayer commLayer; + + /** + * The ORB has been destroyed. + */ + + protected boolean m_destroyed; + + /** + * Maintains a UseTable with IIOPConnection + * objects. Then, when the table removes older connections, the manager + * close them. + */ + UseTable m_connections; + + /** + * Opened client connections. This table allows reuse opened connections for + * a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_client_connections; + + /** + * Opened bidirectional connections. This table allows reuse opened + * connections for a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_bidirectional_connections; + + /** + * Connections that are opening now. Other threads that want to open a new + * connection to the same listen point must wait to not open more than one + * connection. + */ + java.util.Hashtable m_connections_opening; + + int maxOpenedConnections; + int connectTimeout; + boolean ipv6; + + + /** + * Opened SSL client connections. This table allows reuse opened connections for + * a given listen point. + *

+ * This is a Hashtable, the stored object class is + * IIOPConnection and the keys are ListenPoints. + */ + + java.util.Hashtable m_ssl_client_connections; + + public IIOPConnectionManager( TIDORB orb, IIOPCommLayer commLayer ) + { + super(orb); + this.commLayer = commLayer; + m_client_connections = new java.util.Hashtable(); + m_bidirectional_connections = new java.util.Hashtable(); + m_ssl_client_connections = new java.util.Hashtable(); + + maxOpenedConnections = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.MAX_OPENED_CONNECTIONS ) + .getInt(); + + connectTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_CONNECT_TIMEOUT ) + .getInt(); + + + m_connections = new UseTable( maxOpenedConnections ); + + + m_connections_opening = new java.util.Hashtable(); + m_destroyed = false; + + //mcpg + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + if (this.ipv6 == true) + { + System.setProperty("java.net.preferIPv6Address","true"); + System.setProperty("java.net.preferIPv4Stack","false"); + } + } + + /** + * Notifies the connection use. + * + * @param conn + * the connection in use + */ + /* synchronized */ + + //public synchronized void use(IIOPConnection conn) + public synchronized void use(Connection conn) + { + if (m_destroyed) + return; + + m_connections.use(conn); + } + + /** + * The manager is Notified a connection is been closing. + * + * @param conn + * the connection that is closing. + */ + + //synchronized public void closing(IIOPConnection conn) + synchronized public void closing(Connection conn) + { + if (m_destroyed) + return; + + removeListenPoints(conn); + + m_connections.remove(conn); + } + + /** + * When a new Socket is created (a new connection has been accepted by the + * ServerSocket) a new IIOPConnection, in SERVER mode, must be + * registered. + * + * @param socket + * the new socket. + */ + + synchronized public void createServerConnection(Socket socket) + { + if (m_destroyed) { + // drop the socket + try { + socket.close(); + } + catch (java.io.IOException ioe) {} + } else { + // create the new connection and add the new connection to + // connection table + newConnection(IIOPConnection.serverConnection(this, socket)); + } + } + + + /** + * Saves the ListenPoint associated to a bidirectional + * connection to be used as a client connection when a connection to the + * listen point will be required. + * + * @param listen_point + * the ListenPoint where the connection will be + * seen as a client connection. + * @param conn + * the bidirectional connection. + */ + + synchronized public void + addBidirectionalConnection(ListenPoint listen_point, +// IIOPConnection conn) + Connection conn) + { + if (m_destroyed) + return; + + m_bidirectional_connections.put(listen_point, conn); + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public IIOPConnection getClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + //opened connection + IIOPConnection conn = null; + // check if a connection is opening now + OpeningLock opening_lock = null; + // this thread must open a connection and unlock the OpeningLock + boolean open_a_connection = false; + + synchronized (this) { + if (m_destroyed) + throw new TRANSIENT("IIOP Layer shutdown", 0, + CompletionStatus.COMPLETED_NO); + + // looks for an existing connection + + conn = (IIOPConnection) m_bidirectional_connections.get(listen_point); + + if (conn != null) + return conn; + + conn = (IIOPConnection) m_client_connections.get(listen_point); + + if (conn != null) + return conn; + + // check if is opening now + opening_lock = (OpeningLock) + m_connections_opening.get(listen_point); + + // create a lock + if (opening_lock == null) { + opening_lock = new OpeningLock(); + m_connections_opening.put(listen_point, opening_lock); + open_a_connection = true; + } + } + + if (!open_a_connection) { + try { + conn = (IIOPConnection)opening_lock.waitOpening( this.connectTimeout ); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + if (m_orb.m_trace != null) { + String[] msg = { "Socket connection timeout exceeded", + "waiting to connecting with ", + listen_point.toString(), + ". Released lock over it." }; + m_orb.printTrace(Trace.DEBUG, msg); + } + m_connections_opening.remove(listen_point); + throw new TRANSIENT(ce.toString()); + } + } + + } else { + try { + conn = openClientConnection(listen_point, policy_context); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + opening_lock.setError(ce); + m_connections_opening.remove(listen_point); + throw ce; + } + } + + synchronized (this) { + + newConnection(conn); + + // add the new connection to the client_connections + + m_client_connections.put(listen_point, conn); + + opening_lock.setOpened(conn); + m_connections_opening.remove(listen_point); + } + + if (m_orb.m_trace != null) { + String[] msg = { conn.toString(), " Opened!" }; + m_orb.printTrace(Trace.DEBUG, msg); + } + + } + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ( (!conn.isBidirectionalConnection()) + && (bidir != null) + && (bidir.value() == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode( + commLayer.getBidirectionalService() + ); + } + + return conn; + } + + private IIOPConnection + openClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + IIOPConnection conn = null; + + // create a new connection + if (m_orb.m_trace != null) { + String[] msg = { "Opening client connection with ", + listen_point.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + // create the new connection + conn = IIOPConnection.clientConnection(this, listen_point); + + // is bidirectional ??? + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ((bidir != null && bidir.value() + == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode(commLayer.getBidirectionalService()); + } else { + + es.tid.TIDorbj.core.poa.CurrentImpl poa_current = + m_orb.initPOACurrent(); + + if (poa_current.inContext()) { + try { + POAImpl current_poa = (POAImpl) poa_current.get_POA(); + + if (current_poa.isBidirectional()) + conn.setBidirectionalMode( + commLayer.getBidirectionalService()); + + } + catch (org.omg.PortableServer.CurrentPackage.NoContext nc) {} + // add the new connection to connection table + } + } + + return conn; + } + + + private SSLConnection + openSSLClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + SSLConnection conn = null; + + // create a new connection + if (m_orb.m_trace != null) { + String[] msg = { "Opening client connection with ", + listen_point.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + // create the new connection + conn = SSLConnection.clientConnection(this, listen_point); + + // is bidirectional ??? + + BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + + if ((bidir != null && bidir.value() + == org.omg.BiDirPolicy.BOTH.value) + && (commLayer.hasServerListener())) { + conn.setBidirectionalMode(commLayer.getBidirectionalService()); + } else { + + es.tid.TIDorbj.core.poa.CurrentImpl poa_current = + m_orb.initPOACurrent(); + + if (poa_current.inContext()) { + try { + POAImpl current_poa = (POAImpl) poa_current.get_POA(); + + if (current_poa.isBidirectional()) + conn.setBidirectionalMode( + commLayer.getBidirectionalService()); + + } + catch (org.omg.PortableServer.CurrentPackage.NoContext nc) {} + // add the new connection to connection table + } + } + + return conn; + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public void prepareClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + getClientConnection(listen_point, policy_context); + } + + /** + * Checks in a new connection for manage it. + * + * @param conn + * the bidirectional connection. + */ + protected void newConnection(IIOPConnection conn) + { + try { + + m_connections.append(conn); + + } catch (es.tid.TIDorbj.core.util.FullUseTableException f) { + conn.closeByManager(); + if (conn.isClientConnection()) { + throw new TRANSIENT( + "Maximun of Connections reached, and all are in use, try later!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + Object[] removed = m_connections.getRemovedObjects(); + + if (removed != null) { + for (int i = 0; i < removed.length; i++) { + closeConnection((IIOPConnection) removed[i]); + } + } + } + + + + /** + * Checks in a new connection for manage it. + * + * @param conn + * the bidirectional connection. + */ + protected void newConnection(SSLConnection conn) + { + try { + + m_connections.append(conn); + + } catch (es.tid.TIDorbj.core.util.FullUseTableException f) { + conn.closeByManager(); + if (conn.isClientConnection()) { + throw new TRANSIENT( + "Maximun of Connections reached, and all are in use, try later!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + Object[] removed = m_connections.getRemovedObjects(); + + if (removed != null) { + for (int i = 0; i < removed.length; i++) { + closeConnection((IIOPConnection) removed[i]); + } + } + } + + /** + * Removes from the client connection table the listen points associated to + * a connection. + * + * @param conn + * the connection. + */ + //protected void removeListenPoints(IIOPConnection conn) + protected void removeListenPoints(Connection conn) + { + java.util.Enumeration points = conn.getListenPoints(); + if (points == null) + return; + + // remove listenPoints + while (points.hasMoreElements()) { + + ListenPoint _listen_point = (ListenPoint) points.nextElement(); + + // remove from client_connections + m_client_connections.remove(_listen_point); + + // remove from bidirectional_connections if ListenPoint refers to + // the given connection + //if ((IIOPConnection) m_bidirectional_connections.get(_listen_point) + if ((Connection) m_bidirectional_connections.get(_listen_point) + == conn) + m_bidirectional_connections.remove(_listen_point); + } + } + + /** + * Close the connection due to it has been decided that it not has been used + * for a long time. + * + * @param conn + * the connection. + */ + //protected void closeConnection(IIOPConnection conn) + protected void closeConnection(Connection conn) + { + removeListenPoints(conn); + conn.closeByManager(); + } + + /** + * @return true if it has not any active connection + */ + public boolean activeConnections() + { + return m_connections.getSize() > 0; + } + + /** + * Close all connections due to an ORB close session. + */ + synchronized public void destroy() + { + if (!m_destroyed) { + java.util.Enumeration conns = m_connections.elements(); + + //IIOPConnection conn; + Connection conn; + + while (conns.hasMoreElements()) { + conn = (IIOPConnection) conns.nextElement(); + m_connections.remove(conn); + closeConnection(conn); + } + + m_destroyed = true; + } + } + + + + + /** + * When a new SSLSocket is created (a new connection has been accepted by the + * ServerSocket) a new IIOPConnection, in SERVER mode, must be + * registered. + * + * @param socket + * the new socket. + */ + + synchronized public void createSSLServerConnection(SSLSocket socket) + { + if (m_destroyed) { + // drop the socket + try { + socket.close(); + } + catch (java.io.IOException ioe) {} + } else { + // create the new connection and add the new connection to + // connection table + newConnection(SSLConnection.serverConnection(this, socket)); + } + } + + /** + * Looks for a client connection with the listen point. If it does not + * exist, then the creates one. + * + * @param listen_point + * the ListenPoint that determines a remote ORB in + * a Object reference. + */ + public SSLConnection getSSLClientConnection(ListenPoint listen_point, + PolicyContext policy_context) + { + //opened connection + SSLConnection conn = null; + // check if a connection is opening now + OpeningLock opening_lock = null; + // this thread must open a connection and unlock the OpeningLock + boolean open_a_connection = false; + + synchronized (this) { + if (m_destroyed) + throw new TRANSIENT("IIOP Layer shutdown", 0, + CompletionStatus.COMPLETED_NO); + + // looks for an existing connection + +// conn = (IIOPConnection) m_bidirectional_connections.get(listen_point); + +// if (conn != null) +// return conn; + + conn = (SSLConnection) m_ssl_client_connections.get(listen_point); + + if (conn != null) + return conn; + + // check if is opening now + opening_lock = (OpeningLock) + m_connections_opening.get(listen_point); + + // create a lock + if (opening_lock == null) { + opening_lock = new OpeningLock(); + m_connections_opening.put(listen_point, opening_lock); + open_a_connection = true; + } + } + + if (!open_a_connection) { + try { + conn = (SSLConnection)opening_lock.waitOpening( this.connectTimeout ); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + if (m_orb.m_trace != null) { + String[] msg = { "Socket connection timeout exceeded", + "waiting to connecting with ", + listen_point.toString(), + ". Released lock over it." }; + m_orb.printTrace(Trace.DEBUG, msg); + } + m_connections_opening.remove(listen_point); + throw new TRANSIENT(ce.toString()); + } + } + + } else { + try { + conn = openSSLClientConnection(listen_point, policy_context); + } catch (org.omg.CORBA.COMM_FAILURE ce) { + synchronized (this) { + opening_lock.setError(ce); + m_connections_opening.remove(listen_point); + throw ce; + } + } + + synchronized (this) { + + newConnection(conn); + + // add the new connection to the client_connections + + m_ssl_client_connections.put(listen_point, conn); + + opening_lock.setOpened(conn); + m_connections_opening.remove(listen_point); + } + + if (m_orb.m_trace != null) { + String[] msg = { conn.toString(), " Opened!" }; + m_orb.printTrace(Trace.DEBUG, msg); + } + + } + +// BidirectionalPolicy bidir = policy_context.getBidirectionalPolicy(); + +// if ( (!conn.isBidirectionalConnection()) +// && (bidir != null) +// && (bidir.value() == org.omg.BiDirPolicy.BOTH.value) +// && (commLayer.hasServerListener())) { +// conn.setBidirectionalMode( +// commLayer.getBidirectionalService() +// ); +// } + + return conn; + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.java new file mode 100644 index 0000000..b419afc --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPCorbaloc.java @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.util.StringTokenizer; + +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.Corbaloc; + +public class IIOPCorbaloc +{ + + public static String getObjectId(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, path, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:iiop:")) { + corbaloc = corbaloc_URL.substring(14); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + return corbaloc.substring(slashposition + 1); + } + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, url_key, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:iiop:")) { + corbaloc = corbaloc_URL.substring(14); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + url_key = corbaloc.substring(slashposition + 1); + + ObjectKey objectkey = createKey(url_key); + + profiles = new IIOPProfile[1]; + + profiles[0] = new IIOPProfile(version, listener, objectkey, null); + + return new IIOPIOR("", profiles); + } + + /** + * Simulates an usual ObjectKey, that is marshaled in an Encapsulation, but + * instead, the url ObjectKey is marshaled as a ulong value (the size) and + * the char array of the string (without the end of string character *. + * + * @param url + * @return + * @throws org.omg.CORBA.ORBPackage.InvalidName + */ + private static ObjectKey createKey(String url_key) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + CDROutputStream output = + new CDROutputStream(null, + new byte[url_key.length() + CDR.ULONG_SIZE]); + + char[] url_buffer = url_key.toCharArray(); + + output.write_ulong(url_buffer.length); + output.write_char_array(url_buffer, 0, url_buffer.length); + + CDRInputStream input = (CDRInputStream) output.create_input_stream(); + + Encapsulation encap = input.readEncapsulation(); + + return new ObjectKey(encap); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.java new file mode 100644 index 0000000..454a124 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPIOR.java @@ -0,0 +1,245 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.iiop.IORAddressingInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.util.Corbaloc; +import es.tid.TIDorbj.util.Base16Codec; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.ziop.ZIOP; + +/** + * Representation of an Internet Object Reference (IOR). An IOR is compounded + * by; + *

    + *
  • at least one TaggedProfile + *
  • the repositoryId of the reference + *
+ * In addition, the ior has its stringified representation and its marshaled + * value. + * + * @autor Juan A. Cáceres + * @version 2.0 + */ + +public class IIOPIOR extends IOR +{ + + String toString; + + // IIOP optimizations + + boolean iiopProfileSearched; + + IIOPProfile iiopProfile; + + int iiopProfilePosition; + + int hash_code = -1; + + boolean ziopSearched; + + boolean hasZIOPPolicies; + + public IIOPIOR() { + this.toString = null; + this.iiopProfile = null; + this.iiopProfileSearched = false; + this.iiopProfilePosition = 0; + this.ziopSearched = false; + this.hasZIOPPolicies = false; + } + + public IIOPIOR(String id, TaggedProfile[] profiles) { + super( id, profiles ); + this.toString = null; + this.ziopSearched = false; + this.hasZIOPPolicies = false; + } + + public IIOPIOR( IOR ior ){ + assign( ior ); + } + + public void assign(IIOPIOR ior) { + super.profiles = ior.profiles; + super.type_id = ior.type_id; + this.toString = ior.toString; + } + + + public static IIOPIOR fromString(TIDORB orb, String ior_str) { + int length = ior_str.length(); + if (((length % 2) != 0) || (length < 14)) + throw new INV_OBJREF("IOR format error: invalid ior length.", 0, + CompletionStatus.COMPLETED_NO); + if (!ior_str.startsWith("IOR:")) + throw new INV_OBJREF("Invalid IOR format id: \"IOR:\".", 0, + CompletionStatus.COMPLETED_NO); + + byte[] buffer = new byte[(length - 4) / 2]; + char[] ior_chars = ior_str.toCharArray(); + int j = 4; + try { + for (int i = 0; i < buffer.length; i++) + buffer[i] = + (byte) (16 * (Base16Codec.getValue(ior_chars[j++])) + + Base16Codec.getValue(ior_chars[j++])); + } + catch (Exception e) { + throw new INV_OBJREF(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + // create the the ior with the new buffer + IIOPIOR ior = new IIOPIOR(); + + CDRInputStream internet_cdr = new CDRInputStream(orb, buffer); + + internet_cdr.setByteOrder(internet_cdr.read_boolean()); + + ior.read(internet_cdr); + + ior.toString = ior_str; + + return ior; + } + + + public synchronized IIOPProfile profileIIOP() { + if (iiopProfile != null) + return iiopProfile; + + if (iiopProfileSearched) + throw new org.omg.CORBA.INV_OBJREF(); + + iiopProfileSearched = true; + + int count = super.memberCount(); + + for (int i = 0; i < count; i++) { + if ( super.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value) { + iiopProfilePosition = i; + iiopProfile = ( IIOPProfile ) getProfile( i ); + return iiopProfile; + } + } + + throw new org.omg.CORBA.INV_OBJREF(); + } + + public ObjectKey getObjectKey() { + IIOPProfile profile = this.profileIIOP(); + + return profile.getObjectKey(); + } + + public TargetAddress toObjectKeyAddress() { + TargetAddress address = new TargetAddress(); + + address.setObjectKey(getObjectKey()); + + return address; + } + + public TargetAddress toProfileAddress() { + + IIOPProfile profile = profileIIOP(); + + TargetAddress address = new TargetAddress(); + + address.profile(profile); + + return address; + } + + public TargetAddress toIORAddress() { + IIOPProfile profile = profileIIOP(); + + TargetAddress address = new TargetAddress(); + + address.ior(new IORAddressingInfo(iiopProfilePosition, this)); + + return address; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.iop.IOR#toURL() + */ + public String toURL() { + return Corbaloc.toURL( this ); + } + + public boolean is_ZIOP() { + if (!ziopSearched) { + hasZIOPPolicies = ZIOP.checkCompressionEnabled(profileIIOP().getPolicies()); + ziopSearched = true; + } + return hasZIOPPolicies; + } + + public PolicyContext policies() { + IIOPProfile profile = profileIIOP(); + return profile.getPolicies(); + } + + public org.omg.SSLIOP.SSL get_SSL() { + if (!this.iiopProfileSearched) + return this.profileIIOP().getSSLComponent().getSSL(); + else + throw new org.omg.CORBA.INV_OBJREF("No SSL Component found in IOR", 0, + CompletionStatus.COMPLETED_NO); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.java new file mode 100644 index 0000000..8a9ae41 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPLocateResponseHandler.java @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.LocateResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + */ +public class IIOPLocateResponseHandler extends QueuedLocateResponseHandler implements LocateResponseHandler { + + private IIOPConnection conn; + private GIOPVersion version; + private RequestId requestId; + private ObjectKey objectKey; + + + public IIOPLocateResponseHandler( IIOPConnection conn, + GIOPVersion version, + RequestId requestId, + ObjectKey objectKey) + { + setConnection( conn ); + setVersion ( version ); + setRequestId ( requestId ); + setObjectKey ( objectKey ); + } + + public void setConnection( IIOPConnection conn ){ + this.conn = conn; + } + + public IIOPConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setRequestId( RequestId requestId ){ + this.requestId = requestId; + } + + public RequestId getRequestId(){ + return this.requestId; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + throw new INTERNAL("Not supported"); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, reference ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, e ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#setResponseValue(boolean) + */ + public void submitResponse( boolean value ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, value ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.java new file mode 100644 index 0000000..639a80b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPProfile.java @@ -0,0 +1,402 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.IOP.TAG_INTERNET_IOP; +import org.omg.IOP.TAG_ORB_TYPE; +import org.omg.IOP.TAG_POLICIES; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.iop.ORBComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.security.CSIComponent; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedComponentReader; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * IIOPProfile defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class IIOPProfile extends TaggedProfile { + + private GIOPVersion m_version; + + private ListenPoint m_listen_point; + + private ObjectKey m_object_key; + + private TaggedComponent[] m_components; + + private CDRInputStream m_profile_data; + + public IIOPProfile() + { + super(TAG_INTERNET_IOP.value); + + m_version = null; + m_listen_point = null; + m_object_key = null; + m_components = null; + m_profile_data = null; + } + + public IIOPProfile(GIOPVersion version, ListenPoint listen_point) + { + super(TAG_INTERNET_IOP.value); + this.m_version = version; + this.m_listen_point = listen_point; + m_object_key = null; + m_components = null; + m_profile_data = null; + } + + public IIOPProfile(GIOPVersion version, + ListenPoint listen_point, + ObjectKey object_key, + TaggedComponent[] tagged_components) + { + super(TAG_INTERNET_IOP.value); + this.m_version = version; + this.m_listen_point = listen_point; + this.m_object_key = object_key; + m_components = tagged_components; + m_profile_data = null; + } + + public GIOPVersion getVersion() + { + if (m_version == null) + extractMembers(); + return m_version; + + } + + public ListenPoint getListenPoint() + { + if (m_listen_point == null) + extractMembers(); + + // Remove %interface from host string + int pos = m_listen_point.m_host.indexOf("%"); + if (pos != -1) { + String only_host_string; + only_host_string = m_listen_point.m_host.substring(0,pos); + m_listen_point.m_host = only_host_string; + } + + return m_listen_point; + } + + public ObjectKey getObjectKey() + { + if (m_object_key == null) + extractMembers(); + return m_object_key; + } + + public TaggedComponent[] getTaggedComponents() + { + if (m_components == null) + extractMembers(); + return m_components; + } + + public boolean equal( Object profile) + { + if (m_profile_data != null) + extractMembers(); + + IIOPProfile iiopProfile; + if ( profile instanceof IIOPProfile ){ + iiopProfile = ( IIOPProfile )profile; + } else { + iiopProfile = null; + } + + return iiopProfile != null && + getVersion() .equal ( iiopProfile.getVersion() ) && + getListenPoint().equals( iiopProfile.getListenPoint() ) && + getObjectKey() .equal ( iiopProfile.getObjectKey() ); + } + + public void partialRead( es.tid.TIDorbj.core.cdr.CDRInputStream input ) { + m_profile_data = input.copy(); + input.skipEncapsulation(); + } + + synchronized protected void extractMembers() { + if (m_version != null) // has the members + return; + + if (m_profile_data == null) + throw new org.omg.CORBA.INTERNAL("Empty Profile"); + + m_profile_data.enterEncapsulation(); + + m_version = GIOPVersion.read(m_profile_data); + + m_listen_point = ListenPoint.read(m_profile_data); + + m_object_key = new ObjectKey(); + m_object_key.read( m_profile_data ); + if (m_version.minor != 0) { + int size = m_profile_data.read_ulong(); + if (size < 0) { + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + } else { + m_components = new TaggedComponent[size]; + for (int i = 0; i < size; i++) { + + TaggedComponent comp = + TaggedComponentReader.read(m_profile_data); + + m_components[i] = comp; + + // Check tag + + if (comp.m_tag == TAG_POLICIES.value) { + PoliciesComponent policies_component = (PoliciesComponent) comp; + //m_policies = policies_component.getPolicies(); + } + if (comp.m_tag == TAG_SSL_SEC_TRANS.value) { + SSLComponent ssl_component = (SSLComponent) comp; + m_listen_point.m_ssl_port = ssl_component.getSSLPort(); + // m_ssl = ssl_component.getSSL(); + } + if (comp.m_tag == TAG_CSI_SEC_MECH_LIST.value) { + CSIComponent csi_component = (CSIComponent) comp; + + } + + } + } + } + + m_profile_data = null; + } + + public void write(CDROutputStream out) + { + extractMembers(); + + // write tag + out.write_ulong(tag); + + // write profile data + + out.enterEncapsulation(); + + m_version.write(out); + ListenPoint.write(out, m_listen_point); + m_object_key.write(out); + + if (m_version.minor != 0) { + if (m_components == null) + out.write_ulong(0); + else { + out.write_ulong(m_components.length); + for (int i = 0; i < m_components.length; i++) + m_components[i].write(out); + } + } + + out.exitEncapsulation(); + } + + public String toString() + { + if (m_profile_data != null) + extractMembers(); + + boolean from_tidorb = false; + + if (m_components != null) + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_ORB_TYPE.value) { + if (((ORBComponent) m_components[i]).m_orb_type + == ConfORB.ORB_TYPE.m_orb_type) { + from_tidorb = true; + break; + } + } + + StringBuffer buffer = new StringBuffer(); + + buffer.append("Profile: { "); + buffer.append('\n'); + buffer.append('\t'); + buffer.append(getVersion().toString()); + buffer.append(", "); + buffer.append('\n'); + buffer.append('\t'); + buffer.append(getListenPoint().toString()); + buffer.append(", "); + + ORBComponent orb_component = getORBComponent(); + if (orb_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_ORB_TYPE: "); + buffer.append(orb_component.toString()); + } + + PoliciesComponent policies_component = getPoliciesComponent(); + if (policies_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_POLICIES: "); + buffer.append(policies_component.toString()); + } + + + SSLComponent ssl_component = getSSLComponent(); + if (ssl_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_SSL_SEC_TRANS: "); + buffer.append(ssl_component.toString()); + } + + CSIComponent csi_component = getCSIComponent(); + if (csi_component != null) { + buffer.append('\n'); + buffer.append('\t'); + buffer.append("TAG_CSI_SEC_MECH_LIST: "); + buffer.append(csi_component.toString()); + } + + buffer.append('\n'); + buffer.append('\t'); + + if ( from_tidorb ) { + POAKey key; + try { + key = POAKey.createKey( getObjectKey().getMarshaledKey() ); + buffer.append( key.toString() ); + } catch ( Throwable th ) { + buffer.append( "ObjectKey[OPAQUE]" ); + } + + } else { + buffer.append("ObjectKey[OPAQUE]"); + } + buffer.append('\n'); + buffer.append('}'); + + return buffer.toString(); + } + + /** + * @return + */ + public PoliciesComponent getPoliciesComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_POLICIES.value) { + return (PoliciesComponent) m_components[i]; + } + } + + return null; + } + + + public ORBComponent getORBComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_ORB_TYPE.value) { + return (ORBComponent) m_components[i]; + } + } + + return null; + } + + public SSLComponent getSSLComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_SSL_SEC_TRANS.value) { + return (SSLComponent) m_components[i]; + } + } + return null; + } + + + public CSIComponent getCSIComponent() + { + if (m_components != null) { + for (int i = 0; i < m_components.length; i++) + if (m_components[i].m_tag == TAG_CSI_SEC_MECH_LIST.value) { + return (CSIComponent) m_components[i]; + } + } + return null; + } + + + public PolicyContext getPolicies() + { + PoliciesComponent policies_component = this.getPoliciesComponent(); + if (policies_component != null) + return policies_component.getPolicies(); + else + return null; + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.java b/source/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.java new file mode 100644 index 0000000..756c957 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IIOPResponseHandler.java @@ -0,0 +1,193 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + + +/** + * ResponseHandler implementation for the IIOPCommunicationLayer + * + * @author jprojas + * + */ +public class IIOPResponseHandler extends QueuedResponseHandler implements ResponseHandler { + + private IIOPConnection conn; + private GIOPVersion version; + private ServerRequestImpl serverRequest; + private ObjectKey objectKey; + private PolicyContext policySupplier; + + public IIOPResponseHandler( IIOPConnection conn, + GIOPVersion version, + ServerRequestImpl + serverRequest, + ObjectKey objectKey, + PolicyContext policySupplier){ + setConnection( conn ); + setVersion( version ); + setServerRequest( serverRequest ); + setObjectKey( objectKey ); + setPolicyContext( policySupplier ); + } + + public void setConnection( IIOPConnection conn ){ + this.conn = conn; + } + + public IIOPConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setServerRequest( ServerRequestImpl serverRequest ){ + this.serverRequest = serverRequest; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + /** + * @param policySupplier The policySupplier to set. + */ + public void setPolicyContext(PolicyContext policySupplier) + { + this.policySupplier = policySupplier; + } + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + return this.policySupplier; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.serverRequest.setForward( reference ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + if( this.serverRequest.withResponse() ) { + this.serverRequest.setSystemException( e ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.conn.sendReply( this.serverRequest, this.policySupplier ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /** + * remove from here + * @author jprojas + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.java b/source/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.java new file mode 100644 index 0000000..1b01475 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/IORAddressingInfo.java @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +/** + * IORAddressingInfo structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class IORAddressingInfo { + + public int m_selected_profile_index; + + public IOR m_ior; + + public IIOPProfile getProfileIIOP() + { + if (m_selected_profile_index == -1) + return null; + else + return (IIOPProfile) m_ior.getProfile(m_selected_profile_index); + } + + public IORAddressingInfo(int selected_profile_index, IOR ior) + { + this.m_selected_profile_index = selected_profile_index; + this.m_ior = ior; + } + + public static IORAddressingInfo + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int index; + + index = input.read_ulong(); + + IOR ior = new DefaultIOR(); + + ior.read(input); + + if (index >= ior.memberCount()) + throw new MARSHAL("Invalid selected Profile Number: " + index, + 0, + CompletionStatus.COMPLETED_NO); + + return new IORAddressingInfo(index, ior); + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_selected_profile_index); + m_ior.write(output); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ListenPoint.java b/source/es/tid/TIDorbj/core/comm/iiop/ListenPoint.java new file mode 100644 index 0000000..95f6b63 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ListenPoint.java @@ -0,0 +1,110 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +/** + * ListenPoint structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ListenPoint +{ + private String m_str; + + public String m_host; + + public int m_port; + + public int m_ssl_port; + + public ListenPoint(String host, int port) + { + m_str = null; + m_host = host; + m_port = port; + m_ssl_port = 0; + } + + public boolean equals(Object obj) + { + if (obj instanceof ListenPoint) { + ListenPoint other = (ListenPoint) obj; + return (m_port == other.m_port) && (m_host.equals(other.m_host)); + } + + return false; + } + + public int hashCode() + { + return m_host.hashCode() + m_port; + } + + public static ListenPoint read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + return new ListenPoint(input.read_string(), + 0xffff & input.read_ushort()); + } + + public static void write(es.tid.TIDorbj.core.cdr.CDROutputStream output, + ListenPoint point) + { + output.write_string(point.m_host); + output.write_ushort((short) point.m_port); + } + + public String toString() + { + if (m_str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("ListenPoint("); + buffer.append(String.valueOf(m_port)); + buffer.append('@'); + buffer.append(m_host); + buffer.append(')'); + m_str = buffer.toString(); + } + return m_str; + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/Lock.java b/source/es/tid/TIDorbj/core/comm/iiop/Lock.java new file mode 100644 index 0000000..cdf463a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/Lock.java @@ -0,0 +1,133 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.INTERNAL; + +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.util.OperationCompletion; + +/** + * Lock where the the threads that have invoked a request must be locket until + * the complete response has been replied or the response timeout has expired. + * + * + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class Lock +{ + + /** + * The Operation Completion Status. + */ + OperationCompletion m_state; + + /** + * Request identifier. This identifier will be the key for the connection + * thread to + */ + + RequestId m_request_id; + + GIOPFragmentedMessage message; + + public Lock() + { + m_request_id = null; + message = null; + m_state = new OperationCompletion(); + } + + public RequestId requestId() + { + return m_request_id; + } + + public void requestId(RequestId id) + { + m_request_id = id; + } + + public boolean getCompleted() + { + return m_state.isCompleted(); + } + + public void setCompleted() + { + m_state.setCompleted(); + } + + public void setMessage(GIOPFragmentedMessage msg) + { + message = msg; + } + + public GIOPFragmentedMessage getMessage() + { + return message; + } + + public void waitForCompletion(long how_long) + { + try { + m_state.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + public void cancelWaiting() + { + m_state.interruptWaiting(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.java b/source/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.java new file mode 100644 index 0000000..a2449a2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/LockEnumeration.java @@ -0,0 +1,63 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +public class LockEnumeration +{ + java.util.Enumeration m_elements; + + public LockEnumeration(java.util.Enumeration elements) + { + m_elements = elements; + } + + public boolean hasMoreElements() + { + return m_elements.hasMoreElements(); + } + + public Lock next() + { + return (Lock) m_elements.nextElement(); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/LockList.java b/source/es/tid/TIDorbj/core/comm/iiop/LockList.java new file mode 100644 index 0000000..208d0f3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/LockList.java @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.giop.RequestId; + +public class LockList +{ + + java.util.Hashtable m_table; + + public LockList() + { + m_table = new java.util.Hashtable(); + } + + public void put(Lock lock) + { + m_table.put(lock.requestId(), lock); + } + + public Lock get(RequestId request_id) + { + return (Lock) m_table.get(request_id); + } + + public void remove(RequestId request_id) + { + m_table.remove(request_id); + } + + public int size() + { + return m_table.size(); + } + + public LockEnumeration elements() + { + return new LockEnumeration(m_table.elements()); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/OpeningLock.java b/source/es/tid/TIDorbj/core/comm/iiop/OpeningLock.java new file mode 100644 index 0000000..a612721 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/OpeningLock.java @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.comm.Connection; + +/** + * + * Maintains the connection opening lock. + * + * @author Juan A. Caceres + * @version 1.0 + */ + +class OpeningLock +{ + + public final static int OPENING = 0; + + public final static int OPENED = 1; + + public final static int ERROR = 2; + + private int m_status; + + //private IIOPConnection m_opened_connection; + private Connection m_opened_connection; + + private org.omg.CORBA.COMM_FAILURE m_error; + + public OpeningLock() + { + m_status = OPENING; + m_opened_connection = null; + m_error = null; + } + + //public synchronized IIOPConnection waitOpening(long time) + public synchronized Connection waitOpening(long time) + { + if (m_status == OPENING) { + try { + wait(time); + } + catch (InterruptedException ioe) {} + } + + if (m_status == OPENED) + return m_opened_connection; + + else if (m_status == ERROR) + throw m_error; + else + //throw new org.omg.CORBA.COMM_FAILURE("IIOPConnection timout"); + throw new org.omg.CORBA.COMM_FAILURE("Connection timout"); + } + + //public synchronized void setOpened(IIOPConnection conn) + public synchronized void setOpened(Connection conn) + { + m_status = OPENED; + m_opened_connection = conn; + notifyAll(); + } + + public synchronized void setError(org.omg.CORBA.COMM_FAILURE failure) + { + m_status = ERROR; + m_error = failure; + notifyAll(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.java b/source/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.java new file mode 100644 index 0000000..4a23e4f --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/RECOVERABLE_COMM_FAILURE.java @@ -0,0 +1,63 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.COMM_FAILURE; + +/** + * Failure thrown in connection that can be recovered for resending requests. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class RECOVERABLE_COMM_FAILURE extends Exception +{ + + public org.omg.CORBA.COMM_FAILURE m_comm_failure; + + public RECOVERABLE_COMM_FAILURE(COMM_FAILURE failure) + { + m_comm_failure = failure; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.java b/source/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.java new file mode 100644 index 0000000..7480357 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ReliableOnewayThread.java @@ -0,0 +1,67 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import es.tid.TIDorbj.core.RequestImpl; + + +public class ReliableOnewayThread extends java.lang.Thread +{ + IIOPCommLayer m_comm; + + RequestImpl m_request; + + IIOPIOR m_ior; + + public ReliableOnewayThread(IIOPCommLayer comm, RequestImpl req, IIOPIOR ior) + { + this.m_comm = comm; + m_request = req; + this.m_ior = ior; + } + + public void run() + { + m_comm.reliableOnewayRun(m_request, m_ior); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/ServerListener.java b/source/es/tid/TIDorbj/core/comm/iiop/ServerListener.java new file mode 100644 index 0000000..0e5cab8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/ServerListener.java @@ -0,0 +1,376 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 445 $ +* Date: $Date: 2010-01-21 18:29:00 +0100 (Thu, 21 Jan 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.Trace; + +public class ServerListener extends Thread +{ + + /** + * ServerSocket state + */ + + boolean m_shutdowned; + + boolean m_connected; + + /** + * ServerSocket where the communication layer will accept connections. This + * socket will be only avalilable when a the ORB's run method + * had been invoked. + */ + ServerSocket m_server_socket; + + /** + * Conection manager. + */ + IIOPConnectionManager m_manager; + + /** + * Listen points where the ServerSocket will be listening. This + * Vector { point(host,port) } will be used to create de local IOR's. + */ + java.util.Vector m_listen_points; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + ServiceContextList m_bidirectional_service; + + es.tid.TIDorbj.core.TIDORB m_orb; + + String hostAddress; + String hostName; + int port; + int backlog; + int reconnect; + GIOPVersion giopVersion; + boolean ipv6; + String iface; + String m_listen_points_string; + + public ServerListener(IIOPConnectionManager manager) + { + m_shutdowned = true; + m_connected = false; + + this.m_manager = manager; + m_orb = manager.orb(); + + m_listen_points = new java.util.Vector(); + InetAddress inet; + + + this.hostAddress = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS ) + .getValue(); + this.hostName = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_NAME ) + .getValue(); + this.port = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.PORT ) + .getInt(); + this.backlog = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_BACKLOG ) + .getInt(); + this.reconnect = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_RECONNECT ) + .getInt(); + this.giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + this.ipv6 = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IPV6 ) + .getBoolean(); + this.iface = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.IFACE ) + .getString(); + + + try { + if ( hostAddress == null) { + m_server_socket = new ServerSocket( this.port , this.backlog ); + } else { + m_server_socket = new ServerSocket( + this.port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + + if (this.hostName != null) { + m_listen_points.addElement(new ListenPoint(this.hostName, + m_server_socket.getLocalPort())); + } else { + + if (this.ipv6) { + if ( hostAddress == null) { + inet = InetAddress.getByName("::1"); //ip6-localhost"); + } + else { + inet = InetAddress.getByName(hostAddress); + } + m_listen_points.addElement(new ListenPoint( + inet.getHostAddress(), + m_server_socket.getLocalPort())); + } + + inet = InetAddress.getLocalHost(); + m_listen_points.addElement(new ListenPoint( + inet.getHostAddress()+ "%" + iface, + m_server_socket.getLocalPort())); + } + + m_shutdowned = false; + m_connected = true; + + } + catch (java.io.IOException e) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open ServerSocket: " + e.toString() + ); + } + + m_listen_points_string = ""; + for (int i = 0; i < m_listen_points.size(); i++) { + m_listen_points_string += m_listen_points.elementAt(i).toString(); + m_listen_points_string += " "; + } + + + m_orb.printTrace( + Trace.DEBUG, "ServerListener connected at: " + m_listen_points_string + ); + } + + public java.util.Vector getListenPoints() { + return m_listen_points; + } + + public synchronized void shutdown() { + if (!m_shutdowned) { + m_shutdowned = true; + try { + m_server_socket.close(); + } catch (Throwable th) {} + + m_server_socket = null; + + m_orb.printTrace( + Trace.DEBUG, "ServerListener at " + m_listen_points_string + " shutdown!" + ); + } + } + + public synchronized void resetServerSocket() { + if (!m_shutdowned) { + try { + if (m_server_socket != null) + m_server_socket.close(); + } + catch (Throwable th) {} + + try { + if ( this.hostAddress == null) { + m_server_socket = new ServerSocket( + ((ListenPoint)m_listen_points.elementAt(0)).m_port, + this.backlog + ); + } else { + m_server_socket = new ServerSocket( + ((ListenPoint)m_listen_points.elementAt(0)).m_port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + } catch (Throwable th) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open ServerSocket: " + th.toString() + ); + } + } + } + + public void run() + { + while (!m_shutdowned) { + while (m_connected) { + + Socket client_socket = null; + try { + client_socket = m_server_socket.accept(); + } catch (Throwable se) { + + if ( m_shutdowned ){ + return; + } + + m_connected = false; + + m_orb.printTrace( + Trace.ERROR, "Error in ServerSocket.accept(): ", se + ); + } + + try { + if (client_socket != null) { + m_manager.createServerConnection(client_socket); + } + } catch (Throwable e) { + try { + client_socket.close(); + } catch (Throwable t) {} + + m_orb.printTrace( + Trace.ERROR, "Error creating ServerConnection: ", e + ); + } + } + + if ((!m_connected) && (!m_shutdowned)) { + + // RECONNECT + + //printTrace will check for a trace handler existence + m_orb.printTrace( Trace.DEBUG, "Trying to reconnect server socket "); + + try { + resetServerSocket(); + m_connected = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, "ServerSocket reconnected" + ); + } + } catch (Throwable th) { + m_orb.printTrace( + Trace.ERROR, "ServerSocket reconnect error: ", th + ); + try { + Thread.sleep( this.reconnect ); + } catch (InterruptedException e) {} + } + } + } + } + + public IOR createIOR(String id, POAKey key, + TaggedComponent[] extraComponents) { + + TaggedProfile[] profiles = new TaggedProfile[m_listen_points.size()]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + for (int i = 0; i < m_listen_points.size(); i++) { + profiles[i] = new IIOPProfile(this.giopVersion, + (ListenPoint)m_listen_points.elementAt(i), + key, + components); + } + + return new IIOPIOR(id, profiles); + }//createIOR + + public IOR createIOR(String id, ObjectKey key, + TaggedComponent[] extraComponents) { + + TaggedProfile[] profiles = new TaggedProfile[m_listen_points.size()]; + + TaggedComponent[] components = null; + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + 1]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + components[extraComponents.length] = ConfORB.ORB_TYPE; + } else { + components = new TaggedComponent[1]; + components[0] = ConfORB.ORB_TYPE; + } + + for (int i = 0; i < m_listen_points.size(); i++) { + profiles[i] = new IIOPProfile(this.giopVersion, + (ListenPoint)m_listen_points.elementAt(i), + key, + components); + } + + return new IIOPIOR(id, profiles); + }//createIOR + +} diff --git a/source/es/tid/TIDorbj/core/comm/iiop/TargetAddress.java b/source/es/tid/TIDorbj/core/comm/iiop/TargetAddress.java new file mode 100644 index 0000000..bcba253 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/TargetAddress.java @@ -0,0 +1,206 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.iop.TaggedProfileReader; + +/** + * Union TargetAddress defined in GIOP module (version 1.2). + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: jprojas: should be refactored to use a generic profile and moved to giop +//package +public class TargetAddress +{ + + short m_discriminator; + + protected ObjectKey m_object_key; + + protected IIOPProfile m_profile; + + protected IORAddressingInfo m_ior; + + public TargetAddress() + { + reset(); + } + + public short setObjectKey(ObjectKey value) + { + reset(); + m_discriminator = AddressingDisposition._KeyAddr; + m_object_key = value; + return m_discriminator; + } + + public IIOPProfile profile() + { + return m_profile; + } + + public short profile(IIOPProfile value) + { + reset(); + m_discriminator = AddressingDisposition._ProfileAddr; + m_profile = value; + return m_discriminator; + } + + public IORAddressingInfo ior() + { + return m_ior; + } + + public short ior(IORAddressingInfo value) + { + reset(); + m_discriminator = AddressingDisposition._ReferenceAddr; + m_ior = value; + return m_discriminator; + } + + public short discriminator() + { + return m_discriminator; + } + + private void reset() + { + m_discriminator = -1; + m_object_key = null; + m_profile = null; + m_ior = null; + } + + public ObjectKey getObjectKey() + { + if (m_discriminator < 0) + return null; + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + return m_object_key; + case AddressingDisposition._ProfileAddr: + return m_profile.getObjectKey(); + case AddressingDisposition._ReferenceAddr: + TaggedProfile tag_profile; + tag_profile = + m_ior.m_ior.getProfile(m_ior.m_selected_profile_index); + if (tag_profile instanceof IIOPProfile) + return ((IIOPProfile) tag_profile).getObjectKey(); + else + return null; // I can not know how select get the object key + default: + return null; + } + } + + public boolean write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + if (m_discriminator < 0) + return false; + out.write_short(m_discriminator); + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + m_object_key.write(out); + break; + case AddressingDisposition._ProfileAddr: + m_profile.write(out); + break; + case AddressingDisposition._ReferenceAddr: + m_ior.write(out); + break; + default: + return false; + } + return true; + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream in) + { + reset(); + AddressingDisposition disposition = + AddressingDisposition.from_short(in.read_short()); + + if (disposition == null) { + throw new MARSHAL("Invalid TargetAddress discriminator", + 0, + CompletionStatus.COMPLETED_NO); + } + + m_discriminator = disposition.value(); + + switch (m_discriminator) + { + case AddressingDisposition._KeyAddr: + m_object_key = new ObjectKey(); + m_object_key.read(in); + break; + case AddressingDisposition._ProfileAddr: + TaggedProfile tag_profile = TaggedProfileReader.read(in); + if (tag_profile instanceof IIOPProfile) + m_profile = (IIOPProfile) tag_profile; + else + throw new MARSHAL("IIOP Profile expected.", + 0, + CompletionStatus.COMPLETED_NO); + + break; + case AddressingDisposition._ReferenceAddr: + m_ior = IORAddressingInfo.read(in); + break; + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.java b/source/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.java new file mode 100644 index 0000000..abcd9e9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/iiop/WriteTimeout.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.iiop; + +public class WriteTimeout extends Exception +{} diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/all-wcprops b/source/es/tid/TIDorbj/core/comm/local/.svn/all-wcprops new file mode 100644 index 0000000..efe2dfc --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 85 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local +END +LocalLocateResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 117 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.java +END +LocalCommLayer.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local/LocalCommLayer.java +END +LocalResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.java +END +LocalServerRequest.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local/LocalServerRequest.java +END +AMILocalResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.java +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/entries b/source/es/tid/TIDorbj/core/comm/local/.svn/entries new file mode 100644 index 0000000..413e00f --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/entries @@ -0,0 +1,207 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/local +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + + + +() + +LocalLocateResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +2780780c4138b6bd1a075cbaad134c98 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5896 + +LocalCommLayer.java +file + + + + +2010-04-28T10:50:46.000000Z +3e38caf1107d5483311e34ea8ac10cd3 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +16760 + +LocalResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +24b740438f75c1ed246a55cf984811a9 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5315 + +LocalServerRequest.java +file + + + + +2009-05-27T12:24:01.000000Z +ca9195fb58ffbe3d8cc2d86bc35c772e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4592 + +AMILocalResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +c7993c980a77b09ec4532cb2b1995cb8 +2006-01-31T16:34:41.000000Z +12 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +7341 + diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/AMILocalResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/AMILocalResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/AMILocalResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalCommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalCommLayer.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalCommLayer.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalLocateResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalServerRequest.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalServerRequest.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/prop-base/LocalServerRequest.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/AMILocalResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/AMILocalResponseHandler.java.svn-base new file mode 100644 index 0000000..29ea8d4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/AMILocalResponseHandler.java.svn-base @@ -0,0 +1,236 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationDelegate; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ + +/* + * TODO: this class and its peer LocalLocateResponseHandler are too similar, + * check it! + */ + +public class AMILocalResponseHandler extends QueuedResponseHandler { + + + private LocalServerRequest serverRequest; + private ObjectKey objectKey; + + private OperationCompletion completionStatus; + + private Object forwardReference; + private SystemException exception; + + private PolicyContext requestPolicyContext; + + private TIDORB m_orb; + + public AMILocalResponseHandler( + ObjectKey objectKey, + LocalServerRequest serverRequest, TIDORB orb ){ + this.objectKey = objectKey; + this.serverRequest = serverRequest; + this.completionStatus = new OperationCompletion(); + this.m_orb = orb; + } + + /** + * OWN METHODS + */ + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.serverRequest.getLocalRequest().getPolicyContext(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.serverRequest.setForward( reference ); + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + this.exception = e; + this.serverRequest.setSystemException( e ); + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + // TODO Auto-generated method stub + + } + + private void putReply() { + RequestImpl request = serverRequest.getLocalRequest(); + Object ami_handler = request.get_ami_handler(); + RequestImpl replyHandlerRequest = (RequestImpl) ami_handler._request(request.operation()); + if (request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_in_arg(); + $ami_return_val.read_value(request.return_value().create_input_stream(), request.return_value().type()); + } + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + + if ( serverRequest.isForwarded() ) { + + IIOPIOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = + ( ( org.omg.CORBA.portable.ObjectImpl )forward )._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = ( ( IIOPCommunicationDelegate )forward_delegate ).getIIOPReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IIOPIOR.fromString(m_orb, m_orb.object_to_string( forward ) + ); + } + + //throw new es.tid.TIDorbj.core.comm.ForwardRequest( forwarded_ior ); + } + + } +} diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalCommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalCommLayer.java.svn-base new file mode 100644 index 0000000..a56d283 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalCommLayer.java.svn-base @@ -0,0 +1,471 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision$ + * Date: $Date$ + * Last modified by: $Author$ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.ValueBase; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationDelegate; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.poa.ExecThread; +import es.tid.TIDorbj.core.poa.POAManagerImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * Layer that dispatchs the request to local objects. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Javier Fdez. Mejuto + * @version 1.0 + */ + +//TODO: maybe local comm layer should be a CommunicationLayer itself +public class LocalCommLayer extends + es.tid.TIDorbj.core.comm.iiop.CommunicationLayer { + public LocalCommLayer( es.tid.TIDorbj.core.TIDORB orb ) { + super( orb ); + } + + public boolean objectExists( IIOPIOR ior, PolicyContext policy_context ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + try { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + ObjectKey objectKey = ior.getObjectKey(); + + LocalLocateResponseHandler responseHandler; + responseHandler = new LocalLocateResponseHandler( + objectKey, + policy_context + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * Local request cannot be dispatched regularly because the + * dispatcher should wait for them... think of this later + * CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + */ + + // Check if the the thread that invoked the request is an ExecThread + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( responseHandler ); + } else { + // application invocation + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + + responseHandler.waitForCompletion(timeout); + + + } + + // Invoking poaManager + + if ( ! responseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( responseHandler.isExceptionSet() ) { + throw responseHandler.getException(); + } + + if ( responseHandler.isForwarded() ) { + IIOPIOR forwardIOR; + + org.omg.CORBA.Object forwardReference; + forwardReference = responseHandler.getForwardReference(); + + if ( forwardReference instanceof ValueBase ) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + if ( forwardReference instanceof ObjectImpl ){ + ObjectImpl reference; + reference = ( ( ObjectImpl )forwardReference ); + + Delegate forwardDelegate; + forwardDelegate = reference._get_delegate(); + + if ( forwardDelegate instanceof IIOPCommunicationDelegate ) { + forwardIOR = ( ( IIOPCommunicationDelegate )forwardDelegate ) + .getIIOPReference(); + } else { + //TODO: ask juan: this could happen? + // write ior from anothers's ORB Object + forwardIOR = IIOPIOR.fromString( m_orb, m_orb + .object_to_string( forwardReference ) ); + } + throw new ForwardRequest( forwardIOR ); + } else { + throw new org.omg.CORBA.INV_OBJREF(); + } + } + + // Return results + return responseHandler.getResult(); + } catch ( INTERNAL e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.ERROR, + "INTERNAL Exception in local oneway invocation", + e + ); + } + throw e; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.ERROR, + "Exception in local location invocation", + e + ); + } + throw e; + } + } + + public void request( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + try { + + request.withResponse( true ); + sendRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + throw fr; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, "Exception in local invocation", + e ); + } + throw e; + } + } + + public void onewayRequest( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + request.withResponse( false ); + sendRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + // unreachable + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, + "Exception in local oneway invocaton", e ); + } + throw e; + } + } + + //corregir + public void asyncRequest( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + try { + + request.withResponse( true ); + sendAsyncRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + throw fr; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, "Exception in local asynchronous invocation", + e ); + } + throw e; + } + } + + protected void sendRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + long timeout = QoS.checkRequestTime(this.m_orb, + request.getPolicyContext()); + + ObjectKey objectKey = ior.getObjectKey(); + + PolicyContext policyContext; + policyContext = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest; + serverRequest = new LocalServerRequest( request ); + + + //CreatingResponseHandler + LocalResponseHandler responseHandler; + responseHandler = new LocalResponseHandler( + objectKey, + serverRequest ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + POAManagerImpl poaManager; + poaManager = ( POAManagerImpl ) m_orb.initPOA().the_POAManager(); + if ( ! request.withResponse() ) { + // Invoking poaManager + poaManager.put( responseHandler ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread; + currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( responseHandler ); + } else { // application invocation + // Invoking poaManager + poaManager.put( responseHandler ); + + responseHandler.waitForCompletion(timeout ); + } + + if ( ! responseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( serverRequest.isForwarded() ) { + + IIOPIOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = + ( ( org.omg.CORBA.portable.ObjectImpl )forward )._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = + ( ( IIOPCommunicationDelegate )forward_delegate ).getIIOPReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IIOPIOR.fromString( + m_orb, + m_orb.object_to_string( forward ) + ); + } + + throw new es.tid.TIDorbj.core.comm.ForwardRequest( forwarded_ior ); + } + } + } + + + protected void sendAsyncRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + long timeout = QoS.checkRequestTime(this.m_orb, + request.getPolicyContext()); + + ObjectKey objectKey = ior.getObjectKey(); + + PolicyContext policyContext; + policyContext = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest; + serverRequest = new LocalServerRequest( request ); + + + //CreatingResponseHandler + AMILocalResponseHandler amiResponseHandler; + amiResponseHandler = new AMILocalResponseHandler(objectKey, serverRequest, m_orb ); + amiResponseHandler.setSerial(m_orb.getRequestCounter().next()); + + POAManagerImpl poaManager; + poaManager = ( POAManagerImpl ) m_orb.initPOA().the_POAManager(); + if ( ! request.withResponse() ) { + // Invoking poaManager + poaManager.put( amiResponseHandler ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread; + currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( amiResponseHandler ); + } else { // application invocation + // Invoking poaManager + poaManager.put( amiResponseHandler ); + } + + + /*if ( ! amiResponseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + }*/ + + } + } + + + /** + + protected void sendRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.ForwardRequest { + + ObjectKey key = ior.getObjectKey(); + POAKey poaKey; + if ( key instanceof POAKey ) { + poaKey = ( POAKey ) key; + } else { + poaKey = new POAKey( key.getMarshaledKey() ); + } + + PolicyContext policy_context = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest = new LocalServerRequest( request ); + + // Creating LocalRequest + LocalRequest localRequest = new LocalRequest( poaKey, m_orb.initPOA(), + serverRequest ); + + if ( !request.withResponse() ) { + // Invoking poaManager + POAManagerImpl poaManager = ( POAManagerImpl ) m_orb.initPOA() + .the_POAManager(); + poaManager.put( localRequest ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread this_thread = Thread.currentThread(); + + POAManagerImpl poaManager = ( POAManagerImpl ) m_orb.initPOA() + .the_POAManager(); + + if ( this_thread instanceof ExecThread ) { + ( ( ExecThread ) this_thread ).processLocalRequest( + localRequest, poaManager ); + } else { // application invocation + // Invoking poaManager + poaManager.put( localRequest ); + localRequest.waitForCompletion( PolicyUtil + .getRelativeRequestTimeoutValue( policy_context ) ); + } + + if ( !localRequest.getCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( serverRequest.isForwarded() ) { + + es.tid.TIDorbj.core.iop.IOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = ( ( org.omg.CORBA.portable.ObjectImpl ) forward ) + ._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = ( ( IIOPCommunicationDelegate ) forward_delegate ) + .getReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IOR.fromString( m_orb, m_orb + .object_to_string( forward ) ); + } + + throw new es.tid.TIDorbj.core.ForwardRequest( forwarded_ior ); + } + } + } + + */ + + public void prepareRequest( es.tid.TIDorbj.core.StreamRequestImpl request ) { + throw new org.omg.CORBA.INTERNAL(); + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws es.tid.TIDorbj.core.comm.ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + throw new org.omg.CORBA.INTERNAL(); + } + + public void dump(java.io.PrintWriter writer){ + } +} diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..9ea1d14 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalLocateResponseHandler.java.svn-base @@ -0,0 +1,199 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class LocalLocateResponseHandler extends QueuedLocateResponseHandler { + + private OperationCompletion completionStatus; + + private ObjectKey objectKey; + + //To store whether the object was found or not + private boolean locationResult; + + private Object forwardReference; + + private SystemException exception; + + private PolicyContext requestPolicyContext; + + + public LocalLocateResponseHandler( ObjectKey key, PolicyContext ctx){ + this.completionStatus = new OperationCompletion(); + this.objectKey = key; + this.requestPolicyContext = ctx; + } + + /** + * OWN METHODS + */ + public boolean getResult(){ + return this.locationResult; + } + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /** + * INHERITED METHODS + */ + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.requestPolicyContext; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException systemException ) { + this.exception = systemException; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#submitResponse(boolean) + */ + public void submitResponse( boolean value ) { + this.locationResult = value; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /*TODO: remove from here upon refactoring completion*/ + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.poa.QueuedRequest#sendError(org.omg.CORBA.SystemException, es.tid.TIDorbj.util.Trace) + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + } + + + /**/ + +} diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalResponseHandler.java.svn-base new file mode 100644 index 0000000..37dce97 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalResponseHandler.java.svn-base @@ -0,0 +1,184 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ + +/* + * TODO: this class and its peer LocalLocateResponseHandler are too similar, + * check it! + */ + +public class LocalResponseHandler extends QueuedResponseHandler { + + + private LocalServerRequest serverRequest; + private ObjectKey objectKey; + + private OperationCompletion completionStatus; + + private Object forwardReference; + private SystemException exception; + + private PolicyContext requestPolicyContext; + + public LocalResponseHandler( + ObjectKey objectKey, + LocalServerRequest serverRequest ){ + this.objectKey = objectKey; + this.serverRequest = serverRequest; + this.completionStatus = new OperationCompletion(); + } + + /** + * OWN METHODS + */ + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.serverRequest.getLocalRequest().getPolicyContext(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.serverRequest.setForward( reference ); + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + this.exception = e; + this.serverRequest.setSystemException( e ); + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + this.completionStatus.setCompleted(); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + // TODO Auto-generated method stub + + } + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalServerRequest.java.svn-base b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalServerRequest.java.svn-base new file mode 100644 index 0000000..e01724a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/.svn/text-base/LocalServerRequest.java.svn-base @@ -0,0 +1,159 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.NVList; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; + +public class LocalServerRequest extends org.omg.CORBA.ServerRequest +{ + + RequestImpl m_local_request; + + NVList m_server_parameters; + + org.omg.CORBA.Object m_forward_obj; + + public LocalServerRequest(RequestImpl request) + { + m_local_request = request; + m_server_parameters = null; + m_forward_obj = null; + } + + public String operation() + { + return m_local_request.operation(); + } + + public org.omg.CORBA.Context ctx() + { + return m_local_request.ctx(); + } + + public void arguments(org.omg.CORBA.NVList nv) + { + if (nv == null) + throw new BAD_PARAM("Null NVList reference", 0, + CompletionStatus.COMPLETED_NO); + + m_server_parameters = nv; + // performance improvement: wrap the parameter anys and do not copy then + // ONLY WITH NO ONEWAY REQUEST!!!!! + + boolean wrap_anys = m_local_request.withResponse(); + + NVListImpl.assignInArguments(m_local_request.arguments(), + m_server_parameters, wrap_anys); + } + + public void set_result(Any result) + { + if (result == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + Any result_any = m_local_request.return_value(); + AnyImpl.assignValue(result, result_any); + } + + public void set_exception(Any except) + { + if (except == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + m_local_request.setUserException(except); + } + + // TIDorb operations + + public void fixOutArguments() + { + // performance improvement: wrap the parameter anys and do not copy them + // ONLY WITH NO ONEWAY REQUEST!!!!! + NVListImpl.assignOutArguments(m_server_parameters, + m_local_request.arguments(), true); + } + + public void setSystemException(org.omg.CORBA.SystemException except) + { + if (except == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + m_local_request.setSystemException(except); + } + + public boolean isForwarded() + { + return m_forward_obj != null; + } + + public void setForward(org.omg.CORBA.Object obj) + { + m_forward_obj = obj; + } + + public org.omg.CORBA.Object getForward() + { + return m_forward_obj; + } + + public void destroy() + { + NVListImpl.destroy(m_server_parameters); + } + + public RequestImpl getLocalRequest() + { + return m_local_request; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.java b/source/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.java new file mode 100644 index 0000000..1b0a0df --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/AMILocalResponseHandler.java @@ -0,0 +1,236 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 12 $ +* Date: $Date: 2006-01-31 17:34:41 +0100 (Tue, 31 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationDelegate; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ + +/* + * TODO: this class and its peer LocalLocateResponseHandler are too similar, + * check it! + */ + +public class AMILocalResponseHandler extends QueuedResponseHandler { + + + private LocalServerRequest serverRequest; + private ObjectKey objectKey; + + private OperationCompletion completionStatus; + + private Object forwardReference; + private SystemException exception; + + private PolicyContext requestPolicyContext; + + private TIDORB m_orb; + + public AMILocalResponseHandler( + ObjectKey objectKey, + LocalServerRequest serverRequest, TIDORB orb ){ + this.objectKey = objectKey; + this.serverRequest = serverRequest; + this.completionStatus = new OperationCompletion(); + this.m_orb = orb; + } + + /** + * OWN METHODS + */ + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.serverRequest.getLocalRequest().getPolicyContext(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.serverRequest.setForward( reference ); + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + this.exception = e; + this.serverRequest.setSystemException( e ); + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + this.completionStatus.setCompleted(); + this.putReply(); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + // TODO Auto-generated method stub + + } + + private void putReply() { + RequestImpl request = serverRequest.getLocalRequest(); + Object ami_handler = request.get_ami_handler(); + RequestImpl replyHandlerRequest = (RequestImpl) ami_handler._request(request.operation()); + if (request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_in_arg(); + $ami_return_val.read_value(request.return_value().create_input_stream(), request.return_value().type()); + } + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + + if ( serverRequest.isForwarded() ) { + + IIOPIOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = + ( ( org.omg.CORBA.portable.ObjectImpl )forward )._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = ( ( IIOPCommunicationDelegate )forward_delegate ).getIIOPReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IIOPIOR.fromString(m_orb, m_orb.object_to_string( forward ) + ); + } + + //throw new es.tid.TIDorbj.core.comm.ForwardRequest( forwarded_ior ); + } + + } +} diff --git a/source/es/tid/TIDorbj/core/comm/local/LocalCommLayer.java b/source/es/tid/TIDorbj/core/comm/local/LocalCommLayer.java new file mode 100644 index 0000000..d5d7863 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/LocalCommLayer.java @@ -0,0 +1,471 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJ + * Programming Language: Java + * + * File: $Source$ + * Version: $Revision: 395 $ + * Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ + * Last modified by: $Author: avega $ + * + * (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo + * S.A.Unipersonal (Telef�nica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.Delegate; +import org.omg.CORBA.portable.ObjectImpl; +import org.omg.CORBA.portable.ValueBase; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationDelegate; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.poa.ExecThread; +import es.tid.TIDorbj.core.poa.POAManagerImpl; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * Layer that dispatchs the request to local objects. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Javier Fdez. Mejuto + * @version 1.0 + */ + +//TODO: maybe local comm layer should be a CommunicationLayer itself +public class LocalCommLayer extends + es.tid.TIDorbj.core.comm.iiop.CommunicationLayer { + public LocalCommLayer( es.tid.TIDorbj.core.TIDORB orb ) { + super( orb ); + } + + public boolean objectExists( IIOPIOR ior, PolicyContext policy_context ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + try { + + long timeout = QoS.checkRequestTime(this.m_orb, + policy_context); + + ObjectKey objectKey = ior.getObjectKey(); + + LocalLocateResponseHandler responseHandler; + responseHandler = new LocalLocateResponseHandler( + objectKey, + policy_context + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * Local request cannot be dispatched regularly because the + * dispatcher should wait for them... think of this later + * CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + */ + + // Check if the the thread that invoked the request is an ExecThread + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( responseHandler ); + } else { + // application invocation + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + + responseHandler.waitForCompletion(timeout); + + + } + + // Invoking poaManager + + if ( ! responseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( responseHandler.isExceptionSet() ) { + throw responseHandler.getException(); + } + + if ( responseHandler.isForwarded() ) { + IIOPIOR forwardIOR; + + org.omg.CORBA.Object forwardReference; + forwardReference = responseHandler.getForwardReference(); + + if ( forwardReference instanceof ValueBase ) { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + if ( forwardReference instanceof ObjectImpl ){ + ObjectImpl reference; + reference = ( ( ObjectImpl )forwardReference ); + + Delegate forwardDelegate; + forwardDelegate = reference._get_delegate(); + + if ( forwardDelegate instanceof IIOPCommunicationDelegate ) { + forwardIOR = ( ( IIOPCommunicationDelegate )forwardDelegate ) + .getIIOPReference(); + } else { + //TODO: ask juan: this could happen? + // write ior from anothers's ORB Object + forwardIOR = IIOPIOR.fromString( m_orb, m_orb + .object_to_string( forwardReference ) ); + } + throw new ForwardRequest( forwardIOR ); + } else { + throw new org.omg.CORBA.INV_OBJREF(); + } + } + + // Return results + return responseHandler.getResult(); + } catch ( INTERNAL e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.ERROR, + "INTERNAL Exception in local oneway invocation", + e + ); + } + throw e; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.ERROR, + "Exception in local location invocation", + e + ); + } + throw e; + } + } + + public void request( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + try { + + request.withResponse( true ); + sendRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + throw fr; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, "Exception in local invocation", + e ); + } + throw e; + } + } + + public void onewayRequest( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + request.withResponse( false ); + sendRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + // unreachable + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, + "Exception in local oneway invocaton", e ); + } + throw e; + } + } + + //corregir + public void asyncRequest( es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + try { + + request.withResponse( true ); + sendAsyncRequest( request, ior ); + + } catch ( es.tid.TIDorbj.core.comm.ForwardRequest fr ) { + throw fr; + } catch ( RuntimeException e ) { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( Trace.ERROR, "Exception in local asynchronous invocation", + e ); + } + throw e; + } + } + + protected void sendRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + long timeout = QoS.checkRequestTime(this.m_orb, + request.getPolicyContext()); + + ObjectKey objectKey = ior.getObjectKey(); + + PolicyContext policyContext; + policyContext = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest; + serverRequest = new LocalServerRequest( request ); + + + //CreatingResponseHandler + LocalResponseHandler responseHandler; + responseHandler = new LocalResponseHandler( + objectKey, + serverRequest ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + POAManagerImpl poaManager; + poaManager = ( POAManagerImpl ) m_orb.initPOA().the_POAManager(); + if ( ! request.withResponse() ) { + // Invoking poaManager + poaManager.put( responseHandler ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread; + currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( responseHandler ); + } else { // application invocation + // Invoking poaManager + poaManager.put( responseHandler ); + + responseHandler.waitForCompletion(timeout ); + } + + if ( ! responseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( serverRequest.isForwarded() ) { + + IIOPIOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = + ( ( org.omg.CORBA.portable.ObjectImpl )forward )._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = + ( ( IIOPCommunicationDelegate )forward_delegate ).getIIOPReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IIOPIOR.fromString( + m_orb, + m_orb.object_to_string( forward ) + ); + } + + throw new es.tid.TIDorbj.core.comm.ForwardRequest( forwarded_ior ); + } + } + } + + + protected void sendAsyncRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.comm.ForwardRequest { + + long timeout = QoS.checkRequestTime(this.m_orb, + request.getPolicyContext()); + + ObjectKey objectKey = ior.getObjectKey(); + + PolicyContext policyContext; + policyContext = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest; + serverRequest = new LocalServerRequest( request ); + + + //CreatingResponseHandler + AMILocalResponseHandler amiResponseHandler; + amiResponseHandler = new AMILocalResponseHandler(objectKey, serverRequest, m_orb ); + amiResponseHandler.setSerial(m_orb.getRequestCounter().next()); + + POAManagerImpl poaManager; + poaManager = ( POAManagerImpl ) m_orb.initPOA().the_POAManager(); + if ( ! request.withResponse() ) { + // Invoking poaManager + poaManager.put( amiResponseHandler ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread currentThread = Thread.currentThread(); + + if ( currentThread instanceof ExecThread ) { + ExecThread currentExecThread; + currentExecThread = ( ExecThread )currentThread; + currentExecThread.processLocalRequest( amiResponseHandler ); + } else { // application invocation + // Invoking poaManager + poaManager.put( amiResponseHandler ); + } + + + /*if ( ! amiResponseHandler.isCompleted() ) { + throw new NO_RESPONSE(); + }*/ + + } + } + + + /** + + protected void sendRequest( RequestImpl request, IOR ior ) + throws es.tid.TIDorbj.core.ForwardRequest { + + ObjectKey key = ior.getObjectKey(); + POAKey poaKey; + if ( key instanceof POAKey ) { + poaKey = ( POAKey ) key; + } else { + poaKey = new POAKey( key.getMarshaledKey() ); + } + + PolicyContext policy_context = request.getPolicyContext(); + + // Creating ServerRequest + LocalServerRequest serverRequest = new LocalServerRequest( request ); + + // Creating LocalRequest + LocalRequest localRequest = new LocalRequest( poaKey, m_orb.initPOA(), + serverRequest ); + + if ( !request.withResponse() ) { + // Invoking poaManager + POAManagerImpl poaManager = ( POAManagerImpl ) m_orb.initPOA() + .the_POAManager(); + poaManager.put( localRequest ); + } else { + // Check if the the thread that invoked the request is an ExecThread + + Thread this_thread = Thread.currentThread(); + + POAManagerImpl poaManager = ( POAManagerImpl ) m_orb.initPOA() + .the_POAManager(); + + if ( this_thread instanceof ExecThread ) { + ( ( ExecThread ) this_thread ).processLocalRequest( + localRequest, poaManager ); + } else { // application invocation + // Invoking poaManager + poaManager.put( localRequest ); + localRequest.waitForCompletion( PolicyUtil + .getRelativeRequestTimeoutValue( policy_context ) ); + } + + if ( !localRequest.getCompleted() ) { + throw new NO_RESPONSE(); + } + + if ( serverRequest.isForwarded() ) { + + es.tid.TIDorbj.core.iop.IOR forwarded_ior; + + org.omg.CORBA.Object forward = serverRequest.getForward(); + + if ( forward instanceof org.omg.CORBA.portable.ValueBase ) + throw new org.omg.CORBA.NO_IMPLEMENT(); + + if ( ! ( forward instanceof org.omg.CORBA.portable.ObjectImpl ) ) + throw new org.omg.CORBA.INV_OBJREF(); + + org.omg.CORBA.portable.Delegate forward_delegate = ( ( org.omg.CORBA.portable.ObjectImpl ) forward ) + ._get_delegate(); + + if ( forward_delegate instanceof IIOPCommunicationDelegate ) { + forwarded_ior = ( ( IIOPCommunicationDelegate ) forward_delegate ) + .getReference(); + } else { // write ior from anothers's ORB Object + forwarded_ior = IOR.fromString( m_orb, m_orb + .object_to_string( forward ) ); + } + + throw new es.tid.TIDorbj.core.ForwardRequest( forwarded_ior ); + } + } + } + + */ + + public void prepareRequest( es.tid.TIDorbj.core.StreamRequestImpl request ) { + throw new org.omg.CORBA.INTERNAL(); + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + es.tid.TIDorbj.core.cdr.CDROutputStream stream, + es.tid.TIDorbj.core.policy.PolicyContext policy_context ) + throws es.tid.TIDorbj.core.comm.ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + throw new org.omg.CORBA.INTERNAL(); + } + + public void dump(java.io.PrintWriter writer){ + } +} diff --git a/source/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.java b/source/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.java new file mode 100644 index 0000000..eb9e2b5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/LocalLocateResponseHandler.java @@ -0,0 +1,199 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class LocalLocateResponseHandler extends QueuedLocateResponseHandler { + + private OperationCompletion completionStatus; + + private ObjectKey objectKey; + + //To store whether the object was found or not + private boolean locationResult; + + private Object forwardReference; + + private SystemException exception; + + private PolicyContext requestPolicyContext; + + + public LocalLocateResponseHandler( ObjectKey key, PolicyContext ctx){ + this.completionStatus = new OperationCompletion(); + this.objectKey = key; + this.requestPolicyContext = ctx; + } + + /** + * OWN METHODS + */ + public boolean getResult(){ + return this.locationResult; + } + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /** + * INHERITED METHODS + */ + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.requestPolicyContext; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException systemException ) { + this.exception = systemException; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#submitResponse(boolean) + */ + public void submitResponse( boolean value ) { + this.locationResult = value; + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /*TODO: remove from here upon refactoring completion*/ + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.poa.QueuedRequest#sendError(org.omg.CORBA.SystemException, es.tid.TIDorbj.util.Trace) + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + } + + + /**/ + +} diff --git a/source/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.java b/source/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.java new file mode 100644 index 0000000..25647f0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/LocalResponseHandler.java @@ -0,0 +1,184 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.OperationCompletion; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ + +/* + * TODO: this class and its peer LocalLocateResponseHandler are too similar, + * check it! + */ + +public class LocalResponseHandler extends QueuedResponseHandler { + + + private LocalServerRequest serverRequest; + private ObjectKey objectKey; + + private OperationCompletion completionStatus; + + private Object forwardReference; + private SystemException exception; + + private PolicyContext requestPolicyContext; + + public LocalResponseHandler( + ObjectKey objectKey, + LocalServerRequest serverRequest ){ + this.objectKey = objectKey; + this.serverRequest = serverRequest; + this.completionStatus = new OperationCompletion(); + } + + /** + * OWN METHODS + */ + + public boolean isForwarded(){ + return this.forwardReference != null; + } + + public Object getForwardReference(){ + return this.forwardReference; + } + + public boolean isCompleted(){ + return this.completionStatus.isCompleted(); + } + + public boolean isExceptionSet(){ + return this.exception != null; + } + + public SystemException getException(){ + return this.exception; + } + + + public void waitForCompletion(long how_long) + { + try { + this.completionStatus.waitForCompletion(how_long); + } + catch (java.lang.InterruptedException ie) { + throw new INTERNAL("Unexpected Interrupted Exception"); + } + catch (es.tid.TIDorbj.core.util.OnlyOneThreadCanWait only) { + throw new INTERNAL("Only one Thread can wait in the request lock."); + } + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext() { + return this.serverRequest.getLocalRequest().getPolicyContext(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + this.forwardReference = reference; + this.serverRequest.setForward( reference ); + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + this.exception = e; + this.serverRequest.setSystemException( e ); + this.completionStatus.setCompleted(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + this.completionStatus.setCompleted(); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + // TODO Auto-generated method stub + + } + + + +} diff --git a/source/es/tid/TIDorbj/core/comm/local/LocalServerRequest.java b/source/es/tid/TIDorbj/core/comm/local/LocalServerRequest.java new file mode 100644 index 0000000..66c130c --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/local/LocalServerRequest.java @@ -0,0 +1,159 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.local; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.NVList; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; + +public class LocalServerRequest extends org.omg.CORBA.ServerRequest +{ + + RequestImpl m_local_request; + + NVList m_server_parameters; + + org.omg.CORBA.Object m_forward_obj; + + public LocalServerRequest(RequestImpl request) + { + m_local_request = request; + m_server_parameters = null; + m_forward_obj = null; + } + + public String operation() + { + return m_local_request.operation(); + } + + public org.omg.CORBA.Context ctx() + { + return m_local_request.ctx(); + } + + public void arguments(org.omg.CORBA.NVList nv) + { + if (nv == null) + throw new BAD_PARAM("Null NVList reference", 0, + CompletionStatus.COMPLETED_NO); + + m_server_parameters = nv; + // performance improvement: wrap the parameter anys and do not copy then + // ONLY WITH NO ONEWAY REQUEST!!!!! + + boolean wrap_anys = m_local_request.withResponse(); + + NVListImpl.assignInArguments(m_local_request.arguments(), + m_server_parameters, wrap_anys); + } + + public void set_result(Any result) + { + if (result == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + Any result_any = m_local_request.return_value(); + AnyImpl.assignValue(result, result_any); + } + + public void set_exception(Any except) + { + if (except == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + m_local_request.setUserException(except); + } + + // TIDorb operations + + public void fixOutArguments() + { + // performance improvement: wrap the parameter anys and do not copy them + // ONLY WITH NO ONEWAY REQUEST!!!!! + NVListImpl.assignOutArguments(m_server_parameters, + m_local_request.arguments(), true); + } + + public void setSystemException(org.omg.CORBA.SystemException except) + { + if (except == null) + throw new BAD_PARAM("Null any reference", 0, + CompletionStatus.COMPLETED_NO); + + m_local_request.setSystemException(except); + } + + public boolean isForwarded() + { + return m_forward_obj != null; + } + + public void setForward(org.omg.CORBA.Object obj) + { + m_forward_obj = obj; + } + + public org.omg.CORBA.Object getForward() + { + return m_forward_obj; + } + + public void destroy() + { + NVListImpl.destroy(m_server_parameters); + } + + public RequestImpl getLocalRequest() + { + return m_local_request; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/all-wcprops b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/all-wcprops new file mode 100644 index 0000000..0c2fd88 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/all-wcprops @@ -0,0 +1,65 @@ +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop +END +SSLConnection.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.java +END +SSLIOPCommLayer.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.java +END +SSLComponent.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.java +END +SSLIOPCommunicationLayerPropertiesInfo.java +K 25 +svn:wc:ra_dav:version-url +V 130 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.java +END +SSLLocateResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.java +END +SSLIOPCommunicationDelegate.java +K 25 +svn:wc:ra_dav:version-url +V 119 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.java +END +SSLIOPCommunicationLayer.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.java +END +SSLIOPCorbaloc.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.java +END +SSLResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.java +END +SSLServerListener.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.java +END diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/entries b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/entries new file mode 100644 index 0000000..40c2b4d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/entries @@ -0,0 +1,368 @@ +10 + +dir +478 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/comm/ssliop +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +SSLConnection.java +file + + + + +2011-03-27T14:09:43.000000Z +ebdeafb18c5f8e84c7fbd41dc54e9c52 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +19383 + +SSLIOPCommLayer.java +file + + + + +2011-03-27T14:09:43.000000Z +13eed8eeea3ba096354cde0cd37ae378 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +30617 + +SSLComponent.java +file + + + + +2011-03-27T14:09:43.000000Z +7b7711347a611b7222d765076e83d2d7 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +5882 + +SSLIOPCommunicationLayerPropertiesInfo.java +file + + + + +2011-03-27T14:09:43.000000Z +f483ec1e3a08e0ae93808219f1d63661 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +8429 + +SSLLocateResponseHandler.java +file + + + + +2011-03-27T14:09:43.000000Z +ff94f16e58bbe7cd4f175049d2fd2643 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +5665 + +SSLIOPCommunicationDelegate.java +file + + + + +2011-03-27T14:09:43.000000Z +a124ab3bde21ef922960d5c1d9a4759c +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +12137 + +SSLIOPCommunicationLayer.java +file + + + + +2011-03-27T14:09:43.000000Z +1ad7ec1691a572d69296d16ab4cb2868 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +12905 + +SSLIOPCorbaloc.java +file + + + + +2011-03-27T14:09:43.000000Z +1faafc4c18485ff5a23a8ad1801a7bd9 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +7069 + +SSLResponseHandler.java +file + + + + +2011-03-27T14:09:43.000000Z +26e1c9761d87114c3c6ce04471a3c11b +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +5908 + +SSLServerListener.java +file + + + + +2011-03-27T14:09:43.000000Z +56d008a02e5fb412f25b84390030c452 +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +15524 + diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLComponent.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLComponent.java.svn-base new file mode 100644 index 0000000..02258d2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLComponent.java.svn-base @@ -0,0 +1,195 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.SSLIOP.SSL; +import org.omg.SSLIOP.SSLHelper; + + +/** + * SSLComponent data struct defined in the GIOP Module. + * + * @autor avega + * @version 1.0 + */ +public class SSLComponent extends TaggedComponent +{ + + private SSL m_ssl; + + public SSLComponent() + { + super(TAG_SSL_SEC_TRANS.value); + m_ssl = new SSL(); + } + + public SSLComponent(SSL ssl) + { + super(TAG_SSL_SEC_TRANS.value); + m_ssl = ssl; + } + + + public short getTargetSupports() + { + return m_ssl.target_supports; + } + + + public short getTargetRequires() + { + return m_ssl.target_requires; + } + + + public short getSSLPort() + { + return m_ssl.port; + } + + + public SSL getSSL() + { + return m_ssl; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + SSLHelper.write(out, m_ssl); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_ssl = SSLHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("port: "); + if (m_ssl.port < 0) { + int myint = 65536 + m_ssl.port; + print_buffer.print(myint); + } + else { + print_buffer.print(m_ssl.port); + } + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("target_supports: "); + print_buffer.print(print_AssociationOptions(m_ssl.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("target_requires: "); + print_buffer.print(print_AssociationOptions(m_ssl.target_requires)); + return buffer.toString(); + } + + + public static String print_AssociationOptions(int mask) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + if ( (mask & org.omg.Security.NoProtection.value) > 0) { + print_buffer.print("\n \t \t \t NoProtection"); + } + if ( (mask & org.omg.Security.Integrity.value) > 0) { + print_buffer.print("\n \t \t \t Integrity"); + } + if ( (mask & org.omg.Security.Confidentiality.value) > 0) { + print_buffer.print("\n \t \t \t Confidentiality"); + } + if ( (mask & org.omg.Security.DetectReplay.value) > 0) { + print_buffer.print("\n \t \t \t DetectReplay"); + } + if ( (mask & org.omg.Security.DetectMisordering.value) > 0) { + print_buffer.print("\n \t \t \t DetectMisordering"); + } + if ( (mask & org.omg.Security.EstablishTrustInTarget.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInTarget"); + } + if ( (mask & org.omg.Security.EstablishTrustInClient.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInClient"); + } + if ( (mask & org.omg.Security.NoDelegation.value) > 0) { + print_buffer.print("\n \t \t \t NoDelegation"); + } + if ( (mask & org.omg.Security.SimpleDelegation.value) > 0) { + print_buffer.print("\n \t \t \t SimpleDelegation"); + } + if ( (mask & org.omg.Security.CompositeDelegation.value) > 0) { + print_buffer.print("\n \t \t \t CompositeDelegation"); + } + if ( (mask & org.omg.CSIIOP.IdentityAssertion.value) > 0) { + print_buffer.print("\n \t \t \t IdentityAssertion"); + } + if ( (mask & org.omg.CSIIOP.DelegationByClient.value) > 0) { + print_buffer.print("\n \t \t \t DelegationByClient"); + } + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLConnection.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLConnection.java.svn-base new file mode 100644 index 0000000..ce5015b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLConnection.java.svn-base @@ -0,0 +1,577 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.io.IOException; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.SSLContext; + +import java.security.KeyStore; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.TrustManagerFactory; + +import java.io.FileInputStream; + +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; +import es.tid.TIDorbj.core.comm.iiop.*; + +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb SSLIOP SSLConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SSLConnection extends Connection { + + /** + * SSLConnection Socket. + */ + javax.net.ssl.SSLSocket m_socket; + + /** + * SSLConnection Socket InputStream. + */ + public java.io.InputStream m_socket_in; + + /** + * SSLConnection Socket OutputStream. + */ + public java.io.OutputStream m_socket_out; + + private boolean tcpNoDelay; + private int soTimeout; + private int soLinger; + + private int socketWriteTimeout; + + String ssl_key_store_file; + String ssl_key_store_passwd; + String ssl_version; + + + private SSLConnection(IIOPConnectionManager mngr, javax.net.ssl.SSLSocket socket) + { + super(mngr); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + tcpNoDelay = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.TCP_NODELAY ) + .getBoolean(); + + soTimeout = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_TIMEOUT ) + .getInt(); + + soLinger = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_LINGER ) + .getInt(); + + socketWriteTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_WRITE_TIMEOUT ) + .getInt(); + + + try { + this.m_socket = socket; + + my_port = socket.getLocalPort(); + + socket.setTcpNoDelay( tcpNoDelay ); + socket.setSoTimeout( soTimeout ); + + socket.setSoLinger( soLinger != -1, soLinger ); + + m_socket_in = socket.getInputStream(); + m_socket_out = socket.getOutputStream(); + } + catch (java.io.IOException ioe) { + throw new OBJECT_NOT_EXIST(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + } + + m_write_monitor = new ConnectionWriteMonitor( socketWriteTimeout ); + } + + + /** + * SSLConnection hash code. + */ + public int hashCode() { + // return my_port; + return m_socket.hashCode(); + } + + public boolean equals(Object obj) { + return obj instanceof SSLConnection && + ( ( SSLConnection )obj ).my_port == my_port; + } + + public String toString() { + if (m_str == null) { + if (m_mode == CLIENT_MODE) { + m_str = "Client SSLConnection at " + m_socket.toString(); + } else if (m_mode == SERVER_MODE) { + m_str = "Server SSLConnection at " + m_socket.toString(); + } else { + m_str = "Bidirectional SSLConnection at " + m_socket.toString(); + } + } + return m_str; + } + + /** + * Creates a new connection in SERVER_MODE. + * + * @param mngr + * the manager + * @param sock + * Socket created in the accept + * method in a ServerSocket object. + */ + public static SSLConnection serverConnection(IIOPConnectionManager mngr, + javax.net.ssl.SSLSocket sock) { + SSLConnection conn = new SSLConnection(mngr, sock); + conn.m_mode = SERVER_MODE; + conn.init(); + + if (conn.m_orb.m_trace != null) { + conn.m_orb.printTrace(Trace.DEBUG, "Creating " + conn.toString()); + } + + return conn; + } + + /** + * Creates a new connection in CLIENT_MODE. + */ + + public static SSLConnection clientConnection(IIOPConnectionManager mngr, + ListenPoint listen_point) + { + + String ssl_key_store_file = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + String ssl_key_store_passwd = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + + String ssl_key_store_type = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_type_name ) + .getValue(); + + String ssl_trust_store_file = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_file_name ) + .getValue(); + + String ssl_trust_store_passwd = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_passwd_name ) + .getValue(); + + String ssl_trust_store_type = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_type_name ) + .getValue(); + + String ssl_version = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_version_name ) + .getValue(); + + + SSLSocketFactory ssf = null; + + try { + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); // TODO: put in param + kmf.init(ks, ksPass); + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getSocketFactory(); + + } catch (java.lang.Exception e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + else { + ssf = (SSLSocketFactory) SSLSocketFactory.getDefault(); + } + // create the socket + SSLSocket socket = + (SSLSocket) ssf.createSocket(listen_point.m_host, listen_point.m_ssl_port); + + socket.startHandshake(); + + SSLConnection conn = new SSLConnection(mngr, socket); + conn.m_mode = CLIENT_MODE; + conn.m_initial_point = listen_point; + conn.addListenPoint(listen_point); + conn.init(); + return conn; + + } + catch (java.io.IOException ioe) { + throw new TRANSIENT(ioe.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + catch (java.lang.SecurityException sce) { + throw new NO_PERMISSION(sce.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + + protected void close() + { + try { + m_socket.close(); + } + catch (IOException ioe) {} + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, + toString() + + " client socket closed"); + + // notify the writers blocked in write_monitor + + m_write_monitor.setException(m_state.getError()); + + // notify the locks + + LockEnumeration enumer = m_lock_list.elements(); + Lock lock; + + while (enumer.hasMoreElements()) { + lock = enumer.next(); + synchronized (lock) { + lock.cancelWaiting(); + } + } + + AMILockEnumeration ami_enum = m_ami_lock_list.elements(); + AMILock ami_lock; + + while (ami_enum.hasMoreElements()) { + ami_lock = ami_enum.next(); + synchronized (ami_lock) { + ami_lock.notify(); + } + } + + if (m_addresses != null) { + m_addresses.clear(); + } + + // clear buffers + + Enumeration msgs = m_uncompleted_messages.elements(); + + while (msgs.hasMoreElements()) { + m_uncompleted_messages.remove(msgs.nextElement()); + } + + // send_buffer = null; + // send_header_buffer = null; + // receive_header_buffer = null; + } + + protected void dispatchRequest(GIOPLocateRequestMessage message) { + + ObjectKey obj_key; + obj_key = message.extractAddress().getObjectKey(); + + SSLLocateResponseHandler responseHandler; + responseHandler = new SSLLocateResponseHandler( + this, + message.getHeader().getVersion(), + message.getRequestId(), + obj_key + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + m_requests_in_POA.inc(); + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + } + + protected void dispatchRequest(GIOPRequestMessage message) { + + ServerRequestImpl serverRequest; + serverRequest = message.extractRequest(m_orb); + + ObjectKey objectKey; + objectKey = serverRequest.getTarget().getObjectKey(); + + SSLResponseHandler responseHandler; + responseHandler = new SSLResponseHandler( + this, + message.getHeader().getVersion(), + serverRequest, + objectKey, + message.getRequestInvocationPolicies() + + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * TODO: ask juan: in previous code, when reference has been located, + * if it's not local just returns... which should be the + * refactoring mapping since the POAKey is resolved outside, + * under ExecThread, and there's "no way?" to acces the object + * reference to check if either it's local or not + * Previous code + if (!obj_impl._is_local()) { + // oneway request to a non local object: DISCARD + return; + } + * */ + + if (serverRequest.withResponse()) { + m_requests_in_POA.inc(); + } + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + } + + public void read(byte[] buffer, int offset, int length) + { + try { + int numReadNow = 0; + + while (length > 0) { + + numReadNow = m_socket_in.read(buffer, offset, length); + if (numReadNow < 0) { + throw new COMM_FAILURE("Broken SSLConnection", 0, + CompletionStatus.COMPLETED_NO); + } + + offset += numReadNow; + length -= numReadNow; + + } + + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer) + { + try { + + m_socket_out.write(buffer, 0, buffer.length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer, int offset, int length) + { + try { + m_socket_out.write(buffer, offset, length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommLayer.java.svn-base new file mode 100644 index 0000000..288b75a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommLayer.java.svn-base @@ -0,0 +1,962 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 309 $ +* Date: $Date: 2008-11-07 09:54:08 +0100 (Fri, 07 Nov 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.Properties; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESOURCES; +import org.omg.CORBA.Object; + +import org.omg.SSLIOP.SSL; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * IIOP Communications layer. It will manage the request for a remote object + * using the IIOP Protocol. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SSLIOPCommLayer extends es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer +{ + + + /** + * Server Socket listening thread. + */ + SSLServerListener m_ssl_server_listener; + + private SSLIOPCommunicationLayerPropertiesInfo propertiesInfo; + + public SSLIOPCommLayer(TIDORB orb) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb, null); + + this.propertiesInfo = SSLIOPCommunicationLayerPropertiesInfo.getInstance(); + + orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + )); + + + } + + public boolean isLocal( IIOPIOR ior) + { + if (m_ssl_server_listener == null) // no object adaptor initialized + return false; + + // Check SSLComponent of IOR... + es.tid.TIDorbj.core.comm.ssliop.SSLComponent ior_ssl_component = + ior.profileIIOP().getSSLComponent(); + + if (ior_ssl_component == null) + return false; + + + org.omg.SSLIOP.SSL ssl = ior_ssl_component.getSSL(); + + es.tid.TIDorbj.core.comm.iiop.ListenPoint server_listen_point = + m_ssl_server_listener.getListenPoint(); + + es.tid.TIDorbj.core.comm.iiop.ListenPoint ior_listen_point = + ior.profileIIOP().getListenPoint(); + + return ( server_listen_point.m_host.equals(ior_listen_point.m_host) + && (server_listen_point.m_port == ssl.port) ); + + } + + public boolean hasServerListener() + { + return (m_ssl_server_listener != null); + } + + /** + * Sends a request (with response) allocating an active connection with the + * corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + protected void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + PolicyContext policy_context = request.getPolicyContext(); + + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendRequest(request, ior); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * Sends a request using the IIOP protocol. + * + * @param request + * the CORBA request. + */ + public void request(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws ForwardRequest + { + request.withResponse(true); + sendRequest(request, ior); + } + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void onewayRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + if ( reliable_oneway ) { + try { + ReliableOnewayThread th = + new ReliableOnewayThread(this, request, ior); + th.start(); + return; + } + catch (Throwable thw) { + throw new NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } else { + + try { + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + + conn = + m_connection_manager + .getSSLClientConnection(profile.getListenPoint(), + request.getPolicyContext()); + + conn.sendOnewayRequestAsync(request, ior); + + } + catch (Throwable th) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + "Exception in oneway remote invocation", + th); + } + } + } + + /** + * Sends a asynchronous request using the IIOP protocol allocating an active + * connection with the corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + public void asyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + request.withResponse(true); + + PolicyContext policy_context = request.getPolicyContext(); + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendAsyncRequest(request, ior); //*opc1*, ami_handler); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void reliableOnewayRun( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + PolicyContext policy_context = + request.getPolicyContext(); + + request.reliableOneway(true); + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + + conn = + m_connection_manager + .getSSLClientConnection(profile.getListenPoint(), + policy_context); + + conn.sendOnewayRequestSync(request, ior); + + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) + throw rcf.m_comm_failure; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication" + +" recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + + recover_count--; + + if (m_orb.m_trace != null) { + String[] msg = { "Communication forwarded: ", + fr.forward_reference.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + } + } + } + catch (Throwable e) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Exception in reliable remote oneway invocation :", + e); + } + } + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + */ + public boolean objectExists(IIOPIOR ior, + PolicyContext policy_context) + throws ForwardRequest + { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendLocateRequest(ior, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + org.omg.CORBA.portable.ObjectImpl obj = request.getTarget(); + es.tid.TIDorbj.core.comm.CommunicationDelegate delegate = + (es.tid.TIDorbj.core.comm.CommunicationDelegate) obj._get_delegate(); + es.tid.TIDorbj.core.iop.IOR ior = delegate.getReference(); + + IIOPIOR iiopIOR; + if ( ior instanceof IIOPIOR ){ + iiopIOR = ( IIOPIOR )ior; + } else { + throw new org.omg.CORBA.INTERNAL("Not an IIOP IOR."); + } + + PolicyContext policy_context = + delegate.createRequestPolicyContext(); + + IIOPProfile profile; + profile = iiopIOR.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + } + + SSLConnection conn = null; + int recover_count = max_recover_count; + + while (conn == null) { + + try { + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + } + + conn.prepareRequest(request, iiopIOR); + + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + CDROutputStream stream, + PolicyContext policy_context + ) throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn = null; + int recover_count = max_recover_count; + + while (true) { + try { + + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendRequest(ior, stream, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * ORB Server IIOPConnection part shutdown. + */ + public synchronized void shutdown() + { + try { + if (m_ssl_server_listener != null) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "Shutdown SSLIOPCommLayer .SSLServerListener"); + } + m_ssl_server_listener.shutdown(); + m_ssl_server_listener = null; + } + } + catch (Throwable e) {} + + ((es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer)this).shutdown(); + } + + /** + * IIOP Layer close. + */ + public synchronized void destroy() + { + if (!m_destroyed) { + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, "Destroying SSLIOPCommLayer"); + } + + try { + if (m_ssl_server_listener != null) { + m_ssl_server_listener.shutdown(); + m_ssl_server_listener = null; + } + } + catch (Throwable e) {} + + ((es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer)this).destroy(); + } + } + + public synchronized void initServerListener() + { + if (m_ssl_server_listener == null) { + m_ssl_server_listener = new SSLServerListener(m_connection_manager); + m_ssl_server_listener.setDaemon(false); + try { + + m_ssl_server_listener.start(); + + } + catch (Throwable thw) { + m_ssl_server_listener = null; + throw new org.omg.CORBA.NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } + + // Also init IIOP server listener. It will always repond "NO_PERMISSION" + super.initServerListener(); + + } + + public synchronized IOR createIOR(String id, + POAKey key, + TaggedComponent[] extraComponents) + { + if (m_ssl_server_listener == null) + throw new org.omg.CORBA.INTERNAL("SSLServerListener not initialized"); + + TaggedComponent[] components = null; + int num_components = 1; // SSLComponent + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + num_components]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + } else { + components = new TaggedComponent[num_components]; + } + + // Add SSLComponent + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) m_ssl_server_listener.getListenPoint().m_port); + + SSLComponent ssl_component = new SSLComponent(ssl); + components[num_components - 1] = ssl_component; + + + return super.createIOR(id, key, components); + + } + + public synchronized IOR createIOR(String id, + ObjectKey key, + TaggedComponent[] extraComponents) + { + if (m_ssl_server_listener == null) + throw new org.omg.CORBA.INTERNAL("SSLServerListener not initialized"); + + TaggedComponent[] components = null; + int num_components = 1; // SSLComponent + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + num_components]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + } else { + components = new TaggedComponent[num_components]; + } + + // Add SSLComponent + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) m_ssl_server_listener.getListenPoint().m_port); + + SSLComponent ssl_component = new SSLComponent(ssl); + components[num_components - 1] = ssl_component; + + return super.createIOR(id, key, components); + + } + + +// public synchronized ServiceContextList getBidirectionalService() +// { +// if (m_destroyed) +// throw new org.omg.CORBA.BAD_INV_ORDER("ORB is destroying"); + +// if (m_bidirectional_service == null) { +// if (m_ssl_server_listener == null) +// throw new INTERNAL("Trying to create a bidirectional context " +// + "without ListenPoint"); + +// BiDirServiceContext bidir_context = new BiDirServiceContext(1); + +// bidir_context.m_listen_points[0] = +// m_ssl_server_listener.getListenPoint(); + +// m_bidirectional_service = new ServiceContextList(1); +// m_bidirectional_service.m_components[0] = bidir_context; + +// } + +// return m_bidirectional_service; +// } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationDelegate.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationDelegate.java.svn-base new file mode 100644 index 0000000..50adff2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationDelegate.java.svn-base @@ -0,0 +1,366 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 391 $ +* Date: $Date: 2009-05-25 16:58:01 +0200 (Mon, 25 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.comm.iiop.CommunicationLayer; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * @author avega + * + */ +public class SSLIOPCommunicationDelegate extends CommunicationDelegate { + + private IIOPIOR ssliopReference; + private SSLIOPCommunicationLayer communicationLayer; + + /** + * + */ + public SSLIOPCommunicationDelegate( SSLIOPCommunicationLayer communicationLayer ) { + super(); + if ( communicationLayer != null ){ + super.setORB( communicationLayer.getORB() ); + this.communicationLayer = communicationLayer; + this.forwardReference = null; + } else { + throw new IllegalArgumentException( + "Parameter 'commLayer' cannot be null" + ); + } + } + + public void setReference(IOR ior) { + IIOPIOR iiopIOR = null; + if(! (ior instanceof IIOPIOR) ) { + iiopIOR = new IIOPIOR(ior); + + } else { + iiopIOR = (IIOPIOR) ior; + } + + super.setReference(iiopIOR); + + IIOPProfile profile = iiopIOR.profileIIOP(); + + PoliciesComponent policiesComponent = profile.getPoliciesComponent(); + + if(policiesComponent != null) { + this.setPolicyContext(policiesComponent.getPolicies()); + } + + + + }//setReference + + + public synchronized IIOPIOR getIIOPReference(){ + if ( this.ssliopReference == null ){ + this.ssliopReference = new IIOPIOR(); + this.ssliopReference.assign( super.reference ); + } + return this.ssliopReference; + } + + + public IOR getReference(){ + return getIIOPReference(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#isLocal(org.omg.CORBA.Object) + */ + public boolean isLocal( org.omg.CORBA.Object self) { + + if ( super.getORB() == null) { + throw new BAD_OPERATION("ORB Singleton", 0, + CompletionStatus.COMPLETED_NO ); + } + + try { + if ( this.forwardReference == null) { + return this.communicationLayer.isLocal( this.getIIOPReference() ); + } else { + return this.forwardReference.is_local(null); + } + } catch ( CommunicationException ce ) { + return false; + } + }//isLocal + + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#non_existent(org.omg.CORBA.Object) + */ + public boolean non_existent(org.omg.CORBA.Object self){ + TIDORB orb = super.getORB(); + if ( orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + PolicyContext request_policy_context = createRequestPolicyContext(); + + CommunicationLayer comm_layer = this.communicationLayer.getCommLayer(); + + try { + + if ( this.forwardReference == null) { + return !comm_layer.objectExists( + this.getIIOPReference(), + request_policy_context); + } else { // there is forwards + boolean non_existent = true; + try { + non_existent = this.forwardReference.non_existent(null); + } + catch (org.omg.CORBA.COMM_FAILURE cf) { + non_existent = true; + } + catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + non_existent = false; + } + + if (non_existent) { + this.forwardReference = null; + } + + return non_existent; + } + } catch (ForwardRequest fe) { + + this.setForward(fe); + + } + + return non_existent(self); + }//non_existent + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#duplicate(org.omg.CORBA.Object) + */ + public Object duplicate(Object self) { + SSLIOPCommunicationDelegate delegate; + delegate = new SSLIOPCommunicationDelegate( this.communicationLayer ); + delegate.setReference( this.getReference() ); + + delegate.forwardReference = this.forwardReference; + + //getPolicyContext never returns null. + delegate.setPolicyContext( super.getPolicyContext().duplicate() ); + + ObjectImpl obj = new ObjectImpl(); + + obj._set_delegate(delegate); + + return obj; + }//duplicate + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release(org.omg.CORBA.Object) + */ + public void release(org.omg.CORBA.Object self) { + //Empty treatment + }//release + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release_reply(org.omg.CORBA.Object, org.omg.CORBA.portable.InputStream) + */ + public void release_reply(org.omg.CORBA.Object object, + org.omg.CORBA.portable.InputStream inputStream ) { + //Empty treatment + }//release_reply + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl) + */ + public void prepareRequest( StreamRequestImpl request ) { + this.communicationLayer.getCommLayer().prepareRequest( request ); + }//prepareRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#onewayRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void onewayRequest(RequestImpl request) { + if ( this.forwardReference != null ) { + this.forwardReference.onewayRequest(request); + } else { + this.communicationLayer.getCommLayer().onewayRequest( request, this.getIIOPReference() ); + } + }//oneWayRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(es.tid.TIDorbj.core.RequestImpl) + */ + public void invoke(RequestImpl request) { + try { + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().request( + request, + (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.invoke(request); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + invoke(request); + + }//forwarded + }//invoke + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) + */ + public InputStream invoke(org.omg.CORBA.Object object, + OutputStream stream ) + throws ApplicationException, RemarshalException + { + + if (is_local(object)) { + throw new BAD_OPERATION("Request is only valid for remote objects"); + } + + if (stream instanceof es.tid.TIDorbj.core.cdr.CDROutputStream) { + + es.tid.TIDorbj.core.cdr.CDROutputStream out = + (es.tid.TIDorbj.core.cdr.CDROutputStream) stream; + try { + if ( this.forwardReference == null) { + return this.communicationLayer.getCommLayer().request( + (IIOPIOR)this.getReference(), + out, + createRequestPolicyContext() + ); + } else { + return this.forwardReference.invoke(object, stream); + } + + } + catch (es.tid.TIDorbj.core.comm.ForwardRequest fr) { + this.setForward(fr); + throw new org.omg.CORBA.portable.RemarshalException(); + } + } else { + throw new org.omg.CORBA.BAD_OPERATION("Not a TIDorbJ's Stream"); + } + }//invoke stream + + // AMI callback operations + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#asyncRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void asyncRequest(RequestImpl request, Object ami_handler ) { + try { + request.set_ami_handler(ami_handler); + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().asyncRequest( + request, (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.asyncRequest(request, ami_handler); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + asyncRequest(request, ami_handler); + + }//forwarded + }//asyncRequest + + + + + +}//SSLIOPCommunicationDelegate diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayer.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayer.java.svn-base new file mode 100644 index 0000000..b3b0cbc --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayer.java.svn-base @@ -0,0 +1,398 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 274 $ +* Date: $Date: 2008-04-12 16:33:40 +0200 (Sat, 12 Apr 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.Properties; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationLayer; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.RequestDispatcher; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.CommLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +/** + * Entry point for the SSLIOPCommunicationLayer + * + * @author + * + * + */ +public class SSLIOPCommunicationLayer implements CommunicationLayer { + + public static String ID = "SSLIOPCommunicationLayer"; + + /* + * used for incoming requests notifications + */ + private RequestDispatcher dispatcher; + + /* + * the underlying ORB implementation + */ + private TIDORB orb; + + private CommLayer commLayer; + + private SSLIOPCommunicationLayerPropertiesInfo propertiesInfo; + + /** + * + */ + public SSLIOPCommunicationLayer() { + IIOPCommunicationLayer.ID = "SSLIOPCommunicationLayer"; + } + + public void setORB(TIDORB orb) { + if ( orb != null ){ + if ( this.orb != null ){ + this.commLayer.shutdown(); + this.propertiesInfo = null; + this.commLayer = null; + } + this.orb = orb; + this.propertiesInfo = SSLIOPCommunicationLayerPropertiesInfo.getInstance(); + this.orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + ) + ); + + + this.commLayer = new CommLayer( this.orb ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public CommLayer getCommLayer(){ + return this.commLayer; + } + + + public void setServerModeEnabled( boolean value ){ + if ( value ){ + this.commLayer.getExternalLayer().initServerListener(); + } + } + + public boolean isServerModeEnabled(){ + return this.commLayer.getExternalLayer().hasServerListener(); + } + + public synchronized ServiceContextList getBidirectionalService() { + return this.commLayer.getExternalLayer().getBidirectionalService(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String) + */ + public CommunicationDelegate createDelegate(String url) throws CommunicationException { + CommunicationDelegate delegate; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorb:" ) ){ + ior = Corbaloc.getIOR( url ); + } else if ( url.startsWith( "corbaloc:ssliop:" )) { + ior = SSLIOPCorbaloc.getIOR( url ); + } else if ( url.startsWith( "corbaloc:" )) { + ior = IIOPCorbaloc.getIOR( url ); + } else { + ior = IIOPIOR.fromString(this.orb, url); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + delegate = createDelegate( ior ); + } else { + delegate = null; + } + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String, java.util.Properties) + */ + public CommunicationDelegate createDelegate(String url, Properties info) + throws CommunicationException + { + return createDelegate( url ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR) + */ + public CommunicationDelegate createDelegate(IOR ior) + throws CommunicationException + { + SSLIOPCommunicationDelegate delegate = new SSLIOPCommunicationDelegate( this ); + delegate.setReference( ior ); + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR, java.util.Properties) + */ + public CommunicationDelegate createDelegate(IOR ior, Properties info) + throws CommunicationException + { + return createDelegate( ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(java.lang.String) + */ + public boolean accepts(String url) + throws CommunicationException + { + return url!= null && + ( url.startsWith( "corbaloc:ssliop:" ) || + url.startsWith( "corbaloc:tidorb:" ) || + url.startsWith( "corbaloc::" ) || + ( + url.startsWith( "IOR" ) && + this.accepts( DefaultIOR.fromString( this.orb, url ) ) + ) + ); + }//accepts + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(org.omg.IOP.IOR) + */ + public boolean accepts(IOR ior) + throws CommunicationException + { + boolean accepted; + accepted = ior instanceof IIOPIOR; + + int profilesCount = ior.memberCount(); + for (int i = 0; !accepted && i < profilesCount; i++) { + accepted = ior.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value; + } + + return accepted; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createIOR(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public IOR createIOR(String repositoryId, + ObjectKey key, + TaggedComponent[] components) + throws CommunicationException + { + return this.commLayer.getExternalLayer().createIOR( + repositoryId, + key, + components + ); + }//createIOR + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createURL(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public String createURL(String repositoryId, ObjectKey key) + throws CommunicationException + { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(es.tid.TIDorbj.core.iop.IOR) + */ + public String getInitialReference( IOR ior ) + throws CommunicationException + { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(java.lang.String) + */ + public String getInitialReference( String url ) + throws CommunicationException + { + String initialReference; + try { + initialReference = IIOPCorbaloc.getObjectId( url ); + } catch ( Throwable th ){ + initialReference = null; + } + return initialReference; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(es.tid.TIDorbj.core.iop.IOR) + */ + public boolean isLocal(IOR ior) + throws CommunicationException + { + return ior != null && this.accepts( ior ) && this.commLayer.isLocal( (IIOPIOR)ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(java.lang.String) + */ + public boolean isLocal(String url) throws CommunicationException { + boolean isLocal; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorbj:" ) ){ + ior = Corbaloc.getIOR( url ); + } else { + ior = IIOPCorbaloc.getIOR( url ); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + isLocal = this.isLocal( ior ); + } else { + isLocal = false; + } + return isLocal; + }//isLocal + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getPropertyInfo(java.lang.String, java.util.Properties) + */ + public PropertyInfo[] getPropertiesInfo() { + return ( PropertyInfo[] )this.propertiesInfo.map.entrySet().toArray( new PropertyInfo[0] ); + }//getPropertiInfo + + public PropertyInfo getPropertyInfo( String name){ + return ( PropertyInfo )this.propertiesInfo.map.get( name ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMajorVersion() + */ + public int getMajorVersion() { + return 1; + }//getMajorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMinorVersion() + */ + public int getMinorVersion() { + return 0; + }//getMinorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getId() + */ + public String getId() { + return SSLIOPCommunicationLayer.ID; + } + + public String toString(){ + + String hostSpec; + hostSpec = this.propertiesInfo.hostName.value; + if ( hostSpec == null ){ + hostSpec = this.propertiesInfo.hostAddress.value; + } + if ( hostSpec == null ){ + try { + hostSpec = java.net.InetAddress.getLocalHost().getHostName(); + } + catch (Exception e) {} + } + + StringBuffer toString = new StringBuffer( "[ " ) + .append( SSLIOPCommunicationLayer.ID ) + .append( " ( ssliop://" ) // TODO: change to ssliop:// + .append( hostSpec ) + .append( ':' ) + .append( this.propertiesInfo.ssl_port.value ) + .append( " )" ) + .append( " ]"); + + return toString.toString(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#shutdown(boolean) + */ + public void shutdown( boolean waitForCompletion ) { + if ( this.commLayer != null ){ + if ( waitForCompletion ){ + this.commLayer.shutdown(); + } else { + this.commLayer.destroy(); + } + this.commLayer = null; + } + } + + + /** + * PRIVATE METHODS + * @author avega + */ + + public void dump(java.io.PrintWriter writer){ + this.propertiesInfo.dump(writer); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayerPropertiesInfo.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayerPropertiesInfo.java.svn-base new file mode 100644 index 0000000..c7d6142 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCommunicationLayerPropertiesInfo.java.svn-base @@ -0,0 +1,292 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 274 $ +* Date: $Date: 2008-04-12 16:33:40 +0200 (Sat, 12 Apr 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; + +/** + * @author avega + * + * + * + */ +public class SSLIOPCommunicationLayerPropertiesInfo + extends IIOPCommunicationLayerPropertiesInfo{ + + + + /* + * Key Store options + */ + public final static String DEFAULT_SSL_KEY_STORE_FILE = null; + + public final static String ssl_key_store_file_name = + "es.tid.TIDorbj.ssliop.key_store_file"; + + + public final static String DEFAULT_SSL_KEY_STORE_PASSWD = null; + + public final static String ssl_key_store_passwd_name = + "es.tid.TIDorbj.ssliop.key_store_passwd"; + + + public final static String DEFAULT_SSL_KEY_STORE_TYPE = "JKS"; + + public final static String ssl_key_store_type_name = + "es.tid.TIDorbj.ssliop.key_store_type"; + + + /* + * TrustManager options + */ + public final static String DEFAULT_SSL_TRUST_STORE_FILE = null; + + public final static String ssl_trust_store_file_name = + "es.tid.TIDorbj.ssliop.trust_store_file"; + + + public final static String DEFAULT_SSL_TRUST_STORE_PASSWD = null; + + public final static String ssl_trust_store_passwd_name = + "es.tid.TIDorbj.ssliop.trust_store_passwd"; + + + public final static String DEFAULT_SSL_TRUST_STORE_TYPE = "JKS"; + + public final static String ssl_trust_store_type_name = + "es.tid.TIDorbj.ssliop.trust_store_type"; + + + /** + * SSL port used for generated IORs and URLs. Default value: 0 + */ + public final static String DEFAULT_SSL_PORT = "0"; + + public final static String ssl_port_name = + "es.tid.TIDorbj.ssliop.port"; + + + + + /** + * SSL version to be used by SSLIOP layer + * SSLv2 is not recomended due to security flaws + * Values must be 0 (SSLv2), 1 (SSLv3), 2 (SSLv23), 3 (TLSv1) + * Default value: 2 + */ + public final static String DEFAULT_SSL_VERSION = "SSLv3"; + + public final static String ssl_version_name = + "es.tid.TIDorbj.ssliop.ssl_version"; + + + + public PropertyInfo ssl_key_store_file; + public PropertyInfo ssl_key_store_passwd; + public PropertyInfo ssl_key_store_type; /* JKS or PKCS12 */ + + public PropertyInfo ssl_trust_store_file; + public PropertyInfo ssl_trust_store_passwd; + public PropertyInfo ssl_trust_store_type; /* JKS or PKCS12 */ + + public PropertyInfo ssl_port; + public PropertyInfo ssl_version; + + //public HashMap map; + + public SSLIOPCommunicationLayerPropertiesInfo() { + + super(); + + // TODO: resize map ?? + + /** + * SSL KEY STORE FILE + */ + ssl_key_store_file = new PropertyInfo( + ssl_key_store_file_name, + DEFAULT_SSL_KEY_STORE_FILE + ); + ssl_key_store_file.setDescription( + "Key Store file name." + ); + ssl_key_store_file.setRequired( false ); + ssl_key_store_file.setChoices ( null ); + map.put( ssl_key_store_file_name, ssl_key_store_file ); + + + /** + * SSL KEY STORE PASSWD + */ + ssl_key_store_passwd = new PropertyInfo( + ssl_key_store_passwd_name, + DEFAULT_SSL_KEY_STORE_PASSWD + ); + ssl_key_store_passwd.setDescription( + "Key Store passwd." + ); + ssl_key_store_passwd.setRequired( false ); + ssl_key_store_passwd.setChoices ( null ); + map.put( ssl_key_store_passwd_name, ssl_key_store_passwd ); + + + /** + * SSL TRUST STORE TYPE + */ + ssl_key_store_type = new PropertyInfo( + ssl_key_store_type_name, + DEFAULT_SSL_KEY_STORE_TYPE + ); + ssl_key_store_passwd.setDescription( + "Key Store type." + ); + ssl_key_store_passwd.setRequired( false ); + ssl_key_store_passwd.setChoices ( new String[]{ "JKS", "PCKS12" } ); + map.put( ssl_key_store_type_name, ssl_key_store_type ); + + + + + /** + * SSL TRUST STORE FILE + */ + ssl_trust_store_file = new PropertyInfo( + ssl_trust_store_file_name, + DEFAULT_SSL_TRUST_STORE_FILE + ); + ssl_trust_store_file.setDescription( + "Trust Store file name." + ); + ssl_trust_store_file.setRequired( false ); + ssl_trust_store_file.setChoices ( null ); + map.put( ssl_trust_store_file_name, ssl_trust_store_file ); + + + /** + * SSL TRUST STORE PASSWD + */ + ssl_trust_store_passwd = new PropertyInfo( + ssl_trust_store_passwd_name, + DEFAULT_SSL_TRUST_STORE_PASSWD + ); + ssl_trust_store_passwd.setDescription( + "Key Store passwd." + ); + ssl_trust_store_passwd.setRequired( false ); + ssl_trust_store_passwd.setChoices ( null ); + map.put( ssl_trust_store_passwd_name, ssl_trust_store_passwd ); + + + /** + * SSL TRUST STORE TYPE + */ + ssl_trust_store_type = new PropertyInfo( + ssl_trust_store_type_name, + DEFAULT_SSL_TRUST_STORE_TYPE + ); + ssl_trust_store_passwd.setDescription( + "Trust Store type." + ); + ssl_trust_store_passwd.setRequired( false ); + ssl_trust_store_passwd.setChoices ( new String[]{ "JKS", "PCKS12" } ); + map.put( ssl_trust_store_type_name, ssl_trust_store_type ); + + + + /** + * SSL PORT + */ + ssl_port = new PropertyInfo( + ssl_port_name, + DEFAULT_SSL_PORT + ); + ssl_port.setDescription( + "SSL port." + ); + ssl_port.setRequired( false ); + ssl_port.setChoices ( null ); + map.put( ssl_port_name, ssl_port ); + + + /** + * SSL VERSION + */ + ssl_version = new PropertyInfo( + ssl_version_name, + DEFAULT_SSL_VERSION + ); + ssl_version.setDescription( + "SSL Version" + ); + ssl_version.setRequired( false ); + ssl_version.setChoices ( new String[]{ "SSLv2", "SSLv3", "SSLv23", "TLSv1" } ); + map.put( ssl_version_name, ssl_version ); + + + + } + + public static SSLIOPCommunicationLayerPropertiesInfo getInstance(){ + return new SSLIOPCommunicationLayerPropertiesInfo(); + } + + public void dump(java.io.PrintWriter writer) + { + writer.println("SSLIOPCommunicationLayer properties:"); + + Iterator it = map.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry e = (Map.Entry)it.next(); + writer.print('\t'); + writer.print(e.getKey()); + writer.print('='); + writer.print( ((PropertyInfo)e.getValue()).getValue()); + writer.println(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCorbaloc.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCorbaloc.java.svn-base new file mode 100644 index 0000000..dfa6513 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLIOPCorbaloc.java.svn-base @@ -0,0 +1,202 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.StringTokenizer; + +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +import org.omg.SSLIOP.SSL; +import org.omg.CSIIOP.*; + +public class SSLIOPCorbaloc +{ + + public static String getObjectId(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, path, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:ssliop:")) { + corbaloc = corbaloc_URL.substring(16); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + return corbaloc.substring(slashposition + 1); + } + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, url_key, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:ssliop:")) { + corbaloc = corbaloc_URL.substring(16); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + url_key = corbaloc.substring(slashposition + 1); + + ObjectKey objectkey = createKey(url_key); + + + // Add to components a new SSLComponent with a listenpoint port as SSL + TaggedComponent[] components = new TaggedComponent[1]; + + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) listener.m_port); + SSLComponent ssl_component = new SSLComponent(ssl); + components[0] = ssl_component; + + listener.m_ssl_port = listener.m_port; + listener.m_port = 0; // not used + + + profiles = new IIOPProfile[1]; + + //profiles[0] = new IIOPProfile(version, listener, objectkey, null); + profiles[0] = new IIOPProfile(version, listener, objectkey, components); + + return new IIOPIOR("", profiles); + } + + /** + * Simulates an usual ObjectKey, that is marshaled in an Encapsulation, but + * instead, the url ObjectKey is marshaled as a ulong value (the size) and + * the char array of the string (without the end of string character *. + * + * @param url + * @return + * @throws org.omg.CORBA.ORBPackage.InvalidName + */ + private static ObjectKey createKey(String url_key) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + CDROutputStream output = + new CDROutputStream(null, + new byte[url_key.length() + CDR.ULONG_SIZE]); + + char[] url_buffer = url_key.toCharArray(); + + output.write_ulong(url_buffer.length); + output.write_char_array(url_buffer, 0, url_buffer.length); + + CDRInputStream input = (CDRInputStream) output.create_input_stream(); + + Encapsulation encap = input.readEncapsulation(); + + return new ObjectKey(encap); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..4e2ef90 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLLocateResponseHandler.java.svn-base @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.LocateResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + */ +public class SSLLocateResponseHandler extends QueuedLocateResponseHandler implements LocateResponseHandler { + + private SSLConnection conn; + private GIOPVersion version; + private RequestId requestId; + private ObjectKey objectKey; + + + public SSLLocateResponseHandler( SSLConnection conn, + GIOPVersion version, + RequestId requestId, + ObjectKey objectKey) + { + setConnection( conn ); + setVersion ( version ); + setRequestId ( requestId ); + setObjectKey ( objectKey ); + } + + public void setConnection( SSLConnection conn ){ + this.conn = conn; + } + + public SSLConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setRequestId( RequestId requestId ){ + this.requestId = requestId; + } + + public RequestId getRequestId(){ + return this.requestId; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + throw new INTERNAL("Not supported"); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, reference ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, e ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#setResponseValue(boolean) + */ + public void submitResponse( boolean value ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, value ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLResponseHandler.java.svn-base new file mode 100644 index 0000000..6d65d39 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLResponseHandler.java.svn-base @@ -0,0 +1,193 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + + +/** + * ResponseHandler implementation for the IIOPCommunicationLayer + * + * @author jprojas + * + */ +public class SSLResponseHandler extends QueuedResponseHandler implements ResponseHandler { + + private SSLConnection conn; + private GIOPVersion version; + private ServerRequestImpl serverRequest; + private ObjectKey objectKey; + private PolicyContext policySupplier; + + public SSLResponseHandler( SSLConnection conn, + GIOPVersion version, + ServerRequestImpl + serverRequest, + ObjectKey objectKey, + PolicyContext policySupplier){ + setConnection( conn ); + setVersion( version ); + setServerRequest( serverRequest ); + setObjectKey( objectKey ); + setPolicyContext( policySupplier ); + } + + public void setConnection( SSLConnection conn ){ + this.conn = conn; + } + + public SSLConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setServerRequest( ServerRequestImpl serverRequest ){ + this.serverRequest = serverRequest; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + /** + * @param policySupplier The policySupplier to set. + */ + public void setPolicyContext(PolicyContext policySupplier) + { + this.policySupplier = policySupplier; + } + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + return this.policySupplier; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.serverRequest.setForward( reference ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + if( this.serverRequest.withResponse() ) { + this.serverRequest.setSystemException( e ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.conn.sendReply( this.serverRequest, this.policySupplier ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /** + * remove from here + * @author jprojas + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLServerListener.java.svn-base b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLServerListener.java.svn-base new file mode 100644 index 0000000..014b03d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/.svn/text-base/SSLServerListener.java.svn-base @@ -0,0 +1,462 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 379 $ +* Date: $Date: 2009-04-07 12:17:19 +0200 (Tue, 07 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2010 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.net.InetAddress; +import java.net.Socket; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLContext; + +import java.security.KeyStore; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.TrustManagerFactory; + +import java.io.FileInputStream; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.Trace; + +import org.omg.SSLIOP.SSL; +import org.omg.CSIIOP.*; + + +public class SSLServerListener extends Thread +{ + + /** + * SSLServerSocket state + */ + + boolean m_shutdowned; + + boolean m_connected; + + /** + * SSLServerSocket where the communication layer will accept connections. This + * socket will be only avalilable when a the ORB's run method + * had been invoked. + */ + SSLServerSocket m_server_socket; + + /** + * Conection manager. + */ + IIOPConnectionManager m_manager; + + + /** + * Listen point where the SSLServerSocket will be listening. This + * point(host,port) will be used to create de local IOR's. + */ + ListenPoint m_listen_point; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + ServiceContextList m_bidirectional_service; + + es.tid.TIDorbj.core.TIDORB m_orb; + + String hostAddress; + String hostName; + int port; + int backlog; + int reconnect; + GIOPVersion giopVersion; + + String ssl_key_store_file; + String ssl_key_store_passwd; + String ssl_key_store_type; + + String ssl_trust_store_file; + String ssl_trust_store_passwd; + String ssl_trust_store_type; + + String ssl_version; + + + public SSLServerListener(IIOPConnectionManager manager) + { + m_shutdowned = true; + m_connected = false; + + this.m_manager = manager; + m_orb = manager.orb(); + + this.hostAddress = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS ) + .getValue(); + this.hostName = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_NAME ) + .getValue(); +// this.port = +// m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) +// .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.PORT ) +// .getInt(); + this.backlog = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_BACKLOG ) + .getInt(); + this.reconnect = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_RECONNECT ) + .getInt(); + this.giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + + // SSL options + + this.ssl_key_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + this.ssl_key_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + + this.ssl_key_store_type = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_type_name ) + .getValue(); + + this.ssl_trust_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_file_name ) + .getValue(); + + this.ssl_trust_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_passwd_name ) + .getValue(); + + this.ssl_trust_store_type = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_type_name ) + .getValue(); + + this.ssl_version = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_version_name ) + .getValue(); + + // port is ssl_port + this.port = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_port_name ) + .getInt(); + + + + + + + + SSLServerSocketFactory ssf = null; + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, ksPass); + + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getServerSocketFactory(); + + } catch (Exception e) { + throw new org.omg.CORBA.INITIALIZE("Can init SSLServerSocketFactory: " + + e.toString() ); + } + + } else { + // TODO: bad initialized?? + ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + } + + try { + if ( hostAddress == null) { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + this.port , + this.backlog ); + + } else { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + this.port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + + if ( this.hostName != null) { + m_listen_point = new ListenPoint( + this.hostName , + m_server_socket.getLocalPort() + ); + } else { + m_listen_point = new ListenPoint( + InetAddress.getLocalHost().getHostAddress(), + m_server_socket.getLocalPort() + ); + } + + m_shutdowned = false; + m_connected = true; + + } + catch (java.io.IOException e) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open SSLServerSocket: " + e.toString() + ); + } + + m_orb.printTrace( + Trace.DEBUG, "SSLServerListener connected at: " + m_listen_point.toString() + ); + } + + public ListenPoint getListenPoint() { + return m_listen_point; + } + + public synchronized void shutdown() { + if (!m_shutdowned) { + m_shutdowned = true; + try { + m_server_socket.close(); + } catch (Throwable th) {} + + m_server_socket = null; + + m_orb.printTrace( + Trace.DEBUG, "SSLServerListener at " + m_listen_point.toString() + " shutdown!" + ); + } + } + + public synchronized void resetServerSocket() { + if (!m_shutdowned) { + try { + if (m_server_socket != null) + m_server_socket.close(); + } + catch (Throwable th) {} + + SSLServerSocketFactory ssf = null; + + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, ksPass); + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getServerSocketFactory(); + + if ( this.hostAddress == null) { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + m_listen_point.m_port, + this.backlog + ); + } else { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + m_listen_point.m_port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + } catch (Throwable th) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open SSLServerSocket: " + th.toString() + ); + } + + } else { + ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + } + } + } + + public void run() + { + while (!m_shutdowned) { + while (m_connected) { + + Socket client_socket = null; + try { + client_socket = m_server_socket.accept(); + } catch (Throwable se) { + + if ( m_shutdowned ){ + return; + } + + m_connected = false; + + m_orb.printTrace( + Trace.ERROR, "Error in SSLServerSocket.accept(): ", se + ); + } + + try { + if (client_socket != null) { + m_manager.createSSLServerConnection((SSLSocket)client_socket); + } + } catch (Throwable e) { + try { + client_socket.close(); + } catch (Throwable t) {} + + m_orb.printTrace( + Trace.ERROR, "Error creating SSLServerConnection: ", e + ); + } + } + + if ((!m_connected) && (!m_shutdowned)) { + + // RECONNECT + + //printTrace will check for a trace handler existence + m_orb.printTrace( Trace.DEBUG, "Trying to reconnect server socket "); + + try { + resetServerSocket(); + m_connected = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, "SSLServerSocket reconnected" + ); + } + } catch (Throwable th) { + m_orb.printTrace( + Trace.ERROR, "SSLServerSocket reconnect error: ", th + ); + try { + Thread.sleep( this.reconnect ); + } catch (InterruptedException e) {} + } + } + } + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.java new file mode 100644 index 0000000..02258d2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLComponent.java @@ -0,0 +1,195 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.SSLIOP.SSL; +import org.omg.SSLIOP.SSLHelper; + + +/** + * SSLComponent data struct defined in the GIOP Module. + * + * @autor avega + * @version 1.0 + */ +public class SSLComponent extends TaggedComponent +{ + + private SSL m_ssl; + + public SSLComponent() + { + super(TAG_SSL_SEC_TRANS.value); + m_ssl = new SSL(); + } + + public SSLComponent(SSL ssl) + { + super(TAG_SSL_SEC_TRANS.value); + m_ssl = ssl; + } + + + public short getTargetSupports() + { + return m_ssl.target_supports; + } + + + public short getTargetRequires() + { + return m_ssl.target_requires; + } + + + public short getSSLPort() + { + return m_ssl.port; + } + + + public SSL getSSL() + { + return m_ssl; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + SSLHelper.write(out, m_ssl); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_ssl = SSLHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("port: "); + if (m_ssl.port < 0) { + int myint = 65536 + m_ssl.port; + print_buffer.print(myint); + } + else { + print_buffer.print(m_ssl.port); + } + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("target_supports: "); + print_buffer.print(print_AssociationOptions(m_ssl.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("target_requires: "); + print_buffer.print(print_AssociationOptions(m_ssl.target_requires)); + return buffer.toString(); + } + + + public static String print_AssociationOptions(int mask) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + if ( (mask & org.omg.Security.NoProtection.value) > 0) { + print_buffer.print("\n \t \t \t NoProtection"); + } + if ( (mask & org.omg.Security.Integrity.value) > 0) { + print_buffer.print("\n \t \t \t Integrity"); + } + if ( (mask & org.omg.Security.Confidentiality.value) > 0) { + print_buffer.print("\n \t \t \t Confidentiality"); + } + if ( (mask & org.omg.Security.DetectReplay.value) > 0) { + print_buffer.print("\n \t \t \t DetectReplay"); + } + if ( (mask & org.omg.Security.DetectMisordering.value) > 0) { + print_buffer.print("\n \t \t \t DetectMisordering"); + } + if ( (mask & org.omg.Security.EstablishTrustInTarget.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInTarget"); + } + if ( (mask & org.omg.Security.EstablishTrustInClient.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInClient"); + } + if ( (mask & org.omg.Security.NoDelegation.value) > 0) { + print_buffer.print("\n \t \t \t NoDelegation"); + } + if ( (mask & org.omg.Security.SimpleDelegation.value) > 0) { + print_buffer.print("\n \t \t \t SimpleDelegation"); + } + if ( (mask & org.omg.Security.CompositeDelegation.value) > 0) { + print_buffer.print("\n \t \t \t CompositeDelegation"); + } + if ( (mask & org.omg.CSIIOP.IdentityAssertion.value) > 0) { + print_buffer.print("\n \t \t \t IdentityAssertion"); + } + if ( (mask & org.omg.CSIIOP.DelegationByClient.value) > 0) { + print_buffer.print("\n \t \t \t DelegationByClient"); + } + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.java new file mode 100644 index 0000000..ce5015b --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLConnection.java @@ -0,0 +1,577 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.io.IOException; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.SSLContext; + +import java.security.KeyStore; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.TrustManagerFactory; + +import java.io.FileInputStream; + +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.Bounds; +import org.omg.CORBA.COMM_FAILURE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_PERMISSION; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.TRANSIENT; +import org.omg.CORBA.INITIALIZE; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ReplyHandlerStub; +import org.omg.Compression.COMPRESSORID_NONE; +import org.omg.Compression.CompressorIdLevel; +import org.omg.Compression.COMPRESSORID_ZLIB; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.NamedValueImpl; +import es.tid.TIDorbj.core.ORBComponent; +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.Connection; +import es.tid.TIDorbj.core.comm.CommunicationManager; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.AddressingDisposition; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.GIOPCancelRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPHeader; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPLocateRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPRequestMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.comm.giop.LocateReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.MessageFactory; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.giop.ZIOPMessage; +import es.tid.TIDorbj.core.comm.iiop.*; + +import es.tid.TIDorbj.core.ziop.ZIOP; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.AMILock; +import es.tid.TIDorbj.core.messaging.AMILockEnumeration; +import es.tid.TIDorbj.core.messaging.AMILockList; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.core.util.Counter; +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.RemovableObject; +import es.tid.TIDorbj.core.util.UseTable; +import es.tid.TIDorbj.util.Trace; + +/** + * TIDorb SSLIOP SSLConnection: sends and receives IIOP Messages under the GIOP + * protocol. + * + *

+ * Copyright 2000 Telefónica I+D. Printed in Spain (Europe). All Rights + * Reserved. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SSLConnection extends Connection { + + /** + * SSLConnection Socket. + */ + javax.net.ssl.SSLSocket m_socket; + + /** + * SSLConnection Socket InputStream. + */ + public java.io.InputStream m_socket_in; + + /** + * SSLConnection Socket OutputStream. + */ + public java.io.OutputStream m_socket_out; + + private boolean tcpNoDelay; + private int soTimeout; + private int soLinger; + + private int socketWriteTimeout; + + String ssl_key_store_file; + String ssl_key_store_passwd; + String ssl_version; + + + private SSLConnection(IIOPConnectionManager mngr, javax.net.ssl.SSLSocket socket) + { + super(mngr); + + m_manager = mngr; + + + m_addresses = new Hashtable(); + m_bidirectional_service = null; + m_send_bidirectional_service = false; + + tcpNoDelay = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.TCP_NODELAY ) + .getBoolean(); + + soTimeout = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_TIMEOUT ) + .getInt(); + + soLinger = m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_LINGER ) + .getInt(); + + socketWriteTimeout = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SOCKET_WRITE_TIMEOUT ) + .getInt(); + + + try { + this.m_socket = socket; + + my_port = socket.getLocalPort(); + + socket.setTcpNoDelay( tcpNoDelay ); + socket.setSoTimeout( soTimeout ); + + socket.setSoLinger( soLinger != -1, soLinger ); + + m_socket_in = socket.getInputStream(); + m_socket_out = socket.getOutputStream(); + } + catch (java.io.IOException ioe) { + throw new OBJECT_NOT_EXIST(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + } + + m_write_monitor = new ConnectionWriteMonitor( socketWriteTimeout ); + } + + + /** + * SSLConnection hash code. + */ + public int hashCode() { + // return my_port; + return m_socket.hashCode(); + } + + public boolean equals(Object obj) { + return obj instanceof SSLConnection && + ( ( SSLConnection )obj ).my_port == my_port; + } + + public String toString() { + if (m_str == null) { + if (m_mode == CLIENT_MODE) { + m_str = "Client SSLConnection at " + m_socket.toString(); + } else if (m_mode == SERVER_MODE) { + m_str = "Server SSLConnection at " + m_socket.toString(); + } else { + m_str = "Bidirectional SSLConnection at " + m_socket.toString(); + } + } + return m_str; + } + + /** + * Creates a new connection in SERVER_MODE. + * + * @param mngr + * the manager + * @param sock + * Socket created in the accept + * method in a ServerSocket object. + */ + public static SSLConnection serverConnection(IIOPConnectionManager mngr, + javax.net.ssl.SSLSocket sock) { + SSLConnection conn = new SSLConnection(mngr, sock); + conn.m_mode = SERVER_MODE; + conn.init(); + + if (conn.m_orb.m_trace != null) { + conn.m_orb.printTrace(Trace.DEBUG, "Creating " + conn.toString()); + } + + return conn; + } + + /** + * Creates a new connection in CLIENT_MODE. + */ + + public static SSLConnection clientConnection(IIOPConnectionManager mngr, + ListenPoint listen_point) + { + + String ssl_key_store_file = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + String ssl_key_store_passwd = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + + String ssl_key_store_type = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_type_name ) + .getValue(); + + String ssl_trust_store_file = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_file_name ) + .getValue(); + + String ssl_trust_store_passwd = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_passwd_name ) + .getValue(); + + String ssl_trust_store_type = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_type_name ) + .getValue(); + + String ssl_version = + mngr.orb().getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_version_name ) + .getValue(); + + + SSLSocketFactory ssf = null; + + try { + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); // TODO: put in param + kmf.init(ks, ksPass); + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getSocketFactory(); + + } catch (java.lang.Exception e) { + throw new INITIALIZE(e.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + else { + ssf = (SSLSocketFactory) SSLSocketFactory.getDefault(); + } + // create the socket + SSLSocket socket = + (SSLSocket) ssf.createSocket(listen_point.m_host, listen_point.m_ssl_port); + + socket.startHandshake(); + + SSLConnection conn = new SSLConnection(mngr, socket); + conn.m_mode = CLIENT_MODE; + conn.m_initial_point = listen_point; + conn.addListenPoint(listen_point); + conn.init(); + return conn; + + } + catch (java.io.IOException ioe) { + throw new TRANSIENT(ioe.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + catch (java.lang.SecurityException sce) { + throw new NO_PERMISSION(sce.toString(), 0, + CompletionStatus.COMPLETED_NO); + } + + } + + + protected void close() + { + try { + m_socket.close(); + } + catch (IOException ioe) {} + + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEEP_DEBUG, + toString() + + " client socket closed"); + + // notify the writers blocked in write_monitor + + m_write_monitor.setException(m_state.getError()); + + // notify the locks + + LockEnumeration enumer = m_lock_list.elements(); + Lock lock; + + while (enumer.hasMoreElements()) { + lock = enumer.next(); + synchronized (lock) { + lock.cancelWaiting(); + } + } + + AMILockEnumeration ami_enum = m_ami_lock_list.elements(); + AMILock ami_lock; + + while (ami_enum.hasMoreElements()) { + ami_lock = ami_enum.next(); + synchronized (ami_lock) { + ami_lock.notify(); + } + } + + if (m_addresses != null) { + m_addresses.clear(); + } + + // clear buffers + + Enumeration msgs = m_uncompleted_messages.elements(); + + while (msgs.hasMoreElements()) { + m_uncompleted_messages.remove(msgs.nextElement()); + } + + // send_buffer = null; + // send_header_buffer = null; + // receive_header_buffer = null; + } + + protected void dispatchRequest(GIOPLocateRequestMessage message) { + + ObjectKey obj_key; + obj_key = message.extractAddress().getObjectKey(); + + SSLLocateResponseHandler responseHandler; + responseHandler = new SSLLocateResponseHandler( + this, + message.getHeader().getVersion(), + message.getRequestId(), + obj_key + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + m_requests_in_POA.inc(); + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + + } + + protected void dispatchRequest(GIOPRequestMessage message) { + + ServerRequestImpl serverRequest; + serverRequest = message.extractRequest(m_orb); + + ObjectKey objectKey; + objectKey = serverRequest.getTarget().getObjectKey(); + + SSLResponseHandler responseHandler; + responseHandler = new SSLResponseHandler( + this, + message.getHeader().getVersion(), + serverRequest, + objectKey, + message.getRequestInvocationPolicies() + + ); + + responseHandler.setSerial(m_orb.getRequestCounter().next()); + + /* + * TODO: ask juan: in previous code, when reference has been located, + * if it's not local just returns... which should be the + * refactoring mapping since the POAKey is resolved outside, + * under ExecThread, and there's "no way?" to acces the object + * reference to check if either it's local or not + * Previous code + if (!obj_impl._is_local()) { + // oneway request to a non local object: DISCARD + return; + } + * */ + + if (serverRequest.withResponse()) { + m_requests_in_POA.inc(); + } + CommunicationManager.getInstance( this.m_orb ) + .getRequestDispatcher().dispatchRequest( responseHandler ); + } + + public void read(byte[] buffer, int offset, int length) + { + try { + int numReadNow = 0; + + while (length > 0) { + + numReadNow = m_socket_in.read(buffer, offset, length); + if (numReadNow < 0) { + throw new COMM_FAILURE("Broken SSLConnection", 0, + CompletionStatus.COMPLETED_NO); + } + + offset += numReadNow; + length -= numReadNow; + + } + + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer) + { + try { + + m_socket_out.write(buffer, 0, buffer.length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + protected void write(byte[] buffer, int offset, int length) + { + try { + m_socket_out.write(buffer, offset, length); + m_socket_out.flush(); + } + catch (IOException ioe) { + COMM_FAILURE connection_error = + new COMM_FAILURE(ioe.toString(), + 0, + CompletionStatus.COMPLETED_NO); + closeByBrokenConnection(connection_error); + + throw connection_error; + } + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.java new file mode 100644 index 0000000..288b75a --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommLayer.java @@ -0,0 +1,962 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 309 $ +* Date: $Date: 2008-11-07 09:54:08 +0100 (Fri, 07 Nov 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.Properties; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_RESOURCES; +import org.omg.CORBA.Object; + +import org.omg.SSLIOP.SSL; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.BiDirServiceContext; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * IIOP Communications layer. It will manage the request for a remote object + * using the IIOP Protocol. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SSLIOPCommLayer extends es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer +{ + + + /** + * Server Socket listening thread. + */ + SSLServerListener m_ssl_server_listener; + + private SSLIOPCommunicationLayerPropertiesInfo propertiesInfo; + + public SSLIOPCommLayer(TIDORB orb) + { + // crear la conexion servidora y lanzar threads de escucha + super(orb, null); + + this.propertiesInfo = SSLIOPCommunicationLayerPropertiesInfo.getInstance(); + + orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + )); + + + } + + public boolean isLocal( IIOPIOR ior) + { + if (m_ssl_server_listener == null) // no object adaptor initialized + return false; + + // Check SSLComponent of IOR... + es.tid.TIDorbj.core.comm.ssliop.SSLComponent ior_ssl_component = + ior.profileIIOP().getSSLComponent(); + + if (ior_ssl_component == null) + return false; + + + org.omg.SSLIOP.SSL ssl = ior_ssl_component.getSSL(); + + es.tid.TIDorbj.core.comm.iiop.ListenPoint server_listen_point = + m_ssl_server_listener.getListenPoint(); + + es.tid.TIDorbj.core.comm.iiop.ListenPoint ior_listen_point = + ior.profileIIOP().getListenPoint(); + + return ( server_listen_point.m_host.equals(ior_listen_point.m_host) + && (server_listen_point.m_port == ssl.port) ); + + } + + public boolean hasServerListener() + { + return (m_ssl_server_listener != null); + } + + /** + * Sends a request (with response) allocating an active connection with the + * corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + protected void sendRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + PolicyContext policy_context = request.getPolicyContext(); + + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendRequest(request, ior); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * Sends a request using the IIOP protocol. + * + * @param request + * the CORBA request. + */ + public void request(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + throws ForwardRequest + { + request.withResponse(true); + sendRequest(request, ior); + } + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void onewayRequest(es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior) + { + if ( reliable_oneway ) { + try { + ReliableOnewayThread th = + new ReliableOnewayThread(this, request, ior); + th.start(); + return; + } + catch (Throwable thw) { + throw new NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } else { + + try { + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + + conn = + m_connection_manager + .getSSLClientConnection(profile.getListenPoint(), + request.getPolicyContext()); + + conn.sendOnewayRequestAsync(request, ior); + + } + catch (Throwable th) { + if (m_orb.m_trace != null) + m_orb.printTrace(Trace.DEBUG, + "Exception in oneway remote invocation", + th); + } + } + } + + /** + * Sends a asynchronous request using the IIOP protocol allocating an active + * connection with the corresponding server referenced by its target address. + *

+ * If necessary, tries to do a recovery loop. + * + * @param request + * the CORBA request. + */ + public void asyncRequest(es.tid.TIDorbj.core.RequestImpl request, IIOPIOR ior) + throws ForwardRequest + { + + request.withResponse(true); + + PolicyContext policy_context = request.getPolicyContext(); + + // PolicyContext policy_context = request + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL( "Can not get IIOP Profile." ); + } + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context + ); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + {"Can not recover the communication any more: ", + ce.toString() }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + conn.sendAsyncRequest(request, ior); //*opc1*, ami_handler); + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + rcf.m_comm_failure.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + recover_time + + " milliseconds."); + } + + try { + Thread.sleep( recover_time ); + } + catch (InterruptedException e) {} + + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + + /** + * Sends a oneway request using the IIOP protocol allocating an active + * IIOPConnection with the server referenced in the request target address. + * + * @param request + * the CORBA request. + */ + public void reliableOnewayRun( + es.tid.TIDorbj.core.RequestImpl request, + IIOPIOR ior ) { + try { + + PolicyContext policy_context = + request.getPolicyContext(); + + request.reliableOneway(true); + + request.withResponse(false); + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + + conn = + m_connection_manager + .getSSLClientConnection(profile.getListenPoint(), + policy_context); + + conn.sendOnewayRequestSync(request, ior); + + return; + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) + throw rcf.m_comm_failure; + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication" + +" recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + + recover_count--; + + if (m_orb.m_trace != null) { + String[] msg = { "Communication forwarded: ", + fr.forward_reference.toString() }; + m_orb.printTrace(Trace.DEBUG, msg); + } + } + } + } + catch (Throwable e) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Exception in reliable remote oneway invocation :", + e); + } + } + + /** + * Sends a object existence request. + * + * @param ior + * the object IOR. + */ + public boolean objectExists(IIOPIOR ior, + PolicyContext policy_context) + throws ForwardRequest + { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn; + int recover_count = max_recover_count; + + // recovering loop + + while (true) { + + try { + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendLocateRequest(ior, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + public void prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl request) + { + org.omg.CORBA.portable.ObjectImpl obj = request.getTarget(); + es.tid.TIDorbj.core.comm.CommunicationDelegate delegate = + (es.tid.TIDorbj.core.comm.CommunicationDelegate) obj._get_delegate(); + es.tid.TIDorbj.core.iop.IOR ior = delegate.getReference(); + + IIOPIOR iiopIOR; + if ( ior instanceof IIOPIOR ){ + iiopIOR = ( IIOPIOR )ior; + } else { + throw new org.omg.CORBA.INTERNAL("Not an IIOP IOR."); + } + + PolicyContext policy_context = + delegate.createRequestPolicyContext(); + + IIOPProfile profile; + profile = iiopIOR.profileIIOP(); + + if (profile == null) { + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + } + + SSLConnection conn = null; + int recover_count = max_recover_count; + + while (conn == null) { + + try { + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = + { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE -> Communication " + + "recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + } + + conn.prepareRequest(request, iiopIOR); + + } + + public org.omg.CORBA.portable.InputStream request( + IIOPIOR ior, + CDROutputStream stream, + PolicyContext policy_context + ) throws ForwardRequest, + org.omg.CORBA.portable.ApplicationException, + org.omg.CORBA.portable.RemarshalException { + + IIOPProfile profile = ior.profileIIOP(); + + if (profile == null) + throw new org.omg.CORBA.INTERNAL("Can not get IIOP Profile."); + + SSLConnection conn = null; + int recover_count = max_recover_count; + + while (true) { + try { + + conn = + m_connection_manager.getSSLClientConnection( + profile.getListenPoint(), + policy_context); + + } + catch (org.omg.CORBA.COMM_FAILURE ce) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) { + String[] msg = { + "Can not recover the communication any more: ", + ce.toString() + }; + + m_orb.printTrace(Trace.DEBUG, msg); + } + + throw ce; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + continue; + } + + try { + + return conn.sendRequest(ior, stream, policy_context); + + } + catch (RECOVERABLE_COMM_FAILURE rcf) { + + recover_count--; + + if (recover_count <= 0) { + if (m_orb.m_trace != null) + m_orb.printTrace( + Trace.DEBUG, + "Can not recover the communication any more: ", + rcf.m_comm_failure); + + throw rcf.m_comm_failure; + } + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, + "CORBA::COMM_FAILURE->Communication recovered, waiting " + + this.recover_time + + " milliseconds."); + } + + try { + Thread.sleep( this.recover_time ); + } + catch (InterruptedException e) {} + + } + catch (ForwardRequest fr) { + throw fr; + } + catch (RuntimeException re) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.ERROR, + "Exception in remote invocation", re); + } + throw re; + } + } + } + + /** + * ORB Server IIOPConnection part shutdown. + */ + public synchronized void shutdown() + { + try { + if (m_ssl_server_listener != null) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, + "Shutdown SSLIOPCommLayer .SSLServerListener"); + } + m_ssl_server_listener.shutdown(); + m_ssl_server_listener = null; + } + } + catch (Throwable e) {} + + ((es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer)this).shutdown(); + } + + /** + * IIOP Layer close. + */ + public synchronized void destroy() + { + if (!m_destroyed) { + + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEBUG, "Destroying SSLIOPCommLayer"); + } + + try { + if (m_ssl_server_listener != null) { + m_ssl_server_listener.shutdown(); + m_ssl_server_listener = null; + } + } + catch (Throwable e) {} + + ((es.tid.TIDorbj.core.comm.iiop.IIOPCommLayer)this).destroy(); + } + } + + public synchronized void initServerListener() + { + if (m_ssl_server_listener == null) { + m_ssl_server_listener = new SSLServerListener(m_connection_manager); + m_ssl_server_listener.setDaemon(false); + try { + + m_ssl_server_listener.start(); + + } + catch (Throwable thw) { + m_ssl_server_listener = null; + throw new org.omg.CORBA.NO_RESOURCES("Can't create thread: " + + thw.toString()); + } + } + + // Also init IIOP server listener. It will always repond "NO_PERMISSION" + super.initServerListener(); + + } + + public synchronized IOR createIOR(String id, + POAKey key, + TaggedComponent[] extraComponents) + { + if (m_ssl_server_listener == null) + throw new org.omg.CORBA.INTERNAL("SSLServerListener not initialized"); + + TaggedComponent[] components = null; + int num_components = 1; // SSLComponent + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + num_components]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + } else { + components = new TaggedComponent[num_components]; + } + + // Add SSLComponent + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) m_ssl_server_listener.getListenPoint().m_port); + + SSLComponent ssl_component = new SSLComponent(ssl); + components[num_components - 1] = ssl_component; + + + return super.createIOR(id, key, components); + + } + + public synchronized IOR createIOR(String id, + ObjectKey key, + TaggedComponent[] extraComponents) + { + if (m_ssl_server_listener == null) + throw new org.omg.CORBA.INTERNAL("SSLServerListener not initialized"); + + TaggedComponent[] components = null; + int num_components = 1; // SSLComponent + + if(extraComponents != null) { + components = new TaggedComponent[extraComponents.length + num_components]; + System.arraycopy(extraComponents, 0, components, 0, extraComponents.length); + } else { + components = new TaggedComponent[num_components]; + } + + // Add SSLComponent + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) m_ssl_server_listener.getListenPoint().m_port); + + SSLComponent ssl_component = new SSLComponent(ssl); + components[num_components - 1] = ssl_component; + + return super.createIOR(id, key, components); + + } + + +// public synchronized ServiceContextList getBidirectionalService() +// { +// if (m_destroyed) +// throw new org.omg.CORBA.BAD_INV_ORDER("ORB is destroying"); + +// if (m_bidirectional_service == null) { +// if (m_ssl_server_listener == null) +// throw new INTERNAL("Trying to create a bidirectional context " +// + "without ListenPoint"); + +// BiDirServiceContext bidir_context = new BiDirServiceContext(1); + +// bidir_context.m_listen_points[0] = +// m_ssl_server_listener.getListenPoint(); + +// m_bidirectional_service = new ServiceContextList(1); +// m_bidirectional_service.m_components[0] = bidir_context; + +// } + +// return m_bidirectional_service; +// } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.java new file mode 100644 index 0000000..50adff2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationDelegate.java @@ -0,0 +1,366 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 391 $ +* Date: $Date: 2009-05-25 16:58:01 +0200 (Mon, 25 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Object; +import org.omg.CORBA.portable.ApplicationException; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; +import org.omg.CORBA.portable.RemarshalException; + +import es.tid.TIDorbj.core.ObjectImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.StreamRequestImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.comm.iiop.CommunicationLayer; + +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * @author avega + * + */ +public class SSLIOPCommunicationDelegate extends CommunicationDelegate { + + private IIOPIOR ssliopReference; + private SSLIOPCommunicationLayer communicationLayer; + + /** + * + */ + public SSLIOPCommunicationDelegate( SSLIOPCommunicationLayer communicationLayer ) { + super(); + if ( communicationLayer != null ){ + super.setORB( communicationLayer.getORB() ); + this.communicationLayer = communicationLayer; + this.forwardReference = null; + } else { + throw new IllegalArgumentException( + "Parameter 'commLayer' cannot be null" + ); + } + } + + public void setReference(IOR ior) { + IIOPIOR iiopIOR = null; + if(! (ior instanceof IIOPIOR) ) { + iiopIOR = new IIOPIOR(ior); + + } else { + iiopIOR = (IIOPIOR) ior; + } + + super.setReference(iiopIOR); + + IIOPProfile profile = iiopIOR.profileIIOP(); + + PoliciesComponent policiesComponent = profile.getPoliciesComponent(); + + if(policiesComponent != null) { + this.setPolicyContext(policiesComponent.getPolicies()); + } + + + + }//setReference + + + public synchronized IIOPIOR getIIOPReference(){ + if ( this.ssliopReference == null ){ + this.ssliopReference = new IIOPIOR(); + this.ssliopReference.assign( super.reference ); + } + return this.ssliopReference; + } + + + public IOR getReference(){ + return getIIOPReference(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#isLocal(org.omg.CORBA.Object) + */ + public boolean isLocal( org.omg.CORBA.Object self) { + + if ( super.getORB() == null) { + throw new BAD_OPERATION("ORB Singleton", 0, + CompletionStatus.COMPLETED_NO ); + } + + try { + if ( this.forwardReference == null) { + return this.communicationLayer.isLocal( this.getIIOPReference() ); + } else { + return this.forwardReference.is_local(null); + } + } catch ( CommunicationException ce ) { + return false; + } + }//isLocal + + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#non_existent(org.omg.CORBA.Object) + */ + public boolean non_existent(org.omg.CORBA.Object self){ + TIDORB orb = super.getORB(); + if ( orb == null) { + throw new BAD_OPERATION("ORB Singleton"); + } + + PolicyContext request_policy_context = createRequestPolicyContext(); + + CommunicationLayer comm_layer = this.communicationLayer.getCommLayer(); + + try { + + if ( this.forwardReference == null) { + return !comm_layer.objectExists( + this.getIIOPReference(), + request_policy_context); + } else { // there is forwards + boolean non_existent = true; + try { + non_existent = this.forwardReference.non_existent(null); + } + catch (org.omg.CORBA.COMM_FAILURE cf) { + non_existent = true; + } + catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + non_existent = false; + } + + if (non_existent) { + this.forwardReference = null; + } + + return non_existent; + } + } catch (ForwardRequest fe) { + + this.setForward(fe); + + } + + return non_existent(self); + }//non_existent + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#duplicate(org.omg.CORBA.Object) + */ + public Object duplicate(Object self) { + SSLIOPCommunicationDelegate delegate; + delegate = new SSLIOPCommunicationDelegate( this.communicationLayer ); + delegate.setReference( this.getReference() ); + + delegate.forwardReference = this.forwardReference; + + //getPolicyContext never returns null. + delegate.setPolicyContext( super.getPolicyContext().duplicate() ); + + ObjectImpl obj = new ObjectImpl(); + + obj._set_delegate(delegate); + + return obj; + }//duplicate + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release(org.omg.CORBA.Object) + */ + public void release(org.omg.CORBA.Object self) { + //Empty treatment + }//release + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#release_reply(org.omg.CORBA.Object, org.omg.CORBA.portable.InputStream) + */ + public void release_reply(org.omg.CORBA.Object object, + org.omg.CORBA.portable.InputStream inputStream ) { + //Empty treatment + }//release_reply + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#prepareRequest(es.tid.TIDorbj.core.StreamRequestImpl) + */ + public void prepareRequest( StreamRequestImpl request ) { + this.communicationLayer.getCommLayer().prepareRequest( request ); + }//prepareRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#onewayRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void onewayRequest(RequestImpl request) { + if ( this.forwardReference != null ) { + this.forwardReference.onewayRequest(request); + } else { + this.communicationLayer.getCommLayer().onewayRequest( request, this.getIIOPReference() ); + } + }//oneWayRequest + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(es.tid.TIDorbj.core.RequestImpl) + */ + public void invoke(RequestImpl request) { + try { + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().request( + request, + (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.invoke(request); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + invoke(request); + + }//forwarded + }//invoke + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#invoke(org.omg.CORBA.Object, org.omg.CORBA.portable.OutputStream) + */ + public InputStream invoke(org.omg.CORBA.Object object, + OutputStream stream ) + throws ApplicationException, RemarshalException + { + + if (is_local(object)) { + throw new BAD_OPERATION("Request is only valid for remote objects"); + } + + if (stream instanceof es.tid.TIDorbj.core.cdr.CDROutputStream) { + + es.tid.TIDorbj.core.cdr.CDROutputStream out = + (es.tid.TIDorbj.core.cdr.CDROutputStream) stream; + try { + if ( this.forwardReference == null) { + return this.communicationLayer.getCommLayer().request( + (IIOPIOR)this.getReference(), + out, + createRequestPolicyContext() + ); + } else { + return this.forwardReference.invoke(object, stream); + } + + } + catch (es.tid.TIDorbj.core.comm.ForwardRequest fr) { + this.setForward(fr); + throw new org.omg.CORBA.portable.RemarshalException(); + } + } else { + throw new org.omg.CORBA.BAD_OPERATION("Not a TIDorbJ's Stream"); + } + }//invoke stream + + // AMI callback operations + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationDelegate#asyncRequest(es.tid.TIDorbj.core.RequestImpl) + */ + public void asyncRequest(RequestImpl request, Object ami_handler ) { + try { + request.set_ami_handler(ami_handler); + if ( this.forwardReference == null ) { + this.communicationLayer.getCommLayer().asyncRequest( + request, (IIOPIOR)this.getReference() + ); + } else { + // there is forwards + this.forwardReference.asyncRequest(request, ami_handler); + + } + } catch (org.omg.CORBA.COMM_FAILURE cf) { + this.forwardReference = null; + throw cf; + } catch (org.omg.CORBA.OBJECT_NOT_EXIST one) { + this.forwardReference = null; + throw one; + } catch (ForwardRequest fe) { + + this.setForward(fe); + + request.setPolicyContext(this.forwardReference.createRequestPolicyContext()); + + asyncRequest(request, ami_handler); + + }//forwarded + }//asyncRequest + + + + + +}//SSLIOPCommunicationDelegate diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.java new file mode 100644 index 0000000..b3b0cbc --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayer.java @@ -0,0 +1,398 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 274 $ +* Date: $Date: 2008-04-12 16:33:40 +0200 (Sat, 12 Apr 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.Properties; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.CommunicationLayer; +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.RequestDispatcher; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.CommLayer; +import es.tid.TIDorbj.core.comm.iiop.IIOPCorbaloc; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +/** + * Entry point for the SSLIOPCommunicationLayer + * + * @author + * + * + */ +public class SSLIOPCommunicationLayer implements CommunicationLayer { + + public static String ID = "SSLIOPCommunicationLayer"; + + /* + * used for incoming requests notifications + */ + private RequestDispatcher dispatcher; + + /* + * the underlying ORB implementation + */ + private TIDORB orb; + + private CommLayer commLayer; + + private SSLIOPCommunicationLayerPropertiesInfo propertiesInfo; + + /** + * + */ + public SSLIOPCommunicationLayer() { + IIOPCommunicationLayer.ID = "SSLIOPCommunicationLayer"; + } + + public void setORB(TIDORB orb) { + if ( orb != null ){ + if ( this.orb != null ){ + this.commLayer.shutdown(); + this.propertiesInfo = null; + this.commLayer = null; + } + this.orb = orb; + this.propertiesInfo = SSLIOPCommunicationLayerPropertiesInfo.getInstance(); + this.orb.m_conf.fillPropertyInfo( + (PropertyInfo[]) + this.propertiesInfo.map.values().toArray( + new PropertyInfo[]{} + ) + ); + + + this.commLayer = new CommLayer( this.orb ); + } else { + throw new IllegalArgumentException( "Parameter 'orb' cannot be null" ); + } + }//setORB + + public TIDORB getORB() { + return this.orb; + }//getORB + + public CommLayer getCommLayer(){ + return this.commLayer; + } + + + public void setServerModeEnabled( boolean value ){ + if ( value ){ + this.commLayer.getExternalLayer().initServerListener(); + } + } + + public boolean isServerModeEnabled(){ + return this.commLayer.getExternalLayer().hasServerListener(); + } + + public synchronized ServiceContextList getBidirectionalService() { + return this.commLayer.getExternalLayer().getBidirectionalService(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String) + */ + public CommunicationDelegate createDelegate(String url) throws CommunicationException { + CommunicationDelegate delegate; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorb:" ) ){ + ior = Corbaloc.getIOR( url ); + } else if ( url.startsWith( "corbaloc:ssliop:" )) { + ior = SSLIOPCorbaloc.getIOR( url ); + } else if ( url.startsWith( "corbaloc:" )) { + ior = IIOPCorbaloc.getIOR( url ); + } else { + ior = IIOPIOR.fromString(this.orb, url); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + delegate = createDelegate( ior ); + } else { + delegate = null; + } + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#connect(java.lang.String, java.util.Properties) + */ + public CommunicationDelegate createDelegate(String url, Properties info) + throws CommunicationException + { + return createDelegate( url ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR) + */ + public CommunicationDelegate createDelegate(IOR ior) + throws CommunicationException + { + SSLIOPCommunicationDelegate delegate = new SSLIOPCommunicationDelegate( this ); + delegate.setReference( ior ); + return delegate; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createDelegate(es.tid.TIDorbj.core.iop.IOR, java.util.Properties) + */ + public CommunicationDelegate createDelegate(IOR ior, Properties info) + throws CommunicationException + { + return createDelegate( ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(java.lang.String) + */ + public boolean accepts(String url) + throws CommunicationException + { + return url!= null && + ( url.startsWith( "corbaloc:ssliop:" ) || + url.startsWith( "corbaloc:tidorb:" ) || + url.startsWith( "corbaloc::" ) || + ( + url.startsWith( "IOR" ) && + this.accepts( DefaultIOR.fromString( this.orb, url ) ) + ) + ); + }//accepts + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#accepts(org.omg.IOP.IOR) + */ + public boolean accepts(IOR ior) + throws CommunicationException + { + boolean accepted; + accepted = ior instanceof IIOPIOR; + + int profilesCount = ior.memberCount(); + for (int i = 0; !accepted && i < profilesCount; i++) { + accepted = ior.getProfile( i ).tag == org.omg.IOP.TAG_INTERNET_IOP.value; + } + + return accepted; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createIOR(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public IOR createIOR(String repositoryId, + ObjectKey key, + TaggedComponent[] components) + throws CommunicationException + { + return this.commLayer.getExternalLayer().createIOR( + repositoryId, + key, + components + ); + }//createIOR + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#createURL(java.lang.String, es.tid.TIDorbj.core.comm.iiop.ObjectKey) + */ + public String createURL(String repositoryId, ObjectKey key) + throws CommunicationException + { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(es.tid.TIDorbj.core.iop.IOR) + */ + public String getInitialReference( IOR ior ) + throws CommunicationException + { + throw new NO_IMPLEMENT(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getInitialReference(java.lang.String) + */ + public String getInitialReference( String url ) + throws CommunicationException + { + String initialReference; + try { + initialReference = IIOPCorbaloc.getObjectId( url ); + } catch ( Throwable th ){ + initialReference = null; + } + return initialReference; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(es.tid.TIDorbj.core.iop.IOR) + */ + public boolean isLocal(IOR ior) + throws CommunicationException + { + return ior != null && this.accepts( ior ) && this.commLayer.isLocal( (IIOPIOR)ior ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#isLocal(java.lang.String) + */ + public boolean isLocal(String url) throws CommunicationException { + boolean isLocal; + if ( this.accepts( url ) ){ + IOR ior; + try { + if ( url.startsWith( "corbaloc:tidorbj:" ) ){ + ior = Corbaloc.getIOR( url ); + } else { + ior = IIOPCorbaloc.getIOR( url ); + } + } catch ( InvalidName in ){ + throw new CommunicationException( "Invalid url: " + in.getMessage(), in ); + } + isLocal = this.isLocal( ior ); + } else { + isLocal = false; + } + return isLocal; + }//isLocal + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getPropertyInfo(java.lang.String, java.util.Properties) + */ + public PropertyInfo[] getPropertiesInfo() { + return ( PropertyInfo[] )this.propertiesInfo.map.entrySet().toArray( new PropertyInfo[0] ); + }//getPropertiInfo + + public PropertyInfo getPropertyInfo( String name){ + return ( PropertyInfo )this.propertiesInfo.map.get( name ); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMajorVersion() + */ + public int getMajorVersion() { + return 1; + }//getMajorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getMinorVersion() + */ + public int getMinorVersion() { + return 0; + }//getMinorVersion + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#getId() + */ + public String getId() { + return SSLIOPCommunicationLayer.ID; + } + + public String toString(){ + + String hostSpec; + hostSpec = this.propertiesInfo.hostName.value; + if ( hostSpec == null ){ + hostSpec = this.propertiesInfo.hostAddress.value; + } + if ( hostSpec == null ){ + try { + hostSpec = java.net.InetAddress.getLocalHost().getHostName(); + } + catch (Exception e) {} + } + + StringBuffer toString = new StringBuffer( "[ " ) + .append( SSLIOPCommunicationLayer.ID ) + .append( " ( ssliop://" ) // TODO: change to ssliop:// + .append( hostSpec ) + .append( ':' ) + .append( this.propertiesInfo.ssl_port.value ) + .append( " )" ) + .append( " ]"); + + return toString.toString(); + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.CommunicationLayer#shutdown(boolean) + */ + public void shutdown( boolean waitForCompletion ) { + if ( this.commLayer != null ){ + if ( waitForCompletion ){ + this.commLayer.shutdown(); + } else { + this.commLayer.destroy(); + } + this.commLayer = null; + } + } + + + /** + * PRIVATE METHODS + * @author avega + */ + + public void dump(java.io.PrintWriter writer){ + this.propertiesInfo.dump(writer); + } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.java new file mode 100644 index 0000000..c7d6142 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCommunicationLayerPropertiesInfo.java @@ -0,0 +1,292 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 274 $ +* Date: $Date: 2008-04-12 16:33:40 +0200 (Sat, 12 Apr 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefnica Investigacin y Desarrollo +* S.A.Unipersonal (Telefnica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import es.tid.TIDorbj.core.comm.PropertyInfo; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayerPropertiesInfo; + +/** + * @author avega + * + * + * + */ +public class SSLIOPCommunicationLayerPropertiesInfo + extends IIOPCommunicationLayerPropertiesInfo{ + + + + /* + * Key Store options + */ + public final static String DEFAULT_SSL_KEY_STORE_FILE = null; + + public final static String ssl_key_store_file_name = + "es.tid.TIDorbj.ssliop.key_store_file"; + + + public final static String DEFAULT_SSL_KEY_STORE_PASSWD = null; + + public final static String ssl_key_store_passwd_name = + "es.tid.TIDorbj.ssliop.key_store_passwd"; + + + public final static String DEFAULT_SSL_KEY_STORE_TYPE = "JKS"; + + public final static String ssl_key_store_type_name = + "es.tid.TIDorbj.ssliop.key_store_type"; + + + /* + * TrustManager options + */ + public final static String DEFAULT_SSL_TRUST_STORE_FILE = null; + + public final static String ssl_trust_store_file_name = + "es.tid.TIDorbj.ssliop.trust_store_file"; + + + public final static String DEFAULT_SSL_TRUST_STORE_PASSWD = null; + + public final static String ssl_trust_store_passwd_name = + "es.tid.TIDorbj.ssliop.trust_store_passwd"; + + + public final static String DEFAULT_SSL_TRUST_STORE_TYPE = "JKS"; + + public final static String ssl_trust_store_type_name = + "es.tid.TIDorbj.ssliop.trust_store_type"; + + + /** + * SSL port used for generated IORs and URLs. Default value: 0 + */ + public final static String DEFAULT_SSL_PORT = "0"; + + public final static String ssl_port_name = + "es.tid.TIDorbj.ssliop.port"; + + + + + /** + * SSL version to be used by SSLIOP layer + * SSLv2 is not recomended due to security flaws + * Values must be 0 (SSLv2), 1 (SSLv3), 2 (SSLv23), 3 (TLSv1) + * Default value: 2 + */ + public final static String DEFAULT_SSL_VERSION = "SSLv3"; + + public final static String ssl_version_name = + "es.tid.TIDorbj.ssliop.ssl_version"; + + + + public PropertyInfo ssl_key_store_file; + public PropertyInfo ssl_key_store_passwd; + public PropertyInfo ssl_key_store_type; /* JKS or PKCS12 */ + + public PropertyInfo ssl_trust_store_file; + public PropertyInfo ssl_trust_store_passwd; + public PropertyInfo ssl_trust_store_type; /* JKS or PKCS12 */ + + public PropertyInfo ssl_port; + public PropertyInfo ssl_version; + + //public HashMap map; + + public SSLIOPCommunicationLayerPropertiesInfo() { + + super(); + + // TODO: resize map ?? + + /** + * SSL KEY STORE FILE + */ + ssl_key_store_file = new PropertyInfo( + ssl_key_store_file_name, + DEFAULT_SSL_KEY_STORE_FILE + ); + ssl_key_store_file.setDescription( + "Key Store file name." + ); + ssl_key_store_file.setRequired( false ); + ssl_key_store_file.setChoices ( null ); + map.put( ssl_key_store_file_name, ssl_key_store_file ); + + + /** + * SSL KEY STORE PASSWD + */ + ssl_key_store_passwd = new PropertyInfo( + ssl_key_store_passwd_name, + DEFAULT_SSL_KEY_STORE_PASSWD + ); + ssl_key_store_passwd.setDescription( + "Key Store passwd." + ); + ssl_key_store_passwd.setRequired( false ); + ssl_key_store_passwd.setChoices ( null ); + map.put( ssl_key_store_passwd_name, ssl_key_store_passwd ); + + + /** + * SSL TRUST STORE TYPE + */ + ssl_key_store_type = new PropertyInfo( + ssl_key_store_type_name, + DEFAULT_SSL_KEY_STORE_TYPE + ); + ssl_key_store_passwd.setDescription( + "Key Store type." + ); + ssl_key_store_passwd.setRequired( false ); + ssl_key_store_passwd.setChoices ( new String[]{ "JKS", "PCKS12" } ); + map.put( ssl_key_store_type_name, ssl_key_store_type ); + + + + + /** + * SSL TRUST STORE FILE + */ + ssl_trust_store_file = new PropertyInfo( + ssl_trust_store_file_name, + DEFAULT_SSL_TRUST_STORE_FILE + ); + ssl_trust_store_file.setDescription( + "Trust Store file name." + ); + ssl_trust_store_file.setRequired( false ); + ssl_trust_store_file.setChoices ( null ); + map.put( ssl_trust_store_file_name, ssl_trust_store_file ); + + + /** + * SSL TRUST STORE PASSWD + */ + ssl_trust_store_passwd = new PropertyInfo( + ssl_trust_store_passwd_name, + DEFAULT_SSL_TRUST_STORE_PASSWD + ); + ssl_trust_store_passwd.setDescription( + "Key Store passwd." + ); + ssl_trust_store_passwd.setRequired( false ); + ssl_trust_store_passwd.setChoices ( null ); + map.put( ssl_trust_store_passwd_name, ssl_trust_store_passwd ); + + + /** + * SSL TRUST STORE TYPE + */ + ssl_trust_store_type = new PropertyInfo( + ssl_trust_store_type_name, + DEFAULT_SSL_TRUST_STORE_TYPE + ); + ssl_trust_store_passwd.setDescription( + "Trust Store type." + ); + ssl_trust_store_passwd.setRequired( false ); + ssl_trust_store_passwd.setChoices ( new String[]{ "JKS", "PCKS12" } ); + map.put( ssl_trust_store_type_name, ssl_trust_store_type ); + + + + /** + * SSL PORT + */ + ssl_port = new PropertyInfo( + ssl_port_name, + DEFAULT_SSL_PORT + ); + ssl_port.setDescription( + "SSL port." + ); + ssl_port.setRequired( false ); + ssl_port.setChoices ( null ); + map.put( ssl_port_name, ssl_port ); + + + /** + * SSL VERSION + */ + ssl_version = new PropertyInfo( + ssl_version_name, + DEFAULT_SSL_VERSION + ); + ssl_version.setDescription( + "SSL Version" + ); + ssl_version.setRequired( false ); + ssl_version.setChoices ( new String[]{ "SSLv2", "SSLv3", "SSLv23", "TLSv1" } ); + map.put( ssl_version_name, ssl_version ); + + + + } + + public static SSLIOPCommunicationLayerPropertiesInfo getInstance(){ + return new SSLIOPCommunicationLayerPropertiesInfo(); + } + + public void dump(java.io.PrintWriter writer) + { + writer.println("SSLIOPCommunicationLayer properties:"); + + Iterator it = map.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry e = (Map.Entry)it.next(); + writer.print('\t'); + writer.print(e.getKey()); + writer.print('='); + writer.print( ((PropertyInfo)e.getValue()).getValue()); + writer.println(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.java new file mode 100644 index 0000000..dfa6513 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLIOPCorbaloc.java @@ -0,0 +1,202 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.util.StringTokenizer; + +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.util.Corbaloc; + +import org.omg.SSLIOP.SSL; +import org.omg.CSIIOP.*; + +public class SSLIOPCorbaloc +{ + + public static String getObjectId(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, path, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:ssliop:")) { + corbaloc = corbaloc_URL.substring(16); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + return corbaloc.substring(slashposition + 1); + } + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc, addr, url_key, v, l; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:ssliop:")) { + corbaloc = corbaloc_URL.substring(16); + } else if (corbaloc_URL.startsWith("corbaloc::")) { + corbaloc = corbaloc_URL.substring(10); + } else { + throw new InvalidName("Invalid corbaloc"); + } + + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = es.tid.TIDorbj.core.util.Corbaloc.parseVersion(v); + } + + } + + l = staddr.nextToken(); + + listener = es.tid.TIDorbj.core.util.Corbaloc.parseListenPoint(l); + + url_key = corbaloc.substring(slashposition + 1); + + ObjectKey objectkey = createKey(url_key); + + + // Add to components a new SSLComponent with a listenpoint port as SSL + TaggedComponent[] components = new TaggedComponent[1]; + + org.omg.SSLIOP.SSL ssl = new org.omg.SSLIOP.SSL ( + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) (org.omg.CSIIOP.Integrity.value | + org.omg.CSIIOP.Confidentiality.value | + org.omg.CSIIOP.NoDelegation.value), + (short) listener.m_port); + SSLComponent ssl_component = new SSLComponent(ssl); + components[0] = ssl_component; + + listener.m_ssl_port = listener.m_port; + listener.m_port = 0; // not used + + + profiles = new IIOPProfile[1]; + + //profiles[0] = new IIOPProfile(version, listener, objectkey, null); + profiles[0] = new IIOPProfile(version, listener, objectkey, components); + + return new IIOPIOR("", profiles); + } + + /** + * Simulates an usual ObjectKey, that is marshaled in an Encapsulation, but + * instead, the url ObjectKey is marshaled as a ulong value (the size) and + * the char array of the string (without the end of string character *. + * + * @param url + * @return + * @throws org.omg.CORBA.ORBPackage.InvalidName + */ + private static ObjectKey createKey(String url_key) + throws org.omg.CORBA.ORBPackage.InvalidName + { + + CDROutputStream output = + new CDROutputStream(null, + new byte[url_key.length() + CDR.ULONG_SIZE]); + + char[] url_buffer = url_key.toCharArray(); + + output.write_ulong(url_buffer.length); + output.write_char_array(url_buffer, 0, url_buffer.length); + + CDRInputStream input = (CDRInputStream) output.create_input_stream(); + + Encapsulation encap = input.readEncapsulation(); + + return new ObjectKey(encap); + } + + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.java new file mode 100644 index 0000000..4e2ef90 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLLocateResponseHandler.java @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.LocateResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.poa.QueuedLocateResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * @author jprojas + * + */ +public class SSLLocateResponseHandler extends QueuedLocateResponseHandler implements LocateResponseHandler { + + private SSLConnection conn; + private GIOPVersion version; + private RequestId requestId; + private ObjectKey objectKey; + + + public SSLLocateResponseHandler( SSLConnection conn, + GIOPVersion version, + RequestId requestId, + ObjectKey objectKey) + { + setConnection( conn ); + setVersion ( version ); + setRequestId ( requestId ); + setObjectKey ( objectKey ); + } + + public void setConnection( SSLConnection conn ){ + this.conn = conn; + } + + public SSLConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setRequestId( RequestId requestId ){ + this.requestId = requestId; + } + + public RequestId getRequestId(){ + return this.requestId; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + throw new INTERNAL("Not supported"); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + throw new NO_IMPLEMENT( + "LocateRequest doesn't have a peer ServerRequest", + 0, + CompletionStatus.COMPLETED_NO + ); + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, reference ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, e ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.LocateResponseHandler#setResponseValue(boolean) + */ + public void submitResponse( boolean value ) { + if ( this.conn != null ){ + this.conn.sendLocateReply( this.version, this.requestId, value ); + } else { + throw new INTERNAL( "No IIOPConnection configured" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + throw new INTERNAL( "LocateRequest requires a return value" ); + } + + /* + * remove from here + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.java new file mode 100644 index 0000000..6d65d39 --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLResponseHandler.java @@ -0,0 +1,193 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 385 $ +* Date: $Date: 2009-04-16 10:15:52 +0200 (Thu, 16 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.Object; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.SystemException; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.ServerRequestImpl; +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.poa.QueuedResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + + +/** + * ResponseHandler implementation for the IIOPCommunicationLayer + * + * @author jprojas + * + */ +public class SSLResponseHandler extends QueuedResponseHandler implements ResponseHandler { + + private SSLConnection conn; + private GIOPVersion version; + private ServerRequestImpl serverRequest; + private ObjectKey objectKey; + private PolicyContext policySupplier; + + public SSLResponseHandler( SSLConnection conn, + GIOPVersion version, + ServerRequestImpl + serverRequest, + ObjectKey objectKey, + PolicyContext policySupplier){ + setConnection( conn ); + setVersion( version ); + setServerRequest( serverRequest ); + setObjectKey( objectKey ); + setPolicyContext( policySupplier ); + } + + public void setConnection( SSLConnection conn ){ + this.conn = conn; + } + + public SSLConnection getConnection(){ + return this.conn; + } + + public void setVersion( GIOPVersion version ){ + this.version = version; + } + + public GIOPVersion getVersion(){ + return this.version; + } + + public void setServerRequest( ServerRequestImpl serverRequest ){ + this.serverRequest = serverRequest; + } + + public void setObjectKey( ObjectKey objectKey ){ + this.objectKey = objectKey; + } + + /** + * @param policySupplier The policySupplier to set. + */ + public void setPolicyContext(PolicyContext policySupplier) + { + this.policySupplier = policySupplier; + } + /* + * (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getPolicyContext() + */ + public PolicyContext getPolicyContext(){ + return this.policySupplier; + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getObjectKey() + */ + public ObjectKey getObjectKey() { + return this.objectKey; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#getServerRequest() + */ + public ServerRequest getServerRequest() { + return this.serverRequest; + } + + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.Object) + */ + public void submitResponse( Object reference ) { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.serverRequest.setForward( reference ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse(org.omg.CORBA.SystemException) + */ + public void submitResponse( SystemException e ) { + if ( this.conn != null ){ + if( this.serverRequest.withResponse() ) { + this.serverRequest.setSystemException( e ); + this.conn.sendReply( this.serverRequest, null ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /* (non-Javadoc) + * @see es.tid.TIDorbj.core.comm.ResponseHandler#submitResponse() + */ + public void submitResponse() { + if ( this.conn != null ){ + if ( this.serverRequest.withResponse() ) { + this.conn.sendReply( this.serverRequest, this.policySupplier ); + } + } else { + throw new INTERNAL( "No IIOPConnection configured!" ); + } + } + + /** + * remove from here + * @author jprojas + */ + public void sendError( SystemException e, Trace trace ) { + throw new NO_IMPLEMENT(); + + } + +} diff --git a/source/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.java b/source/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.java new file mode 100644 index 0000000..014b03d --- /dev/null +++ b/source/es/tid/TIDorbj/core/comm/ssliop/SSLServerListener.java @@ -0,0 +1,462 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 379 $ +* Date: $Date: 2009-04-07 12:17:19 +0200 (Tue, 07 Apr 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2010 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.comm.ssliop; + +import java.net.InetAddress; +import java.net.Socket; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLContext; + +import java.security.KeyStore; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.TrustManagerFactory; + +import java.io.FileInputStream; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.giop.ServiceContextList; +import es.tid.TIDorbj.core.comm.iiop.*; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.Trace; + +import org.omg.SSLIOP.SSL; +import org.omg.CSIIOP.*; + + +public class SSLServerListener extends Thread +{ + + /** + * SSLServerSocket state + */ + + boolean m_shutdowned; + + boolean m_connected; + + /** + * SSLServerSocket where the communication layer will accept connections. This + * socket will be only avalilable when a the ORB's run method + * had been invoked. + */ + SSLServerSocket m_server_socket; + + /** + * Conection manager. + */ + IIOPConnectionManager m_manager; + + + /** + * Listen point where the SSLServerSocket will be listening. This + * point(host,port) will be used to create de local IOR's. + */ + ListenPoint m_listen_point; + + /** + * Service context that contains the information for activating the + * bidirectional service. + */ + ServiceContextList m_bidirectional_service; + + es.tid.TIDorbj.core.TIDORB m_orb; + + String hostAddress; + String hostName; + int port; + int backlog; + int reconnect; + GIOPVersion giopVersion; + + String ssl_key_store_file; + String ssl_key_store_passwd; + String ssl_key_store_type; + + String ssl_trust_store_file; + String ssl_trust_store_passwd; + String ssl_trust_store_type; + + String ssl_version; + + + public SSLServerListener(IIOPConnectionManager manager) + { + m_shutdowned = true; + m_connected = false; + + this.m_manager = manager; + m_orb = manager.orb(); + + this.hostAddress = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_ADDRESS ) + .getValue(); + this.hostName = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.HOST_NAME ) + .getValue(); +// this.port = +// m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) +// .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.PORT ) +// .getInt(); + this.backlog = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_BACKLOG ) + .getInt(); + this.reconnect = + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.SERVER_SOCKET_RECONNECT ) + .getInt(); + this.giopVersion = + GIOPVersion.fromString( + m_orb.getCommunicationManager().getLayerById( IIOPCommunicationLayer.ID ) + .getPropertyInfo( IIOPCommunicationLayerPropertiesInfo.GIOP_VERSION ) + .getString() + ); + + + // SSL options + + this.ssl_key_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_file_name ) + .getValue(); + + this.ssl_key_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_passwd_name ) + .getValue(); + + this.ssl_key_store_type = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_key_store_type_name ) + .getValue(); + + this.ssl_trust_store_file = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_file_name ) + .getValue(); + + this.ssl_trust_store_passwd = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_passwd_name ) + .getValue(); + + this.ssl_trust_store_type = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_trust_store_type_name ) + .getValue(); + + this.ssl_version = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_version_name ) + .getValue(); + + // port is ssl_port + this.port = + m_orb.getCommunicationManager().getLayerById( SSLIOPCommunicationLayer.ID ) + .getPropertyInfo( SSLIOPCommunicationLayerPropertiesInfo.ssl_port_name ) + .getInt(); + + + + + + + + SSLServerSocketFactory ssf = null; + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, ksPass); + + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getServerSocketFactory(); + + } catch (Exception e) { + throw new org.omg.CORBA.INITIALIZE("Can init SSLServerSocketFactory: " + + e.toString() ); + } + + } else { + // TODO: bad initialized?? + ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + } + + try { + if ( hostAddress == null) { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + this.port , + this.backlog ); + + } else { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + this.port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + + if ( this.hostName != null) { + m_listen_point = new ListenPoint( + this.hostName , + m_server_socket.getLocalPort() + ); + } else { + m_listen_point = new ListenPoint( + InetAddress.getLocalHost().getHostAddress(), + m_server_socket.getLocalPort() + ); + } + + m_shutdowned = false; + m_connected = true; + + } + catch (java.io.IOException e) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open SSLServerSocket: " + e.toString() + ); + } + + m_orb.printTrace( + Trace.DEBUG, "SSLServerListener connected at: " + m_listen_point.toString() + ); + } + + public ListenPoint getListenPoint() { + return m_listen_point; + } + + public synchronized void shutdown() { + if (!m_shutdowned) { + m_shutdowned = true; + try { + m_server_socket.close(); + } catch (Throwable th) {} + + m_server_socket = null; + + m_orb.printTrace( + Trace.DEBUG, "SSLServerListener at " + m_listen_point.toString() + " shutdown!" + ); + } + } + + public synchronized void resetServerSocket() { + if (!m_shutdowned) { + try { + if (m_server_socket != null) + m_server_socket.close(); + } + catch (Throwable th) {} + + SSLServerSocketFactory ssf = null; + + + if ( (!ssl_key_store_file.equals("")) && + (!ssl_key_store_passwd.equals("")) ) { + + try { + + SSLContext sc = SSLContext.getInstance(ssl_version); + + // + // Init KeyStore + // + String ksName = ssl_key_store_file; + char ksPass[] = ssl_key_store_passwd.toCharArray(); + KeyStore ks = KeyStore.getInstance(ssl_key_store_type); + ks.load(new FileInputStream(ksName), ksPass); + + KeyManagerFactory kmf = + KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, ksPass); + + // + // Init TrustManager + // + String tsName = ssl_trust_store_file; + char tsPass[] = ssl_trust_store_passwd.toCharArray(); + KeyStore ts = KeyStore.getInstance(ssl_trust_store_type); + ts.load(new FileInputStream(tsName), tsPass); + + TrustManagerFactory tmf = + TrustManagerFactory.getInstance("PKIX"); // TODO: put in param + tmf.init(ts); + + // Init SSLContext + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + ssf = sc.getServerSocketFactory(); + + if ( this.hostAddress == null) { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + m_listen_point.m_port, + this.backlog + ); + } else { + m_server_socket = (SSLServerSocket) ssf.createServerSocket( + m_listen_point.m_port, + this.backlog, + InetAddress.getByName( this.hostAddress ) + ); + } + m_server_socket.setReuseAddress(true); + } catch (Throwable th) { + throw new org.omg.CORBA.INITIALIZE( + "Can not open SSLServerSocket: " + th.toString() + ); + } + + } else { + ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + } + } + } + + public void run() + { + while (!m_shutdowned) { + while (m_connected) { + + Socket client_socket = null; + try { + client_socket = m_server_socket.accept(); + } catch (Throwable se) { + + if ( m_shutdowned ){ + return; + } + + m_connected = false; + + m_orb.printTrace( + Trace.ERROR, "Error in SSLServerSocket.accept(): ", se + ); + } + + try { + if (client_socket != null) { + m_manager.createSSLServerConnection((SSLSocket)client_socket); + } + } catch (Throwable e) { + try { + client_socket.close(); + } catch (Throwable t) {} + + m_orb.printTrace( + Trace.ERROR, "Error creating SSLServerConnection: ", e + ); + } + } + + if ((!m_connected) && (!m_shutdowned)) { + + // RECONNECT + + //printTrace will check for a trace handler existence + m_orb.printTrace( Trace.DEBUG, "Trying to reconnect server socket "); + + try { + resetServerSocket(); + m_connected = true; + + if (m_orb.m_trace != null) { + m_orb.printTrace( + Trace.DEBUG, "SSLServerSocket reconnected" + ); + } + } catch (Throwable th) { + m_orb.printTrace( + Trace.ERROR, "SSLServerSocket reconnect error: ", th + ); + try { + Thread.sleep( this.reconnect ); + } catch (InterruptedException e) {} + } + } + } + } + +} diff --git a/source/es/tid/TIDorbj/core/compression/.svn/all-wcprops b/source/es/tid/TIDorbj/core/compression/.svn/all-wcprops new file mode 100644 index 0000000..ac62d7f --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/all-wcprops @@ -0,0 +1,29 @@ +K 25 +svn:wc:ra_dav:version-url +V 86 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression +END +ZlibCompressorImpl.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.java +END +CompressorFactoryImpl.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.java +END +CompressionManagerImpl.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression/CompressionManagerImpl.java +END +CompressorImpl.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression/CompressorImpl.java +END diff --git a/source/es/tid/TIDorbj/core/compression/.svn/entries b/source/es/tid/TIDorbj/core/compression/.svn/entries new file mode 100644 index 0000000..96054f4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/entries @@ -0,0 +1,164 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/compression +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ZlibCompressorImpl.java +file + + + + +2010-04-28T11:50:13.000000Z +e47160cf9dc8b62815204f9095952a25 +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +5648 + +CompressorFactoryImpl.java +file + + + + +2010-04-28T11:50:13.000000Z +631d0856216bb750c1072326ae3457bf +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +4326 + +CompressionManagerImpl.java +file + + + + +2010-04-28T11:50:13.000000Z +f74c5e2390d5a73a872fa2aaa5acaa40 +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + + + + + + + + +6589 + +CompressorImpl.java +file + + + + +2010-04-28T11:50:13.000000Z +5740a5ff7e9485042d63c2b5017d4252 +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +5699 + diff --git a/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressionManagerImpl.java.svn-base b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressionManagerImpl.java.svn-base new file mode 100644 index 0000000..cf585c3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressionManagerImpl.java.svn-base @@ -0,0 +1,206 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source +* Version: 1 +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * CompressionManagerImpl Compression manager. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionManagerImpl extends CompressionManagerLocalBase +{ + + + TIDORB m_orb; + + /** + * m_factories Data structure to store factories. + * + */ + Hashtable m_factories; + + /** + * Creates a new CompressionManagerImpl instance. + * + * @param orb a TIDORB value + */ + public CompressionManagerImpl(TIDORB orb) + { + this.m_orb = orb; + m_factories = new Hashtable(); + + // Creates and registers default provided compressor: ZLib + Short zlib_id = new Short(COMPRESSORID_ZLIB.value); + CompressorFactory zlib_factory = + new CompressorFactoryImpl(orb, zlib_id.shortValue()); + m_factories.put(zlib_id, zlib_factory); + } + + /** + * register_factory Register a compression factory in the + * current manager + * + * @param compressor_factory a CompressorFactory value + * @exception FactoryAlreadyRegistered if an error occurs + */ + synchronized public void register_factory(CompressorFactory compressor_factory) + throws FactoryAlreadyRegistered + { + Short comp_id = new Short(compressor_factory.compressor_id()); + + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory == null) { + m_factories.put(comp_id, compressor_factory); + } + else + throw new FactoryAlreadyRegistered(); + } + + /** + * unregister_factory Unregister a compression factory. + * + * @param compressor_id a short value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public void unregister_factory(short compressor_id) + throws UnknownCompressorId + { + Short comp_id = new Short(compressor_id); + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory != null) { + m_factories.remove(comp_id); + } + else + throw new UnknownCompressorId(); + } + + + /** + * get_factory returns the required factory. + * + * @param compressor_id a short value + * @return a CompressorFactory value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public CompressorFactory get_factory(short compressor_id) + throws UnknownCompressorId + { + + Short comp_id = new Short(compressor_id); + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory == null) { + if ( (compressor_id != COMPRESSORID_GZIP.value) && + (compressor_id != COMPRESSORID_PKZIP.value) && + (compressor_id != COMPRESSORID_BZIP2.value) && + (compressor_id != COMPRESSORID_ZLIB.value) && + (compressor_id != COMPRESSORID_LZMA.value) && + (compressor_id != COMPRESSORID_LZOP.value) && + (compressor_id != COMPRESSORID_RZIP.value) && + (compressor_id != COMPRESSORID_7X.value) && + (compressor_id != COMPRESSORID_XAR.value) ) + throw new UnknownCompressorId(); + else + factory = new CompressorFactoryImpl(m_orb, compressor_id); + } + return factory; + + } + + /** + * get_compressor returns the required compressor. + * + * @param compressor_id a short value + * @param compression_level a short value + * @return a Compressor value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public Compressor get_compressor(short compressor_id, + short compression_level) + throws UnknownCompressorId + { + Short comp_id = new Short(compressor_id); + CompressorFactory factory = (CompressorFactory) m_factories.get(comp_id); + + if (factory != null) { + return factory.get_compressor(compression_level); + } + else + throw new UnknownCompressorId(); + + } + + /** + * get_factories returns all factories. + * + * @return a CompressorFactory[] value + */ + synchronized public CompressorFactory[] get_factories() + { + + Object[] keys = m_factories.keySet().toArray(); + + CompressorFactory[] factories = new CompressorFactory[keys.length]; + + for (int i = 0; i < keys.length; i++) { + factories[i] = (CompressorFactory) m_factories.get(keys[i]); + } + + return factories; + } + + +} diff --git a/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorFactoryImpl.java.svn-base b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorFactoryImpl.java.svn-base new file mode 100644 index 0000000..02a85b7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorFactoryImpl.java.svn-base @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; + +/** + * CompressorFactoryImpl compressor factory class. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressorFactoryImpl extends CompressorFactoryLocalBase +{ + TIDORB m_orb; + + /** + * m_compressor_id identifies the compressor family. + * + */ + short m_compressor_id; + + Hashtable m_compressors; + + /** + * Creates a new CompressorFactoryImpl instance. + * + * @param orb a TIDORB value + * @param compressor_id a short value + */ + public CompressorFactoryImpl(TIDORB orb, short compressor_id) + { + this.m_orb = orb; + this.m_compressor_id = compressor_id; + + switch (m_compressor_id) { + case COMPRESSORID_ZLIB.value: + break; + default: + throw new NO_IMPLEMENT(); + } + m_compressors = new Hashtable(); + } + + + /** + * Returns compressor_id value. + * + * @return a short value + */ + public short compressor_id() + { + return m_compressor_id; + } + + /** + * get_compressor returns a compressor according with the + * required level + * + * @param compression_level a short value + * @return a Compressor value + */ + synchronized public Compressor get_compressor(short compression_level) + { + if (compression_level > 9 ) + throw new BAD_PARAM("Compression level not valid", 44, + CompletionStatus.COMPLETED_NO); + Short comp_level = new Short(compression_level); + Compressor compressor = (Compressor) m_compressors.get(comp_level); + + if (compressor != null) { + return compressor; + } else { + + Compressor new_compressor; + + switch (m_compressor_id) { + case COMPRESSORID_GZIP.value: + case COMPRESSORID_PKZIP.value: + case COMPRESSORID_BZIP2.value: + throw new NO_IMPLEMENT(); + case COMPRESSORID_ZLIB.value: + new_compressor = new ZlibCompressorImpl(m_orb, compression_level, + this); + break; + default: + throw new NO_IMPLEMENT(); + } + m_compressors.put(comp_level, new_compressor); + + return new_compressor; + } + + } + + + +} diff --git a/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorImpl.java.svn-base b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorImpl.java.svn-base new file mode 100644 index 0000000..b55c3cb --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/text-base/CompressorImpl.java.svn-base @@ -0,0 +1,192 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * CompressorImpl is the abstract implementation of a compressor. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public abstract class CompressorImpl extends CompressorLocalBase +{ + + TIDORB m_orb; + short m_level; + long m_compressed_bytes; + long m_uncompressed_bytes; + float m_ratio; + CompressorFactory m_factory; + + + /** + * Creates a new CompressorImpl instance. + * + */ + public CompressorImpl() + { + this.m_orb = null; + this.m_factory = null; + this.m_level = 0; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * Creates a new CompressorImpl instance. + * + * @param level a short value + * @param factory a CompressorFactory value + */ + public CompressorImpl(short level, CompressorFactory factory) + { + this.m_orb = null; + this.m_factory = factory; + this.m_level = level; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * Creates a new CompressorImpl instance. + * + * @param orb a TIDORB value + * @param level a short value + * @param factory a CompressorFactory value + */ + public CompressorImpl(TIDORB orb, short level, CompressorFactory factory) + { + this.m_orb = orb; + this.m_factory = factory; + this.m_level = level; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * compress performs compression over source byte sequence and + * puts the result in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + public abstract void compress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException; + + /** + * decompress performs decompression over source and puts the result + * in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + public abstract void decompress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException; + + /** + * compressor_factory returns its compressor factory. + * + * @return an org.omg.Compression.CompressorFactory value + */ + public org.omg.Compression.CompressorFactory compressor_factory() + { + return m_factory; + } + + /** + * compression_level returns its compression level. + * + * @return a short value + */ + public short compression_level() + { + return m_level; + } + + /** + * Returns compressed_bytes written by this compressor. + * + * @return a long value + */ + public long compressed_bytes() + { + return m_compressed_bytes; + } + + /** + * Returns uncompressed_bytes read by this compressor. + * + * @return a long value + */ + public long uncompressed_bytes() + { + return m_uncompressed_bytes; + } + + /** + * Return compression_ratio reached with this compressor. + * + * @return an int value + */ + public float compression_ratio() + { + return m_ratio; + } + + +} diff --git a/source/es/tid/TIDorbj/core/compression/.svn/text-base/ZlibCompressorImpl.java.svn-base b/source/es/tid/TIDorbj/core/compression/.svn/text-base/ZlibCompressorImpl.java.svn-base new file mode 100644 index 0000000..ec2aee2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/.svn/text-base/ZlibCompressorImpl.java.svn-base @@ -0,0 +1,175 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.zip.*; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * ZlibCompressorImpl Zlib compressor. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class ZlibCompressorImpl extends CompressorImpl +{ + + /** + * Describe constant CHUNK_SIZE here. + * + */ + private int chunk_size; + + + /** + * Creates a new ZlibCompressorImpl instance. + * + * @param orb a TIDORB value + * @param level a short value + * @param factory a CompressorFactory value + */ + public ZlibCompressorImpl(TIDORB orb, short level, CompressorFactory factory) + { + super(orb, level, factory); + chunk_size = orb.m_conf.ziop_chunk_size; + } + + /** + * compress performs compression over source and puts result + * in target + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + synchronized public void compress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException + { + int have = 0; + int source_length = source.length; + + byte[] target_buffer = new byte[0]; + int target_length = 0; + + Deflater compresser = new Deflater(m_level); + + compresser.setInput(source, 0, source.length); + compresser.finish(); + + byte[] out = new byte[chunk_size]; + + do { + have = compresser.deflate(out, 0, chunk_size); + + if (have > 0) { + // Copy 'out' buffer to 'target' OctetSeq + int current_length = target_length; + byte[] aux_buffer = new byte[current_length + have]; + target_length += have; + System.arraycopy(target_buffer, 0, aux_buffer, 0, current_length); + System.arraycopy(out, 0, aux_buffer, current_length, have); + target_buffer = aux_buffer; + } + } while (have > 0 ); + + compresser.end(); + target.value = target_buffer; + + m_compressed_bytes += target.value.length; + m_uncompressed_bytes += source.length; + } + + /** + * decompress performs decompression on source sequence and puts + * result in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + synchronized public void decompress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException + { + + int have = 0; + int source_length = source.length; + + byte[] target_buffer = new byte[0]; + int target_length = 0; + + Inflater decompresser = new Inflater(); + decompresser.setInput(source, 0, source.length); + + byte[] out = new byte[chunk_size]; + + do { + + try { + have = decompresser.inflate(out, 0, chunk_size); + } catch (java.util.zip.DataFormatException dfe) { + throw new org.omg.Compression.CompressionException(); + } + + if ( have > 0) { + // Copy 'out' buffer to 'target' OctetSeq + int current_length = target_length; + byte[] aux_buffer = new byte[current_length + have]; + target_length += have; + System.arraycopy(target_buffer, 0, aux_buffer, 0, current_length); + System.arraycopy(out, 0, aux_buffer, current_length, have); + target_buffer = aux_buffer; + } + } while (have > 0 ); + + decompresser.end(); + target.value = target_buffer; + } + +} diff --git a/source/es/tid/TIDorbj/core/compression/CompressionManagerImpl.java b/source/es/tid/TIDorbj/core/compression/CompressionManagerImpl.java new file mode 100644 index 0000000..cf585c3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/CompressionManagerImpl.java @@ -0,0 +1,206 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source +* Version: 1 +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * CompressionManagerImpl Compression manager. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionManagerImpl extends CompressionManagerLocalBase +{ + + + TIDORB m_orb; + + /** + * m_factories Data structure to store factories. + * + */ + Hashtable m_factories; + + /** + * Creates a new CompressionManagerImpl instance. + * + * @param orb a TIDORB value + */ + public CompressionManagerImpl(TIDORB orb) + { + this.m_orb = orb; + m_factories = new Hashtable(); + + // Creates and registers default provided compressor: ZLib + Short zlib_id = new Short(COMPRESSORID_ZLIB.value); + CompressorFactory zlib_factory = + new CompressorFactoryImpl(orb, zlib_id.shortValue()); + m_factories.put(zlib_id, zlib_factory); + } + + /** + * register_factory Register a compression factory in the + * current manager + * + * @param compressor_factory a CompressorFactory value + * @exception FactoryAlreadyRegistered if an error occurs + */ + synchronized public void register_factory(CompressorFactory compressor_factory) + throws FactoryAlreadyRegistered + { + Short comp_id = new Short(compressor_factory.compressor_id()); + + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory == null) { + m_factories.put(comp_id, compressor_factory); + } + else + throw new FactoryAlreadyRegistered(); + } + + /** + * unregister_factory Unregister a compression factory. + * + * @param compressor_id a short value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public void unregister_factory(short compressor_id) + throws UnknownCompressorId + { + Short comp_id = new Short(compressor_id); + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory != null) { + m_factories.remove(comp_id); + } + else + throw new UnknownCompressorId(); + } + + + /** + * get_factory returns the required factory. + * + * @param compressor_id a short value + * @return a CompressorFactory value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public CompressorFactory get_factory(short compressor_id) + throws UnknownCompressorId + { + + Short comp_id = new Short(compressor_id); + CompressorFactory factory = + (CompressorFactory) m_factories.get(comp_id); + + if (factory == null) { + if ( (compressor_id != COMPRESSORID_GZIP.value) && + (compressor_id != COMPRESSORID_PKZIP.value) && + (compressor_id != COMPRESSORID_BZIP2.value) && + (compressor_id != COMPRESSORID_ZLIB.value) && + (compressor_id != COMPRESSORID_LZMA.value) && + (compressor_id != COMPRESSORID_LZOP.value) && + (compressor_id != COMPRESSORID_RZIP.value) && + (compressor_id != COMPRESSORID_7X.value) && + (compressor_id != COMPRESSORID_XAR.value) ) + throw new UnknownCompressorId(); + else + factory = new CompressorFactoryImpl(m_orb, compressor_id); + } + return factory; + + } + + /** + * get_compressor returns the required compressor. + * + * @param compressor_id a short value + * @param compression_level a short value + * @return a Compressor value + * @exception UnknownCompressorId if an error occurs + */ + synchronized public Compressor get_compressor(short compressor_id, + short compression_level) + throws UnknownCompressorId + { + Short comp_id = new Short(compressor_id); + CompressorFactory factory = (CompressorFactory) m_factories.get(comp_id); + + if (factory != null) { + return factory.get_compressor(compression_level); + } + else + throw new UnknownCompressorId(); + + } + + /** + * get_factories returns all factories. + * + * @return a CompressorFactory[] value + */ + synchronized public CompressorFactory[] get_factories() + { + + Object[] keys = m_factories.keySet().toArray(); + + CompressorFactory[] factories = new CompressorFactory[keys.length]; + + for (int i = 0; i < keys.length; i++) { + factories[i] = (CompressorFactory) m_factories.get(keys[i]); + } + + return factories; + } + + +} diff --git a/source/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.java b/source/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.java new file mode 100644 index 0000000..02a85b7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/CompressorFactoryImpl.java @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; + +/** + * CompressorFactoryImpl compressor factory class. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressorFactoryImpl extends CompressorFactoryLocalBase +{ + TIDORB m_orb; + + /** + * m_compressor_id identifies the compressor family. + * + */ + short m_compressor_id; + + Hashtable m_compressors; + + /** + * Creates a new CompressorFactoryImpl instance. + * + * @param orb a TIDORB value + * @param compressor_id a short value + */ + public CompressorFactoryImpl(TIDORB orb, short compressor_id) + { + this.m_orb = orb; + this.m_compressor_id = compressor_id; + + switch (m_compressor_id) { + case COMPRESSORID_ZLIB.value: + break; + default: + throw new NO_IMPLEMENT(); + } + m_compressors = new Hashtable(); + } + + + /** + * Returns compressor_id value. + * + * @return a short value + */ + public short compressor_id() + { + return m_compressor_id; + } + + /** + * get_compressor returns a compressor according with the + * required level + * + * @param compression_level a short value + * @return a Compressor value + */ + synchronized public Compressor get_compressor(short compression_level) + { + if (compression_level > 9 ) + throw new BAD_PARAM("Compression level not valid", 44, + CompletionStatus.COMPLETED_NO); + Short comp_level = new Short(compression_level); + Compressor compressor = (Compressor) m_compressors.get(comp_level); + + if (compressor != null) { + return compressor; + } else { + + Compressor new_compressor; + + switch (m_compressor_id) { + case COMPRESSORID_GZIP.value: + case COMPRESSORID_PKZIP.value: + case COMPRESSORID_BZIP2.value: + throw new NO_IMPLEMENT(); + case COMPRESSORID_ZLIB.value: + new_compressor = new ZlibCompressorImpl(m_orb, compression_level, + this); + break; + default: + throw new NO_IMPLEMENT(); + } + m_compressors.put(comp_level, new_compressor); + + return new_compressor; + } + + } + + + +} diff --git a/source/es/tid/TIDorbj/core/compression/CompressorImpl.java b/source/es/tid/TIDorbj/core/compression/CompressorImpl.java new file mode 100644 index 0000000..b55c3cb --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/CompressorImpl.java @@ -0,0 +1,192 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.Hashtable; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * CompressorImpl is the abstract implementation of a compressor. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public abstract class CompressorImpl extends CompressorLocalBase +{ + + TIDORB m_orb; + short m_level; + long m_compressed_bytes; + long m_uncompressed_bytes; + float m_ratio; + CompressorFactory m_factory; + + + /** + * Creates a new CompressorImpl instance. + * + */ + public CompressorImpl() + { + this.m_orb = null; + this.m_factory = null; + this.m_level = 0; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * Creates a new CompressorImpl instance. + * + * @param level a short value + * @param factory a CompressorFactory value + */ + public CompressorImpl(short level, CompressorFactory factory) + { + this.m_orb = null; + this.m_factory = factory; + this.m_level = level; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * Creates a new CompressorImpl instance. + * + * @param orb a TIDORB value + * @param level a short value + * @param factory a CompressorFactory value + */ + public CompressorImpl(TIDORB orb, short level, CompressorFactory factory) + { + this.m_orb = orb; + this.m_factory = factory; + this.m_level = level; + this.m_compressed_bytes = 0; + this.m_uncompressed_bytes = 0; + this.m_ratio = 0; + } + + /** + * compress performs compression over source byte sequence and + * puts the result in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + public abstract void compress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException; + + /** + * decompress performs decompression over source and puts the result + * in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + public abstract void decompress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException; + + /** + * compressor_factory returns its compressor factory. + * + * @return an org.omg.Compression.CompressorFactory value + */ + public org.omg.Compression.CompressorFactory compressor_factory() + { + return m_factory; + } + + /** + * compression_level returns its compression level. + * + * @return a short value + */ + public short compression_level() + { + return m_level; + } + + /** + * Returns compressed_bytes written by this compressor. + * + * @return a long value + */ + public long compressed_bytes() + { + return m_compressed_bytes; + } + + /** + * Returns uncompressed_bytes read by this compressor. + * + * @return a long value + */ + public long uncompressed_bytes() + { + return m_uncompressed_bytes; + } + + /** + * Return compression_ratio reached with this compressor. + * + * @return an int value + */ + public float compression_ratio() + { + return m_ratio; + } + + +} diff --git a/source/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.java b/source/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.java new file mode 100644 index 0000000..ec2aee2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/compression/ZlibCompressorImpl.java @@ -0,0 +1,175 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author $ +* +* (C) Copyright 2008 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.compression; + +import java.util.zip.*; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.Compression.*; +import es.tid.TIDorbj.core.TIDORB; + + +/** + * ZlibCompressorImpl Zlib compressor. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class ZlibCompressorImpl extends CompressorImpl +{ + + /** + * Describe constant CHUNK_SIZE here. + * + */ + private int chunk_size; + + + /** + * Creates a new ZlibCompressorImpl instance. + * + * @param orb a TIDORB value + * @param level a short value + * @param factory a CompressorFactory value + */ + public ZlibCompressorImpl(TIDORB orb, short level, CompressorFactory factory) + { + super(orb, level, factory); + chunk_size = orb.m_conf.ziop_chunk_size; + } + + /** + * compress performs compression over source and puts result + * in target + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + synchronized public void compress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException + { + int have = 0; + int source_length = source.length; + + byte[] target_buffer = new byte[0]; + int target_length = 0; + + Deflater compresser = new Deflater(m_level); + + compresser.setInput(source, 0, source.length); + compresser.finish(); + + byte[] out = new byte[chunk_size]; + + do { + have = compresser.deflate(out, 0, chunk_size); + + if (have > 0) { + // Copy 'out' buffer to 'target' OctetSeq + int current_length = target_length; + byte[] aux_buffer = new byte[current_length + have]; + target_length += have; + System.arraycopy(target_buffer, 0, aux_buffer, 0, current_length); + System.arraycopy(out, 0, aux_buffer, current_length, have); + target_buffer = aux_buffer; + } + } while (have > 0 ); + + compresser.end(); + target.value = target_buffer; + + m_compressed_bytes += target.value.length; + m_uncompressed_bytes += source.length; + } + + /** + * decompress performs decompression on source sequence and puts + * result in target. + * + * @param source a byte value + * @param target an org.omg.CORBA.OctetSeqHolder value + * @exception org.omg.Compression.CompressionException if an error occurs + */ + synchronized public void decompress(byte[] source, + org.omg.CORBA.OctetSeqHolder target) + throws org.omg.Compression.CompressionException + { + + int have = 0; + int source_length = source.length; + + byte[] target_buffer = new byte[0]; + int target_length = 0; + + Inflater decompresser = new Inflater(); + decompresser.setInput(source, 0, source.length); + + byte[] out = new byte[chunk_size]; + + do { + + try { + have = decompresser.inflate(out, 0, chunk_size); + } catch (java.util.zip.DataFormatException dfe) { + throw new org.omg.Compression.CompressionException(); + } + + if ( have > 0) { + // Copy 'out' buffer to 'target' OctetSeq + int current_length = target_length; + byte[] aux_buffer = new byte[current_length + have]; + target_length += have; + System.arraycopy(target_buffer, 0, aux_buffer, 0, current_length); + System.arraycopy(out, 0, aux_buffer, current_length, have); + target_buffer = aux_buffer; + } + } while (have > 0 ); + + decompresser.end(); + target.value = target_buffer; + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/all-wcprops b/source/es/tid/TIDorbj/core/iop/.svn/all-wcprops new file mode 100644 index 0000000..30080cd --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/all-wcprops @@ -0,0 +1,65 @@ +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop +END +TaggedProfileReader.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/TaggedProfileReader.java +END +TaggedComponentReader.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/TaggedComponentReader.java +END +CSIComponent.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/CSIComponent.java +END +ProfileMultipleComponents.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.java +END +SSLComponent.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/SSLComponent.java +END +ORBComponent.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/ORBComponent.java +END +IOR.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/IOR.java +END +TaggedProfile.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/TaggedProfile.java +END +DefaultIOR.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/DefaultIOR.java +END +TaggedComponent.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop/TaggedComponent.java +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/entries b/source/es/tid/TIDorbj/core/iop/.svn/entries new file mode 100644 index 0000000..c63a8ab --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/entries @@ -0,0 +1,368 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/iop +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TaggedProfileReader.java +file + + + + +2009-05-27T12:24:01.000000Z +ae2d1126bf50d0c47fb0cde430a41160 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2917 + +TaggedComponentReader.java +file +478 + + + +2011-04-29T14:42:47.000000Z +1d4c6f3b40c81ac58e2d2c5b9aa43118 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3153 + +CSIComponent.java +file + + + + +2010-04-28T10:47:58.000000Z +250be94cde87b1790fb250d1ebd5c946 +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + + + + + + + + +11602 + +ProfileMultipleComponents.java +file + + + + +2009-05-27T12:24:01.000000Z +a2287a140221a616a486d2ec92da00f2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4437 + +SSLComponent.java +file + + + + +2010-04-28T10:47:58.000000Z +859db675bc13fa5f58268f1fb52c4f1b +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + + + + + + + + +5506 + +ORBComponent.java +file + + + + +2010-04-28T10:47:58.000000Z +3de964984fb6577b2dde5e46b8af93ab +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3178 + +IOR.java +file + + + + +2009-05-27T12:24:01.000000Z +3053c54dfa123b3fd75abdd93705f126 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8640 + +TaggedProfile.java +file + + + + +2009-05-27T12:24:01.000000Z +f1702d4fa98608a3a68a8dcac5dc261d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2654 + +DefaultIOR.java +file + + + + +2009-05-27T12:24:01.000000Z +696853fcdcdc20e0c784fd1395e53a51 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4118 + +TaggedComponent.java +file + + + + +2009-05-27T12:24:01.000000Z +8589b0c30eb4c845b9568c59349bfc3e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2599 + diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/DefaultIOR.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/DefaultIOR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/DefaultIOR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/IOR.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/IOR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/IOR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ORBComponent.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ORBComponent.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ORBComponent.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ProfileMultipleComponents.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ProfileMultipleComponents.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/ProfileMultipleComponents.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponent.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponent.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponent.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponentReader.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponentReader.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedComponentReader.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfile.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfile.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfile.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfileReader.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfileReader.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/prop-base/TaggedProfileReader.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/CSIComponent.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/CSIComponent.java.svn-base new file mode 100644 index 0000000..95f61a1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/CSIComponent.java.svn-base @@ -0,0 +1,330 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2009 Telefonica Investigacion y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import java.io.StringWriter; +import java.io.PrintWriter; +import java.lang.Byte; + +import es.tid.TIDorbj.core.ConfORB; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; +import org.omg.CSIIOP.CompoundSecMechList; +import org.omg.CSIIOP.CompoundSecMechListHelper; +import org.omg.CSIIOP.ServiceConfiguration; +import org.omg.CSI.ITTAbsent; +import org.omg.CSI.ITTAnonymous; +import org.omg.CSI.ITTPrincipalName; +import org.omg.CSI.ITTX509CertChain; +import org.omg.CSI.ITTDistinguishedName; + + + +/** + * CSIComponent data struct defined in the GIOP Module. + * + * @autor + * @version 1.0 + */ +public class CSIComponent extends TaggedComponent +{ + + private CompoundSecMechList m_mec_list; + + public CSIComponent() + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = new CompoundSecMechList(); + } + + public CSIComponent(CompoundSecMechList mec_list) + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = mec_list; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + CompoundSecMechListHelper.write(out, m_mec_list); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_mec_list = CompoundSecMechListHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("stateful: "); + print_buffer.print(m_mec_list.stateful); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + for (int i = 0; i < m_mec_list.mechanism_list.length; i++) { + print_buffer.print("mechanism: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" transport_mech: " + + CSIComponent.print_TransportMechTag( + m_mec_list.mechanism_list[i].transport_mech.tag)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" as_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" client_authentication_mech: " + + print_OID(m_mec_list.mechanism_list[i].as_context_mech.client_authentication_mech)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_name: " + + print_GSS_NT_ExportedName( + m_mec_list.mechanism_list[i].as_context_mech.target_name)); + + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" sas_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" privilege_authorities: " + + CSIComponent.print_PrivilegeAuthorities( + m_mec_list.mechanism_list[i].sas_context_mech.privilege_authorities)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_naming_mechanims: " + + print_OIDList( + m_mec_list.mechanism_list[i].sas_context_mech.supported_naming_mechanisms)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_identity_types: " + + print_IdentityTokenTypes( + m_mec_list.mechanism_list[i].sas_context_mech.supported_identity_types)); + } + return buffer.toString(); + } + + + + public static String print_PrivilegeAuthorities(ServiceConfiguration[] privilege_authorities) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < privilege_authorities.length; i++) { + print_buffer.print("\n \t \t \t sintax: " + privilege_authorities[i].syntax); + print_buffer.print("\n \t \t \t name: " + privilege_authorities[i].name); + } + + return buffer.toString(); + } + + public static String print_OID(byte[] oid) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t OID: "); + + for (int i = 0; i < oid.length; i++) { + String hex = Integer.toHexString(oid[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + } + + return buffer.toString(); + } + + + public static String print_OIDList(byte[][] oid_list) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < oid_list.length; i++) { + print_buffer.print(print_OID(oid_list[i])); + } + + return buffer.toString(); + } + + public static String print_IdentityTokenTypes(int type) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(type) { + case org.omg.CSI.ITTAbsent.value: + print_buffer.print("\n \t \t \t Absent"); + break; + case org.omg.CSI.ITTAnonymous.value: + print_buffer.print("\n \t \t \t Anonymous"); + break; + case org.omg.CSI.ITTPrincipalName.value: + print_buffer.print("\n \t \t \t PrincipalName"); + break; + case org.omg.CSI.ITTX509CertChain.value: + print_buffer.print("\n \t \t \t ITTX509CertChain"); + break; + case org.omg.CSI.ITTDistinguishedName.value: + print_buffer.print("\n \t \t \t ITTDistinguishedName"); + break; + } + return buffer.toString(); + } + + + public static String print_TransportMechTag(int tag) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(tag) { + case org.omg.IOP.TAG_SSL_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_SSL_SEC_TRANS"); + break; + case org.omg.IOP.TAG_TLS_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_TLS_SEC_TRANS"); + break; + case org.omg.IOP.TAG_NULL_TAG.value: + print_buffer.print("\n \t \t \t TAG_NULL_TAG"); + break; + } + return buffer.toString(); + } + + + public static String print_GSS_NT_ExportedName(byte[] name) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t "); + + for (int i = 0; i < name.length; i++) { + String hex = Integer.toHexString(name[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + + } + + return buffer.toString(); + + } + + +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/DefaultIOR.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/DefaultIOR.java.svn-base new file mode 100644 index 0000000..d5df4db --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/DefaultIOR.java.svn-base @@ -0,0 +1,136 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.NO_IMPLEMENT; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class DefaultIOR extends IOR { + + /** + * + */ + public DefaultIOR() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @param type_id + * @param profiles + */ + public DefaultIOR( String type_id, TaggedProfile[] profiles ) { + super( type_id, profiles ); + } + + public static IOR fromString(TIDORB orb, String ior_str) { + + int length = ior_str.length(); + if (((length % 2) != 0) || (length < 14)) + throw new INV_OBJREF("IOR format error: invalid ior length.", 0, + CompletionStatus.COMPLETED_NO); + if (!ior_str.startsWith("IOR:")) + throw new INV_OBJREF("Invalid IOR format id: \"IOR:\".", 0, + CompletionStatus.COMPLETED_NO); + + byte[] buffer = new byte[(length - 4) / 2]; + char[] ior_chars = ior_str.toCharArray(); + int j = 4; + try { + for (int i = 0; i < buffer.length; i++) + buffer[i] = + (byte) (16 * (Base16Codec.getValue(ior_chars[j++])) + + Base16Codec.getValue(ior_chars[j++])); + } + catch (Exception e) { + throw new INV_OBJREF(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + // create the the ior with the new buffer + IOR ior = new DefaultIOR(); + + CDRInputStream internet_cdr = new CDRInputStream(orb, buffer); + + internet_cdr.setByteOrder(internet_cdr.read_boolean()); + + ior.read(internet_cdr); + + ior.toString = ior_str; + + return ior; + } + + public String toURL(){ + return toString(); + } + + public ObjectKey getObjectKey() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toObjectKeyAddress() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toProfileAddress() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toIORAddress() { + throw new NO_IMPLEMENT(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/IOR.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/IOR.java.svn-base new file mode 100644 index 0000000..7b4c952 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/IOR.java.svn-base @@ -0,0 +1,311 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.portable.IDLEntity; +import org.omg.IOP.TAG_INTERNET_IOP; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * Representation of an Internet Object Reference (IOR). An IOR is compounded + * by; + *

    + *
  • at least one TaggedProfile + *
  • the repositoryId of the reference + *
+ * In addition, the ior has its stringified representation and its marshaled + * value. + * + * @autor Juan A. Cáceres + * @version 2.0 + */ + +public abstract class IOR implements IDLEntity { /*extends org.omg.IOP.IOR*/ + + + private static IOR nullIOR; + + String toString; + + + public java.lang.String type_id; + public TaggedProfile[] profiles; + + + int hash_code = -1; + + public IOR() { + toString = null; + } + + public IOR(String type_id, TaggedProfile[] profiles) { + this.type_id = type_id; + this.profiles = profiles; + toString = null; + } + + public static IOR nullIOR() { + if ( nullIOR == null ) { + nullIOR = new DefaultIOR("", new TaggedProfile[0]){ + + }; + } + return nullIOR; + } + + public synchronized void addProfile(TaggedProfile profile) + { + if(this.profiles == null) { + this.profiles = new TaggedProfile[1]; + this.profiles[0] = profile; + } else { + TaggedProfile[] tmp = new TaggedProfile[this.profiles.length + 1]; + System.arraycopy(this.profiles, 0, tmp, 0, this.profiles.length); + tmp[this.profiles.length] = profile; + this.profiles = tmp; + } + this.toString = null; + } + + public synchronized void assign(IOR ior) { + if ( ior != null ) { + this.profiles = ior.profiles; + this.type_id = ior.type_id; + this.toString = ior.toString; + } else { + this.profiles = null; + this.type_id = null; + this.toString = null; + } + } + + public String getTypeId() { + return this.type_id; + } + + public int memberCount() { + return ( this.profiles == null )?0:this.profiles.length; + } + + public TaggedProfile getProfile(int index) { + return (index < 0) || (index >= profiles.length)? + null:profiles[index]; + } + + public boolean equivalent(IOR ior) { + if ((profiles == null) || (ior.profiles == null)) + return false; + + if (!type_id.equals(ior.type_id)) + return false; + + IOR ior_max, ior_min; + + if (memberCount() > ior.memberCount()) { + ior_max = this; + ior_min = ior; + } else { + ior_max = ior; + ior_min = this; + } + + int size_min = ior_min.memberCount(); + int size_max = ior_max.memberCount(); + + for (int i = 0; i < size_min; i++) { + if (ior_min.profiles[i].tag == TAG_INTERNET_IOP.value) { + for (int j = 0; j < size_max; j++) { + if (ior_max.profiles[j].tag == TAG_INTERNET_IOP.value) { + if ( ior_min.profiles[i].equal( ior_max.profiles[j] ) ){ + return true; + } + } + } + } + } + return false; + } + + public String toString() { + return toString(null); + } + + public int hashCode() { + if (hash_code == -1) { + hash_code = toString().hashCode(); + } + return hash_code; + } + + public synchronized String toString(TIDORB orb) { + if (toString == null) { + CDROutputStream ior_output = null; + + if (orb == null) { + ior_output = new CDROutputStream( + orb, + ConfORB.DEFAULT_BLOCK_SIZE + ); + } else { + ior_output = new CDROutputStream(orb, orb.m_conf.block_size); + } + + ior_output.write_boolean(ior_output.getByteOrder()); + + write(ior_output); + + // compound the buffer string + + BufferCDR cdr_buffer = ior_output.getBuffer(); + + int available = cdr_buffer.getAvailable(); + + char[] buffer = new char[(2 * available) + 4]; + + int i = 0; + buffer[i++] = 'I'; + buffer[i++] = 'O'; + buffer[i++] = 'R'; + buffer[i++] = ':'; + + int num_chunks = cdr_buffer.getNumAvailableChunks(); + + ChunkCDR cdr_chunk = null; + + int octet = 0; + int chunk_available; + byte[] ior_data; + + int chunk_no = 0; + + while (i < buffer.length) { + cdr_chunk = cdr_buffer.getChunk(chunk_no++); + chunk_available = cdr_chunk.getAvailable(); + ior_data = cdr_chunk.getBuffer(); + + for (int j = 0; j < chunk_available; j++) { + octet = ior_data[j]; + buffer[i++] = Base16Codec.toBase16[(octet & 0xf0) >> 4]; + buffer[i++] = Base16Codec.toBase16[octet & 0xf]; + } + } + + toString = new String(buffer); + } + + return toString; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) { + // write type_id + out.write_string(type_id); + + // write profiles sequence + + out.write_ulong(profiles.length); + + for (int i = 0; i < profiles.length; i++) { + ((TaggedProfile)profiles[i]).write(out); + } + } + + + public void read(CDRInputStream input) { + type_id = input.read_string(); + + int size = input.read_ulong(); + + if (size < 0) { + throw new INV_OBJREF("Invalid Profile sequence length.", 0, + CompletionStatus.COMPLETED_NO); + } + + profiles = new TaggedProfile[size]; + + int tag; + + for (int i = 0; i < profiles.length; i++) { + profiles[i] = TaggedProfileReader.read(input); + } + } + + + + public static void skip(CDRInputStream input) { + input.skipString(); + + int size = input.read_ulong(); + + if (size < 0) + throw new INV_OBJREF("Invalid Profile sequence length.", 0, + CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < size; i++) { + TaggedProfile.skip(input); + } + + } + + public abstract String toURL(); + + + public abstract ObjectKey getObjectKey(); + + public abstract TargetAddress toObjectKeyAddress(); + + public abstract TargetAddress toProfileAddress(); + + public abstract TargetAddress toIORAddress(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/ORBComponent.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/ORBComponent.java.svn-base new file mode 100644 index 0000000..b69f580 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/ORBComponent.java.svn-base @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.ConfORB; +import org.omg.IOP.TAG_ORB_TYPE; + +/** + * ORBComponent data struct defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ORBComponent extends TaggedComponent +{ + + public int m_orb_type; + + public ORBComponent() + { + super(TAG_ORB_TYPE.value); + m_orb_type = 0; + } + + public ORBComponent(int type) + { + super(TAG_ORB_TYPE.value); + m_orb_type = type; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + out.write_ulong(m_orb_type); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_orb_type = input.read_ulong(); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + if (m_orb_type == ConfORB.ORB_TYPE.m_orb_type) { + print_buffer.print("ORB type ID: "); + print_buffer.print(m_orb_type); + print_buffer.print(" (TIDORB - Telefonica I+D)"); + } else { + print_buffer.print("ORB: "); + print_buffer.print(m_orb_type); + } + + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/ProfileMultipleComponents.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/ProfileMultipleComponents.java.svn-base new file mode 100644 index 0000000..e72ea4a --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/ProfileMultipleComponents.java.svn-base @@ -0,0 +1,156 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.IOP.TAG_MULTIPLE_COMPONENTS; + +/** + * ProfileMultipleComponents sequence defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ProfileMultipleComponents extends TaggedProfile +{ + + private TaggedComponent[] m_components; + + es.tid.TIDorbj.core.cdr.CDRInputStream m_profile_data; + + protected ProfileMultipleComponents() + { + super(TAG_MULTIPLE_COMPONENTS.value); + m_components = null; + m_profile_data = null; + } + + public ProfileMultipleComponents(TaggedComponent[] tagged_components) + { + super(TAG_MULTIPLE_COMPONENTS.value); + m_components = tagged_components; + } + + public TaggedComponent[] getTaggedComponents() + { + if (m_profile_data != null) + extract_members(); + return m_components; + } + + synchronized protected void extract_members() + { + if (m_profile_data == null) + throw new org.omg.CORBA.INTERNAL("Empty Profile"); + + m_profile_data.enterEncapsulation(); + + int size = m_profile_data.read_ulong(); + if (size < 0) + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + if (size > 0) { + m_components = new TaggedComponent[size]; + for (int i = 0; i < size; i++) { + m_components[i] = TaggedComponentReader.read(m_profile_data); + } + } + + m_profile_data = null; + } + + public boolean equal( Object o ){ + ProfileMultipleComponents pfc; + if ( o instanceof ProfileMultipleComponents ){ + pfc = ( ProfileMultipleComponents )o; + } else { + pfc = null; + } + + if ( pfc == null ){ + return false; + } else { + throw new NO_IMPLEMENT(); + } + } + + synchronized public void + write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_profile_data != null) { + extract_members(); + } + + // write tag + output.write_ulong(tag); + + // write profile data + + output.enterEncapsulation(); + + if (m_components == null) + output.write_ulong(0); + else { + output.write_ulong(m_components.length); + for (int i = 0; i < m_components.length; i++) + m_components[i].write(output); + } + + output.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_profile_data = input.copy(); + input.skipEncapsulation(); + + /* + * profile_data = input.copy(); + * + * profile_data.fix_starting(); + * + * int length = input.read_ulong(); + * + * for(int i = 0; i 0) { + print_buffer.print("\n \t \t \t NoProtection"); + } + if ( (mask & org.omg.Security.Integrity.value) > 0) { + print_buffer.print("\n \t \t \t Integrity"); + } + if ( (mask & org.omg.Security.Confidentiality.value) > 0) { + print_buffer.print("\n \t \t \t Confidentiality"); + } + if ( (mask & org.omg.Security.DetectReplay.value) > 0) { + print_buffer.print("\n \t \t \t DetectReplay"); + } + if ( (mask & org.omg.Security.DetectMisordering.value) > 0) { + print_buffer.print("\n \t \t \t DetectMisordering"); + } + if ( (mask & org.omg.Security.EstablishTrustInTarget.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInTarget"); + } + if ( (mask & org.omg.Security.EstablishTrustInClient.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInClient"); + } + if ( (mask & org.omg.Security.NoDelegation.value) > 0) { + print_buffer.print("\n \t \t \t NoDelegation"); + } + if ( (mask & org.omg.Security.SimpleDelegation.value) > 0) { + print_buffer.print("\n \t \t \t SimpleDelegation"); + } + if ( (mask & org.omg.Security.CompositeDelegation.value) > 0) { + print_buffer.print("\n \t \t \t CompositeDelegation"); + } + if ( (mask & org.omg.CSIIOP.IdentityAssertion.value) > 0) { + print_buffer.print("\n \t \t \t IdentityAssertion"); + } + if ( (mask & org.omg.CSIIOP.DelegationByClient.value) > 0) { + print_buffer.print("\n \t \t \t DelegationByClient"); + } + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponent.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponent.java.svn-base new file mode 100644 index 0000000..12489fe --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponent.java.svn-base @@ -0,0 +1,88 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +/** + * TaggedComponent structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class TaggedComponent +{ + + public int m_tag; + + public es.tid.TIDorbj.core.cdr.Encapsulation m_component_data; + + public TaggedComponent(int tag) + { + m_tag = tag; + m_component_data = null; + } + + public TaggedComponent(int tag, + es.tid.TIDorbj.core.cdr.Encapsulation component_data) + { + m_tag = tag; + m_component_data = component_data; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_tag); + output.writeEncapsulation(m_component_data); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_component_data = input.readEncapsulation(); + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUlong(); //tag + input.skipEncapsulation(); // component_data + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponentReader.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponentReader.java.svn-base new file mode 100644 index 0000000..afb1698 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedComponentReader.java.svn-base @@ -0,0 +1,92 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.IOP.TAG_ORB_TYPE; +import org.omg.IOP.TAG_POLICIES; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; + +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.security.CSIComponent; + +/** + * Helper class for read TaggedComponent structures. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class TaggedComponentReader +{ + + public static TaggedComponent + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int profile_id = input.read_ulong(); + + switch (profile_id) + { + case TAG_ORB_TYPE.value: + ORBComponent orb_component = new ORBComponent(); + orb_component.partialRead(input); + return orb_component; + case TAG_POLICIES.value: + PoliciesComponent policies = new PoliciesComponent(); + policies.partialRead(input); + return policies; + case TAG_SSL_SEC_TRANS.value: + SSLComponent ssl_component = new SSLComponent(); + ssl_component.partialRead(input); + return ssl_component; + case TAG_CSI_SEC_MECH_LIST.value: + CSIComponent csi_component = new CSIComponent(); + csi_component.partialRead(input); + return csi_component; + default: + TaggedComponent comp = new TaggedComponent(profile_id); + comp.partialRead(input); + return comp; + } + } +} diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfile.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfile.java.svn-base new file mode 100644 index 0000000..8526d3f --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfile.java.svn-base @@ -0,0 +1,89 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * TaggedProfile structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class TaggedProfile implements IDLEntity {/*extends org.omg.IOP.TaggedProfile {*/ + + + public int tag; + public byte[] profile_data; + + public TaggedProfile() {} + + public TaggedProfile(int tag, byte[] profile_data) { + this.tag = tag; + this.profile_data = profile_data; + } + + public TaggedProfile(int tag) { + this( tag, null ); + } + + public abstract boolean equal( Object profile ); + + public abstract void write( + es.tid.TIDorbj.core.cdr.CDROutputStream output + ); + + public abstract void partialRead( + es.tid.TIDorbj.core.cdr.CDRInputStream input + ); + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) { + // skip tag + input.skipUlong(); + // skip encapsulation + int encapsulation_size = input.read_ulong(); + input.skipOctetArray(encapsulation_size); + } + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfileReader.java.svn-base b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfileReader.java.svn-base new file mode 100644 index 0000000..2c84aed --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/.svn/text-base/TaggedProfileReader.java.svn-base @@ -0,0 +1,87 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.IOP.TAG_INTERNET_IOP; +import org.omg.IOP.TAG_MULTIPLE_COMPONENTS; + +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; + +/** + * Helper class for reading GIOP TaggedProfile. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: maybe a TaggedProfile factory could help in generalizing profiles management +//generating profiles depending on the ID, each profile could read itself from the CDR input +public abstract class TaggedProfileReader +{ + + public static TaggedProfile + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int profile_id = input.read_ulong(); + + switch (profile_id) + { + case TAG_INTERNET_IOP.value: + IIOPProfile profile_iiop = new IIOPProfile(); + profile_iiop.partialRead(input); + return profile_iiop; + case TAG_MULTIPLE_COMPONENTS.value: + ProfileMultipleComponents multi_comp = + new ProfileMultipleComponents(); + multi_comp.partialRead(input); + return multi_comp; + default: + throw new MARSHAL("Invalid Profile TAG.", + 0, + CompletionStatus.COMPLETED_NO); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/CSIComponent.java b/source/es/tid/TIDorbj/core/iop/CSIComponent.java new file mode 100644 index 0000000..95f61a1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/CSIComponent.java @@ -0,0 +1,330 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2009 Telefonica Investigacion y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import java.io.StringWriter; +import java.io.PrintWriter; +import java.lang.Byte; + +import es.tid.TIDorbj.core.ConfORB; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; +import org.omg.CSIIOP.CompoundSecMechList; +import org.omg.CSIIOP.CompoundSecMechListHelper; +import org.omg.CSIIOP.ServiceConfiguration; +import org.omg.CSI.ITTAbsent; +import org.omg.CSI.ITTAnonymous; +import org.omg.CSI.ITTPrincipalName; +import org.omg.CSI.ITTX509CertChain; +import org.omg.CSI.ITTDistinguishedName; + + + +/** + * CSIComponent data struct defined in the GIOP Module. + * + * @autor + * @version 1.0 + */ +public class CSIComponent extends TaggedComponent +{ + + private CompoundSecMechList m_mec_list; + + public CSIComponent() + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = new CompoundSecMechList(); + } + + public CSIComponent(CompoundSecMechList mec_list) + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = mec_list; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + CompoundSecMechListHelper.write(out, m_mec_list); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_mec_list = CompoundSecMechListHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("stateful: "); + print_buffer.print(m_mec_list.stateful); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + for (int i = 0; i < m_mec_list.mechanism_list.length; i++) { + print_buffer.print("mechanism: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" transport_mech: " + + CSIComponent.print_TransportMechTag( + m_mec_list.mechanism_list[i].transport_mech.tag)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" as_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" client_authentication_mech: " + + print_OID(m_mec_list.mechanism_list[i].as_context_mech.client_authentication_mech)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_name: " + + print_GSS_NT_ExportedName( + m_mec_list.mechanism_list[i].as_context_mech.target_name)); + + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" sas_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" privilege_authorities: " + + CSIComponent.print_PrivilegeAuthorities( + m_mec_list.mechanism_list[i].sas_context_mech.privilege_authorities)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_naming_mechanims: " + + print_OIDList( + m_mec_list.mechanism_list[i].sas_context_mech.supported_naming_mechanisms)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_identity_types: " + + print_IdentityTokenTypes( + m_mec_list.mechanism_list[i].sas_context_mech.supported_identity_types)); + } + return buffer.toString(); + } + + + + public static String print_PrivilegeAuthorities(ServiceConfiguration[] privilege_authorities) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < privilege_authorities.length; i++) { + print_buffer.print("\n \t \t \t sintax: " + privilege_authorities[i].syntax); + print_buffer.print("\n \t \t \t name: " + privilege_authorities[i].name); + } + + return buffer.toString(); + } + + public static String print_OID(byte[] oid) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t OID: "); + + for (int i = 0; i < oid.length; i++) { + String hex = Integer.toHexString(oid[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + } + + return buffer.toString(); + } + + + public static String print_OIDList(byte[][] oid_list) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < oid_list.length; i++) { + print_buffer.print(print_OID(oid_list[i])); + } + + return buffer.toString(); + } + + public static String print_IdentityTokenTypes(int type) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(type) { + case org.omg.CSI.ITTAbsent.value: + print_buffer.print("\n \t \t \t Absent"); + break; + case org.omg.CSI.ITTAnonymous.value: + print_buffer.print("\n \t \t \t Anonymous"); + break; + case org.omg.CSI.ITTPrincipalName.value: + print_buffer.print("\n \t \t \t PrincipalName"); + break; + case org.omg.CSI.ITTX509CertChain.value: + print_buffer.print("\n \t \t \t ITTX509CertChain"); + break; + case org.omg.CSI.ITTDistinguishedName.value: + print_buffer.print("\n \t \t \t ITTDistinguishedName"); + break; + } + return buffer.toString(); + } + + + public static String print_TransportMechTag(int tag) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(tag) { + case org.omg.IOP.TAG_SSL_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_SSL_SEC_TRANS"); + break; + case org.omg.IOP.TAG_TLS_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_TLS_SEC_TRANS"); + break; + case org.omg.IOP.TAG_NULL_TAG.value: + print_buffer.print("\n \t \t \t TAG_NULL_TAG"); + break; + } + return buffer.toString(); + } + + + public static String print_GSS_NT_ExportedName(byte[] name) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t "); + + for (int i = 0; i < name.length; i++) { + String hex = Integer.toHexString(name[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + + } + + return buffer.toString(); + + } + + +} diff --git a/source/es/tid/TIDorbj/core/iop/DefaultIOR.java b/source/es/tid/TIDorbj/core/iop/DefaultIOR.java new file mode 100644 index 0000000..9f0be19 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/DefaultIOR.java @@ -0,0 +1,136 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.NO_IMPLEMENT; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public class DefaultIOR extends IOR { + + /** + * + */ + public DefaultIOR() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @param type_id + * @param profiles + */ + public DefaultIOR( String type_id, TaggedProfile[] profiles ) { + super( type_id, profiles ); + } + + public static IOR fromString(TIDORB orb, String ior_str) { + + int length = ior_str.length(); + if (((length % 2) != 0) || (length < 14)) + throw new INV_OBJREF("IOR format error: invalid ior length.", 0, + CompletionStatus.COMPLETED_NO); + if (!ior_str.startsWith("IOR:")) + throw new INV_OBJREF("Invalid IOR format id: \"IOR:\".", 0, + CompletionStatus.COMPLETED_NO); + + byte[] buffer = new byte[(length - 4) / 2]; + char[] ior_chars = ior_str.toCharArray(); + int j = 4; + try { + for (int i = 0; i < buffer.length; i++) + buffer[i] = + (byte) (16 * (Base16Codec.getValue(ior_chars[j++])) + + Base16Codec.getValue(ior_chars[j++])); + } + catch (Exception e) { + throw new INV_OBJREF(e.getMessage(), 0, + CompletionStatus.COMPLETED_NO); + } + // create the the ior with the new buffer + IOR ior = new DefaultIOR(); + + CDRInputStream internet_cdr = new CDRInputStream(orb, buffer); + + internet_cdr.setByteOrder(internet_cdr.read_boolean()); + + ior.read(internet_cdr); + + ior.toString = ior_str; + + return ior; + } + + public String toURL(){ + return toString(); + } + + public ObjectKey getObjectKey() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toObjectKeyAddress() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toProfileAddress() { + throw new NO_IMPLEMENT(); + } + + public TargetAddress toIORAddress() { + throw new NO_IMPLEMENT(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/IOR.java b/source/es/tid/TIDorbj/core/iop/IOR.java new file mode 100644 index 0000000..34f7901 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/IOR.java @@ -0,0 +1,311 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.portable.IDLEntity; +import org.omg.IOP.TAG_INTERNET_IOP; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.BufferCDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.ChunkCDR; +import es.tid.TIDorbj.core.comm.iiop.TargetAddress; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * Representation of an Internet Object Reference (IOR). An IOR is compounded + * by; + *
    + *
  • at least one TaggedProfile + *
  • the repositoryId of the reference + *
+ * In addition, the ior has its stringified representation and its marshaled + * value. + * + * @autor Juan A. Cáceres + * @version 2.0 + */ + +public abstract class IOR implements IDLEntity { /*extends org.omg.IOP.IOR*/ + + + private static IOR nullIOR; + + String toString; + + + public java.lang.String type_id; + public TaggedProfile[] profiles; + + + int hash_code = -1; + + public IOR() { + toString = null; + } + + public IOR(String type_id, TaggedProfile[] profiles) { + this.type_id = type_id; + this.profiles = profiles; + toString = null; + } + + public static IOR nullIOR() { + if ( nullIOR == null ) { + nullIOR = new DefaultIOR("", new TaggedProfile[0]){ + + }; + } + return nullIOR; + } + + public synchronized void addProfile(TaggedProfile profile) + { + if(this.profiles == null) { + this.profiles = new TaggedProfile[1]; + this.profiles[0] = profile; + } else { + TaggedProfile[] tmp = new TaggedProfile[this.profiles.length + 1]; + System.arraycopy(this.profiles, 0, tmp, 0, this.profiles.length); + tmp[this.profiles.length] = profile; + this.profiles = tmp; + } + this.toString = null; + } + + public synchronized void assign(IOR ior) { + if ( ior != null ) { + this.profiles = ior.profiles; + this.type_id = ior.type_id; + this.toString = ior.toString; + } else { + this.profiles = null; + this.type_id = null; + this.toString = null; + } + } + + public String getTypeId() { + return this.type_id; + } + + public int memberCount() { + return ( this.profiles == null )?0:this.profiles.length; + } + + public TaggedProfile getProfile(int index) { + return (index < 0) || (index >= profiles.length)? + null:profiles[index]; + } + + public boolean equivalent(IOR ior) { + if ((profiles == null) || (ior.profiles == null)) + return false; + + if (!type_id.equals(ior.type_id)) + return false; + + IOR ior_max, ior_min; + + if (memberCount() > ior.memberCount()) { + ior_max = this; + ior_min = ior; + } else { + ior_max = ior; + ior_min = this; + } + + int size_min = ior_min.memberCount(); + int size_max = ior_max.memberCount(); + + for (int i = 0; i < size_min; i++) { + if (ior_min.profiles[i].tag == TAG_INTERNET_IOP.value) { + for (int j = 0; j < size_max; j++) { + if (ior_max.profiles[j].tag == TAG_INTERNET_IOP.value) { + if ( ior_min.profiles[i].equal( ior_max.profiles[j] ) ){ + return true; + } + } + } + } + } + return false; + } + + public String toString() { + return toString(null); + } + + public int hashCode() { + if (hash_code == -1) { + hash_code = toString().hashCode(); + } + return hash_code; + } + + public synchronized String toString(TIDORB orb) { + if (toString == null) { + CDROutputStream ior_output = null; + + if (orb == null) { + ior_output = new CDROutputStream( + orb, + ConfORB.DEFAULT_BLOCK_SIZE + ); + } else { + ior_output = new CDROutputStream(orb, orb.m_conf.block_size); + } + + ior_output.write_boolean(ior_output.getByteOrder()); + + write(ior_output); + + // compound the buffer string + + BufferCDR cdr_buffer = ior_output.getBuffer(); + + int available = cdr_buffer.getAvailable(); + + char[] buffer = new char[(2 * available) + 4]; + + int i = 0; + buffer[i++] = 'I'; + buffer[i++] = 'O'; + buffer[i++] = 'R'; + buffer[i++] = ':'; + + int num_chunks = cdr_buffer.getNumAvailableChunks(); + + ChunkCDR cdr_chunk = null; + + int octet = 0; + int chunk_available; + byte[] ior_data; + + int chunk_no = 0; + + while (i < buffer.length) { + cdr_chunk = cdr_buffer.getChunk(chunk_no++); + chunk_available = cdr_chunk.getAvailable(); + ior_data = cdr_chunk.getBuffer(); + + for (int j = 0; j < chunk_available; j++) { + octet = ior_data[j]; + buffer[i++] = Base16Codec.toBase16[(octet & 0xf0) >> 4]; + buffer[i++] = Base16Codec.toBase16[octet & 0xf]; + } + } + + toString = new String(buffer); + } + + return toString; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) { + // write type_id + out.write_string(type_id); + + // write profiles sequence + + out.write_ulong(profiles.length); + + for (int i = 0; i < profiles.length; i++) { + ((TaggedProfile)profiles[i]).write(out); + } + } + + + public void read(CDRInputStream input) { + type_id = input.read_string(); + + int size = input.read_ulong(); + + if (size < 0) { + throw new INV_OBJREF("Invalid Profile sequence length.", 0, + CompletionStatus.COMPLETED_NO); + } + + profiles = new TaggedProfile[size]; + + int tag; + + for (int i = 0; i < profiles.length; i++) { + profiles[i] = TaggedProfileReader.read(input); + } + } + + + + public static void skip(CDRInputStream input) { + input.skipString(); + + int size = input.read_ulong(); + + if (size < 0) + throw new INV_OBJREF("Invalid Profile sequence length.", 0, + CompletionStatus.COMPLETED_NO); + + for (int i = 0; i < size; i++) { + TaggedProfile.skip(input); + } + + } + + public abstract String toURL(); + + + public abstract ObjectKey getObjectKey(); + + public abstract TargetAddress toObjectKeyAddress(); + + public abstract TargetAddress toProfileAddress(); + + public abstract TargetAddress toIORAddress(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/ORBComponent.java b/source/es/tid/TIDorbj/core/iop/ORBComponent.java new file mode 100644 index 0000000..60e886d --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/ORBComponent.java @@ -0,0 +1,113 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.ConfORB; +import org.omg.IOP.TAG_ORB_TYPE; + +/** + * ORBComponent data struct defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ORBComponent extends TaggedComponent +{ + + public int m_orb_type; + + public ORBComponent() + { + super(TAG_ORB_TYPE.value); + m_orb_type = 0; + } + + public ORBComponent(int type) + { + super(TAG_ORB_TYPE.value); + m_orb_type = type; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + out.write_ulong(m_orb_type); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_orb_type = input.read_ulong(); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + if (m_orb_type == ConfORB.ORB_TYPE.m_orb_type) { + print_buffer.print("ORB type ID: "); + print_buffer.print(m_orb_type); + print_buffer.print(" (TIDORB - Telefonica I+D)"); + } else { + print_buffer.print("ORB: "); + print_buffer.print(m_orb_type); + } + + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.java b/source/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.java new file mode 100644 index 0000000..11f6da3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/ProfileMultipleComponents.java @@ -0,0 +1,156 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.IOP.TAG_MULTIPLE_COMPONENTS; + +/** + * ProfileMultipleComponents sequence defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class ProfileMultipleComponents extends TaggedProfile +{ + + private TaggedComponent[] m_components; + + es.tid.TIDorbj.core.cdr.CDRInputStream m_profile_data; + + protected ProfileMultipleComponents() + { + super(TAG_MULTIPLE_COMPONENTS.value); + m_components = null; + m_profile_data = null; + } + + public ProfileMultipleComponents(TaggedComponent[] tagged_components) + { + super(TAG_MULTIPLE_COMPONENTS.value); + m_components = tagged_components; + } + + public TaggedComponent[] getTaggedComponents() + { + if (m_profile_data != null) + extract_members(); + return m_components; + } + + synchronized protected void extract_members() + { + if (m_profile_data == null) + throw new org.omg.CORBA.INTERNAL("Empty Profile"); + + m_profile_data.enterEncapsulation(); + + int size = m_profile_data.read_ulong(); + if (size < 0) + throw new org.omg.CORBA.MARSHAL("Invalid component size"); + if (size > 0) { + m_components = new TaggedComponent[size]; + for (int i = 0; i < size; i++) { + m_components[i] = TaggedComponentReader.read(m_profile_data); + } + } + + m_profile_data = null; + } + + public boolean equal( Object o ){ + ProfileMultipleComponents pfc; + if ( o instanceof ProfileMultipleComponents ){ + pfc = ( ProfileMultipleComponents )o; + } else { + pfc = null; + } + + if ( pfc == null ){ + return false; + } else { + throw new NO_IMPLEMENT(); + } + } + + synchronized public void + write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if (m_profile_data != null) { + extract_members(); + } + + // write tag + output.write_ulong(tag); + + // write profile data + + output.enterEncapsulation(); + + if (m_components == null) + output.write_ulong(0); + else { + output.write_ulong(m_components.length); + for (int i = 0; i < m_components.length; i++) + m_components[i].write(output); + } + + output.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_profile_data = input.copy(); + input.skipEncapsulation(); + + /* + * profile_data = input.copy(); + * + * profile_data.fix_starting(); + * + * int length = input.read_ulong(); + * + * for(int i = 0; i 0) { + print_buffer.print("\n \t \t \t NoProtection"); + } + if ( (mask & org.omg.Security.Integrity.value) > 0) { + print_buffer.print("\n \t \t \t Integrity"); + } + if ( (mask & org.omg.Security.Confidentiality.value) > 0) { + print_buffer.print("\n \t \t \t Confidentiality"); + } + if ( (mask & org.omg.Security.DetectReplay.value) > 0) { + print_buffer.print("\n \t \t \t DetectReplay"); + } + if ( (mask & org.omg.Security.DetectMisordering.value) > 0) { + print_buffer.print("\n \t \t \t DetectMisordering"); + } + if ( (mask & org.omg.Security.EstablishTrustInTarget.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInTarget"); + } + if ( (mask & org.omg.Security.EstablishTrustInClient.value) > 0) { + print_buffer.print("\n \t \t \t EstablishTrustInClient"); + } + if ( (mask & org.omg.Security.NoDelegation.value) > 0) { + print_buffer.print("\n \t \t \t NoDelegation"); + } + if ( (mask & org.omg.Security.SimpleDelegation.value) > 0) { + print_buffer.print("\n \t \t \t SimpleDelegation"); + } + if ( (mask & org.omg.Security.CompositeDelegation.value) > 0) { + print_buffer.print("\n \t \t \t CompositeDelegation"); + } + if ( (mask & org.omg.CSIIOP.IdentityAssertion.value) > 0) { + print_buffer.print("\n \t \t \t IdentityAssertion"); + } + if ( (mask & org.omg.CSIIOP.DelegationByClient.value) > 0) { + print_buffer.print("\n \t \t \t DelegationByClient"); + } + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/iop/TaggedComponent.java b/source/es/tid/TIDorbj/core/iop/TaggedComponent.java new file mode 100644 index 0000000..3a7261c --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/TaggedComponent.java @@ -0,0 +1,88 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +/** + * TaggedComponent structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public class TaggedComponent +{ + + public int m_tag; + + public es.tid.TIDorbj.core.cdr.Encapsulation m_component_data; + + public TaggedComponent(int tag) + { + m_tag = tag; + m_component_data = null; + } + + public TaggedComponent(int tag, + es.tid.TIDorbj.core.cdr.Encapsulation component_data) + { + m_tag = tag; + m_component_data = component_data; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + output.write_ulong(m_tag); + output.writeEncapsulation(m_component_data); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_component_data = input.readEncapsulation(); + } + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUlong(); //tag + input.skipEncapsulation(); // component_data + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/TaggedComponentReader.java b/source/es/tid/TIDorbj/core/iop/TaggedComponentReader.java new file mode 100644 index 0000000..1c38ff5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/TaggedComponentReader.java @@ -0,0 +1,92 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.IOP.TAG_ORB_TYPE; +import org.omg.IOP.TAG_POLICIES; +import org.omg.IOP.TAG_SSL_SEC_TRANS; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; + +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import es.tid.TIDorbj.core.security.CSIComponent; + +/** + * Helper class for read TaggedComponent structures. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class TaggedComponentReader +{ + + public static TaggedComponent + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int profile_id = input.read_ulong(); + + switch (profile_id) + { + case TAG_ORB_TYPE.value: + ORBComponent orb_component = new ORBComponent(); + orb_component.partialRead(input); + return orb_component; + case TAG_POLICIES.value: + PoliciesComponent policies = new PoliciesComponent(); + policies.partialRead(input); + return policies; + case TAG_SSL_SEC_TRANS.value: + SSLComponent ssl_component = new SSLComponent(); + ssl_component.partialRead(input); + return ssl_component; + case TAG_CSI_SEC_MECH_LIST.value: + CSIComponent csi_component = new CSIComponent(); + csi_component.partialRead(input); + return csi_component; + default: + TaggedComponent comp = new TaggedComponent(profile_id); + comp.partialRead(input); + return comp; + } + } +} diff --git a/source/es/tid/TIDorbj/core/iop/TaggedProfile.java b/source/es/tid/TIDorbj/core/iop/TaggedProfile.java new file mode 100644 index 0000000..bd83a32 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/TaggedProfile.java @@ -0,0 +1,89 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.portable.IDLEntity; + +/** + * TaggedProfile structure defined in the GIOP Module. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class TaggedProfile implements IDLEntity {/*extends org.omg.IOP.TaggedProfile {*/ + + + public int tag; + public byte[] profile_data; + + public TaggedProfile() {} + + public TaggedProfile(int tag, byte[] profile_data) { + this.tag = tag; + this.profile_data = profile_data; + } + + public TaggedProfile(int tag) { + this( tag, null ); + } + + public abstract boolean equal( Object profile ); + + public abstract void write( + es.tid.TIDorbj.core.cdr.CDROutputStream output + ); + + public abstract void partialRead( + es.tid.TIDorbj.core.cdr.CDRInputStream input + ); + + public static void skip(es.tid.TIDorbj.core.cdr.CDRInputStream input) { + // skip tag + input.skipUlong(); + // skip encapsulation + int encapsulation_size = input.read_ulong(); + input.skipOctetArray(encapsulation_size); + } + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/iop/TaggedProfileReader.java b/source/es/tid/TIDorbj/core/iop/TaggedProfileReader.java new file mode 100644 index 0000000..ebdc936 --- /dev/null +++ b/source/es/tid/TIDorbj/core/iop/TaggedProfileReader.java @@ -0,0 +1,87 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.iop; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.IOP.TAG_INTERNET_IOP; +import org.omg.IOP.TAG_MULTIPLE_COMPONENTS; + +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; + +/** + * Helper class for reading GIOP TaggedProfile. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +//TODO: maybe a TaggedProfile factory could help in generalizing profiles management +//generating profiles depending on the ID, each profile could read itself from the CDR input +public abstract class TaggedProfileReader +{ + + public static TaggedProfile + read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int profile_id = input.read_ulong(); + + switch (profile_id) + { + case TAG_INTERNET_IOP.value: + IIOPProfile profile_iiop = new IIOPProfile(); + profile_iiop.partialRead(input); + return profile_iiop; + case TAG_MULTIPLE_COMPONENTS.value: + ProfileMultipleComponents multi_comp = + new ProfileMultipleComponents(); + multi_comp.partialRead(input); + return multi_comp; + default: + throw new MARSHAL("Invalid Profile TAG.", + 0, + CompletionStatus.COMPLETED_NO); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/all-wcprops b/source/es/tid/TIDorbj/core/messaging/.svn/all-wcprops new file mode 100644 index 0000000..ac1327b --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/all-wcprops @@ -0,0 +1,119 @@ +K 25 +svn:wc:ra_dav:version-url +V 84 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging +END +RequestEndTimePolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.java +END +AMIManager.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMIManager.java +END +QoS.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/QoS.java +END +RebindPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.java +END +AMIManagerConf.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMIManagerConf.java +END +AMILockList.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMILockList.java +END +_ExceptionHolderImpl.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.java +END +AMIManagerConfListener.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.java +END +ThreadStateListener.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/ThreadStateListener.java +END +AMILock.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMILock.java +END +QueueOrderPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.java +END +AMILockEnumeration.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMILockEnumeration.java +END +RequestStartTimePolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.java +END +AMIThreadPool.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMIThreadPool.java +END +PoliciesComponent.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/PoliciesComponent.java +END +RelativeRoundtripTimeoutPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 124 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.java +END +RequestPriorityPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.java +END +RelativeRequestTimeoutPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 122 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.java +END +AMIThread.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging/AMIThread.java +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/entries b/source/es/tid/TIDorbj/core/messaging/.svn/entries new file mode 100644 index 0000000..3f0de54 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/entries @@ -0,0 +1,683 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/messaging +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + + + +() + +RequestEndTimePolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +f93766e7e3f10151513977d626c0bffb +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3683 + +AMIManager.java +file + + + + +2010-04-28T11:50:13.000000Z +b48a105f3874db6cec8f771e6734ca88 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +4991 + +QoS.java +file + + + + +2009-05-27T14:10:34.000000Z +80d31d546da7f21e9bff0eb553704f74 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +8326 + +RebindPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +9410561d27ececfe6999c3802eadc06b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2833 + +AMIManagerConf.java +file + + + + +2009-05-27T14:10:34.000000Z +b3e6c98f04fd5f8b54ef0227d13bb8f3 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3987 + +AMILockList.java +file + + + + +2009-05-27T14:10:34.000000Z +0fbd8aa5de8a165c97f0fac0b9407229 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3894 + +AMIManagerConfListener.java +file + + + + +2009-05-27T12:24:00.000000Z +bd79a3fc5a48deb4303616d094ee15b1 +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1660 + +_ExceptionHolderImpl.java +file + + + + +2010-04-28T11:50:13.000000Z +ce5ec654c41a2508d18d9082805b073a +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +5111 + +ThreadStateListener.java +file + + + + +2009-05-27T12:24:00.000000Z +8e0e4e26409358fd3534c371627438c7 +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1846 + +AMILock.java +file + + + + +2010-04-28T11:50:13.000000Z +e3579a8f6dcee9bdbe5bd53e4ae63ec4 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +13843 + +QueueOrderPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +a4a149bd5febe522213846e46c710c1f +2009-01-07T08:56:41.327974Z +349 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3970 + +AMILockEnumeration.java +file + + + + +2009-05-27T12:24:00.000000Z +283c93d4125a25b9458e75bd7b4192ae +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1946 + +RequestStartTimePolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +f6fe2798f7d124020c383524193b12d0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3655 + +AMIThreadPool.java +file + + + + +2009-05-27T14:10:34.000000Z +b40c7a4c60cfc38e551f2dae7c1f81ea +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +5280 + +PoliciesComponent.java +file + + + + +2009-05-27T12:24:00.000000Z +aca1be7eef51ce444d2f49218aae7fe3 +2009-01-07T08:56:41.327974Z +349 +avega +has-props + + + + + + + + + + + + + + + + + + + + +3305 + +RelativeRoundtripTimeoutPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +9031dfff4cd31df769f5b920e0213dc5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3105 + +RequestPriorityPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +df4ef85fe5df5017e55a1b579d0584b4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2070 + +RelativeRequestTimeoutPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +f97577eed8a40114f330cfd417eb8557 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3299 + +AMIThread.java +file + + + + +2009-05-27T14:10:34.000000Z +b34c1ea189b6696adc09842746baf565 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +7160 + diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILock.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILock.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILock.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockEnumeration.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockEnumeration.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockEnumeration.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockList.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMILockList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManager.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConf.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConf.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConf.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConfListener.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConfListener.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIManagerConfListener.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThread.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThread.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThread.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThreadPool.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThreadPool.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/AMIThreadPool.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/PoliciesComponent.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/PoliciesComponent.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/PoliciesComponent.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QoS.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QoS.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QoS.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QueueOrderPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QueueOrderPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/QueueOrderPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RebindPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RebindPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RebindPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRequestTimeoutPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRequestTimeoutPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRequestTimeoutPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestEndTimePolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestEndTimePolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestEndTimePolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestPriorityPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestPriorityPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestPriorityPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestStartTimePolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestStartTimePolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/RequestStartTimePolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/ThreadStateListener.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/ThreadStateListener.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/ThreadStateListener.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/_ExceptionHolderImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/_ExceptionHolderImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/prop-base/_ExceptionHolderImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMILock.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMILock.java.svn-base new file mode 100644 index 0000000..d201ec4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMILock.java.svn-base @@ -0,0 +1,393 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import java.io.File; +import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.Streamable; +import org.omg.CORBA.portable.ValueFactory; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ExceptionHolder; +import org.omg.Messaging._ExceptionHolderHelper; + +import es.tid.CORBA.Any; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.OperationCompletion; + +/** + * Lock where the asynchronous requests stay until the complete response has been + * sent to ReplyHandler or the asynchronous response timeout has expired. + * + * + * + * @autor Irenka Redondo Granados + * @version 1.0 + */ + +public class AMILock +{ + + /** + * The Operation Completion Status. + */ + OperationCompletion m_state; + + /** + * Request identifier. This identifier will be the key for the connection + * thread to + */ + RequestId m_request_id; + + /** + * Asynchronous request + */ + RequestImpl m_request; + + GIOPFragmentedMessage message; + + /** + * Reference to ReplyHandler object which the response will be sent + */ + Object m_ami_handler; + + /** + * Asynchronous request's processing time + */ + long time; + + IIOPIOR m_ior; // ?????????? no se descripcion + + IIOPConnection m_conn; + + public AMILock() + { + m_request_id = null; + m_request = null; + message = null; + m_state = new OperationCompletion(); + m_ami_handler = null; + time = 0; + m_ior = null; + m_conn = null; + } + + public RequestId requestId() + { + return m_request_id; + } + + public void requestId(RequestId id) + { + m_request_id = id; + } + + public RequestImpl getRequest() + { + return m_request; + } + + public void setRequest(RequestImpl request) + { + m_request = request; + } + + public boolean getCompleted() + { + return m_state.isCompleted(); + } + + public void setCompleted() + { + m_state.setCompleted(); + } + + public void setMessage(GIOPFragmentedMessage msg) + { + message = msg; + } + + public GIOPFragmentedMessage getMessage() + { + return message; + } + + public void setHandler(Object handler) + { + m_ami_handler = handler; + } + + public Object getHandler() + { + return m_ami_handler; + } + + public void incrementTime (long inc) + { + time = +inc; + } + + public long getTime() + { + return time; + } + + public void setIor(IIOPIOR ior) + { + m_ior = ior; + } + + public IIOPIOR getIor() + { + return m_ior; + } + + public void putReply() { + + if (message == null) { + throw new INTERNAL("No Reply message"); + } + if (message.getHeader().getMsgType().m_value != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = (GIOPReplyMessage) message; + + m_request.setCompletedYes(); + + RequestImpl replyHandlerRequest; + org.omg.CORBA.Any $excep_holder; + _ExceptionHolder excepHolder; + + //Take the exception holder implementation class name + String idExcepHolder = idExcepHolder(m_ami_handler); + _ExceptionHolderImpl excepHolderFactory = + (_ExceptionHolderImpl) m_request.orb().lookup_value_factory(idExcepHolder); + + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + //funciona + /* + reply_message.extractArguments(m_request); + RequestImpl replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()); + if (m_request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_in_arg(); + $ami_return_val.read_value(m_request.return_value().create_input_stream(), m_request.return_value().type()); + } + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + }*/ + + replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()); + if (m_request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_named_in_arg("ami_return_val"); + $ami_return_val.type(m_request.return_value().type()); + } + NVListImpl.setOutParamsAsIn(m_request.arguments(), replyHandlerRequest); + reply_message.extractArgumentsForReplyHandler(replyHandlerRequest); + try { + replyHandlerRequest.invoke(); /// invoke or ther kind of invoke?? + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + break; + case ReplyStatusType._USER_EXCEPTION: + replyHandlerRequest = + (RequestImpl) m_ami_handler._request(m_request.operation() + "_excep"); + $excep_holder = replyHandlerRequest.add_named_in_arg("excep_holder"); + + _ExceptionHolderImpl excepHolder_impl = new _ExceptionHolderImpl(); + $excep_holder.type(excepHolder_impl._type()); + reply_message.extractUserException(excepHolder_impl); + + NVListImpl.setOutParamsAsIn(m_request.arguments(), replyHandlerRequest); + + _ExceptionHolderHelper.insert($excep_holder, + (org.omg.Messaging._ExceptionHolder)excepHolder_impl); + + + + + + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + e.printStackTrace(); + } + break; + case ReplyStatusType._SYSTEM_EXCEPTION: + replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()+"_excep"); + $excep_holder = replyHandlerRequest.add_named_in_arg("excep_holder"); + excepHolder = new _ExceptionHolderImpl(); + $excep_holder.type(excepHolder._type()); + //reply_message.extractSystemException(excepHolder); + $excep_holder.insert_Streamable(excepHolder); + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + //m_request.setSystemException(reply_message.extractSystemException()); + break; + /* + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + m_conn.sendRequest(m_request, m_ior, reply_message.extractAddressingDisposition()); + */ + } + + + } + + private String idExcepHolder (Object ami_handler) { + + if (ami_handler == null) + throw new INTERNAL("AMILock.idExcepHolder ami_handler is NULL"); + + String name = m_ami_handler.getClass().getName(); + String [] replyHandlerClassNameParts = name.split("\\."); + String nameClass = replyHandlerClassNameParts[replyHandlerClassNameParts.length-1]; + replyHandlerClassNameParts[replyHandlerClassNameParts.length-1] = + nameClass.substring(1, nameClass.length()-4); + String replyHandlerClassName = replyHandlerClassNameParts[0]; + + for (int i=1; i< replyHandlerClassNameParts.length; i++) + replyHandlerClassName = replyHandlerClassName + "." + replyHandlerClassNameParts[i]; + + Class replyHandlerClassHelper = null; + String idReplyHandler = null; + try { + replyHandlerClassHelper = Class.forName(replyHandlerClassName.concat("Helper"), + true, m_ami_handler.getClass().getClassLoader()); + Method methodId = replyHandlerClassHelper.getMethod("id",new Class[]{}); + idReplyHandler = (String) methodId.invoke(null,new java.lang.Object[]{}); + + //ReplyHandlerHelper rh = (ReplyHandlerHelper) replyHandlerClassHelper.getClass(); + } catch (ClassNotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchMethodException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + String [] idReplyHandlerParts = idReplyHandler.split(":"); + String [] handlerPath = idReplyHandlerParts[1].split("/"); + String excepHolderName = handlerPath[handlerPath.length - 1]; + excepHolderName = "_" + excepHolderName.substring(0, excepHolderName.length()-7) + + "ExceptionHolder"; + String excepHolderPath = ""; + for (int i=0; i this.m_max_threads) { + throw new + BAD_PARAM("min_threads can not be greater than max_threads."); + } + this.m_min_threads = min_threads; + if (m_listener != null) { + m_listener.minThreadsHasChanged(); + } + } + + synchronized public void setMaxThreads(int max_threads) + { + if (max_threads < this.m_min_threads) { + throw new + BAD_PARAM("max_threads can not be less than min_threads."); + } + this.m_max_threads = max_threads; + } + + synchronized public void setMaxQueuedRequests(int max_queued_requests) + { + if (max_queued_requests < this.m_max_queued_requests) { + throw new + BAD_PARAM("max_queued_requests can not be decreased."); + } + this.m_max_queued_requests = max_queued_requests; + } + + synchronized public void setStarvingTime(int millisecs) + { + if (millisecs < 0) { + throw new BAD_PARAM("starving_time can not be negative."); + } + this.m_starving_time = millisecs; + } + + synchronized public int getMaxQueuedRequests() + { + return m_max_queued_requests; + } + + synchronized public int getMaxThreads() + { + return m_max_threads; + } + + synchronized public int getMinThreads() + { + return m_min_threads; + } + + synchronized public int getStarvingTime() + { + return m_starving_time; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIManagerConfListener.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIManagerConfListener.java.svn-base new file mode 100644 index 0000000..a815fc7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIManagerConfListener.java.svn-base @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +public interface AMIManagerConfListener +{ + + void minThreadsHasChanged(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThread.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThread.java.svn-base new file mode 100644 index 0000000..8d3d71b --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThread.java.svn-base @@ -0,0 +1,214 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.Trace; + +/** + * Execution thread. Gets request from the request queue and executes them. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class AMIThread extends Thread +{ + + private AMIManager m_ami_manager = null; + + private AMILockList m_ami_lock_list = null; + + private boolean m_deactivated = false; + + private ThreadStateListener m_thread_state_listener = null; + + private String m_thread_name; + + private TIDORB m_orb; + + private Trace m_trace; + + + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this ExecThread belongs. + * @param number + * Id number of this ExecThread. + */ + protected AMIThread(AMIManager amiManager) + { + m_ami_manager = amiManager; + m_ami_lock_list = m_ami_manager.getAMILockList(); + m_orb = m_ami_manager.m_orb; + m_trace = m_orb.m_trace; + } + + /** + * Set the ThreadStateListener. Any AMIThread should have a listener + * (eventually the AMIThreadPool) before it is started. + * + * @param l + * The listener. + */ + protected void setThreadStateListener(ThreadStateListener l) + { + m_thread_state_listener = l; + } + + /** + * Checks the state of the POAManager. If the state is ACTIVE, then finish + * returning true. If the state is HOLDING, then wait until state is + * diferent from HOLDING. If the state is DISCARDING, then discard the + * request and return false. If the state is INACTIVE, then reject the + * request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + /*private boolean checkState( QueuedRequest request ) { + + boolean executeRequest = false; + + if (m_trace != null) { + String[] msg = { toString(), " checking state of ", + m_ami_manager.toString() }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + synchronized (m_ami_manager.m_state_mutex) { + boolean exit = false; + while (!exit) { + State state = m_poa_manager.get_state(); + if ((state == State.ACTIVE) && !request.getMustDiscard()) { + exit = true; + executeRequest = true; + } else if (state == State.HOLDING) { + try { + // wait until state changes + m_poa_manager.m_state_mutex.wait(); + } catch (InterruptedException ie) {} + exit = false; + } else if (state == State.INACTIVE) { + // MISSING: define strategy for deactivated POAManagers + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } else if ( state == State.DISCARDING || + request.getMustDiscard() ){ + //TODO: trace removed, restore it at each implementation + //TODO: change method signature to return possible errors + //in state check + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } + } + } + return executeRequest; + }*/ + + /** + * Execution loop. + */ + public void run() + { + + while (!m_deactivated) { + + try { + + if (m_trace != null) { + String[] msg = { toString(), ": sending AMI reply..." }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + AMILock ami_lock = m_ami_lock_list.getFirstReady(); + + if (ami_lock != null) { + // If there is a response ready, then go!! + m_thread_state_listener.setActive(this); + ami_lock.putReply(); + m_thread_state_listener.setInactive(this); + + } else if (m_thread_state_listener.threadCanDie(this)) { + // If restarted and no request, then commit suicide + m_deactivated = true; + } + + } + catch (Throwable unhandledException) { + // Unhandled exception. Should never happen!! + if (m_trace != null) { + m_trace.printStackTrace(Trace.DEBUG, + toString() + "Unhanled Exception ", + unhandledException); + m_trace.print(Trace.DEBUG, toString() + " dies..."); + } + m_deactivated = true; + } + } + m_thread_state_listener.threadHasDied(this); + } + + /** + * @return Returns the string representation of this Thread. + */ + public synchronized String toString() + { + if (m_thread_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append(super.toString()); + buffer.append(" in "); + buffer.append(m_ami_manager.toString()); + m_thread_name = buffer.toString(); + buffer = null; + } + return m_thread_name; + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThreadPool.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThreadPool.java.svn-base new file mode 100644 index 0000000..13c3be7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/AMIThreadPool.java.svn-base @@ -0,0 +1,191 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import java.util.Vector; + +import es.tid.TIDorbj.core.poa.QueueReaderManager; +import es.tid.TIDorbj.util.Trace; + +/** + * Pool of threads for asynchronous responses. + * + * @autor Irenka Redondo + * @version 1.0 + */ +public class AMIThreadPool + implements QueueReaderManager, ThreadStateListener, AMIManagerConfListener +{ + + private Vector m_pool = null; + + private AMIManager m_ami_manager = null; + + private int m_used = 0; + + private int m_active = 0; + + private boolean m_deactivated = false; + + /** + * Constructor. + * + * @param amiManager + * The AMIManager which this thread pool belongs to. + */ + public AMIThreadPool(AMIManager amiManager) + { + m_pool = new Vector(); + m_ami_manager = amiManager; + } + + /** + * Test if another thread should be created. + * + * @return Returns true if another thread has been started, false otherwise. + */ + synchronized public boolean createNewReader() + { + if ((m_used == m_active) + &&(m_used < m_ami_manager.m_conf.getMaxThreads())) { + createThread(); + return true; + } + return false; + } + + synchronized private void createThread() + { + AMIThread t = new AMIThread(m_ami_manager); + m_pool.addElement(t); + t.setThreadStateListener(this); + t.setDaemon(false); + t.start(); + m_used++; + + if (m_ami_manager.m_orb.m_trace != null) { + String[] msg = + { "New thread created, ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_ami_manager.m_conf.getMaxThreads()), + " , min ", + Integer.toString(m_ami_manager.m_conf.getMinThreads()), + ")" + }; + m_ami_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + /** + * Counts the number of active threads (increment). + * + * @param t + * Thread that becomes active. + */ + synchronized public void setActive(Thread t) + { + m_active++; + } + + /** + * Counts the number of active threads (decrement). + * + * @param t + * Thread that becomes inactive. + */ + synchronized public void setInactive(Thread t) + { + m_active--; + } + + /** + * Clean up when a thread dies. + * + * @param t + * Thread that has died. + */ + synchronized public void threadHasDied(Thread t) + { + m_pool.removeElement(t); + m_used--; + if (m_ami_manager.m_orb.m_trace != null) { + String[] msg = + { + "Finalization of thread ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_ami_manager.m_conf.getMaxThreads()), + ", min ", + Integer.toString(m_ami_manager.m_conf.getMinThreads()), + ")" + }; + m_ami_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + synchronized public void deactivation() + { + m_deactivated = true; + } + + synchronized public boolean threadCanDie(Thread t) + { + if (m_deactivated) + return true; + else + return (m_used > m_ami_manager.m_conf.getMinThreads()); + } + + synchronized public void minThreadsHasChanged() + { + while (m_used < m_ami_manager.m_conf.getMinThreads()) { + createThread(); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/PoliciesComponent.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/PoliciesComponent.java.svn-base new file mode 100644 index 0000000..d56f980 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/PoliciesComponent.java.svn-base @@ -0,0 +1,121 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + + +import org.omg.IOP.TAG_POLICIES; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +import java.io.StringWriter; +import java.io.PrintWriter; + +/** + * Supported Qos Policines defined in CORBA Messaging module + * @author caceres + * + */ +public class PoliciesComponent extends TaggedComponent +{ + private PolicyContext policies; + + + public PoliciesComponent() { + super(TAG_POLICIES.value); + this.policies = null; + } + + public PoliciesComponent(PolicyContext policies) { + super(TAG_POLICIES.value); + this.policies = policies; + } + + public void partialRead(CDRInputStream input) + { + policies = new PolicyContext(null); + + input.enterEncapsulation(); + + policies.partialRead(input); + + input.exitEncapsulation(); + + } + + + public void write(CDROutputStream output) + { + output.write_ulong(TAG_POLICIES.value); + + // enter ecapsulation + + output.enterEncapsulation(); + + if(policies == null) { + output.write_ulong(0); + } else { + policies.write(output); + } + + output.exitEncapsulation(); + + + } + + public PolicyContext getPolicies() + { + return policies; + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + policies.dump(print_buffer); + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QoS.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QoS.java.svn-base new file mode 100644 index 0000000..3ff06af --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QoS.java.svn-base @@ -0,0 +1,260 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.Messaging.*; +import org.omg.TimeBase.UtcT; + + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.util.UTC; + +/** + * Supported Qos Policines defined in CORBA Messaging module + * @author caceres + * + */ +public class QoS +{ + /** + * Get the RequestEnd time from the RequestEndTimePolicy and + * the RelativeRoundtripPolicy + * @param context + * @return + */ + public static RequestEndTimePolicy + getEffectiveRequestEndTimePolicy(PolicyContext context) + { + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + RelativeRoundtripTimeoutPolicy relativeRountripTimeoutPolicy = + context.getRelativeRoundtripTimeoutPolicy(); + + if(relativeRountripTimeoutPolicy == null) { + return requestEndTimePolicy; + } else { + + long endTime = UTC.toTimeT(UTC.currentUtcTimeMillis()) + + relativeRountripTimeoutPolicy.relative_expiry(); + + if((requestEndTimePolicy != null) + && (endTime > requestEndTimePolicy.end_time().time) ) { + return requestEndTimePolicy; + } else { + return new RequestEndTimePolicyImpl(endTime); + } + + } + } + + + + + /** + * Checks if the request can be sent and the time while the sender can be + * waiting for the response. + * This operation sleeps the time until the RequestStartTimePolicy + * allows the invocation. + * @param orb The ORB + * @return the time to wait the response + * @throws org.omg.CORBA.TIMEOUT if the request time has expired + */ + public static long checkRequestTime(TIDORB orb, + PolicyContext context) + { + RequestStartTimePolicy requestStartTimePolicy= + context.getRequestStartTimePolicy(); + + long currentTime = 0; + + if(requestStartTimePolicy != null) { + currentTime = UTC.currentUtcTimeMillis(); + checkStart(orb, context, currentTime); + } + + long requestTimeout = + getEffectiveRequestTimeoutInMillis(context, currentTime); + + + if(requestTimeout < 0) { + String msg = + "QoS RequestEndTimePolicy/RelativeRountripTimeoutPolicy exceeded"; + msg += " " + requestTimeout; + throw new org.omg.CORBA.TIMEOUT(msg); + } else { + return requestTimeout; + } + + + + } + + + /** + * @param orb + * @param currentTime in ns. + * @return the time to wait the request in ms. (greather or equal than 0) + */ + private static long getEffectiveRequestTimeoutInMillis(PolicyContext context, + long currentTime) + { + RelativeRoundtripTimeoutPolicy relativeRountripTimeoutPolicy = + context.getRelativeRoundtripTimeoutPolicy(); + + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + + if(requestEndTimePolicy == null) { + if(relativeRountripTimeoutPolicy != null) { + return UTC.toTimeInMillis( + relativeRountripTimeoutPolicy.relative_expiry()); + } else { + return 0; + } + } else { + if(currentTime == 0) { + currentTime = UTC.currentUtcTimeMillis(); + } + + long endTimeout = + UTC.toTimeInMillis(requestEndTimePolicy.end_time().time) + - currentTime; + + if(relativeRountripTimeoutPolicy != null) { + long relativeTimeout = + UTC.toTimeInMillis(relativeRountripTimeoutPolicy.relative_expiry()); + return (endTimeout < relativeTimeout)? endTimeout : relativeTimeout; + } else { + return endTimeout; + } + } + } + + /** + * @param orb + * @param currentTime + * @param startTimePolicy + * @return + */ + private static boolean checkStart(TIDORB orb, + PolicyContext context, + long currentTime) + { + RequestStartTimePolicy requestStartTimePolicy = + context.getRequestStartTimePolicy(); + + // UtcT.time is in order of 100 ns. (1 ns = 10^6 ms.) 100 ns = 10^4 + + long startTime = + UTC.toTimeInMillis(requestStartTimePolicy.start_time().time); + + long sleepMillis = startTime - currentTime; + + if(sleepMillis > 0) { + + try { + Thread.sleep(sleepMillis); + } + catch (InterruptedException e) { + if(orb.m_trace != null ) { + String msg = + "QoS: Request has received an InterruptedException "; + + orb.printTrace( Trace.ERROR, msg); + } + } + + if(orb.m_trace != null ) { + String[] msg = + {"QoS: Request has slept ", + Long.toString(sleepMillis), + " ms. util Messaging::RequestStartTimePolicy value" + }; + + orb.printTrace( Trace.DEEP_DEBUG, msg); + } + + return true; + } + + return false; + } + + + /** + * Validates QoS RequestEndTimePolicy in the ServerSide + * @param policySupplier + * @param trace + * @return + */ + public static boolean validateServerRequestEndTimePolicy(PolicyContext context) + { + if(context == null) { + return true; + } + + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + + if(requestEndTimePolicy == null) { + return true; + } else { + long current_time = UTC.currentUtcTimeMillis(); + UtcT utc_time = requestEndTimePolicy.end_time(); + // Request TIMEOUT? + if(current_time > UTC.toTimeInMillis(utc_time.time)) { + + return false; + } + + return true; + } + + } + + + + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QueueOrderPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QueueOrderPolicyImpl.java.svn-base new file mode 100644 index 0000000..c380911 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/QueueOrderPolicyImpl.java.svn-base @@ -0,0 +1,141 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.OrderingHelper; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.Messaging.QueueOrderPolicyHelper; +import org.omg.Messaging.QueueOrderPolicyLocalBase; +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_DEADLINE; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + * + */ +public class QueueOrderPolicyImpl extends QueueOrderPolicyLocalBase +{ + + short allowedOrders; + + + + /** + * @param allowedOrders + */ + public QueueOrderPolicyImpl(short allowedOrders) + { + super(); + this.allowedOrders = allowedOrders; + } + public short allowed_orders() + { + return allowedOrders; + } + + public int policy_type() + { + return QUEUE_ORDER_POLICY_TYPE.value; + } + + public Policy copy() + { + return new QueueOrderPolicyImpl(this.allowedOrders); + } + + + public void destroy() { + + } + + public static QueueOrderPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + short policy_value = OrderingHelper.extract(val); + + return new QueueOrderPolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static QueueOrderPolicyImpl read(CDRInputStream input) + { + short policy_value = input.read_short(); + + if( (policy_value != ORDER_ANY.value) && + (policy_value != ORDER_TEMPORAL.value) && + (policy_value != ORDER_PRIORITY.value) && + (policy_value != ORDER_DEADLINE.value) ) { + throw new MARSHAL(); + } + + return new QueueOrderPolicyImpl(policy_value); + } + + /** + * @param output + * @param queueOrderPolicy + */ + public static void write(CDROutputStream output, + QueueOrderPolicy queueOrderPolicy) + { + output.write_ushort(queueOrderPolicy.allowed_orders()); + + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RebindPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RebindPolicyImpl.java.svn-base new file mode 100644 index 0000000..1e0936e --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RebindPolicyImpl.java.svn-base @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RebindModeHelper; +import org.omg.Messaging.RebindPolicy; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RebindPolicyImpl extends org.omg.Messaging.RebindPolicyLocalBase +{ + + short m_value; + + public RebindPolicyImpl(short val) + { + m_value = val; + } + + public short rebind_mode() + { + return m_value; + } + + public int policy_type() + { + return org.omg.Messaging.REBIND_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RebindPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RebindPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + short policy_value = RebindModeHelper.extract(val); + + return new RebindPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static void write(CDROutputStream output, RebindPolicy policy) { + RebindModeHelper.write(output, policy.rebind_mode()); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRequestTimeoutPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRequestTimeoutPolicyImpl.java.svn-base new file mode 100644 index 0000000..aff7b1a --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRequestTimeoutPolicyImpl.java.svn-base @@ -0,0 +1,112 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RelativeRequestTimeoutPolicy; +import org.omg.TimeBase.TimeTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RelativeRequestTimeoutPolicyImpl + extends org.omg.Messaging.RelativeRequestTimeoutPolicyLocalBase +{ + + long m_value; + + public RelativeRequestTimeoutPolicyImpl(long val) + { + m_value = val; + } + + public long relative_expiry() + { + return m_value; + } + + public int policy_type() + { + return org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RelativeRequestTimeoutPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static void write(CDROutputStream output, + RelativeRequestTimeoutPolicy policy) + { + TimeTHelper.write(output, policy.relative_expiry()); + } + + public static RelativeRequestTimeoutPolicyImpl read(CDRInputStream input) + { + long policy_value = input.read_ulong(); + return new RelativeRequestTimeoutPolicyImpl(policy_value); + } + + public static RelativeRequestTimeoutPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + long policy_value = org.omg.TimeBase.TimeTHelper.extract(val); + + return new RelativeRequestTimeoutPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base new file mode 100644 index 0000000..760b47e --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RelativeRoundtripTimeoutPolicyImpl.java.svn-base @@ -0,0 +1,109 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicy; +import org.omg.TimeBase.TimeTHelper; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RelativeRoundtripTimeoutPolicyImpl + extends org.omg.Messaging.RelativeRoundtripTimeoutPolicyLocalBase +{ + + long m_value; + + public RelativeRoundtripTimeoutPolicyImpl(long val) + { + m_value = val; + } + + public long relative_expiry() + { + return m_value; + } + + public int policy_type() + { + return RELATIVE_RT_TIMEOUT_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RelativeRoundtripTimeoutPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RelativeRoundtripTimeoutPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + long policy_value = org.omg.TimeBase.TimeTHelper.extract(val); + + return new RelativeRoundtripTimeoutPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static void write(CDROutputStream output, + RelativeRoundtripTimeoutPolicy policy) + { + + TimeTHelper.write(output, policy.relative_expiry()); + } + + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestEndTimePolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestEndTimePolicyImpl.java.svn-base new file mode 100644 index 0000000..1b6ec33 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestEndTimePolicyImpl.java.svn-base @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2005 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.RequestEndTimePolicy; +import org.omg.Messaging.RequestEndTimePolicyLocalBase; +import org.omg.TimeBase.UtcT; +import org.omg.TimeBase.UtcTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + * + */ +public class RequestEndTimePolicyImpl extends RequestEndTimePolicyLocalBase +{ + UtcT endTime; + + /** + * @param time + */ + public RequestEndTimePolicyImpl(UtcT time) + { + endTime = time; + } + + + + /** + * @param endTime + */ + public RequestEndTimePolicyImpl(long endTime) + { + this.endTime = new UtcT(); + this.endTime.time = endTime; + } + + + + public UtcT end_time() + { + return endTime; + } + + + public int policy_type() + { + return REQUEST_END_TIME_POLICY_TYPE.value; + } + + + public void destroy() + { + + } + + public Policy copy() + { + return new RequestEndTimePolicyImpl(endTime); + } + + + + /** + * @param input + * @return + */ + public static Policy read(CDRInputStream input) + { + UtcT end_time = UtcTHelper.read(input); + return new RequestEndTimePolicyImpl(end_time); + } + + /** + * @param output + * @param policy + */ + public static void write(CDROutputStream output, + RequestEndTimePolicy policy) + { + UtcTHelper.write(output, policy.end_time()); + } + + public static RequestEndTimePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + UtcT policy_value = org.omg.TimeBase.UtcTHelper.extract(val); + + return new RequestEndTimePolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestPriorityPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestPriorityPolicyImpl.java.svn-base new file mode 100644 index 0000000..5e72f6a --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestPriorityPolicyImpl.java.svn-base @@ -0,0 +1,87 @@ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.PriorityRange; +import org.omg.Messaging.PriorityRangeHelper; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.RequestPriorityPolicy; +import org.omg.Messaging.RequestPriorityPolicyLocalBase; + + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + */ +public class RequestPriorityPolicyImpl extends RequestPriorityPolicyLocalBase +{ + PriorityRange range; + + + /** + * @param range + */ + public RequestPriorityPolicyImpl(PriorityRange range) + { + this.range = range; + } + public PriorityRange priority_range() + { + return range; + } + + public int policy_type() + { + + return REQUEST_PRIORITY_POLICY_TYPE.value; + } + + public Policy copy() + { + return this; + } + + + public void destroy() + { + + } + + public static void write(CDROutputStream output, + RequestPriorityPolicy policy) + { + PriorityRangeHelper.write(output, policy.priority_range()); + } + + public static RequestPriorityPolicyImpl read(CDRInputStream input) + { + PriorityRange policy_value = PriorityRangeHelper.read(input); + + if(policy_value.min > policy_value.max) { + throw new MARSHAL(); + } + + return new RequestPriorityPolicyImpl(policy_value); + } + + public static RequestPriorityPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + PriorityRange policy_value = PriorityRangeHelper.extract(val); + + return new RequestPriorityPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestStartTimePolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestStartTimePolicyImpl.java.svn-base new file mode 100644 index 0000000..2d0b675 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/RequestStartTimePolicyImpl.java.svn-base @@ -0,0 +1,132 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2005 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.Messaging.RequestStartTimePolicy; +import org.omg.Messaging.RequestStartTimePolicyHelper; +import org.omg.Messaging.RequestStartTimePolicyLocalBase; +import org.omg.TimeBase.UtcT; +import org.omg.TimeBase.UtcTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + */ + +public class RequestStartTimePolicyImpl extends RequestStartTimePolicyLocalBase +{ + UtcT startTime; + + /** + * @param time + */ + public RequestStartTimePolicyImpl(UtcT time) + { + startTime = time; + + + } + + public UtcT start_time() + { + return startTime; + } + + + public int policy_type() + { + return REQUEST_START_TIME_POLICY_TYPE.value; + } + + + + public void destroy() + { + + } + + public Policy copy() + { + return new RequestStartTimePolicyImpl(startTime); + } + + public static void write(CDROutputStream output, Policy policy) + { + RequestStartTimePolicy start_policy = + RequestStartTimePolicyHelper.narrow(policy); + + UtcTHelper.write(output, start_policy.start_time()); + } + + /** + * @param input + * @return + */ + public static RequestStartTimePolicyImpl read(CDRInputStream input) + { + UtcT end_time = UtcTHelper.read(input); + return new RequestStartTimePolicyImpl(end_time); + } + + public static RequestStartTimePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + UtcT policy_value = org.omg.TimeBase.UtcTHelper.extract(val); + + return new RequestStartTimePolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/ThreadStateListener.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/ThreadStateListener.java.svn-base new file mode 100644 index 0000000..cb80a19 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/ThreadStateListener.java.svn-base @@ -0,0 +1,62 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +/** + * Listener of thread state changes. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +interface ThreadStateListener +{ + + boolean threadCanDie(Thread t); + + void threadHasDied(Thread t); + + void setActive(Thread t); + + void setInactive(Thread t); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/.svn/text-base/_ExceptionHolderImpl.java.svn-base b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/_ExceptionHolderImpl.java.svn-base new file mode 100644 index 0000000..a07b4b6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/.svn/text-base/_ExceptionHolderImpl.java.svn-base @@ -0,0 +1,159 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.messaging; + +import java.io.Serializable; +import java.util.Properties; + +import org.omg.CORBA.portable.ValueFactory; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.Messaging._ExceptionHolder; +import org.omg.IOP.CodecPackage.InvalidTypeForEncoding; +import org.omg.IOP.CodecPackage.FormatMismatch; +import org.omg.IOP.*; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA.UserException; + + +public class _ExceptionHolderImpl extends _ExceptionHolder + +{ + + public _ExceptionHolderImpl() { + is_system_exception = false; + byte_order = false; + marshaled_exception = new byte[0]; + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream is) { + + is.fixStarting(); + + // parsear el nombre de la excepcion + String name = is.read_string(); + is.rewind(); + + // TODO: Leer el typecode + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[0]; + org.omg.CORBA.TypeCode _type = + is.orb().create_exception_tc(name, "UserException", members); + + org.omg.CORBA.Any any = is.orb().create_any(); + any.read_value(is, _type); + + byte_order = is.getByteOrder(); + + + try { + // Obtiene codec factory + String[] args = { "", "" }; + Properties props = new Properties(); + props.put("org.omg.CORBA.ORBClass","es.tid.TIDorbj.core.TIDORB"); + + org.omg.CORBA.Object obj = + org.omg.CORBA.ORB.init(args, props).resolve_initial_references("CodecFactory"); + CodecFactory codec_factory = CodecFactoryHelper.narrow(obj); + + // Crea codec + Encoding encoding = new Encoding(); + encoding.format = ENCODING_CDR_ENCAPS.value; + encoding.major_version = 1; + encoding.minor_version = 2; + Codec codec = codec_factory.create_codec(encoding); + + marshaled_exception = codec.encode(any); + + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public void raise_exception() + throws org.omg.CORBA.UserException + { + org.omg.CORBA.Any any = null; + try { + + // Obtiene codec factory + String[] args = { "", "" }; + Properties props = new Properties(); + props.put("org.omg.CORBA.ORBClass","es.tid.TIDorbj.core.TIDORB"); + + org.omg.CORBA.Object obj = + org.omg.CORBA.ORB.init(args,props).resolve_initial_references("CodecFactory"); + CodecFactory codec_factory = CodecFactoryHelper.narrow(obj); + + // Crea codec + Encoding encoding = new Encoding(); + encoding.format = ENCODING_CDR_ENCAPS.value; + encoding.major_version = 1; + encoding.minor_version = 2; + Codec codec = codec_factory.create_codec(encoding); + + any = codec.decode(marshaled_exception); + + } catch (FormatMismatch e) { + e.printStackTrace(); + throw new MARSHAL(); + } catch (Exception e) { + throw new MARSHAL(); + } + + + // TODO: how throw UserException contained in Any?? + throw new UnknownUserException(any); + } + + + public void raise_exception_with_list(org.omg.CORBA.TypeCode[] exc_list) + throws org.omg.CORBA.UserException + { + throw new NO_IMPLEMENT(); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/messaging/AMILock.java b/source/es/tid/TIDorbj/core/messaging/AMILock.java new file mode 100644 index 0000000..ee3ae86 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/AMILock.java @@ -0,0 +1,393 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import java.io.File; +import java.io.Serializable; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.Object; +import org.omg.CORBA.Request; +import org.omg.CORBA.SystemException; +import org.omg.CORBA.portable.Streamable; +import org.omg.CORBA.portable.ValueFactory; +import org.omg.Messaging.ReplyHandler; +import org.omg.Messaging.ReplyHandlerHelper; +import org.omg.Messaging._ExceptionHolder; +import org.omg.Messaging._ExceptionHolderHelper; + +import es.tid.CORBA.Any; +import es.tid.TIDorbj.core.NVListImpl; +import es.tid.TIDorbj.core.RequestImpl; +import es.tid.TIDorbj.core.comm.ForwardRequest; +import es.tid.TIDorbj.core.comm.giop.GIOPFragmentedMessage; +import es.tid.TIDorbj.core.comm.giop.GIOPReplyMessage; +import es.tid.TIDorbj.core.comm.giop.MsgType; +import es.tid.TIDorbj.core.comm.giop.ReplyStatusType; +import es.tid.TIDorbj.core.comm.giop.RequestId; +import es.tid.TIDorbj.core.comm.iiop.IIOPConnection; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.util.OperationCompletion; + +/** + * Lock where the asynchronous requests stay until the complete response has been + * sent to ReplyHandler or the asynchronous response timeout has expired. + * + * + * + * @autor Irenka Redondo Granados + * @version 1.0 + */ + +public class AMILock +{ + + /** + * The Operation Completion Status. + */ + OperationCompletion m_state; + + /** + * Request identifier. This identifier will be the key for the connection + * thread to + */ + RequestId m_request_id; + + /** + * Asynchronous request + */ + RequestImpl m_request; + + GIOPFragmentedMessage message; + + /** + * Reference to ReplyHandler object which the response will be sent + */ + Object m_ami_handler; + + /** + * Asynchronous request's processing time + */ + long time; + + IIOPIOR m_ior; // ?????????? no se descripcion + + IIOPConnection m_conn; + + public AMILock() + { + m_request_id = null; + m_request = null; + message = null; + m_state = new OperationCompletion(); + m_ami_handler = null; + time = 0; + m_ior = null; + m_conn = null; + } + + public RequestId requestId() + { + return m_request_id; + } + + public void requestId(RequestId id) + { + m_request_id = id; + } + + public RequestImpl getRequest() + { + return m_request; + } + + public void setRequest(RequestImpl request) + { + m_request = request; + } + + public boolean getCompleted() + { + return m_state.isCompleted(); + } + + public void setCompleted() + { + m_state.setCompleted(); + } + + public void setMessage(GIOPFragmentedMessage msg) + { + message = msg; + } + + public GIOPFragmentedMessage getMessage() + { + return message; + } + + public void setHandler(Object handler) + { + m_ami_handler = handler; + } + + public Object getHandler() + { + return m_ami_handler; + } + + public void incrementTime (long inc) + { + time = +inc; + } + + public long getTime() + { + return time; + } + + public void setIor(IIOPIOR ior) + { + m_ior = ior; + } + + public IIOPIOR getIor() + { + return m_ior; + } + + public void putReply() { + + if (message == null) { + throw new INTERNAL("No Reply message"); + } + if (message.getHeader().getMsgType().m_value != MsgType._Reply) { + throw new MARSHAL("No Reply message received"); + } + + GIOPReplyMessage reply_message = (GIOPReplyMessage) message; + + m_request.setCompletedYes(); + + RequestImpl replyHandlerRequest; + org.omg.CORBA.Any $excep_holder; + _ExceptionHolder excepHolder; + + //Take the exception holder implementation class name + String idExcepHolder = idExcepHolder(m_ami_handler); + _ExceptionHolderImpl excepHolderFactory = + (_ExceptionHolderImpl) m_request.orb().lookup_value_factory(idExcepHolder); + + + switch (reply_message.replyStatus().value()) + { + case ReplyStatusType._NO_EXCEPTION: + //funciona + /* + reply_message.extractArguments(m_request); + RequestImpl replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()); + if (m_request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_in_arg(); + $ami_return_val.read_value(m_request.return_value().create_input_stream(), m_request.return_value().type()); + } + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + }*/ + + replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()); + if (m_request.result() != null) { + org.omg.CORBA.Any $ami_return_val = replyHandlerRequest.add_named_in_arg("ami_return_val"); + $ami_return_val.type(m_request.return_value().type()); + } + NVListImpl.setOutParamsAsIn(m_request.arguments(), replyHandlerRequest); + reply_message.extractArgumentsForReplyHandler(replyHandlerRequest); + try { + replyHandlerRequest.invoke(); /// invoke or ther kind of invoke?? + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + break; + case ReplyStatusType._USER_EXCEPTION: + replyHandlerRequest = + (RequestImpl) m_ami_handler._request(m_request.operation() + "_excep"); + $excep_holder = replyHandlerRequest.add_named_in_arg("excep_holder"); + + _ExceptionHolderImpl excepHolder_impl = new _ExceptionHolderImpl(); + $excep_holder.type(excepHolder_impl._type()); + reply_message.extractUserException(excepHolder_impl); + + NVListImpl.setOutParamsAsIn(m_request.arguments(), replyHandlerRequest); + + _ExceptionHolderHelper.insert($excep_holder, + (org.omg.Messaging._ExceptionHolder)excepHolder_impl); + + + + + + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + e.printStackTrace(); + } + break; + case ReplyStatusType._SYSTEM_EXCEPTION: + replyHandlerRequest = (RequestImpl) m_ami_handler._request(m_request.operation()+"_excep"); + $excep_holder = replyHandlerRequest.add_named_in_arg("excep_holder"); + excepHolder = new _ExceptionHolderImpl(); + $excep_holder.type(excepHolder._type()); + //reply_message.extractSystemException(excepHolder); + $excep_holder.insert_Streamable(excepHolder); + try { + replyHandlerRequest.invoke(); + } catch (SystemException e) { + String operationName = replyHandlerRequest.operation(); + operationName = operationName.substring(1, operationName.length()); + replyHandlerRequest.setOperationName(operationName); + replyHandlerRequest.invoke(); + } + //m_request.setSystemException(reply_message.extractSystemException()); + break; + /* + case ReplyStatusType._LOCATION_FORWARD: + { + IOR forward_ior = reply_message.extractForward(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._LOCATION_FORWARD_PERM: + { + IOR forward_ior = reply_message.extractForwardPerm(); + throw new ForwardRequest(forward_ior); + } + case ReplyStatusType._NEEDS_ADDRESSING_MODE: + m_conn.sendRequest(m_request, m_ior, reply_message.extractAddressingDisposition()); + */ + } + + + } + + private String idExcepHolder (Object ami_handler) { + + if (ami_handler == null) + throw new INTERNAL("AMILock.idExcepHolder ami_handler is NULL"); + + String name = m_ami_handler.getClass().getName(); + String [] replyHandlerClassNameParts = name.split("\\."); + String nameClass = replyHandlerClassNameParts[replyHandlerClassNameParts.length-1]; + replyHandlerClassNameParts[replyHandlerClassNameParts.length-1] = + nameClass.substring(1, nameClass.length()-4); + String replyHandlerClassName = replyHandlerClassNameParts[0]; + + for (int i=1; i< replyHandlerClassNameParts.length; i++) + replyHandlerClassName = replyHandlerClassName + "." + replyHandlerClassNameParts[i]; + + Class replyHandlerClassHelper = null; + String idReplyHandler = null; + try { + replyHandlerClassHelper = Class.forName(replyHandlerClassName.concat("Helper"), + true, m_ami_handler.getClass().getClassLoader()); + Method methodId = replyHandlerClassHelper.getMethod("id",new Class[]{}); + idReplyHandler = (String) methodId.invoke(null,new java.lang.Object[]{}); + + //ReplyHandlerHelper rh = (ReplyHandlerHelper) replyHandlerClassHelper.getClass(); + } catch (ClassNotFoundException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (SecurityException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchMethodException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalArgumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (IllegalAccessException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (InvocationTargetException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + String [] idReplyHandlerParts = idReplyHandler.split(":"); + String [] handlerPath = idReplyHandlerParts[1].split("/"); + String excepHolderName = handlerPath[handlerPath.length - 1]; + excepHolderName = "_" + excepHolderName.substring(0, excepHolderName.length()-7) + + "ExceptionHolder"; + String excepHolderPath = ""; + for (int i=0; i this.m_max_threads) { + throw new + BAD_PARAM("min_threads can not be greater than max_threads."); + } + this.m_min_threads = min_threads; + if (m_listener != null) { + m_listener.minThreadsHasChanged(); + } + } + + synchronized public void setMaxThreads(int max_threads) + { + if (max_threads < this.m_min_threads) { + throw new + BAD_PARAM("max_threads can not be less than min_threads."); + } + this.m_max_threads = max_threads; + } + + synchronized public void setMaxQueuedRequests(int max_queued_requests) + { + if (max_queued_requests < this.m_max_queued_requests) { + throw new + BAD_PARAM("max_queued_requests can not be decreased."); + } + this.m_max_queued_requests = max_queued_requests; + } + + synchronized public void setStarvingTime(int millisecs) + { + if (millisecs < 0) { + throw new BAD_PARAM("starving_time can not be negative."); + } + this.m_starving_time = millisecs; + } + + synchronized public int getMaxQueuedRequests() + { + return m_max_queued_requests; + } + + synchronized public int getMaxThreads() + { + return m_max_threads; + } + + synchronized public int getMinThreads() + { + return m_min_threads; + } + + synchronized public int getStarvingTime() + { + return m_starving_time; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.java b/source/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.java new file mode 100644 index 0000000..2c51bb6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/AMIManagerConfListener.java @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 8 $ +* Date: $Date: 2006-01-24 17:36:46 +0100 (Tue, 24 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +public interface AMIManagerConfListener +{ + + void minThreadsHasChanged(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/AMIThread.java b/source/es/tid/TIDorbj/core/messaging/AMIThread.java new file mode 100644 index 0000000..4759163 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/AMIThread.java @@ -0,0 +1,214 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.Trace; + +/** + * Execution thread. Gets request from the request queue and executes them. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class AMIThread extends Thread +{ + + private AMIManager m_ami_manager = null; + + private AMILockList m_ami_lock_list = null; + + private boolean m_deactivated = false; + + private ThreadStateListener m_thread_state_listener = null; + + private String m_thread_name; + + private TIDORB m_orb; + + private Trace m_trace; + + + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this ExecThread belongs. + * @param number + * Id number of this ExecThread. + */ + protected AMIThread(AMIManager amiManager) + { + m_ami_manager = amiManager; + m_ami_lock_list = m_ami_manager.getAMILockList(); + m_orb = m_ami_manager.m_orb; + m_trace = m_orb.m_trace; + } + + /** + * Set the ThreadStateListener. Any AMIThread should have a listener + * (eventually the AMIThreadPool) before it is started. + * + * @param l + * The listener. + */ + protected void setThreadStateListener(ThreadStateListener l) + { + m_thread_state_listener = l; + } + + /** + * Checks the state of the POAManager. If the state is ACTIVE, then finish + * returning true. If the state is HOLDING, then wait until state is + * diferent from HOLDING. If the state is DISCARDING, then discard the + * request and return false. If the state is INACTIVE, then reject the + * request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + /*private boolean checkState( QueuedRequest request ) { + + boolean executeRequest = false; + + if (m_trace != null) { + String[] msg = { toString(), " checking state of ", + m_ami_manager.toString() }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + synchronized (m_ami_manager.m_state_mutex) { + boolean exit = false; + while (!exit) { + State state = m_poa_manager.get_state(); + if ((state == State.ACTIVE) && !request.getMustDiscard()) { + exit = true; + executeRequest = true; + } else if (state == State.HOLDING) { + try { + // wait until state changes + m_poa_manager.m_state_mutex.wait(); + } catch (InterruptedException ie) {} + exit = false; + } else if (state == State.INACTIVE) { + // MISSING: define strategy for deactivated POAManagers + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } else if ( state == State.DISCARDING || + request.getMustDiscard() ){ + //TODO: trace removed, restore it at each implementation + //TODO: change method signature to return possible errors + //in state check + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } + } + } + return executeRequest; + }*/ + + /** + * Execution loop. + */ + public void run() + { + + while (!m_deactivated) { + + try { + + if (m_trace != null) { + String[] msg = { toString(), ": sending AMI reply..." }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + AMILock ami_lock = m_ami_lock_list.getFirstReady(); + + if (ami_lock != null) { + // If there is a response ready, then go!! + m_thread_state_listener.setActive(this); + ami_lock.putReply(); + m_thread_state_listener.setInactive(this); + + } else if (m_thread_state_listener.threadCanDie(this)) { + // If restarted and no request, then commit suicide + m_deactivated = true; + } + + } + catch (Throwable unhandledException) { + // Unhandled exception. Should never happen!! + if (m_trace != null) { + m_trace.printStackTrace(Trace.DEBUG, + toString() + "Unhanled Exception ", + unhandledException); + m_trace.print(Trace.DEBUG, toString() + " dies..."); + } + m_deactivated = true; + } + } + m_thread_state_listener.threadHasDied(this); + } + + /** + * @return Returns the string representation of this Thread. + */ + public synchronized String toString() + { + if (m_thread_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append(super.toString()); + buffer.append(" in "); + buffer.append(m_ami_manager.toString()); + m_thread_name = buffer.toString(); + buffer = null; + } + return m_thread_name; + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/AMIThreadPool.java b/source/es/tid/TIDorbj/core/messaging/AMIThreadPool.java new file mode 100644 index 0000000..d3680b3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/AMIThreadPool.java @@ -0,0 +1,191 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import java.util.Vector; + +import es.tid.TIDorbj.core.poa.QueueReaderManager; +import es.tid.TIDorbj.util.Trace; + +/** + * Pool of threads for asynchronous responses. + * + * @autor Irenka Redondo + * @version 1.0 + */ +public class AMIThreadPool + implements QueueReaderManager, ThreadStateListener, AMIManagerConfListener +{ + + private Vector m_pool = null; + + private AMIManager m_ami_manager = null; + + private int m_used = 0; + + private int m_active = 0; + + private boolean m_deactivated = false; + + /** + * Constructor. + * + * @param amiManager + * The AMIManager which this thread pool belongs to. + */ + public AMIThreadPool(AMIManager amiManager) + { + m_pool = new Vector(); + m_ami_manager = amiManager; + } + + /** + * Test if another thread should be created. + * + * @return Returns true if another thread has been started, false otherwise. + */ + synchronized public boolean createNewReader() + { + if ((m_used == m_active) + &&(m_used < m_ami_manager.m_conf.getMaxThreads())) { + createThread(); + return true; + } + return false; + } + + synchronized private void createThread() + { + AMIThread t = new AMIThread(m_ami_manager); + m_pool.addElement(t); + t.setThreadStateListener(this); + t.setDaemon(false); + t.start(); + m_used++; + + if (m_ami_manager.m_orb.m_trace != null) { + String[] msg = + { "New thread created, ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_ami_manager.m_conf.getMaxThreads()), + " , min ", + Integer.toString(m_ami_manager.m_conf.getMinThreads()), + ")" + }; + m_ami_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + /** + * Counts the number of active threads (increment). + * + * @param t + * Thread that becomes active. + */ + synchronized public void setActive(Thread t) + { + m_active++; + } + + /** + * Counts the number of active threads (decrement). + * + * @param t + * Thread that becomes inactive. + */ + synchronized public void setInactive(Thread t) + { + m_active--; + } + + /** + * Clean up when a thread dies. + * + * @param t + * Thread that has died. + */ + synchronized public void threadHasDied(Thread t) + { + m_pool.removeElement(t); + m_used--; + if (m_ami_manager.m_orb.m_trace != null) { + String[] msg = + { + "Finalization of thread ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_ami_manager.m_conf.getMaxThreads()), + ", min ", + Integer.toString(m_ami_manager.m_conf.getMinThreads()), + ")" + }; + m_ami_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + synchronized public void deactivation() + { + m_deactivated = true; + } + + synchronized public boolean threadCanDie(Thread t) + { + if (m_deactivated) + return true; + else + return (m_used > m_ami_manager.m_conf.getMinThreads()); + } + + synchronized public void minThreadsHasChanged() + { + while (m_used < m_ami_manager.m_conf.getMinThreads()) { + createThread(); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/PoliciesComponent.java b/source/es/tid/TIDorbj/core/messaging/PoliciesComponent.java new file mode 100644 index 0000000..49b5be0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/PoliciesComponent.java @@ -0,0 +1,121 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 349 $ +* Date: $Date: 2009-01-07 09:56:41 +0100 (Wed, 07 Jan 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + + +import org.omg.IOP.TAG_POLICIES; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.policy.PolicyContext; + +import java.io.StringWriter; +import java.io.PrintWriter; + +/** + * Supported Qos Policines defined in CORBA Messaging module + * @author caceres + * + */ +public class PoliciesComponent extends TaggedComponent +{ + private PolicyContext policies; + + + public PoliciesComponent() { + super(TAG_POLICIES.value); + this.policies = null; + } + + public PoliciesComponent(PolicyContext policies) { + super(TAG_POLICIES.value); + this.policies = policies; + } + + public void partialRead(CDRInputStream input) + { + policies = new PolicyContext(null); + + input.enterEncapsulation(); + + policies.partialRead(input); + + input.exitEncapsulation(); + + } + + + public void write(CDROutputStream output) + { + output.write_ulong(TAG_POLICIES.value); + + // enter ecapsulation + + output.enterEncapsulation(); + + if(policies == null) { + output.write_ulong(0); + } else { + policies.write(output); + } + + output.exitEncapsulation(); + + + } + + public PolicyContext getPolicies() + { + return policies; + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + policies.dump(print_buffer); + return buffer.toString(); + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/QoS.java b/source/es/tid/TIDorbj/core/messaging/QoS.java new file mode 100644 index 0000000..111e1cd --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/QoS.java @@ -0,0 +1,260 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.Messaging.*; +import org.omg.TimeBase.UtcT; + + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.util.UTC; + +/** + * Supported Qos Policines defined in CORBA Messaging module + * @author caceres + * + */ +public class QoS +{ + /** + * Get the RequestEnd time from the RequestEndTimePolicy and + * the RelativeRoundtripPolicy + * @param context + * @return + */ + public static RequestEndTimePolicy + getEffectiveRequestEndTimePolicy(PolicyContext context) + { + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + RelativeRoundtripTimeoutPolicy relativeRountripTimeoutPolicy = + context.getRelativeRoundtripTimeoutPolicy(); + + if(relativeRountripTimeoutPolicy == null) { + return requestEndTimePolicy; + } else { + + long endTime = UTC.toTimeT(UTC.currentUtcTimeMillis()) + + relativeRountripTimeoutPolicy.relative_expiry(); + + if((requestEndTimePolicy != null) + && (endTime > requestEndTimePolicy.end_time().time) ) { + return requestEndTimePolicy; + } else { + return new RequestEndTimePolicyImpl(endTime); + } + + } + } + + + + + /** + * Checks if the request can be sent and the time while the sender can be + * waiting for the response. + * This operation sleeps the time until the RequestStartTimePolicy + * allows the invocation. + * @param orb The ORB + * @return the time to wait the response + * @throws org.omg.CORBA.TIMEOUT if the request time has expired + */ + public static long checkRequestTime(TIDORB orb, + PolicyContext context) + { + RequestStartTimePolicy requestStartTimePolicy= + context.getRequestStartTimePolicy(); + + long currentTime = 0; + + if(requestStartTimePolicy != null) { + currentTime = UTC.currentUtcTimeMillis(); + checkStart(orb, context, currentTime); + } + + long requestTimeout = + getEffectiveRequestTimeoutInMillis(context, currentTime); + + + if(requestTimeout < 0) { + String msg = + "QoS RequestEndTimePolicy/RelativeRountripTimeoutPolicy exceeded"; + msg += " " + requestTimeout; + throw new org.omg.CORBA.TIMEOUT(msg); + } else { + return requestTimeout; + } + + + + } + + + /** + * @param orb + * @param currentTime in ns. + * @return the time to wait the request in ms. (greather or equal than 0) + */ + private static long getEffectiveRequestTimeoutInMillis(PolicyContext context, + long currentTime) + { + RelativeRoundtripTimeoutPolicy relativeRountripTimeoutPolicy = + context.getRelativeRoundtripTimeoutPolicy(); + + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + + if(requestEndTimePolicy == null) { + if(relativeRountripTimeoutPolicy != null) { + return UTC.toTimeInMillis( + relativeRountripTimeoutPolicy.relative_expiry()); + } else { + return 0; + } + } else { + if(currentTime == 0) { + currentTime = UTC.currentUtcTimeMillis(); + } + + long endTimeout = + UTC.toTimeInMillis(requestEndTimePolicy.end_time().time) + - currentTime; + + if(relativeRountripTimeoutPolicy != null) { + long relativeTimeout = + UTC.toTimeInMillis(relativeRountripTimeoutPolicy.relative_expiry()); + return (endTimeout < relativeTimeout)? endTimeout : relativeTimeout; + } else { + return endTimeout; + } + } + } + + /** + * @param orb + * @param currentTime + * @param startTimePolicy + * @return + */ + private static boolean checkStart(TIDORB orb, + PolicyContext context, + long currentTime) + { + RequestStartTimePolicy requestStartTimePolicy = + context.getRequestStartTimePolicy(); + + // UtcT.time is in order of 100 ns. (1 ns = 10^6 ms.) 100 ns = 10^4 + + long startTime = + UTC.toTimeInMillis(requestStartTimePolicy.start_time().time); + + long sleepMillis = startTime - currentTime; + + if(sleepMillis > 0) { + + try { + Thread.sleep(sleepMillis); + } + catch (InterruptedException e) { + if(orb.m_trace != null ) { + String msg = + "QoS: Request has received an InterruptedException "; + + orb.printTrace( Trace.ERROR, msg); + } + } + + if(orb.m_trace != null ) { + String[] msg = + {"QoS: Request has slept ", + Long.toString(sleepMillis), + " ms. util Messaging::RequestStartTimePolicy value" + }; + + orb.printTrace( Trace.DEEP_DEBUG, msg); + } + + return true; + } + + return false; + } + + + /** + * Validates QoS RequestEndTimePolicy in the ServerSide + * @param policySupplier + * @param trace + * @return + */ + public static boolean validateServerRequestEndTimePolicy(PolicyContext context) + { + if(context == null) { + return true; + } + + RequestEndTimePolicy requestEndTimePolicy = + context.getRequestEndTimePolicy(); + + if(requestEndTimePolicy == null) { + return true; + } else { + long current_time = UTC.currentUtcTimeMillis(); + UtcT utc_time = requestEndTimePolicy.end_time(); + // Request TIMEOUT? + if(current_time > UTC.toTimeInMillis(utc_time.time)) { + + return false; + } + + return true; + } + + } + + + + +} diff --git a/source/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.java new file mode 100644 index 0000000..23eacf4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/QueueOrderPolicyImpl.java @@ -0,0 +1,141 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 349 $ +* Date: $Date: 2009-01-07 09:56:41 +0100 (Wed, 07 Jan 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.OrderingHelper; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.Messaging.QueueOrderPolicyHelper; +import org.omg.Messaging.QueueOrderPolicyLocalBase; +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_DEADLINE; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + * + */ +public class QueueOrderPolicyImpl extends QueueOrderPolicyLocalBase +{ + + short allowedOrders; + + + + /** + * @param allowedOrders + */ + public QueueOrderPolicyImpl(short allowedOrders) + { + super(); + this.allowedOrders = allowedOrders; + } + public short allowed_orders() + { + return allowedOrders; + } + + public int policy_type() + { + return QUEUE_ORDER_POLICY_TYPE.value; + } + + public Policy copy() + { + return new QueueOrderPolicyImpl(this.allowedOrders); + } + + + public void destroy() { + + } + + public static QueueOrderPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + short policy_value = OrderingHelper.extract(val); + + return new QueueOrderPolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static QueueOrderPolicyImpl read(CDRInputStream input) + { + short policy_value = input.read_short(); + + if( (policy_value != ORDER_ANY.value) && + (policy_value != ORDER_TEMPORAL.value) && + (policy_value != ORDER_PRIORITY.value) && + (policy_value != ORDER_DEADLINE.value) ) { + throw new MARSHAL(); + } + + return new QueueOrderPolicyImpl(policy_value); + } + + /** + * @param output + * @param queueOrderPolicy + */ + public static void write(CDROutputStream output, + QueueOrderPolicy queueOrderPolicy) + { + output.write_ushort(queueOrderPolicy.allowed_orders()); + + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.java new file mode 100644 index 0000000..34b992d --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RebindPolicyImpl.java @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RebindModeHelper; +import org.omg.Messaging.RebindPolicy; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RebindPolicyImpl extends org.omg.Messaging.RebindPolicyLocalBase +{ + + short m_value; + + public RebindPolicyImpl(short val) + { + m_value = val; + } + + public short rebind_mode() + { + return m_value; + } + + public int policy_type() + { + return org.omg.Messaging.REBIND_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RebindPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RebindPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + short policy_value = RebindModeHelper.extract(val); + + return new RebindPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static void write(CDROutputStream output, RebindPolicy policy) { + RebindModeHelper.write(output, policy.rebind_mode()); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.java new file mode 100644 index 0000000..e07554b --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RelativeRequestTimeoutPolicyImpl.java @@ -0,0 +1,112 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RelativeRequestTimeoutPolicy; +import org.omg.TimeBase.TimeTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RelativeRequestTimeoutPolicyImpl + extends org.omg.Messaging.RelativeRequestTimeoutPolicyLocalBase +{ + + long m_value; + + public RelativeRequestTimeoutPolicyImpl(long val) + { + m_value = val; + } + + public long relative_expiry() + { + return m_value; + } + + public int policy_type() + { + return org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RelativeRequestTimeoutPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static void write(CDROutputStream output, + RelativeRequestTimeoutPolicy policy) + { + TimeTHelper.write(output, policy.relative_expiry()); + } + + public static RelativeRequestTimeoutPolicyImpl read(CDRInputStream input) + { + long policy_value = input.read_ulong(); + return new RelativeRequestTimeoutPolicyImpl(policy_value); + } + + public static RelativeRequestTimeoutPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + long policy_value = org.omg.TimeBase.TimeTHelper.extract(val); + + return new RelativeRequestTimeoutPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.java new file mode 100644 index 0000000..c5666ce --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RelativeRoundtripTimeoutPolicyImpl.java @@ -0,0 +1,109 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicy; +import org.omg.TimeBase.TimeTHelper; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +public class RelativeRoundtripTimeoutPolicyImpl + extends org.omg.Messaging.RelativeRoundtripTimeoutPolicyLocalBase +{ + + long m_value; + + public RelativeRoundtripTimeoutPolicyImpl(long val) + { + m_value = val; + } + + public long relative_expiry() + { + return m_value; + } + + public int policy_type() + { + return RELATIVE_RT_TIMEOUT_POLICY_TYPE.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RelativeRoundtripTimeoutPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RelativeRoundtripTimeoutPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + long policy_value = org.omg.TimeBase.TimeTHelper.extract(val); + + return new RelativeRoundtripTimeoutPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + public static void write(CDROutputStream output, + RelativeRoundtripTimeoutPolicy policy) + { + + TimeTHelper.write(output, policy.relative_expiry()); + } + + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.java new file mode 100644 index 0000000..f214abd --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RequestEndTimePolicyImpl.java @@ -0,0 +1,145 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2005 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.RequestEndTimePolicy; +import org.omg.Messaging.RequestEndTimePolicyLocalBase; +import org.omg.TimeBase.UtcT; +import org.omg.TimeBase.UtcTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + * + */ +public class RequestEndTimePolicyImpl extends RequestEndTimePolicyLocalBase +{ + UtcT endTime; + + /** + * @param time + */ + public RequestEndTimePolicyImpl(UtcT time) + { + endTime = time; + } + + + + /** + * @param endTime + */ + public RequestEndTimePolicyImpl(long endTime) + { + this.endTime = new UtcT(); + this.endTime.time = endTime; + } + + + + public UtcT end_time() + { + return endTime; + } + + + public int policy_type() + { + return REQUEST_END_TIME_POLICY_TYPE.value; + } + + + public void destroy() + { + + } + + public Policy copy() + { + return new RequestEndTimePolicyImpl(endTime); + } + + + + /** + * @param input + * @return + */ + public static Policy read(CDRInputStream input) + { + UtcT end_time = UtcTHelper.read(input); + return new RequestEndTimePolicyImpl(end_time); + } + + /** + * @param output + * @param policy + */ + public static void write(CDROutputStream output, + RequestEndTimePolicy policy) + { + UtcTHelper.write(output, policy.end_time()); + } + + public static RequestEndTimePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + UtcT policy_value = org.omg.TimeBase.UtcTHelper.extract(val); + + return new RequestEndTimePolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.java new file mode 100644 index 0000000..5e72f6a --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RequestPriorityPolicyImpl.java @@ -0,0 +1,87 @@ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.PriorityRange; +import org.omg.Messaging.PriorityRangeHelper; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.RequestPriorityPolicy; +import org.omg.Messaging.RequestPriorityPolicyLocalBase; + + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + */ +public class RequestPriorityPolicyImpl extends RequestPriorityPolicyLocalBase +{ + PriorityRange range; + + + /** + * @param range + */ + public RequestPriorityPolicyImpl(PriorityRange range) + { + this.range = range; + } + public PriorityRange priority_range() + { + return range; + } + + public int policy_type() + { + + return REQUEST_PRIORITY_POLICY_TYPE.value; + } + + public Policy copy() + { + return this; + } + + + public void destroy() + { + + } + + public static void write(CDROutputStream output, + RequestPriorityPolicy policy) + { + PriorityRangeHelper.write(output, policy.priority_range()); + } + + public static RequestPriorityPolicyImpl read(CDRInputStream input) + { + PriorityRange policy_value = PriorityRangeHelper.read(input); + + if(policy_value.min > policy_value.max) { + throw new MARSHAL(); + } + + return new RequestPriorityPolicyImpl(policy_value); + } + + public static RequestPriorityPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + PriorityRange policy_value = PriorityRangeHelper.extract(val); + + return new RequestPriorityPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.java b/source/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.java new file mode 100644 index 0000000..4dca4a9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/RequestStartTimePolicyImpl.java @@ -0,0 +1,132 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2005 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.Messaging.RequestStartTimePolicy; +import org.omg.Messaging.RequestStartTimePolicyHelper; +import org.omg.Messaging.RequestStartTimePolicyLocalBase; +import org.omg.TimeBase.UtcT; +import org.omg.TimeBase.UtcTHelper; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * @author caceres + */ + +public class RequestStartTimePolicyImpl extends RequestStartTimePolicyLocalBase +{ + UtcT startTime; + + /** + * @param time + */ + public RequestStartTimePolicyImpl(UtcT time) + { + startTime = time; + + + } + + public UtcT start_time() + { + return startTime; + } + + + public int policy_type() + { + return REQUEST_START_TIME_POLICY_TYPE.value; + } + + + + public void destroy() + { + + } + + public Policy copy() + { + return new RequestStartTimePolicyImpl(startTime); + } + + public static void write(CDROutputStream output, Policy policy) + { + RequestStartTimePolicy start_policy = + RequestStartTimePolicyHelper.narrow(policy); + + UtcTHelper.write(output, start_policy.start_time()); + } + + /** + * @param input + * @return + */ + public static RequestStartTimePolicyImpl read(CDRInputStream input) + { + UtcT end_time = UtcTHelper.read(input); + return new RequestStartTimePolicyImpl(end_time); + } + + public static RequestStartTimePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + UtcT policy_value = org.omg.TimeBase.UtcTHelper.extract(val); + + return new RequestStartTimePolicyImpl(policy_value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/messaging/ThreadStateListener.java b/source/es/tid/TIDorbj/core/messaging/ThreadStateListener.java new file mode 100644 index 0000000..afdb5be --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/ThreadStateListener.java @@ -0,0 +1,62 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 8 $ +* Date: $Date: 2006-01-24 17:36:46 +0100 (Tue, 24 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.messaging; + +/** + * Listener of thread state changes. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +interface ThreadStateListener +{ + + boolean threadCanDie(Thread t); + + void threadHasDied(Thread t); + + void setActive(Thread t); + + void setInactive(Thread t); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.java b/source/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.java new file mode 100644 index 0000000..1603582 --- /dev/null +++ b/source/es/tid/TIDorbj/core/messaging/_ExceptionHolderImpl.java @@ -0,0 +1,159 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.messaging; + +import java.io.Serializable; +import java.util.Properties; + +import org.omg.CORBA.portable.ValueFactory; +import org.omg.CORBA_2_3.portable.InputStream; +import org.omg.Messaging._ExceptionHolder; +import org.omg.IOP.CodecPackage.InvalidTypeForEncoding; +import org.omg.IOP.CodecPackage.FormatMismatch; +import org.omg.IOP.*; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA.UserException; + + +public class _ExceptionHolderImpl extends _ExceptionHolder + +{ + + public _ExceptionHolderImpl() { + is_system_exception = false; + byte_order = false; + marshaled_exception = new byte[0]; + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream is) { + + is.fixStarting(); + + // parsear el nombre de la excepcion + String name = is.read_string(); + is.rewind(); + + // TODO: Leer el typecode + org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[0]; + org.omg.CORBA.TypeCode _type = + is.orb().create_exception_tc(name, "UserException", members); + + org.omg.CORBA.Any any = is.orb().create_any(); + any.read_value(is, _type); + + byte_order = is.getByteOrder(); + + + try { + // Obtiene codec factory + String[] args = { "", "" }; + Properties props = new Properties(); + props.put("org.omg.CORBA.ORBClass","es.tid.TIDorbj.core.TIDORB"); + + org.omg.CORBA.Object obj = + org.omg.CORBA.ORB.init(args, props).resolve_initial_references("CodecFactory"); + CodecFactory codec_factory = CodecFactoryHelper.narrow(obj); + + // Crea codec + Encoding encoding = new Encoding(); + encoding.format = ENCODING_CDR_ENCAPS.value; + encoding.major_version = 1; + encoding.minor_version = 2; + Codec codec = codec_factory.create_codec(encoding); + + marshaled_exception = codec.encode(any); + + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public void raise_exception() + throws org.omg.CORBA.UserException + { + org.omg.CORBA.Any any = null; + try { + + // Obtiene codec factory + String[] args = { "", "" }; + Properties props = new Properties(); + props.put("org.omg.CORBA.ORBClass","es.tid.TIDorbj.core.TIDORB"); + + org.omg.CORBA.Object obj = + org.omg.CORBA.ORB.init(args,props).resolve_initial_references("CodecFactory"); + CodecFactory codec_factory = CodecFactoryHelper.narrow(obj); + + // Crea codec + Encoding encoding = new Encoding(); + encoding.format = ENCODING_CDR_ENCAPS.value; + encoding.major_version = 1; + encoding.minor_version = 2; + Codec codec = codec_factory.create_codec(encoding); + + any = codec.decode(marshaled_exception); + + } catch (FormatMismatch e) { + e.printStackTrace(); + throw new MARSHAL(); + } catch (Exception e) { + throw new MARSHAL(); + } + + + // TODO: how throw UserException contained in Any?? + throw new UnknownUserException(any); + } + + + public void raise_exception_with_list(org.omg.CORBA.TypeCode[] exc_list) + throws org.omg.CORBA.UserException + { + throw new NO_IMPLEMENT(); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/all-wcprops b/source/es/tid/TIDorbj/core/poa/.svn/all-wcprops new file mode 100644 index 0000000..db00fae --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/all-wcprops @@ -0,0 +1,143 @@ +K 25 +svn:wc:ra_dav:version-url +V 78 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa +END +ActiveObjectMap.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/ActiveObjectMap.java +END +ThreadPool.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/ThreadPool.java +END +POAImpl.java +K 25 +svn:wc:ra_dav:version-url +V 91 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/POAImpl.java +END +QueuedRequest.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/QueuedRequest.java +END +QueueReaderManager.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/QueueReaderManager.java +END +CurrentImpl.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/CurrentImpl.java +END +QueuedResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/QueuedResponseHandler.java +END +DeadlineRequestComparator.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.java +END +OID.java +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/OID.java +END +ExecThread.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/ExecThread.java +END +ServantDelegate.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/ServantDelegate.java +END +ThreadStateListener.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/ThreadStateListener.java +END +SystemOID.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/SystemOID.java +END +POAManagerConf.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/POAManagerConf.java +END +PriorityRequestComparator.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/PriorityRequestComparator.java +END +TemporalRequestComparator.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/TemporalRequestComparator.java +END +CompletionWaiter.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/CompletionWaiter.java +END +POAManagerConfListener.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/POAManagerConfListener.java +END +POAKey.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/POAKey.java +END +POAManagerImpl.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/POAManagerImpl.java +END +RequestQueue.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/RequestQueue.java +END +QueuedLocateResponseHandler.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.java +END +CurrentInfo.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/CurrentInfo.java +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/entries b/source/es/tid/TIDorbj/core/poa/.svn/entries new file mode 100644 index 0000000..f991e7a --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/entries @@ -0,0 +1,813 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +ActiveObjectMap.java +file + + + + +2009-05-27T12:24:01.000000Z +22574b5e507bd127d0f2349134054f60 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8768 + +ThreadPool.java +file + + + + +2009-05-27T12:24:01.000000Z +b67dd05c64e25a265881282d92a3eb08 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5189 + +QueuedRequest.java +file + + + + +2009-05-27T12:24:01.000000Z +e889fc07831fc75f678773249270d3ea +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4502 + +POAImpl.java +file + + + + +2009-05-27T14:10:34.000000Z +6a9536daa36dff37e5b0ea4ce268018f +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +70595 + +QueueReaderManager.java +file + + + + +2009-05-27T12:24:01.000000Z +706bb4db7df100bbfe5fb0b103c4daae +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1783 + +CurrentImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +8d1e3f6bc3d1fb093ffeb6457f2129ce +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5407 + +QueuedResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +26d292e94165a6a8f2cce4f1eff33b6e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2338 + +DeadlineRequestComparator.java +file + + + + +2009-05-27T12:26:05.000000Z +86c76f86205b0efe0fc762664181559b +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2126 + +OID.java +file + + + + +2009-05-27T12:24:01.000000Z +dfb3db7f2584f233f88da24546ad4e4d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4046 + +ExecThread.java +file +478 + + + +2011-04-29T14:42:47.000000Z +56899f4e95e47d6f3cc0d5463e38523b +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +34154 + +ServantDelegate.java +file + + + + +2009-05-27T12:24:01.000000Z +60d34a59bdf273f0f59a7fe4d1a191c0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4786 + +ThreadStateListener.java +file + + + + +2009-05-27T12:24:01.000000Z +95e28b246593009f8d132fd093d225a2 +2006-01-24T16:36:46.000000Z +8 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1840 + +SystemOID.java +file + + + + +2009-05-27T12:24:01.000000Z +86493c2e307ed725529778f1ec4a3c7b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4193 + +POAManagerConf.java +file + + + + +2009-05-27T12:24:01.000000Z +3c5b729aa9e518a31d40ebad714528d4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3997 + +PriorityRequestComparator.java +file + + + + +2009-05-27T12:26:05.000000Z +0138cbb6ee670b4a0e3a8a27f64717dc +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2316 + +TemporalRequestComparator.java +file + + + + +2009-05-27T12:24:01.000000Z +7aa90eded31b9fa3740541a01a103ca5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +842 + +CompletionWaiter.java +file + + + + +2009-05-27T12:24:01.000000Z +9d08e9d1bc99b46988515345f640469d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3552 + +POAManagerConfListener.java +file + + + + +2009-05-27T12:24:01.000000Z +e30bd28882ec4646c99f57308a08e52c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1646 + +policies +dir + +POAKey.java +file + + + + +2009-05-27T12:24:01.000000Z +8b39dfa0417061a1330bc47830dbba5a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8872 + +POAManagerImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +3f20af275e10e1e0ca9d6d5d6e4d04be +2006-02-09T09:58:57.000000Z +13 +avega +has-props + + + + + + + + + + + + + + + + + + + + +13688 + +QueuedLocateResponseHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +f3ae5333a837e4debcf11369a9706ec6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2434 + +RequestQueue.java +file + + + + +2009-05-27T12:24:01.000000Z +761ce7c6d05cc7162450c3280c714451 +2008-10-28T10:06:44.781798Z +307 +avega +has-props + + + + + + + + + + + + + + + + + + + + +5445 + +CurrentInfo.java +file + + + + +2009-05-27T12:24:01.000000Z +0b74965462c860d321b5b6c5b578666b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2224 + diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ActiveObjectMap.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ActiveObjectMap.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ActiveObjectMap.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CompletionWaiter.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CompletionWaiter.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CompletionWaiter.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentInfo.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentInfo.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/CurrentInfo.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/DeadlineRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/DeadlineRequestComparator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/DeadlineRequestComparator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ExecThread.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ExecThread.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ExecThread.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/OID.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/OID.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/OID.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAKey.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAKey.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAKey.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConf.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConf.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConf.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConfListener.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConfListener.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerConfListener.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/POAManagerImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/PriorityRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/PriorityRequestComparator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/PriorityRequestComparator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueueReaderManager.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueueReaderManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueueReaderManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedLocateResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedRequest.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedRequest.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedRequest.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedResponseHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/QueuedResponseHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/RequestQueue.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/RequestQueue.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/RequestQueue.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ServantDelegate.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ServantDelegate.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ServantDelegate.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/SystemOID.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/SystemOID.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/SystemOID.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/TemporalRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/TemporalRequestComparator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/TemporalRequestComparator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadPool.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadPool.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadPool.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadStateListener.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadStateListener.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/prop-base/ThreadStateListener.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/ActiveObjectMap.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ActiveObjectMap.java.svn-base new file mode 100644 index 0000000..0fb5f80 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ActiveObjectMap.java.svn-base @@ -0,0 +1,308 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Enumeration; +import java.util.Hashtable; + +/** + * Active Object Map. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class ActiveObjectMap +{ + + protected Hashtable m_table = new Hashtable(); + + /** + * Adds a new oid to the Active Object Map. + * + * @param oid + * Object Id. + * @param servant + * Servant which corresponds to oid. + * @param uniqueId + * True if UNIQUE_ID policy is present in this POA. + * @exception ServantAlreadyActive + * If servant is already in the AOM. + * @exception ObjectAlreadyActive + * If uniqueId is true and oid is already in the AOM. + */ + public void put(OID oid, org.omg.PortableServer.Servant servant, + boolean uniqueId) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive + { + + if (m_table.containsKey(oid)) { + throw new org.omg.PortableServer.POAPackage.ObjectAlreadyActive(); + } + + AOMElement element = new AOMElement(servant); + if (uniqueId && m_table.contains(element)) { + throw new org.omg.PortableServer.POAPackage.ServantAlreadyActive(); + } + + m_table.put(oid, element); + } + + /** + * Gets the servant associated to oid. + * + * @param oid + * Object Id. + * @return The servant. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public org.omg.PortableServer.Servant get(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + return element.servant; + } + + /** + * Removes the servant associated to oid. + * + * @param oid + * Object Id. + * @return Retuns the servant removed (if any). + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public org.omg.PortableServer.Servant remove(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.remove(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + return element.servant; + } + + /** + * Tests if a servant is in the Active Object Map. + * + * @return Retuns true if the servant is in the Active Object Map. + */ + public boolean contains(org.omg.PortableServer.Servant servant) + { + AOMElement element = new AOMElement(servant); + return m_table.contains(element); + } + + /** + * Tests if an oid is in the Active Object Map. + * + * @return Retuns true if the oid is in the Active Object Map. + */ + public boolean isActive(OID oid) + { + return (oid != null) && (m_table.containsKey(oid)); + } + + /** + * Gets the first oid associated to a servant. + * + * @param The + * servant. + * @return The Object Id. + */ + public OID get(org.omg.PortableServer.Servant servant) + { + Enumeration oids = m_table.keys(); + Enumeration AOMelems = m_table.elements(); + for (; AOMelems.hasMoreElements();) { + OID curr_oid = (OID) oids.nextElement(); + AOMElement curr_AOMelems = (AOMElement) AOMelems.nextElement(); + if (curr_AOMelems.servant == servant) + return curr_oid; + } + return null; + } + + /** + * Adds a new user for this oid. + * + * @param The + * Object Id. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public void addUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.num_users++; + } + + /** + * Removes a user for this oid. + * + * @param The + * Object Id. + * @return Returns false if there are still users, otherwise returns true. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public boolean removeUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.num_users--; + if (element.num_users <= 0) { + return true; // nobody uses oid anymore + } else { + return false; // someone is still using oid + } + } + + /** + * Marks an oid as "destroying". + * + * @param The + * Object Id. + */ + public void destroy(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.destroying = true; + } + + /** + * Tests if an oid is "destroying". + * + * @return The entry in the Active Object Map. It may be used for + * synchronization purposes. + */ + public java.lang.Object isDestroying(OID oid) + { + AOMElement element = (AOMElement) m_table.get(oid); + if ((element != null) && (element.destroying)) { + return element; + } else { + return null; + } + } + + /** + * Returns an enumeration of all oids in the Active Object Map. + * + * @return The enumeration. + */ + public java.util.Enumeration getOIDs() + { + return new AOMEnumeration(m_table); + } + + /** + * Inner class for the Active Object Map entries. + */ + public class AOMElement + { + + int num_users = 1; // the first user is the POA where oid is created + + org.omg.PortableServer.Servant servant = null; + + boolean destroying = false; + + public AOMElement(org.omg.PortableServer.Servant servant) + { + this.servant = servant; + } + + public boolean equals(Object other) + { + if (other instanceof AOMElement) { + return servant == ((AOMElement) other).servant; + } else { + return false; + } + } + + } + + /** + * Inner class for the enumeration that getOIDs() returns. + */ + public class AOMEnumeration + implements java.util.Enumeration + { + + private java.util.Enumeration keys; + + public AOMEnumeration(Hashtable table) + { + this.keys = table.keys(); + } + + public boolean hasMoreElements() + { + return keys.hasMoreElements(); + } + + public Object nextElement() + { + return keys.nextElement(); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/CompletionWaiter.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CompletionWaiter.java.svn-base new file mode 100644 index 0000000..6d3a015 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CompletionWaiter.java.svn-base @@ -0,0 +1,137 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Class to wait until there are no executing requests. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class CompletionWaiter +{ + + private int m_active_requests = 0; + + private boolean m_stop_waiting = false; + + private es.tid.TIDorbj.core.TIDORB m_orb; + + /** + * Constructor. + * + * @param orb + * The ORB. + */ + public CompletionWaiter(es.tid.TIDorbj.core.TIDORB orb) + { + this.m_orb = orb; + } + + /** + * Tests if an operation should wait for completion. + * + * @return Returns true if it must wait. + */ + protected boolean conditionToWait() + { + try { + CurrentImpl current = m_orb.initPOACurrent(); + POAImpl poa = (POAImpl) current.get_POA(); + return poa.m_orb != m_orb; + } + catch (org.omg.PortableServer.CurrentPackage.NoContext e) { + return true; + } + } + + /** + * Begins a new request (increments active request counter). + */ + synchronized protected void beginRequest() + { + m_active_requests++; + } + + /** + * Ends a request (decrements active request counter and notifies). + */ + synchronized protected void endRequest() + { + m_active_requests--; + if (m_active_requests <= 0) { + notify(); + } + } + + /** + * Waits until there are no active requests. + */ + synchronized protected void waitForCompletion() + { + while ((m_active_requests != 0) && !m_stop_waiting) { + try { + wait(); + } + catch (Exception e) {} + } + m_stop_waiting = false; + } + + /** + * Stops waiting for completion. + */ + synchronized protected void stopWaiting() + { + m_stop_waiting = true; + notifyAll(); + } + + /** + * @return Number of active requests. + */ + synchronized protected int getActiveRequests() + { + return m_active_requests; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentImpl.java.svn-base new file mode 100644 index 0000000..d56c054 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentImpl.java.svn-base @@ -0,0 +1,186 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.PortableServer.CurrentLocalBase; +import org.omg.PortableServer.Servant; +import org.omg.PortableServer.CurrentPackage.NoContext; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * TIDORB implementation of the Current CORBA Object. The current object + * accesses to the CurrentInfo stored in the ExecThread, the thread assotiated + * to the servant execution, returning at each moment the current poa and object + * id (if exists). + * + * @see CurrentInfo + * @see ExecThread + * + * @author Juan A. Cáceres + */ + +public class CurrentImpl extends CurrentLocalBase +{ + + private TIDORB m_orb; + + private boolean destroyed; + + public CurrentImpl(TIDORB orb) + { + m_orb = orb; + } + + public synchronized void destroy() + { + m_orb = null; + destroyed = true; + } + + public synchronized org.omg.PortableServer.POA get_POA() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_current_poa; + } + + public synchronized byte[] get_object_id() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_current_oid.toByteArray(); + } + + public org.omg.CORBA.Object getReference() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_servant._this_object(); + } + + public synchronized org.omg.PortableServer.Servant getServant() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_servant; + } + + /** + * Looks in the current thread for the CurrentInfo that + * determines the current poa and object id needed by the + * Current object. + * + * @return the CurrentInfo object if exits. + * + * @exception org.omg.PortableServer.CurrentPackage.NoContext + * if the current thread is not an instance of + * ExecThread (it is the orb main thread) or + * it is and it is executing a local request, and there is + * out of a POA-dispatched operation. + */ + + protected CurrentInfo getCurrentInfo() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + Thread th = Thread.currentThread(); + + if (th instanceof ExecThread) { // the current is in a servant + // execthread + + ExecThread exec = (ExecThread) th; + + CurrentInfo info = exec.getCurrentInfo(); + + if (info != null) + + return info; + } + + // error executing a local request or we are in the orb main thread + + throw new org.omg.PortableServer.CurrentPackage.NoContext(); + } + + public boolean inContext() + { + Thread th = Thread.currentThread(); + + if (th instanceof ExecThread) { // the current is in a servant + // execthread + + ExecThread exec = (ExecThread) th; + + CurrentInfo info = exec.getCurrentInfo(); + + return (info != null); + } + + return false; + } + + /* (non-Javadoc) + * @see org.omg.PortableServer.CurrentOperations#get_reference() + */ + public Object get_reference() throws NoContext { + return this.getReference(); + } + + /* (non-Javadoc) + * @see org.omg.PortableServer.CurrentOperations#get_servant() + */ + public Servant get_servant() throws NoContext { + return this.getCurrentInfo().m_servant; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentInfo.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentInfo.java.svn-base new file mode 100644 index 0000000..8a6a049 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/CurrentInfo.java.svn-base @@ -0,0 +1,78 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +public class CurrentInfo +{ + + POAImpl m_current_poa; + + OID m_current_oid; + + boolean m_request_in_poa; + + org.omg.PortableServer.Servant m_servant = null; + + public CurrentInfo(POAImpl current_poa, OID current_oid) + { + this.m_current_poa = current_poa; + this.m_current_oid = current_oid; + this.m_request_in_poa = false; + } + + public boolean isRequestInPOA() + { + return m_request_in_poa; + } + + public void setRequestInPOA(boolean val) + { + m_request_in_poa = val; + } + + public void setServant(org.omg.PortableServer.Servant servant) + { + this.m_servant = servant; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/DeadlineRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/DeadlineRequestComparator.java.svn-base new file mode 100644 index 0000000..797d6e2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/DeadlineRequestComparator.java.svn-base @@ -0,0 +1,79 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +import org.omg.Messaging.RequestEndTimePolicy; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Comparator that uses the Messaging::RequestEndTimePolicy to decide the order + * in a request queue. In case of there were not any policy to decide, the + * TemporalRequestComparator will be used. + * @author caceres + * + */ +public class DeadlineRequestComparator + implements Comparator +{ + + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + + + TemporalRequestComparator temporalComparator; + + public DeadlineRequestComparator() + { + temporalComparator = new TemporalRequestComparator(); + } + + + + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + PolicyContext context1 = request1.getPolicyContext(); + PolicyContext context2 = request2.getPolicyContext(); + + RequestEndTimePolicy end1 = null; + RequestEndTimePolicy end2 = null; + + if (context1 != null) { + end1 = context1.getRequestEndTimePolicy(); + } + + if (context2 != null) { + end2 = context2.getRequestEndTimePolicy(); + } + + if(end1 == null) { + if(end2 == null) { + return temporalComparator.compare(o1,o2); + } else { + return GREATER_THAN; + } + } else { + if(end2 == null) { + return LESS_THAN; + } else { // both non-null + + long val1 = end1.end_time().time; + long val2 = end2.end_time().time; + + if(val1 > val2) { + return GREATER_THAN; + } else if(val1 == val2) { + return temporalComparator.compare(o1,o2); + } else { + return LESS_THAN; + } + } + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/ExecThread.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ExecThread.java.svn-base new file mode 100644 index 0000000..708ce83 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ExecThread.java.svn-base @@ -0,0 +1,945 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.BooleanHolder; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.TIMEOUT; +import org.omg.CORBA.UNKNOWN; +import org.omg.PortableServer.DynamicImplementation; +import org.omg.PortableServer.POAManager; +import org.omg.PortableServer.Servant; +import org.omg.PortableServer.POAManagerPackage.State; +import org.omg.PortableServer.POAPackage.AdapterNonExistent; +import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; +import org.omg.PortableServer.POAPackage.ObjectNotActive; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * Execution thread. Gets request from the request queue and executes them. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class ExecThread extends Thread +{ + + private POAManagerImpl m_poa_manager = null; + + private RequestQueue m_queue = null; + + private boolean m_deactivated = false; + + private ThreadStateListener m_thread_state_listener = null; + + private java.util.Stack m_current_info_stack = null; + + private String m_thread_name; + + private TIDORB m_orb; + + private Trace m_trace; + + private long m_max_response_blocked_time; + + private boolean m_qos_enabled; + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this ExecThread belongs. + * @param number + * Id number of this ExecThread. + */ + protected ExecThread(POAManagerImpl poaManager) + { + m_poa_manager = poaManager; + m_queue = m_poa_manager.getRequestQueue(); + m_current_info_stack = new java.util.Stack(); + //TODO: orb referecial by jprojas + m_orb = m_poa_manager.m_orb; + m_trace = m_orb.m_trace; + m_qos_enabled = m_orb.m_conf.qos_enabled; + m_max_response_blocked_time = m_orb.m_conf.max_blocked_time; + } + + /** + * Set the ThreadStateListener. Any ExecThread should have a listener + * (eventually the ThreadPool) before it is started. + * + * @param l + * The listener. + */ + protected void setThreadStateListener(ThreadStateListener l) + { + m_thread_state_listener = l; + } + + /** + * Checks the state of the POAManager. If the state is ACTIVE, then finish + * returning true. If the state is HOLDING, then wait until state is + * diferent from HOLDING. If the state is DISCARDING, then discard the + * request and return false. If the state is INACTIVE, then reject the + * request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + private boolean checkState( QueuedRequest request ) { + + boolean executeRequest = false; + + if (m_trace != null) { + String[] msg = { toString(), " checking state of ", + m_poa_manager.toString() }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + synchronized (m_poa_manager.m_state_mutex) { + boolean exit = false; + while (!exit) { + org.omg.PortableServer.POAManagerPackage.State state = m_poa_manager.get_state(); + if ((state == org.omg.PortableServer.POAManagerPackage.State.ACTIVE) && !request.getMustDiscard()) { + exit = true; + executeRequest = true; + } else if (state == org.omg.PortableServer.POAManagerPackage.State.HOLDING) { + try { + // wait until state changes + m_poa_manager.m_state_mutex.wait(); + } catch (InterruptedException ie) {} + exit = false; + } else if (state == org.omg.PortableServer.POAManagerPackage.State.INACTIVE) { + // MISSING: define strategy for deactivated POAManagers + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to request becase foreing POAManager is INACTIVE" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } else if ( state == org.omg.PortableServer.POAManagerPackage.State.DISCARDING || + request.getMustDiscard() ){ + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to request becase foreing POAManager is DISCARDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + //TODO: change method signature to return possible errors + //in state check + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } + } + } + return executeRequest; + } + + /** + * Execution loop. + */ + public void run() + { + + while (!m_deactivated) { + try { + + if (m_trace != null) { + String[] msg = { toString(), ": getting request..." }; + m_trace.print(Trace.DEEP_DEBUG, msg); + + } + + QueuedRequest thisRequest = m_queue.get(); + + + + if (thisRequest != null) { + // If there is a request, then go!! + m_thread_state_listener.setActive(this); + processRequest(thisRequest); + m_thread_state_listener.setInactive(this); + + } else if (m_thread_state_listener.threadCanDie(this)) { + // If restarted and no request, then commit suicide + m_deactivated = true; + } + + } + catch (Throwable unhandledException) { + // Unhandled exception. Should never happen!! + if (m_trace != null) { + m_trace.printStackTrace(Trace.DEBUG, + toString() + "Unhanled Exception ", + unhandledException); + m_trace.print(Trace.DEBUG, toString() + " dies..."); + } + m_deactivated = true; + } + + + + + } + m_thread_state_listener.threadHasDied(this); + } + + /** + * Process current request. + * + * @return true wherther the request has been queued in + * another POAManager. + */ + private void processRequest(QueuedRequest thisRequest) { + + try { + if (m_trace != null) { + String[] msg = { toString(), " executing request ", thisRequest.toString()}; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + ObjectKey objectKey; + objectKey = thisRequest.getObjectKey(); + + POAKey poaKey; + try { + poaKey = m_orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + } catch ( Throwable th ){ + poaKey = null; + } + + if ( poaKey != null ) { + thisRequest.setPOAKey( poaKey ); + } else { + throw new OBJECT_NOT_EXIST(); + } + + if ( checkState( thisRequest ) ) { + // find poa + POAImpl poa = null; + try { + poa = findPOA( thisRequest ); + } catch ( AdapterNonExistent ane) { + if (m_trace != null) { + m_trace.printStackTrace( + Trace.DEBUG, + new String[]{ + toString(), + "POA ", + thisRequest.getCurrentChildPOAName(), + " not found" + }, + ane + ); + } + throw new org.omg.CORBA.OBJECT_NOT_EXIST(); + } + + if (poa != null) { + execute(thisRequest, poa); + } + } + } catch (org.omg.CORBA.SystemException e) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting a system exception to Request" }; + m_trace.printStackTrace(Trace.DEEP_DEBUG, msg, e); + } + thisRequest.submitResponse( e ); + } catch (java.lang.Throwable th) { + th.printStackTrace( System.err) ; + thisRequest.submitResponse( + new INTERNAL(th.toString(), 0, thisRequest.getStatus() ) + ); + } + } + + /** + * Finds the POA which corresponds to + * + * @param request. + * If the request belongs to another POAManager it is bypassed to + * it, returning null. + * @param request + * The queued request to be executed. + * @returns POAImpl POA where the request must be executed. + * @exception org.omg.PortableServer.POAPackage.AdapterNonExistent + * If it fails finding the POA. + */ + private POAImpl findPOA( QueuedRequest request ) + throws org.omg.PortableServer.POAPackage.AdapterNonExistent + { + + POAImpl current_poa; + + current_poa = request.getCurrentPOA(); + if( current_poa == null ){ + current_poa = this.m_orb.initPOA(); + request.setCurrentPOA( current_poa ); + } + + boolean bypassed = false; + POAManagerImpl nextPOAManager; + while ( !( bypassed || request.isFinalPOA() ) ) { + current_poa = (POAImpl) current_poa.find_POA( + request.getCurrentChildPOAName(),true + ); + + request.nextChildPOA(current_poa); + + nextPOAManager = (POAManagerImpl) current_poa.the_POAManager(); + + if (nextPOAManager != m_poa_manager) { + // bypass request to nextPOAManager + if (m_trace != null) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), " bypassing request ", request.toString(), + " to ", current_poa.toString() + } + ); + } + nextPOAManager.put(request); + bypassed = true; + } + } + return ( bypassed )?null:current_poa; + } + + /** + * Process local Request in the given POAManager. + * + * @param localRequest + * the Local request + * @param current_manager + * the current POA POAManager + */ + public void processLocalRequest( QueuedRequest localRequest ) + { + if (m_trace != null) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " executing local request ", + localRequest.toString() + } + ); + } + + try { + + ObjectKey objectKey; + objectKey = localRequest.getObjectKey(); + + POAKey poaKey; + try { + poaKey = m_orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + } catch ( Throwable th ){ + poaKey = null; + } + + if ( poaKey != null ) { + localRequest.setPOAKey( poaKey ); + } else { + throw new OBJECT_NOT_EXIST(); + } + + POAImpl currentPOA = localRequest.getCurrentPOA(); + if ( currentPOA == null ){ + // Start from rootPOA + currentPOA = this.m_orb.initPOA(); + localRequest.setCurrentPOA( currentPOA ); + } + + POAManager currentPOAManager; + currentPOAManager = currentPOA.the_POAManager(); + + if ( currentPOAManager == this.m_poa_manager ) { + if (!checkState(localRequest)) { + return; + } + } else { + if ( !checkForeingState( localRequest ) ) { + return; + } + } + + // find poa + + POAImpl current_poa = localRequest.getCurrentPOA(); + + try { + while (!localRequest.isFinalPOA()) { + current_poa = (POAImpl) + current_poa.find_POA(localRequest.getCurrentChildPOAName(), + true); + + localRequest.nextChildPOA(current_poa); + + POAManagerImpl nextPOAManager = (POAManagerImpl) + current_poa.the_POAManager(); + + if (nextPOAManager != m_poa_manager) { + // bypass request to nextPOAManager + + if (m_trace != null) { + String[] msg = + { toString(), + " bypassing request ", + localRequest.toString(), + " through ", + current_poa.toString()}; + + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + processLocalRequest( localRequest ); + return; + } + } + } + catch (org.omg.PortableServer.POAPackage.AdapterNonExistent ane) { + if (m_trace != null) { + String[] msg = + { toString(), + "POA ", + localRequest.getCurrentChildPOAName(), + " not found, org.omg.CORBA.OBJECT_NOT_EXIST throwed" }; + + m_trace.printStackTrace(Trace.DEBUG, msg, ane); + } + localRequest.submitResponse(new OBJECT_NOT_EXIST() ); + return; + } + + if (current_poa != null) { + execute(localRequest, current_poa); + } + + } catch (org.omg.CORBA.SystemException se) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting a system exception to localRequest" }; + m_trace.printStackTrace(Trace.DEEP_DEBUG, msg, se); + } + localRequest.submitResponse( se ); + } catch (java.lang.Throwable tw) { + tw.printStackTrace(); + localRequest.submitResponse( + new INTERNAL(tw.toString(), 0, localRequest.getStatus() ) + ); + } + } + + /** + * Checks the state of the given POAManager. If the state is ACTIVE, then + * finish returning true. If the state is HOLDING, then wait until state + * changes or the max_blocked_time timeout is reached. If the state is + * DISCARDING, then discard the request and return false. If the state is + * INACTIVE, then reject the request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + private boolean checkForeingState( QueuedRequest localRequest ) { + if ( m_trace != null ) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Checking foreing POAManager state" + } + ); + } + POAManagerImpl currentPOAManager; + //TODO: add method "getPOAManager" returning a POAManagerImpl to avoid + //castings + currentPOAManager = + ( POAManagerImpl )localRequest.getCurrentPOA().the_POAManager(); + + org.omg.PortableServer.POAManagerPackage.State state = currentPOAManager.get_state(); + + // chech current_manager state + if ( state == org.omg.PortableServer.POAManagerPackage.State.HOLDING ) { + if ( m_trace != null ) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Waiting in a foreing POAManager because it is HOLDING" + } + ); + } + + long timeout = m_max_response_blocked_time; + + if (m_qos_enabled) { + + PolicyContext policyContext; + policyContext = localRequest.getPolicyContext(); + + if(policyContext != null) { + + timeout = QoS.checkRequestTime(m_orb, policyContext); + } + } + + if(timeout > 0) { + synchronized ( currentPOAManager.m_state_mutex ) { + try { + //TODO: check if this could be done outside ExecThread's to + //avoid inclusion of requestPolicy in responsehandlers + currentPOAManager.m_state_mutex.wait(timeout); + } catch ( InterruptedException ie ) { } + } + } + + state = currentPOAManager.get_state(); + + currentPOAManager.put( localRequest ); + if ( state == org.omg.PortableServer.POAManagerPackage.State.HOLDING ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting NO_RESPONSE because foreing POAManager is HOLDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new NO_RESPONSE() ); + return false; + } + } + + if ( state == org.omg.PortableServer.POAManagerPackage.State.INACTIVE ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to localRequest becase foreing POAManager is INACTIVE" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new org.omg.CORBA.TRANSIENT() ); + return false; + } + + if ( ( state == org.omg.PortableServer.POAManagerPackage.State.DISCARDING ) || localRequest.getMustDiscard() ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to localRequest becase foreing POAManager is DISCARDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new org.omg.CORBA.TRANSIENT() ); + return false; + } + + return true; + } + + + + /** + * Executes a queued request depending on its type. + * + * @param request + * The queued request to be executed. + */ + private void execute( QueuedRequest request, POAImpl poa ) { + // TODO:temporary check until refactoring complete + + POAKey poaKey = request.getPOAKey(); + if ( poaKey != null ) { + long poaId; + poaId = poaKey.getPOAId(); + /* + * poaId -> persistent poa. Must check if it's not a persistent poa, + * if it's the same 'instance' that holds the 'servant' right now + */ + if ( poaId != 0 && poaId != poa.getId() ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting OBJECT_NOT_EXIST to request becase poaId isn't int poa" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + request.submitResponse( new org.omg.CORBA.OBJECT_NOT_EXIST() ); + } else { + // execute request + CurrentInfo current; + current = new CurrentInfo( poa, poaKey.getOID() ); + m_current_info_stack.push( current ); + + try { + if ( request instanceof QueuedLocateResponseHandler ) { + execute( ( QueuedLocateResponseHandler ) request, poa ); + } else if ( request instanceof QueuedResponseHandler ){ + execute( ( QueuedResponseHandler )request, poa ); + } + request.setStatus( CompletionStatus.COMPLETED_YES ); + } catch ( org.omg.CORBA.SystemException se ) { + request.submitResponse( se ); + } catch ( java.lang.Throwable tw ) { + request.submitResponse( + new INTERNAL( tw.toString(), 0, request.getStatus() ) + ); + } finally { + m_current_info_stack.pop(); + if ( current.isRequestInPOA() ) { + try { + poa.removeUser( poaKey.getOID() ); + } catch ( Exception e ) { + } + request.destroy(); + } + } + } + } else { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + new String[] { + toString(), + " Invalid target ObjectKey in Request[ ", + request.getObjectKey().toString(), + "]" + } + ); + } + } + } + + private void execute( QueuedLocateResponseHandler handler, POAImpl poa ){ + //TODO: send this to the request... + + BooleanHolder servantLocatorUsed = new org.omg.CORBA.BooleanHolder(); + try { + // Current execution context + CurrentInfo current; + current = (CurrentInfo)m_current_info_stack.peek(); + + // Current servant's OID + OID oid; + oid = current.m_current_oid; + + // Servant location + Servant servant; + servant = poa.find_servant( oid, null, null, servantLocatorUsed ); + if (servant != null) { + handler.submitResponse( true ); + } else { + //This should never happen + throw new INTERNAL( + "find_servant() returning null!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } catch (org.omg.CORBA.SystemException e) { + throw e; + } catch (org.omg.PortableServer.ForwardRequest e) { + handler.submitResponse( e.forward_reference ); + m_poa_manager.m_orb.printTrace(Trace.DEBUG, "Forwarded: ", e); + } catch (Exception e) { + handler.submitResponse( false ); + } + } + + private void execute( QueuedResponseHandler handler, POAImpl poa ){ + try { + + + + /**/ + // get serverRequest (with params for invocation) + ServerRequest serverRequest; + serverRequest = handler.getServerRequest(); + + // QoS validation + if (m_qos_enabled) { + + if(!QoS.validateServerRequestEndTimePolicy(handler.getPolicyContext())) + { + if (m_trace != null) { + + String[] msg = { toString(), + " discarding ", + serverRequest.toString(), + " due to Messaging::RequestEndTimePolicy: TIMEOUT"}; + + m_trace.print(Trace.DEBUG, msg); + } + + throw new TIMEOUT(); + } + + } + /* + * SERVANT LOCATION + **/ + + // Cookie holder to store "reference" to dynamic incarnated servants + // when using servant locator + CookieHolder cookieHolder; + cookieHolder = new CookieHolder(); + + // Boolean holder, to store previous condition + //TODO: verify with juan + BooleanHolder servantLocatorUsed; + servantLocatorUsed = new org.omg.CORBA.BooleanHolder(); + + // Current execution context + CurrentInfo current; + current = (CurrentInfo)m_current_info_stack.peek(); + + // Target servant's OID + OID oid; + oid = current.m_current_oid; + + + org.omg.PortableServer.Servant servant = null; + try { + servant = poa.find_servant( + oid, + serverRequest.operation(), + cookieHolder, + servantLocatorUsed + ); + + poa.addUser( oid ); + + current.setRequestInPOA(true); + + } catch ( ObjectNotActive one ) { + this.m_orb.printTrace( Trace.DEBUG, "", one ); + //TODO: why is status in ServerRequestImpl + throw new org.omg.CORBA.OBJECT_NOT_EXIST( + one.getMessage(), 1, handler.getStatus() + ); + } catch ( ObjectAlreadyActive oae ) { + this.m_orb.printTrace(Trace.DEBUG, "", oae); + throw new org.omg.CORBA.OBJ_ADAPTER( + oae.getMessage(), 0, handler.getStatus() + ); + } catch ( org.omg.PortableServer.ForwardRequest fr ) { + this.m_orb.printTrace( Trace.DEBUG, "Forwarded: ", fr ); + handler.submitResponse( fr.forward_reference ); + return; + } + + // set servant in current object + current.setServant( servant ); + + handler.setStatus( CompletionStatus.COMPLETED_MAYBE ); + + if ( "_is_a".equals( serverRequest.operation() ) ) { + this.invoke_is_a( poa, servant, serverRequest ); + } else { + if (servant instanceof DynamicImplementation) { + // invoke servant using DII + DynamicImplementation dynServant; + dynServant = (DynamicImplementation) servant; + + if ( poa.isSingleThread() ) { + synchronized ( dynServant._get_delegate() ) { + doInvoke(dynServant, serverRequest); + } + } else { + doInvoke(dynServant, serverRequest); + } + } else { + throw new NO_IMPLEMENT( + "Stream based invocation not implemented", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + handler.setStatus(CompletionStatus.COMPLETED_YES); + + // return results (if not oneway) + handler.setPolicyContext(poa.getPolicyContext()); + handler.submitResponse(); + + + // Call postinvoke if necessary + if ( servantLocatorUsed.value ) { + poa.callPostinvoke( + oid.toByteArray(), + serverRequest.operation(), + cookieHolder, + servant + ); + } + /* TODO: why ForwardRequest isn't thrown? + } catch (org.omg.PortableServer.ForwardRequest e) { + handler.submitResponse( e.forward_reference ); + m_poa_manager.m_orb.printTrace(Trace.DEBUG, "Forwarded: ", e); + */ + } catch (org.omg.CORBA.SystemException e) { + throw e; + } catch (Exception e) { + if ( m_trace != null ) { + m_trace.printStackTrace( Trace.DEEP_DEBUG, + " Submitting UNKNOWN exception to handler ", e); + } + + handler.submitResponse( + new UNKNOWN() + ); + } + } + + + + /** + * Executes "_is_a" request on the ServantDelegate. + * + * @param servant + * The target servant of the "_is_a" request. + * @param request + * The queued request to be executed. + */ + private void invoke_is_a(POAImpl poa, + org.omg.PortableServer.Servant servant, + org.omg.CORBA.ServerRequest request) + { + try { + es.tid.TIDorbj.core.poa.ServantDelegate deleg = + (es.tid.TIDorbj.core.poa.ServantDelegate) servant._get_delegate(); + org.omg.CORBA.ORB orb = poa.m_orb; + org.omg.CORBA.NVList params = orb.create_list(1); + org.omg.CORBA.Any $s = orb.create_any(); + $s.type(orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + params.add_value("s", $s, org.omg.CORBA.ARG_IN.value); + request.arguments(params); + String itf = $s.extract_string(); + boolean result = deleg.is_a(servant, itf); + org.omg.CORBA.Any resultAny = orb.create_any(); + resultAny.insert_boolean(result); + request.set_result(resultAny); + } catch (org.omg.CORBA.SystemException se) { + throw se; + } catch (Throwable th) { + if ( this.m_orb.m_trace != null) { + m_trace.printStackTrace( + Trace.DEBUG, + new String[]{ + toString(), + " Exception in servant invoke \"_is_a\" method, ", + "UNKOWN thrown: " + }, + th + ); + } + throw new org.omg.CORBA.UNKNOWN(); + } + + } + + /** + * @return Returns the string representation of this Thread. + */ + public synchronized String toString() + { + if (m_thread_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append(super.toString()); + buffer.append(" in "); + buffer.append(m_poa_manager.toString()); + m_thread_name = buffer.toString(); + buffer = null; + } + return m_thread_name; + } + + /** + * @return Returns the CurrentInfo in the top of the stack. + */ + public CurrentInfo getCurrentInfo() + { + if (m_current_info_stack.empty()) { + return null; + } + return (CurrentInfo) m_current_info_stack.peek(); + } + + private void doInvoke(DynamicImplementation servant, + org.omg.CORBA.ServerRequest request) + { + try { + servant.invoke(request); + } + catch (org.omg.CORBA.SystemException se) { + throw se; + } + catch (Throwable th) { + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { toString(), + " Exception in servant invoke method, UNKOWN thrown: " + }; + + m_trace.printStackTrace(Trace.DEBUG, msg, th); + } + throw new org.omg.CORBA.UNKNOWN(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/OID.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/OID.java.svn-base new file mode 100644 index 0000000..4379c40 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/OID.java.svn-base @@ -0,0 +1,166 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.util.Base64Codec; + +/** + * General Representation of an Object Indentifier. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class OID +{ + + protected byte[] m_value; + + protected int m_hash_code; + + protected boolean m_hash_created; + + protected String m_str; + + protected OID() + { + m_value = null; + m_hash_code = 0; + m_hash_created = false; + } + + public OID(byte[] val) + { + this(); + m_value = val; + } + + public byte[] toByteArray() + { + return m_value; + } + + public boolean equals(Object obj) + { + OID other = null; + + if (!(obj instanceof OID)) + return false; + + other = (OID) obj; + + if (m_value == null) { + if (other.m_value == null) + return true; + else + return false; + } + + if (m_value.length != other.m_value.length) + return false; + + for (int i = 0; i < m_value.length; i++) { + if (m_value[i] != other.m_value[i]) + return false; + } + + return true; + } + + public int hashCode() + { + if (!m_hash_created) { + + if (m_value == null) + return 0; + + for (int i = 0; i < m_value.length; i++) + m_hash_code = (31 * m_hash_code) + m_value[i]; + m_hash_created = true; + } + + return m_hash_code; + } + + public static OID fromString(String str) + throws Exception + { + return new OID(Base64Codec.decode(str)); + } + + public String toString() + { + if (m_str == null) { + if ((m_value != null) || (m_value.length > 0)) + m_str = Base64Codec.encode(m_value); + else + m_str = ""; + } + + return m_str; + } + + /* + * public static void main (String[] args) { try { + * + * byte[] bytes = {(byte)0,(byte)0,(byte)0,(byte)0,(byte)1,(byte)23}; + * + * OID oid = new OID(bytes); + * + * String str = oid.toString(); + * + * System.out.println(str); + * + * oid = OID.fromString(str); + * + * + * byte[] oid_bytes = oid.toByteArray(); + * + * for(int i = bytes.length -1 ; i >= 0; i--) if(oid_bytes[i] != bytes[i]) + * System.out.println("Error in bytes"); + * + * System.out.println("final"); } catch (Throwable th) + * {th.printStackTrace();} } + * + */ +} + diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAImpl.java.svn-base new file mode 100644 index 0000000..518769d --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAImpl.java.svn-base @@ -0,0 +1,1984 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import org.omg.BiDirPolicy.BOTH; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.NORMAL; +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.PortableServer.*; +import org.omg.PortableServer.POAPackage.*; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.poa.policies.*; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Implementation of RTPortableServer::POA + * + * @autor Javier Fdz. Mejuto + * @autor Juan A. Caceres + * @version 2.0 + */ +public class POAImpl extends org.omg.PortableServer.POALocalBase +{ + + /** + * If true the Object has been destroyed and it will throw a + * org.omg.CORBA.OBJECT_NOT_EXIST exception. + * Many Objects has the destroy method, this method will change this attribute. + */ + + protected boolean m_destroyed; + + // attributes for all POAs + public es.tid.TIDorbj.core.TIDORB m_orb = null; + + private String m_name = null; + + private String m_poa_string_name = null; + + private long m_poa_id = 0; + + private byte[] m_id = null; + + private POAKey m_key_seed = null; + + private Vector m_children = null; + + private org.omg.PortableServer.POA m_parent = null; + + private String[] m_path = null; + + private POAManagerImpl m_poa_manager = null; + + private CompletionWaiter m_completion = null; + + private boolean m_destroying = false; + + private boolean m_etherealize = false; + + // attributes depending on policies + private org.omg.PortableServer.AdapterActivator m_adapter_activator = null; + + private org.omg.PortableServer.ServantManager m_servant_manager = null; + + private org.omg.PortableServer.Servant m_default_servant = null; + + private ActiveObjectMap m_active_object_map = null; + + // OID if SystemPolicy + private SystemOID m_current_OID; + + // policies + private IdAssignmentPolicy m_id_assignment_policy = null; + + private IdUniquenessPolicy m_id_uniqueness_policy = null; + + private ImplicitActivationPolicy m_implicit_activation_policy = null; + + private LifespanPolicy m_lifespan_policy = null; + + private RequestProcessingPolicy m_request_processing_policy = null; + + private ServantRetentionPolicy m_servant_retention_policy = null; + + private ThreadPolicy m_thread_policy = null; + + private PoliciesComponent referencePolicies = null; + + /** + * Constructor. + * + * @param orb + * The ORB. + * @param adapter_name + * The POA name. + * @param a_POAManager + * The POA manager which this POA belongs to. + * @param policies + * The policies to be used in the POA. + * @param parent + * The parent POA of this POA. + * @exception org.omg.PortableServer.POAPackage.InvalidPolicy + * When policies are invalid. + */ + public POAImpl(es.tid.TIDorbj.core.TIDORB orb, + java.lang.String adapter_name, + org.omg.PortableServer.POAManager a_POAManager, + org.omg.CORBA.Policy[] policies, + org.omg.PortableServer.POA parent) + throws org.omg.PortableServer.POAPackage.InvalidPolicy + { + int length; + this.m_orb = orb; + this.m_name = adapter_name; + this.m_poa_id = System.currentTimeMillis(); + this.m_children = new Vector(); + this.m_poa_manager = (POAManagerImpl) a_POAManager; + m_poa_manager.addPOA(this); + this.m_parent = parent; + if (parent == null) + this.m_path = new String[0]; + else { + length = (((POAImpl) parent).getPath()).length; + this.m_path = new String[length + 1]; + System.arraycopy(((POAImpl) parent).getPath(), 0, this.m_path, 0, + length); + this.m_path[length] = adapter_name; + } + this.m_completion = new CompletionWaiter(this.m_orb); + + this.referencePolicies = new PoliciesComponent(new PolicyContext(null)); + + // Set policies + if (policies != null) { + for (int i = 0; i < policies.length; i++) { + if (policies[i] == null) + throw new BAD_PARAM("Null policy reference"); + + switch (policies[i].policy_type()) + { + case ID_ASSIGNMENT_POLICY_ID.value: + if (m_id_assignment_policy != null) { + throw new InvalidPolicy(); + } + m_id_assignment_policy = + (IdAssignmentPolicy) policies[i]; + break; + case ID_UNIQUENESS_POLICY_ID.value: + if (m_id_uniqueness_policy != null) { + throw new InvalidPolicy(); + } + m_id_uniqueness_policy = + (IdUniquenessPolicy) policies[i]; + break; + case IMPLICIT_ACTIVATION_POLICY_ID.value: + if (m_implicit_activation_policy != null) { + throw new InvalidPolicy(); + } + m_implicit_activation_policy = + (ImplicitActivationPolicy) policies[i]; + break; + case org.omg.PortableServer.LIFESPAN_POLICY_ID.value: + if (m_lifespan_policy != null) { + throw new InvalidPolicy(); + } + m_lifespan_policy = (LifespanPolicy) policies[i]; + break; + case REQUEST_PROCESSING_POLICY_ID.value: + if (m_request_processing_policy != null) { + throw new InvalidPolicy(); + } + m_request_processing_policy = + (RequestProcessingPolicy) policies[i]; + break; + case SERVANT_RETENTION_POLICY_ID.value: + if (m_servant_retention_policy != null) { + throw new InvalidPolicy(); + } + m_servant_retention_policy = + (ServantRetentionPolicy) policies[i]; + break; + case THREAD_POLICY_ID.value: + if (m_thread_policy != null) { + throw new InvalidPolicy(); + } + m_thread_policy = (ThreadPolicy) policies[i]; + break; + + default: + try { + referencePolicies.getPolicies().setPolicy(policies[i]); + } + catch (PolicyError e) { + throw new InvalidPolicy(); + } + } + } + } + // Set default policies + if (m_id_assignment_policy == null) { + m_id_assignment_policy = + create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID); + } + + if (m_id_uniqueness_policy == null) { + m_id_uniqueness_policy = + create_id_uniqueness_policy(IdUniquenessPolicyValue.UNIQUE_ID); + } + + if (m_implicit_activation_policy == null) { + m_implicit_activation_policy = + create_implicit_activation_policy( + ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION); + } + + if (m_lifespan_policy == null) { + m_lifespan_policy = + create_lifespan_policy(LifespanPolicyValue.TRANSIENT); + } + + if (m_request_processing_policy == null) { + m_request_processing_policy = + create_request_processing_policy( + RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY); + } + + if (m_servant_retention_policy == null) { + m_servant_retention_policy = + create_servant_retention_policy( + ServantRetentionPolicyValue.RETAIN); + } + if (m_thread_policy == null) { + m_thread_policy = + create_thread_policy(ThreadPolicyValue.ORB_CTRL_MODEL); + } + + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + + m_active_object_map = new ActiveObjectMap(); + } + + if (m_id_assignment_policy.value() == IdAssignmentPolicyValue.SYSTEM_ID) + m_current_OID = new SystemOID(m_poa_id, 0); + + // Wrong Policies + if ((m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) + && ((m_id_assignment_policy.value() + == IdAssignmentPolicyValue.USER_ID) + || (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN))) { + throw new InvalidPolicy(); + } + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) + && (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY)) { + throw new InvalidPolicy(); + } + + // Generate id + m_id = createKey(null).toString().getBytes(); + } + + /** + * Create a POA as a children of this POA. + * + * @param adapter_name + * The POA name of the new POA. + * @param a_POAManager + * The POA manager which the new POA belongs to. + * @param policies + * The policies to be used in the new POA. + * @exception org.omg.PortableServer.POAPackage.AdapterAlreadyExists + * When this POA has alreay a children named adapter_name. + * @exception org.omg.PortableServer.POAPackage.InvalidPolicy + * When policies are invalid. + */ + synchronized public org.omg.PortableServer.POA + create_POA(java.lang.String adapter_name, + org.omg.PortableServer.POAManager a_POAManager, + org.omg.CORBA.Policy[] policies) + throws org.omg.PortableServer.POAPackage.AdapterAlreadyExists, + org.omg.PortableServer.POAPackage.InvalidPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((adapter_name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (findChildren(adapter_name) != null) { + throw new org.omg.PortableServer.POAPackage.AdapterAlreadyExists(); + } + POAManagerImpl POAmgr = null; + if (a_POAManager == null) { + POAmgr = new POAManagerImpl(m_orb); + } else { + if(! (a_POAManager instanceof POAManagerImpl)) { + throw new BAD_PARAM("Invalid POAManager: it is not from TIDORB"); + } + + POAmgr = (POAManagerImpl) a_POAManager; + + if(POAmgr.m_orb != m_orb) { + throw new BAD_PARAM("Invalid POAManager: it is not from the same instance of TIDORB"); + } + + } + POAImpl newPOA = + new POAImpl(m_orb, adapter_name, POAmgr, policies, this); + + if (m_destroying) { + newPOA.destroy(false, false); + } else { + m_children.addElement(newPOA); + } + + if(a_POAManager == null) { // recently created + PolicyContext context = newPOA.getPolicyContext(); + + QueueOrderPolicy queuePolicy = context.getQueueOrderPolicy(); + + if(queuePolicy != null) { + POAmgr.setQueueOrderPolicy(queuePolicy); + } + } + + return newPOA; + } + + /** + * @return + */ + public PolicyContext getPolicyContext() + { + return this.referencePolicies.getPolicies(); + } + + /** + * Find a POA among this POA's children. + * + * @param adapter_name + * The POA name. + * @param activate_it + * If it is true find_POA() will try to activate the POA in case + * it can't find it. + * @exception org.omg.PortableServer.POAPackage.AdapterNonExistent + * When this POA has not a children named adapter_name. + */ + public org.omg.PortableServer.POA find_POA(java.lang.String adapter_name, + boolean activate_it) + throws org.omg.PortableServer.POAPackage.AdapterNonExistent + { + synchronized (this) { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + } + + if (adapter_name == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + org.omg.PortableServer.POA poa = findChildren(adapter_name); + + if (poa == null) { + if ((activate_it) && (m_adapter_activator != null)) { + try { + m_adapter_activator.unknown_adapter(this, adapter_name); + } + catch (Exception e) { + throw new org.omg.CORBA.OBJ_ADAPTER(e.getMessage()); + } + poa = findChildren(adapter_name); + // see if _activator has created the POA + if (poa == null) { + // AdapterActivator failed! + throw new AdapterNonExistent(); + } + + if (m_destroying) + poa.destroy(false, false); + + return poa; + + } else { + // AdapterActivator does not exist! + throw new AdapterNonExistent(); + } + } else + return poa; + } + + /** + * Destroy the POA. + * + * @param etherealize_objects + * If true, it must etherealize all objects. + * @param wait_for_completion + * Wait-for-completion flag. + */ + public void destroy(boolean etherealize_objects, + boolean wait_for_completion) + { + synchronized (this) { + if (!m_destroying) { + for (int i = 0; i < m_children.size(); i++) { + org.omg.PortableServer.POA poa=(org.omg.PortableServer.POA) + m_children.elementAt(i); + poa.destroy(etherealize_objects, wait_for_completion); + } + m_etherealize = etherealize_objects; + } + m_destroying = true; + } + + if (wait_for_completion) { + // Wait until there are no executing requests + if (m_completion.conditionToWait()) { + m_completion.waitForCompletion(); + } else { + throw new BAD_INV_ORDER("Can't waitForCompletion!"); + } + + synchronized (this) { + + if (!m_destroyed) { + // POA has not been destroyed yet -> destroy it now + trueDestroy(); + } + } + } else { + synchronized (this) { + boolean PoaNotInUse = m_completion.getActiveRequests() <= 0; + if (PoaNotInUse) { + trueDestroy(); + } + } + + } + } + + /* ************ Policy creation ************* */ + + public org.omg.PortableServer.ThreadPolicy + create_thread_policy(org.omg.PortableServer.ThreadPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.poa.policies.ThreadPolicyImpl(value); + } + + public org.omg.PortableServer.LifespanPolicy + create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.poa.policies.LifespanPolicyImpl(value); + } + + public org.omg.PortableServer.IdUniquenessPolicy + create_id_uniqueness_policy + (org.omg.PortableServer.IdUniquenessPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.IdUniquenessPolicyImpl(value); + } + + public org.omg.PortableServer.IdAssignmentPolicy + create_id_assignment_policy( + org.omg.PortableServer.IdAssignmentPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.IdAssignmentPolicyImpl(value); + } + + public org.omg.PortableServer.ImplicitActivationPolicy + create_implicit_activation_policy( + org.omg.PortableServer.ImplicitActivationPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.ImplicitActivationPolicyImpl(value); + } + + public org.omg.PortableServer.ServantRetentionPolicy + create_servant_retention_policy( + org.omg.PortableServer.ServantRetentionPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.ServantRetentionPolicyImpl(value); + } + + public org.omg.PortableServer.RequestProcessingPolicy + create_request_processing_policy( + org.omg.PortableServer.RequestProcessingPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.RequestProcessingPolicyImpl(value); + } + + /* ************ Accessors ************* */ + + public long getId() + { + return m_poa_id; + } + + public byte[] id() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_id; + } + + public java.lang.String the_name() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_name; + } + + public org.omg.PortableServer.POA the_parent() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_parent; + } + + public String[] getPath() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_path; + } + + synchronized public org.omg.PortableServer.POA[] the_children() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + org.omg.PortableServer.POA[] childrenArray = + new org.omg.PortableServer.POA[m_children.size()]; + m_children.copyInto(childrenArray); + return childrenArray; + } + + public org.omg.PortableServer.POAManager the_POAManager() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_poa_manager; + } + + synchronized public org.omg.PortableServer.AdapterActivator the_activator() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_adapter_activator; + } + + synchronized public void + the_activator(org.omg.PortableServer.AdapterActivator the_activator) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (the_activator == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + m_adapter_activator = the_activator; + } + + synchronized public org.omg.PortableServer.ServantManager + get_servant_manager() + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + return m_servant_manager; + } + + synchronized public void + set_servant_manager(org.omg.PortableServer.ServantManager imgr) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (imgr == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + if (!(imgr instanceof org.omg.PortableServer.ServantActivator)) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) { + if (!(imgr instanceof org.omg.PortableServer.ServantLocator)) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + if (m_servant_manager != null) { + throw new org.omg.CORBA.BAD_INV_ORDER(); + } + m_servant_manager = imgr; + } + + synchronized public org.omg.PortableServer.Servant get_servant() + throws org.omg.PortableServer.POAPackage.NoServant, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (m_default_servant == null) { + throw new org.omg.PortableServer.POAPackage.NoServant(); + } + return m_default_servant; + } + + synchronized public void + set_servant(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + m_default_servant = p_servant; + // Servant delegate creation (oid == null ?) + ServantDelegate delegate = new ServantDelegate(this, null); + m_default_servant._set_delegate(delegate); + } + + /* ************ Activation ************* */ + + /** + * Activate an object in this POA. + * + * @param p_servant + * Servant. + * @return Returns an ORB generated object Id. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] + activate_object(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + != IdAssignmentPolicyValue.SYSTEM_ID) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + OID id = nextOID(); + try { + activate_object_with_id(id, p_servant); + } + catch (org.omg.PortableServer.POAPackage.ObjectAlreadyActive e) { + // this should never happen + throw new + INTERNAL("ObjectAlreadyActive thrown with SYSTEM_ID policy!!"); + } + return id.toByteArray(); + } + + /** + * Activate an object in this POA. + * + * @param id + * User created object Id. + * @param p_servant + * Servant. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If id is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public void + activate_object_with_id(byte[] id, + org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (p_servant == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (id.length == 0) + throw new BAD_PARAM("Invalid id length: 0", 0, + CompletionStatus.COMPLETED_NO); + + activate_object_with_id(new OID(id), p_servant); + + } + + /** + * Activate an object in this POA. + * + * @param id + * User created object Id. + * @param p_servant + * Servant. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If id is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + + protected void + activate_object_with_id(OID oid, + org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + boolean uniqueId = + m_id_uniqueness_policy.value() == IdUniquenessPolicyValue.UNIQUE_ID; + // See if there a destruction process running + + synchronized (m_active_object_map) { + java.lang.Object semaphore = m_active_object_map.isDestroying(oid); + if (semaphore != null) { + synchronized (semaphore) { + try { + semaphore.wait(); + } + catch (Exception e) {} + } + } + } + synchronized (this) { + m_active_object_map.put(oid, p_servant, uniqueId); + // Servant delegate creation + ServantDelegate delegate = new ServantDelegate(this, + oid.toByteArray()); + p_servant._set_delegate(delegate); + } + } + + /** + * Deactivate an object in this POA. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If id is not active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public void deactivate_object(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + OID tid_oid = new OID(oid); + + synchronized (m_active_object_map) { + if (m_active_object_map.isDestroying(tid_oid) == null) { + m_active_object_map.destroy(tid_oid); + tryToRemoveObject(tid_oid); + } + } + } + + /* ************ Id conversion ************* */ + + /** + * Create an object reference for a repository Id (using a new object Id). + * + * @param intf + * The repository Id + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object + create_reference(java.lang.String intf) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (intf == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (intf.length() == 0) + throw new BAD_PARAM("Invalid id length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + != IdAssignmentPolicyValue.SYSTEM_ID) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + OID newOid = nextOID(); + return createReferenceWithIdAux(newOid, intf); + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + */ + public org.omg.CORBA.Object create_reference_with_id(byte[] oid, + java.lang.String intf) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((oid == null) || (intf == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (intf.length() == 0) + throw new BAD_PARAM("Invalid intf length: 0", 0, + CompletionStatus.COMPLETED_NO); + + return create_reference_with_id(new OID(oid), intf); + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + + synchronized protected org.omg.CORBA.Object + create_reference_with_id(OID oid, + java.lang.String intf) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + == IdAssignmentPolicyValue.SYSTEM_ID) { + + SystemOID s_oid = SystemOID.fromOID(oid); + + if (s_oid == null) + throw new BAD_PARAM("Invalid System OID", 0, + CompletionStatus.COMPLETED_NO); + + if (m_lifespan_policy.value() == LifespanPolicyValue.TRANSIENT) { + if ((s_oid.getPOAId() != m_poa_id) + || (currentOID().getSerial() < s_oid.getSerial())) { + throw new org.omg.CORBA.BAD_PARAM(); + } + } else { // PERSISTENT + if ((s_oid.getPOAId() == m_poa_id) + && (currentOID().getSerial() < s_oid.getSerial())) { + throw new org.omg.CORBA.BAD_PARAM(); + } + } + + return createReferenceWithIdAux(s_oid, intf); + } + + return createReferenceWithIdAux(oid, intf); + } + + /** + * Creates a new ObjectKey with the given oid. + *

+ * If the Lifespan policy is TRANSIENT, the poa_id is set to remember that + * the key is only valid in the current poa context. + */ + + protected POAKey createKey(OID oid) + { + if (m_key_seed == null) { + if (m_lifespan_policy.value() == LifespanPolicyValue.TRANSIENT) + m_key_seed = new POAKey(this, m_poa_id, null); + else + m_key_seed = new POAKey(this, 0, null); + } + + POAKey key = null; + + try { + key = (POAKey) m_key_seed.clone(); + } + catch (CloneNotSupportedException cnse) { + throw new org.omg.CORBA.INTERNAL(); + } + + key.setOID(oid); + return key; + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + */ + protected org.omg.CORBA.Object createReferenceWithIdAux( OID oid, java.lang.String intf) + { + POAKey poakey = createKey(oid); + IOR ior; + + TaggedComponent[] poaComponents = null; + + if(referencePolicies.getPolicies().getSize() > 0) { + poaComponents = new TaggedComponent[1]; + poaComponents[0] = referencePolicies; + } + + try { + + ior = m_orb.getCommunicationManager() + .getLayerById( IIOPCommunicationLayer.ID ) + .createIOR(intf, poakey, poaComponents); + + } catch ( CommunicationException ce ) { + throw new INTERNAL( + "Unable to create ior:" + ce.getMessage(), + 0, + CompletionStatus.COMPLETED_NO + ); + } + + return es.tid.TIDorbj.core.ObjectImpl.fromIOR(m_orb, ior); + } + + /** + * Get the object Id of a given servant. + * + * @param p_servant + * The servant. + * @exception org.omg.PortableServer.POAPackage.ServantNotActive + * If p_servant is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] + servant_to_id(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + boolean hasRetain = (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN); + + boolean hasUniqueId = (m_id_uniqueness_policy.value() + == IdUniquenessPolicyValue.UNIQUE_ID); + + boolean hasImplicitActivation =(m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + + boolean hasDefaultServant = (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT); + + if (!(hasDefaultServant + || (hasRetain && (hasUniqueId || hasImplicitActivation)))) + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + + if (hasRetain) { + // 1st behaviour + if (hasUniqueId) { + OID oid = m_active_object_map.get(p_servant); + if (oid != null) { + return oid.toByteArray(); + } + } + // 2nd behaviour + if (hasImplicitActivation) { + OID oid = m_active_object_map.get(p_servant); + if ((oid == null) || (!hasUniqueId)) { + OID newOid = nextOID(); + try { + activate_object_with_id(newOid, p_servant); + return newOid.toByteArray(); + } + catch (ObjectAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + catch (ServantAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + } + } + } + // 3rd behaviour + if (hasDefaultServant && (m_default_servant == p_servant)) { + try { + org.omg.PortableServer.Servant servant = + m_orb.initPOACurrent().getServant(); + if (servant == m_default_servant) { + // operation invoked on the default servant + return m_orb.initPOACurrent().get_object_id(); + } + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + } + + // 4th behaviour + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + /** + * Get the object reference of a given servant. + * + * @param p_servant + * The servant. + * @exception org.omg.PortableServer.POAPackage.ServantNotActive + * If p_servant is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object + servant_to_reference(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + boolean hasRetain = (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN); + boolean hasUniqueId = (m_id_uniqueness_policy.value() + == IdUniquenessPolicyValue.UNIQUE_ID); + boolean hasImplicitActivation = (m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + + if (!(hasRetain && (hasUniqueId || hasImplicitActivation))) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + // 1st behaviour + if (hasUniqueId) { + OID oid = m_active_object_map.get(p_servant); + if (oid != null) { + return create_reference_with_id(oid.toByteArray(), + getRepositoryId(p_servant)); + } + } + + // 2nd behaviour + if (hasImplicitActivation) { + OID oid = m_active_object_map.get(p_servant); + if ((oid == null) || (!hasUniqueId)) { + OID newOid = nextOID(); + try { + activate_object_with_id(newOid, p_servant); + return create_reference_with_id(newOid, + getRepositoryId(p_servant)); + } + catch (ObjectAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + catch (ServantAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + } + } + // 3rd behaviour + try { + org.omg.PortableServer.Servant servant = m_orb.initPOACurrent() + .getServant(); + + if (servant == m_default_servant) { + // operation invoked on the default servant + byte[] currentOID = m_orb.initPOACurrent().get_object_id(); + return create_reference_with_id(currentOID, + getRepositoryId(servant)); + } + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + // 4th behaviour + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + /** + * Get the servant of a given object reference. + * + * @param reference + * The object reference. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongAdapter + * If the object reference does not belong to this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.PortableServer.Servant + reference_to_servant(org.omg.CORBA.Object reference) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongAdapter, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (reference == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + byte[] oid = reference_to_id(reference); + return id_to_servant(oid); + } + + /** + * Get the object Id of a given object reference. + * + * @param reference + * The object reference. + * @exception org.omg.PortableServer.POAPackage.WrongAdapter + * If the object reference does not belong to this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] reference_to_id(org.omg.CORBA.Object reference) + throws org.omg.PortableServer.POAPackage.WrongAdapter, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (reference == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + try { + org.omg.CORBA.portable.ObjectImpl obj = + (org.omg.CORBA.portable.ObjectImpl) reference; + CommunicationDelegate delegate = + (CommunicationDelegate) obj + ._get_delegate(); + IOR ior = delegate.getReference(); + + POAKey poaKey = POAKey.createKey( ior.getObjectKey().getMarshaledKey() ); + POAKey poaKey2 = createKey(null); + if (!poaKey2.samePOA(poaKey)) { + throw new org.omg.PortableServer.POAPackage.WrongAdapter(); + } + return poaKey.getOID().toByteArray(); + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.WrongAdapter(); + } + } + + /** + * Get the servant of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + public org.omg.PortableServer.Servant id_to_servant(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + return id_to_servant(new OID(oid)); + } + + /** + * Get the servant of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized protected org.omg.PortableServer.Servant id_to_servant(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (( m_servant_retention_policy.value() != ServantRetentionPolicyValue.RETAIN) && + ( m_request_processing_policy.value() != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT)) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) + && (m_active_object_map.isActive(oid))) { + return m_active_object_map.get(oid); + } + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) + && (m_default_servant != null)) { + // Default servant invocation (oid == current request oid ??) + ServantDelegate srv_delegate = + (ServantDelegate) m_default_servant._get_delegate(); + srv_delegate.setObjectId(oid.toByteArray()); + return m_default_servant; + } + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + + /** + * Get the object reference of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object id_to_reference(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + OID tid_oid = new OID(oid); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (!m_active_object_map.isActive(tid_oid)) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + org.omg.PortableServer.Servant servant = + m_active_object_map.get(tid_oid); + return create_reference_with_id(tid_oid, getRepositoryId(servant)); + } + + + + + /* ************ TIDorb methods ************* */ + + /** + * Finds the servant for an object Id. Executes all needed activations, + * according to the policies of this POA. + * + * @param oid + * The object Id. + * @param operation + * The name of the operation invoked (if any). + * @param cookieHolder + * The CookieHolder (only if ServantLocator is needed). + * @param servantLocatorUsed + * Returns true if ServantLocator has been used. + * @return The servant. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If it tries to use a inactive object. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If it tries to activate an active object. + * @exception org.omg.PortableServer.ForwardRequest + * It can be thrown by incarnate(). + */ + synchronized protected org.omg.PortableServer.Servant + find_servant(OID oid, + String operation, + CookieHolder cookieHolder, + org.omg.CORBA.BooleanHolder servantLocatorUsed) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.ForwardRequest + { + + servantLocatorUsed.value = false; + org.omg.PortableServer.Servant servant = null; + + try { + + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN)) { + // RETAIN && USE_ACTIVE_OBJECT_MAP_ONLY + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY){ + servant = id_to_servant(oid); + return servant; + } + + // RETAIN && USE_DEFAULT_SERVANT + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + servant = id_to_servant(oid); + return servant; + } + + // RETAIN && USE_SERVANT_MANAGER + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + + try { + // try to get id from the Active Object Map + servant = id_to_servant(oid); + } + catch (ObjectNotActive e){ + // try to use Servant Activator (incarnate) + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) + m_servant_manager; + servant = activator.incarnate(oid.toByteArray(), this); + if (servant == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + try { + // try to activate servant created by Servant + // Activator + activate_object_with_id(oid, servant); + } + catch (ServantAlreadyActive e2) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + + return servant; + } + } else { // NON_REATAIN + + // NON_RETAIN && USE_DEFAULT_SERVANT + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + if (m_default_servant == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + // return Default Servant + servant = m_default_servant; + // Default servant invocation (oid == current request oid + // ??) + ServantDelegate srv_delegate = + (ServantDelegate) servant._get_delegate(); + + srv_delegate.setObjectId(oid.toByteArray()); + + return servant; + } + // NON_RETAIN && USE_SERVANT_MANAGER + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + // try to use Servant Locator (preinvoke) + org.omg.PortableServer.ServantLocator locator = + (org.omg.PortableServer.ServantLocator) + m_servant_manager; + + servant = locator.preinvoke(oid.toByteArray(), this, + operation, cookieHolder); + + servantLocatorUsed.value = true; + // Servant delegate creation (oid == current request oid ??) + + ServantDelegate delegate = + new ServantDelegate(this,oid.toByteArray()); + + servant._set_delegate(delegate); + + return servant; + } + } + + } + catch (org.omg.PortableServer.POAPackage.WrongPolicy dummy) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEEP_DEBUG, + "Unexpected WrongPolicy exception", dummy); + } + + throw new INTERNAL("Unexpected WrongPolicy exception"); + } + + return servant; + } + + /** + * Call postinvoke. This method is only used if there was a preinvoke before + * servant invocation. + * + * @param oid + * The object Id. + * @param operation + * The name of the operation invoked. + * @param cookieHolder + * The CookieHolder + * @param servant + * The servant. + * @return The servant. + */ + synchronized protected void + callPostinvoke(byte[] oid, + String operation, + CookieHolder cookieHolder, + org.omg.PortableServer.Servant servant) + { + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) + && (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER)) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + org.omg.PortableServer.ServantLocator locator = + (org.omg.PortableServer.ServantLocator) m_servant_manager; + if (isSingleThread()) { + synchronized (locator) { + locator.postinvoke(oid, this, operation, + cookieHolder.value, servant); + } + } else { + locator.postinvoke(oid, + this, + operation, + cookieHolder.value, + servant); + } + } + } + + /** + * @return True if POA's ThreadPolicy is SINGLE_THREAD. + */ + synchronized protected boolean isSingleThread() + { + return (m_thread_policy.value() + == ThreadPolicyValue.SINGLE_THREAD_MODEL); + } + + /** + * @return True if POA's BidirectionalPolicy is BOTH. + */ + synchronized public boolean isBidirectional() + { + BidirectionalPolicy bidirectional_policy = + referencePolicies.getPolicies().getBidirectionalPolicy(); + + if(bidirectional_policy == null) { + return false; + } else { + return (bidirectional_policy.value() == BOTH.value); + } + } + + /** + * @return True if this POA has an AdapterActivator. + */ + synchronized protected boolean hasAdapterActivator() + { + return m_adapter_activator != null; + } + + /** + * Adds a new user for this oid. This means that there is one more active + * request executing some request with this object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + */ + synchronized protected void addUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + + if (m_active_object_map.isActive(oid)) { + m_active_object_map.addUser(oid); + } + } + + m_completion.beginRequest(); + m_poa_manager.beginRequest(); + } + + /** + * Removes a user for this oid. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @see addUser. + */ + protected void removeUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + // Decrease # of users of OID + m_completion.endRequest(); + synchronized (this) { + m_poa_manager.endRequest(); + if (m_destroying) { + boolean PoaNotInUse = m_completion.getActiveRequests() <= 0; + if (PoaNotInUse) { + trueDestroy(); + } + } else { + tryToRemoveObject(oid); + } + } + } + + /** + * Etherealizes all objects in this POA manager. + */ + synchronized protected void etherealizeAllObjects() + { + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + java.util.Enumeration oids = m_active_object_map.getOIDs(); + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) + && (m_servant_manager != null)) { + // call etherealize + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) m_servant_manager; + while (oids.hasMoreElements()) { + OID oid = (OID) oids.nextElement(); + try { + org.omg.PortableServer.Servant servant = + m_active_object_map.remove(oid); + if (isSingleThread()) { + synchronized (activator) { + activator.etherealize( + oid.toByteArray(), + this, + servant, + false, + m_active_object_map.contains(servant)); + } + } else { + activator.etherealize( + oid.toByteArray(), + this, + servant, + false, + m_active_object_map.contains(servant)); + } + } + catch (Exception e) { + // should never happen + e.printStackTrace(); + } + } + } + } else { + //nothing to do + } + } + + /** + * Creates the root POA. This method should only be called by + * es.tid.TIDorbj.core.TIDorb.resolve_initial_references() + * + * @param orb + * The ORB. + * @see es.tid.TIDorbj.core.TIDORB#resolve_initial_references + */ + static public POAImpl createRootPOA(es.tid.TIDorbj.core.TIDORB orb) + { + POAImpl rootPOA = null; + org.omg.CORBA.Policy[] policies = new org.omg.CORBA.Policy[8]; + policies[0] = + new IdAssignmentPolicyImpl(IdAssignmentPolicyValue.SYSTEM_ID); + policies[1] = + new IdUniquenessPolicyImpl(IdUniquenessPolicyValue.UNIQUE_ID); + policies[2] = + new ImplicitActivationPolicyImpl( + ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + policies[3] = + new LifespanPolicyImpl(LifespanPolicyValue.TRANSIENT); + policies[4] = + new RequestProcessingPolicyImpl( + RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY); + policies[5] = + new ServantRetentionPolicyImpl(ServantRetentionPolicyValue.RETAIN); + policies[6] = new ThreadPolicyImpl(ThreadPolicyValue.ORB_CTRL_MODEL); + policies[7] = + new es.tid.TIDorbj.core.BidirectionalPolicyImpl(NORMAL.value); + try { + POAManagerImpl mgr = new POAManagerImpl(orb); + rootPOA = new POAImpl(orb, "rootPOA", mgr, policies, null); + } + catch (org.omg.PortableServer.POAPackage.InvalidPolicy e) { + // this can never happen + } + return rootPOA; + } + + /* ************ Private methods ************* */ + + /** + * Removes an object if there are no executing request using it. + * + * @param oid + * The object Id. + */ + private void tryToRemoveObject(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + if (m_active_object_map.isActive(oid)) { + boolean OidNotInUse = m_active_object_map.removeUser(oid); + if (OidNotInUse) { + trueRemoveObject(oid); + } + } + } + } + + /** + * Removes an object. + * + * @param oid + * The object Id. + */ + private void trueRemoveObject(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + // Remove OID from ActiveObjectMap + // ///////////////////////////////////////////////////////////// + org.omg.PortableServer.Servant servant = + m_active_object_map.remove(oid); + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEEP_DEBUG, "Removing object: " + + oid.toString()); + } + + // Try to etherealize, if necessary + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) + && (m_servant_manager != null)) { + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) m_servant_manager; + if (isSingleThread()) { + synchronized (activator) { + activator.etherealize(oid.toByteArray(), + this, + servant, + true, + m_active_object_map.contains(servant)); + } + } else { + activator.etherealize(oid.toByteArray(), + this, servant, + true, + m_active_object_map.contains(servant)); + } + } + // Continue with waiting activations of oid (if any) + synchronized (servant) { + servant.notifyAll(); + } + } + + public void destroy() + { + throw new BAD_OPERATION(); + } + + /** + * Destroys the POA manager. + */ + synchronized public void trueDestroy() + { + m_destroyed = true; + + if (m_etherealize) { + // Etherealize all objects + etherealizeAllObjects(); + } else { + // init activeObjectMap (perhaps this is not necessary) + m_active_object_map = new ActiveObjectMap(); + } + // remove POA from parent + if (m_parent != null) { + ((POAImpl) m_parent).m_children.removeElement(this); + } + m_poa_manager.removePOA(this); + m_poa_manager = null; + } + + /** + * Find a POA among the POA's children. + * + * @param poa_name + * The POA name. + */ + private org.omg.PortableServer.POA findChildren(String poa_name) + { + org.omg.PortableServer.POA poa = null; + for (int i = 0; i < m_children.size(); i++) { + poa = (org.omg.PortableServer.POA) m_children.elementAt(i); + if (poa_name.equals(poa.the_name())) { + return poa; + } + } + return null; + } + + /** + * Returns the repository Id of a servant. + * + * @param servant + * The servant. + * @return The repository Id. + */ + private String getRepositoryId(org.omg.PortableServer.Servant servant) + { + return servant._all_interfaces(this, servant._object_id())[0]; + } + + /** + * @return The current System Object Id. + */ + public SystemOID currentOID() + { + return m_current_OID; + } + + /** + * Generates the next oid. + * + * @return The next Object Id. + */ + public OID nextOID() + { + SystemOID aux = m_current_OID; + m_current_OID = m_current_OID.next(); + return aux; + } + + + + /* ************ ObjectImpl ************* */ + + public String toString() + { + if (m_poa_string_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("POA "); + POAKey key = createKey(null); + buffer.append(key.getPOAPath()); + m_poa_string_name = buffer.toString(); + } + + return m_name; + } + + + + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAKey.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAKey.java.svn-base new file mode 100644 index 0000000..addbf89 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAKey.java.svn-base @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +public class POAKey extends ObjectKey + implements Cloneable +{ + + /** + * Magic number: start of an POAKey + */ + + public final static byte MAGIC_START = 0x0; + + /** + * Start encapsulated key size to verify if it is an POAKey + */ + + public final static int START_BUFFER_SIZE = + CDR.ULONG_SIZE /* encapsulation size */ + + CDR.BOOLEAN_SIZE /* byte order */ + + (2 * CDR.OCTET_SIZE); /* and 2 magic number */ + + /** + * Sequence of poa names from the rootPOA to the final POA. + */ + private String[] m_poas = null; + + /** + * Rereference durability. If 0 the reference is persistent, otherwise the + * reference is transient, and it lifespan is joined to its POA lifespan. + */ + private long m_poa_id = 0L; + + /** + * Object Id. + */ + private OID m_oid = null; + + private String m_key_name = null; + + private POAKey(){ + + } + + + public POAKey(org.omg.PortableServer.POA poa, long poa_id, OID oid) { + m_poas = ((POAImpl) (poa)).getPath(); + m_poa_id = poa_id; + m_oid = oid; + } + + public POAKey(String[] poas, long poa_id, OID oid) + { + m_poas = poas; + m_poa_id = poa_id; + m_oid = oid; + } + + + public String getPOA(int poa_level) + { + return m_poas[poa_level]; + } + + public int numberOfPOAs() + { + return m_poas.length; + } + + public OID getOID() + { + return m_oid; + } + + public long getPOAId() + { + return m_poa_id; + } + + protected void setOID(OID oid) + { + m_oid = oid; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if ( super.getMarshaledKey() == null ){ + + // create input stream for save the encapsualation + CDRInputStream encapsulation_input; + encapsulation_input = output.inputStreamAtThisPosition(); + + if (m_poas == null) { + throw new INTERNAL("Uncompleted POAKey"); + } + + // begin marshalling + output.enterEncapsulation(); + + // KEY is alwais 1.2 + + GIOPVersion output_version = output.getVersion(); + output.setVersion(GIOPVersion.VERSION_1_2); + + // write magic start 2 bytes with 0 value + output.write_octet(MAGIC_START); + output.write_octet(MAGIC_START); + + // write string[] with poas path + // - number of poas in path + output.write_ulong(m_poas.length); + // - each poa path entry + for (int i = 0; i < m_poas.length; i++) { + output.write_string(m_poas[i]); + } + + // lifespan time + output.write_longlong(m_poa_id); + + // oid + byte[] oid_value = m_oid.toByteArray(); + if (oid_value == null) { + throw new INTERNAL("Uncompleted POAKey"); + } + output.write_ulong(oid_value.length); + output.write_octet_array(oid_value, 0, oid_value.length); + + output.setVersion(output_version); + + // end marshalling + output.exitEncapsulation(); + + super.setMarshaledKey( encapsulation_input.readEncapsulation() ); + + encapsulation_input = null; + + } else { + super.write( output ); + } + + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + // KEY is alwais 1.2 + + GIOPVersion input_version = input.getVersion(); + + input.setVersion(GIOPVersion.VERSION_1_2); + + // check magic bytes + + byte magic_0 = input.read_octet(); + byte magic_1 = input.read_octet(); + + if ((magic_0 != MAGIC_START) || (magic_1 != MAGIC_START)) + throw new MARSHAL("Not a TIDorb key"); + + // read string[] with poas path + + int length = input.read_ulong(); + + if (length < 0) + throw new INV_OBJREF("Malformed POAKey(bad number of poas)"); + + m_poas = new String[length]; + for (int i = 0; i < m_poas.length; i++) + m_poas[i] = input.read_string(); + + m_poa_id = input.read_longlong(); + + // read byte[] with oid + + length = input.read_ulong(); + + if (length == 0) + throw new org.omg.CORBA.INV_OBJREF("Malformed POAKey"); + + byte[] oid_value = new byte[length]; + input.read_octet_array(oid_value, 0, length); + + m_oid = new OID(oid_value); + + input.setVersion(input_version); + } + + public boolean samePOA(POAKey other) + { + if (m_poa_id != other.m_poa_id) + return false; + if (m_poas.length != other.m_poas.length) + return false; + for (int i = 0; i < m_poas.length; i++) { + if (!m_poas[i].equals(other.m_poas[i])) + return false; + } + return true; + } + + public boolean equals(POAKey other) + { + return m_oid.equals(other.m_oid) && samePOA(other); + } + + public Object clone() + throws CloneNotSupportedException + { + return super.clone(); + } + + public String getPOAPath() + { + StringBuffer str = new StringBuffer("/"); + if (m_poas != null) { + for (int i = 0; i < m_poas.length; i++) { + str.append(m_poas[i]).append("/"); + } + } + + return str.toString(); + } + + public static POAKey createKey(Encapsulation key) + { + if(maybePOAKey(key)) { + POAKey poaKey = new POAKey(); + poaKey.setMarshaledKey( key ); + poaKey.read( key.createInputStream() ); + return poaKey; + } else { + return null; + } + + } + + public static boolean + maybePOAKey(es.tid.TIDorbj.core.cdr.Encapsulation encap) + { + int start = encap.getOffset(); + + if (encap.getLength() < START_BUFFER_SIZE) + return false; + + byte[] start_key_buffer = encap.getOctetSequence(); + + return (start_key_buffer[start + START_BUFFER_SIZE - 1] == MAGIC_START) + && (start_key_buffer[start + START_BUFFER_SIZE - 2] == MAGIC_START); + } + + public synchronized String toString() + { + if (m_key_name == null) { + + StringBuffer str = new StringBuffer("ObjectKey[POA: /"); + + if (m_poas != null) { + for (int i = 0; i < m_poas.length; i++) { + str.append(m_poas[i]).append("/"); + } + } + + if (m_poa_id == 0L) + str.append("; Type: PERSISTENT "); + else { + str.append("; Type: TRANSIENT(POA Id: "); + str.append(m_poa_id); + str.append("); "); + } + + if (m_oid != null) + str.append(m_oid.toString()); + + str.append(']'); + + m_key_name = str.toString(); + } + return m_key_name; + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConf.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConf.java.svn-base new file mode 100644 index 0000000..8664cf4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConf.java.svn-base @@ -0,0 +1,141 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.BAD_PARAM; + +/** + * Configuration set for POAManager. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class POAManagerConf +{ + + private int m_min_threads; + + private int m_max_threads; + + private int m_max_queued_requests; + + private int m_starving_time; + + private POAManagerConfListener m_listener = null; + + protected POAManagerConf(int min_threads, int max_threads, + int max_queued_requests, int starving_time) + { + this.m_min_threads = min_threads; + this.m_max_threads = max_threads; + this.m_max_queued_requests = max_queued_requests; + this.m_starving_time = starving_time; + } + + public void setListener(POAManagerConfListener l) + { + m_listener = l; + } + + synchronized public void setMinThreads(int min_threads) + { + if (min_threads < 0) { + throw new BAD_PARAM("min_threads can not be negative."); + } + if (min_threads > this.m_max_threads) { + throw new + BAD_PARAM("min_threads can not be greater than max_threads."); + } + this.m_min_threads = min_threads; + if (m_listener != null) { + m_listener.minThreadsHasChanged(); + } + } + + synchronized public void setMaxThreads(int max_threads) + { + if (max_threads < this.m_min_threads) { + throw new + BAD_PARAM("max_threads can not be less than min_threads."); + } + this.m_max_threads = max_threads; + } + + synchronized public void setMaxQueuedRequests(int max_queued_requests) + { + if (max_queued_requests < this.m_max_queued_requests) { + throw new + BAD_PARAM("max_queued_requests can not be decreased."); + } + this.m_max_queued_requests = max_queued_requests; + } + + synchronized public void setStarvingTime(int millisecs) + { + if (millisecs < 0) { + throw new BAD_PARAM("starving_time can not be negative."); + } + this.m_starving_time = millisecs; + } + + synchronized public int getMaxQueuedRequests() + { + return m_max_queued_requests; + } + + synchronized public int getMaxThreads() + { + return m_max_threads; + } + + synchronized public int getMinThreads() + { + return m_min_threads; + } + + synchronized public int getStarvingTime() + { + return m_starving_time; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConfListener.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConfListener.java.svn-base new file mode 100644 index 0000000..7745229 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerConfListener.java.svn-base @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +interface POAManagerConfListener +{ + + void minThreadsHasChanged(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerImpl.java.svn-base new file mode 100644 index 0000000..79bcafb --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/POAManagerImpl.java.svn-base @@ -0,0 +1,487 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_DEADLINE; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.PortableServer.POAManagerPackage.AdapterInactive; +import org.omg.PortableServer.POAManagerPackage.State; + +/** + * Implementation of POAManager. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class POAManagerImpl extends org.omg.PortableServer.POAManagerLocalBase + implements es.tid.PortableServer.POAManager +{ + + private boolean destroyed; + + // Relationships + protected es.tid.TIDorbj.core.TIDORB m_orb = null; + + protected POAManagerConf m_conf; + + private Vector m_poas; + + private RequestQueue m_request_queue; + + private ThreadPool m_pool; + + + // Members + private State m_state; + + protected java.lang.Object m_state_mutex; + + protected String m_manager_name; + + static es.tid.TIDorbj.core.util.Counter st_serial = + new es.tid.TIDorbj.core.util.Counter(); + + protected short m_queue_order; + + // waitForCompletion + private CompletionWaiter m_completion; + + /** + * Constructor. + * + * @param orb + * The ORB. + */ + public POAManagerImpl(es.tid.TIDorbj.core.TIDORB orb) + { + m_orb = orb; + synchronized (orb.m_POAManagers) { + orb.m_POAManagers.addElement(this); + } + m_manager_name = "POAManager " + st_serial.inc(); + m_state = State.HOLDING; + m_state_mutex = new Boolean(true); + m_conf = new POAManagerConf(orb.m_conf.poa_min_threads, + orb.m_conf.poa_max_threads, + orb.m_conf.poa_max_queued_requests, + orb.m_conf.poa_starving_time); + m_completion = new CompletionWaiter(orb); + m_poas = new Vector(); + m_pool = new ThreadPool(this); + m_conf.setListener(m_pool); + m_request_queue = new RequestQueue(this, m_pool, new TemporalRequestComparator()); + m_pool.minThreadsHasChanged(); + m_queue_order = ORDER_TEMPORAL.value; + + } + + /** + * Sets the mininum number of execution threads + */ + public void set_min_threads(int min_threads) + { + m_conf.setMinThreads(min_threads); + } + + /** + * Sets the maximun number of execution threads + */ + public void set_max_threads(int max_threads) + { + m_conf.setMaxThreads(max_threads); + } + + /** + * Sets the maximun number of request queued in the POAManager + */ + public void set_max_queued_requests(int max_queued_requests) + { + m_conf.setMaxQueuedRequests(max_queued_requests); + } + + /** + * Sets the maximun time an execution thread is inactive. + */ + public void set_starving_time(int millisecs) + { + m_conf.setStarvingTime(millisecs); + } + + /** + * @return maximun number of request queued in the POAManager + */ + public int get_max_queued_requests() + { + return m_conf.getMaxQueuedRequests(); + } + + /** + * @return the maximun number of execution threads + */ + public int get_max_threads() + { + return m_conf.getMaxThreads(); + } + + /** + * @return the mininum number of execution threads + */ + public int get_min_threads() + { + return m_conf.getMinThreads(); + } + + /** + * @return the maximun time an execution thread is inactive. + */ + public int get_starving_time() + { + return m_conf.getStarvingTime(); + } + + /** + * @return The associated POAManagerConf object. + */ + protected POAManagerConf getConf() + { + return m_conf; + } + + /** + * Adds a POA to this POAManager. + * + * @param poa + * The POA. + */ + protected void addPOA(org.omg.PortableServer.POA poa) + { + m_poas.addElement(poa); + } + + /** + * @return The request queue of this POAManager. + */ + protected RequestQueue getRequestQueue() + { + return m_request_queue; + } + + /** + * @return The thread pool of this POAManager. + */ + protected ThreadPool getThreadPool() + { + return m_pool; + } + + protected void setQueueOrderPolicy(QueueOrderPolicy policy) { + + short order = policy.allowed_orders(); + + set_queue_order(order); + + + } + + public void set_queue_order(short order) { + if(((order ^ ORDER_PRIORITY.value) != 0) + && (m_queue_order != ORDER_PRIORITY.value)){ + m_request_queue.setComparator(new PriorityRequestComparator()); + m_queue_order = ORDER_PRIORITY.value; + } else if (((order ^ ORDER_DEADLINE.value) != 0) + && (m_queue_order != ORDER_DEADLINE.value)){ + m_request_queue.setComparator(new DeadlineRequestComparator()); + m_queue_order = ORDER_DEADLINE.value; + } else if ((m_queue_order != ORDER_TEMPORAL.value) + || (m_queue_order != ORDER_ANY.value)) { + // default comparator will be used + m_request_queue.setComparator(new TemporalRequestComparator()); + } + } + + public short get_queue_order() + { + return m_queue_order; + + } + + + /* ************ State changes ************* */ + + /** + * This operation changes the POA manager to ACTIVE. + * + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void activate() + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> ACTIVE + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.ACTIVE) { + m_completion.stopWaiting(); + m_state = State.ACTIVE; + m_state_mutex.notifyAll(); + } + } + } + + /** + * This operation changes the POA manager to HOLDING. + * + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void hold_requests(boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> HOLDING + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.HOLDING) { + m_completion.stopWaiting(); + m_state = State.HOLDING; + m_state_mutex.notifyAll(); + } + } + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); // synchronized + } + } + + /** + * This operation changes the POA manager to DISCARDING. + * + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void discard_requests(boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> DISCARDING + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.DISCARDING) { + m_completion.stopWaiting(); + m_state = State.DISCARDING; + m_state_mutex.notifyAll(); + } + } + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); // synchronized + } + } + + /** + * This operation changes the POA manager to DEACTIVATE. + * + * @param etherealize_object + * If it is true, then all objects must be etherealized. + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void deactivate(boolean etherealize_objects, + boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + + // State change -> INACTIVE + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + + // reset the last completion waiters + m_completion.stopWaiting(); + + m_pool.deactivation(); + + m_request_queue.deactivation(); + + m_state = State.INACTIVE; + synchronized (m_orb.m_POAManagers) { + for (int i = 0; i < m_orb.m_POAManagers.size(); i++) { + if (m_orb.m_POAManagers.elementAt(i) == this) + m_orb.m_POAManagers.removeElementAt(i); + } + } + } + + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); //synchronized + if (etherealize_objects) { + // Etherealize objects (blocking) + etherealizeAllPOAs(); + } + } else if (etherealize_objects) { + // Etherealize in background + EtherealizerThread t = new EtherealizerThread(this); + t.start(); + } + } + + /** + * @return Return the state of the POA manager. + */ + public org.omg.PortableServer.POAManagerPackage.State get_state() + { + return m_state; + } + + /* ************ TIDorb methods - POA Location ************* */ + + /** + * Puts a new request in this POA manager. + * + * @param request + * The request. + */ + public void put(QueuedRequest request) + { + m_request_queue.add(request); + } + + /** + * Removes a POA from this POA manager. + * + * @param poa + * The POA being removed. + */ + protected void removePOA(org.omg.PortableServer.POA poa) + { + m_poas.removeElement(poa); + } + + /** + * Finds a POA in this POA manager. + * + * @param poaName + * The POA name. + */ + protected org.omg.PortableServer.POA findPOA(String poaName) + { + for (int i = 0; i < m_poas.size(); i++) { + org.omg.PortableServer.POA poa = (org.omg.PortableServer.POA) + m_poas.elementAt(i); + if (poa.the_name().equals(poaName)) { + return poa; + } + } + return null; + } + + /** + * Begins the execution of a request. + */ + protected void beginRequest() + { + m_completion.beginRequest(); + } + + /** + * Ends the execution of a request. + */ + protected void endRequest() + { + m_completion.endRequest(); + } + + /** + * Etherealizes all POAs (due to POA manager deactivation). + */ + protected void etherealizeAllPOAs() + { + for (int i = 0; i < m_poas.size(); i++) { + POAImpl poa = (POAImpl) m_poas.elementAt(i); + poa.etherealizeAllObjects(); + } + } + + /** + * Class to etherealize all POAs in background. + */ + public class EtherealizerThread extends Thread + { + + POAManagerImpl poaManager; + + public EtherealizerThread(POAManagerImpl poaManager) + { + this.poaManager = poaManager; + } + + public void run() + { + poaManager.etherealizeAllPOAs(); + } + } + + /* ************ ObjectImpl ************* */ + + public String toString() + { + return m_manager_name; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/PriorityRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/PriorityRequestComparator.java.svn-base new file mode 100644 index 0000000..e1757f6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/PriorityRequestComparator.java.svn-base @@ -0,0 +1,84 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +import org.omg.Messaging.PriorityRange; +import org.omg.Messaging.RequestPriorityPolicy; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Comparator that uses the request priority to decide the order + * in a request queue. In case of simillar priorities, the + * TemporalRequestComparator will be used. + * @author caceres + * + */ +public class PriorityRequestComparator + implements Comparator +{ + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + public final static int DEFAULT_PRIORITY = 0; + + TemporalRequestComparator temporalComparator; + + + /** + * @param policy + */ + public PriorityRequestComparator() + { + temporalComparator = new TemporalRequestComparator(); + } + + protected short getPriority(RequestPriorityPolicy policy) + { + short priority = DEFAULT_PRIORITY; + + + if(policy != null) { + PriorityRange range = policy.priority_range(); + priority = (short) + Math.round((float) (range.max + range.min) / 2.0); + } + + return priority; + } + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + PolicyContext context1 = request1.getPolicyContext(); + PolicyContext context2 = request2.getPolicyContext(); + + RequestPriorityPolicy reqPriority1 = null; + RequestPriorityPolicy reqPriority2 = null; + + if (context1 != null) { + reqPriority1 = context1.getRequestPriorityPolicy(); + } + + if (context2 != null) { + reqPriority2 = context2.getRequestPriorityPolicy(); + } + + short priority1 = getPriority(reqPriority1); + short priority2 = getPriority(reqPriority2); + + + if(priority1 > priority2) { + return LESS_THAN; + } else if(priority1 == priority2) { + + return temporalComparator.compare(o1, o2); + + } else { + return GREATER_THAN; + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueueReaderManager.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueueReaderManager.java.svn-base new file mode 100644 index 0000000..246478f --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueueReaderManager.java.svn-base @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Interface for queue readers that want to be notified of item availability. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public interface QueueReaderManager +{ + + boolean createNewReader(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedLocateResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedLocateResponseHandler.java.svn-base new file mode 100644 index 0000000..0fedc99 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedLocateResponseHandler.java.svn-base @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.core.comm.LocateResponseHandler; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public abstract class QueuedLocateResponseHandler + extends QueuedResponseHandler + implements LocateResponseHandler { + + private String str; + + public synchronized String toString() { + + if(str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("LocateRequest "); + buffer.append(" to "); + buffer.append(getObjectKey().toString()); + buffer.append(" with order "); + buffer.append(Long.toString(getSerial())); + str = buffer.toString(); + buffer = null; + } + return str; + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedRequest.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedRequest.java.svn-base new file mode 100644 index 0000000..1656ae5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedRequest.java.svn-base @@ -0,0 +1,179 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef?nica Investigaci?n y Desarrollo +* S.A.Unipersonal (Telef?nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + + +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Super class for request that are enqueued for later execution. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public abstract class QueuedRequest implements ResponseHandler +{ + //TODO: Should be removed after refactoring + private POAKey m_poakey; + + private int m_current_child_poa_name_level; + + private boolean m_must_discard = false; + + private org.omg.CORBA.CompletionStatus m_status; + + private POAImpl m_current_poa; + + private PolicyContext m_policy_context; + + private long m_serial; + private short m_priority; + + + //TODO: added by jprojas... + private ResponseHandler responseHandler; + + public QueuedRequest(){ + m_current_child_poa_name_level = 0; + m_poakey = null; + m_status = org.omg.CORBA.CompletionStatus.COMPLETED_NO; + m_current_poa = null; + m_policy_context = null; + m_serial = 0L; + } + + public void setPolicyContext(PolicyContext context) + { + m_policy_context = context; + } + + public PolicyContext getPolicyContext() + { + return m_policy_context; + } + + public void setPriority(short priority) { + m_priority = priority; + } + + public short getPriority () { + return m_priority; + } + + /** + * @param serial the ORB request serial number + */ + public void setSerial(long serial) + { + m_serial = serial; + } + + /** + * @return serial the ORB request serial number + */ + public long getSerial() + { + return m_serial; + } + + + public org.omg.CORBA.CompletionStatus getStatus() { + return m_status; + } + + public void setStatus(org.omg.CORBA.CompletionStatus value) { + if (value != null) { + m_status = value; + } + } + + public void setCurrentPOA( POAImpl currentPOA ){ + this.m_current_poa = currentPOA; + } + + public POAImpl getCurrentPOA() { + return m_current_poa; + } + + //TODO: this method name... igh! + public void nextChildPOA(POAImpl poa) { + m_current_poa = poa; + m_current_child_poa_name_level++; + } + + public String getCurrentChildPOAName() { + return m_poakey.getPOA(m_current_child_poa_name_level); + } + + public void setPOAKey( POAKey key ){ + this.m_poakey = key; + } + + public POAKey getPOAKey() { + return m_poakey; + } + + public OID getOID() { + return m_poakey.getOID(); + } + + public boolean isFinalPOA() { + return m_current_child_poa_name_level >= m_poakey.numberOfPOAs(); + } + + public void setMustDiscard( boolean value ) { + m_must_discard = value; + } + + public boolean getMustDiscard() { + return m_must_discard; + } + + public void destroy() { + //Empty implementation + } + + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedResponseHandler.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedResponseHandler.java.svn-base new file mode 100644 index 0000000..e82d7a6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/QueuedResponseHandler.java.svn-base @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.core.comm.ResponseHandler; + + +/** + * @author jprojas + * + */ +public abstract class QueuedResponseHandler extends QueuedRequest implements + ResponseHandler { + + private String str; + + public synchronized String toString() { + + if(str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("ServerRequest "); + buffer.append(this.getServerRequest().operation()); + buffer.append(" to "); + buffer.append(getObjectKey().toString()); + buffer.append(" with order "); + buffer.append(Long.toString(getSerial())); + str = buffer.toString(); + buffer = null; + } + return str; + } + + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/RequestQueue.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/RequestQueue.java.svn-base new file mode 100644 index 0000000..3c29d1a --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/RequestQueue.java.svn-base @@ -0,0 +1,181 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; +import java.util.Iterator; +import java.util.TreeSet; + + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TRANSIENT; + +import es.tid.TIDorbj.util.Trace; + +/** + * Queue of requests to be read by the execution thread. Implements QoS Messaging + * QueueOrderPolicy. + * + * @autor Javier Fdz. Mejuto + * @autor Juan A. Caceres + * @version 2.0 + */ +class RequestQueue { + + // Naive implementation + private TreeSet m_values = null; + + private QueueReaderManager m_queue_read_manager = null; + + private POAManagerImpl m_poa_manager; + + private boolean m_deactivation; + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this RequestQueue belongs. + * @param reader + * Object that manages the creation of new readers for this + * queue. + */ + public RequestQueue(POAManagerImpl poaManager, + QueueReaderManager reader, + Comparator comparator) { + m_values = new TreeSet(comparator); + m_queue_read_manager = reader; + m_poa_manager = poaManager; + m_deactivation = false; + } + + public synchronized void setComparator(Comparator comparator) + { + TreeSet aux = m_values; + m_values = new TreeSet(comparator); + m_values.addAll(aux); + } + + /** + * Adds an new request to the queue. + * + * @param request The request to be added. + */ + synchronized public void add(QueuedRequest request) { + if ( m_deactivation || + m_values.size() >= m_poa_manager.m_conf.getMaxQueuedRequests()) { + TRANSIENT e = new TRANSIENT(null, 1, CompletionStatus.COMPLETED_NO); + if ( m_poa_manager.m_orb.m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT in request because", + " MaxQueuedRequests ", + Integer.toString(m_poa_manager.m_conf.getMaxQueuedRequests()), + " has been reached" }; + m_poa_manager.m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + request.submitResponse( e ); + } else { + m_values.add(request); + if (!m_queue_read_manager.createNewReader()) { + notify(); + } + } + } + + /** + * Gets (and removes) the first element of the queue. + * + * @return The first element of the queue. + */ + public synchronized QueuedRequest get() { + if ( m_values.isEmpty() ) { + if (m_deactivation) { + return null; + } else { + try { + wait(m_poa_manager.m_conf.getStarvingTime()); + } catch (InterruptedException ie) {} + if ( m_values.isEmpty() ) { + return null; + } + } + } + //first element out + QueuedRequest req = (QueuedRequest) m_values.first(); + + m_values.remove(req); + + return req; + } + + /** + * @return Number of enqueued elements. + */ + synchronized public int size() { + return m_values.size(); + } + + /** + * Set all request to "discarding". + */ + synchronized public void discardAll() { + + Iterator it = m_values.iterator(); + while (it.hasNext()){ + QueuedRequest req = (QueuedRequest) it.next(); + req.setMustDiscard(true); + } + } + + /** + * The POAManager is being deactivating, notify it to all blocked threads. + */ + + synchronized void deactivation() { + if (!m_deactivation) { + m_deactivation = true; + notifyAll(); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/ServantDelegate.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ServantDelegate.java.svn-base new file mode 100644 index 0000000..5a5d794 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ServantDelegate.java.svn-base @@ -0,0 +1,181 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Delegate class for servants. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class ServantDelegate + implements org.omg.PortableServer.portable.Delegate +{ + + private org.omg.CORBA.ORB m_orb = null; + + private org.omg.PortableServer.POA m_poa = null; + + private byte[] m_oid = null; + + /** + * Constructor. + * + * @param poa + * The POA. + * @param oid + * The Object Id. + */ + public ServantDelegate(org.omg.PortableServer.POA poa, byte[] oid) + { + this.m_poa = poa; + this.m_orb = ((es.tid.TIDorbj.core.poa.POAImpl) poa).m_orb; + this.m_oid = oid; + } + + /** + * @param self + * The servant. + * @return The ORB. + */ + public org.omg.CORBA.ORB orb(org.omg.PortableServer.Servant self) + { + return this.m_orb; + } + + /** + * @param self + * The servant. + * @return Return an object reference for this servant. + */ + public org.omg.CORBA.Object this_object(org.omg.PortableServer.Servant self) + { + try { + return m_poa.servant_to_reference(self); + } + catch (org.omg.PortableServer.POAPackage.WrongPolicy e) { + return null; + } + catch (org.omg.PortableServer.POAPackage.ServantNotActive e) { + return null; + } + } + + /** + * @param self + * The servant. + * @return This POA. + */ + public org.omg.PortableServer.POA poa(org.omg.PortableServer.Servant self) + { + return this.m_poa; + } + + /** + * @param self + * The servant. + * @return Return the Object Id. + */ + public byte[] object_id(org.omg.PortableServer.Servant self) + { + return m_oid; + } + + /** + * @param self + * The servant. + * @return Return the default POA. + */ + public org.omg.PortableServer.POA + default_POA(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @param self + * The servant. + * @param repository_id + * The Repository Id. + * @return Return true if the servant is an object with this Repository Id. + */ + public boolean is_a(org.omg.PortableServer.Servant self, + java.lang.String repository_id) + { + String[] reps = self._all_interfaces(m_poa, m_oid); + for (int i = 0; i < reps.length; i++) { + if (repository_id.equals(reps[i])) + return true; + } + return false; + } + + public boolean non_existent(org.omg.PortableServer.Servant self) + { + return false; + } + + public org.omg.CORBA.InterfaceDef + get_interface(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object + get_interface_def(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Sets object Id (useful for default servants). + * + * @param oid + * The Object Id. + */ + protected void setObjectId(byte[] oid) + { + this.m_oid = oid; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/SystemOID.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/SystemOID.java.svn-base new file mode 100644 index 0000000..59f437e --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/SystemOID.java.svn-base @@ -0,0 +1,146 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * System Generated OID. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public class SystemOID extends OID +{ + + private final static int LONG_SIZE = 8; + + private long m_poa_id; + + private long m_serial; + + public SystemOID(long poa_id, long serial) + { + m_poa_id = poa_id; + m_serial = serial; + m_value = new byte[2 * LONG_SIZE]; + write_long(poa_id, m_value, 0); + write_long(serial, m_value, LONG_SIZE); + } + + public SystemOID(long poa_id, long serial, byte[] val) + { + super(val); + this.m_poa_id = poa_id; + this.m_serial = serial; + } + + public SystemOID next() + { + return new SystemOID(m_poa_id, m_serial + 1); + } + + public long getPOAId() + { + return m_poa_id; + } + + public long getSerial() + { + return m_serial; + } + + public static SystemOID fromOID(OID oid) + { + SystemOID other = null; + + try { + other = (SystemOID) oid; + } + catch (ClassCastException cce) { + return fromByteArray(oid.toByteArray()); + } + + return new SystemOID(other.m_poa_id, other.m_serial, other.m_value); + } + + public static SystemOID fromByteArray(byte[] buffer) + { + if ((buffer == null) || (buffer.length != 2 * LONG_SIZE)) + return null; + + long poa_id = read_long(buffer, 0); + + long serial = read_long(buffer, LONG_SIZE); + + return new SystemOID(poa_id, serial, buffer); + } + + public static void write_long(long value, byte[] buffer, int offset) + { + int position = offset; + buffer[position++] = (byte) (value >>> 56); + buffer[position++] = (byte) (value >>> 48); + buffer[position++] = (byte) (value >>> 40); + buffer[position++] = (byte) (value >>> 32); + buffer[position++] = (byte) (value >>> 24); + buffer[position++] = (byte) (value >>> 16); + buffer[position++] = (byte) (value >>> 8); + buffer[position++] = (byte) (value >>> 0); + } + + public static long read_long(byte[] buffer, int offset) + { + + int position = offset; + + return (((long) buffer[position++] & 0xffL) << 56) + | (((long) buffer[position++] & 0xffL) << 48) + | (((long) buffer[position++] & 0xffL) << 40) + | (((long) buffer[position++] & 0xffL) << 32) + | (((long) buffer[position++] & 0xffL) << 24) + | (((long) buffer[position++] & 0xffL) << 16) + | (((long) buffer[position++] & 0xffL) << 8) + | ((long) buffer[position++] & 0xffL); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/TemporalRequestComparator.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/TemporalRequestComparator.java.svn-base new file mode 100644 index 0000000..62cf552 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/TemporalRequestComparator.java.svn-base @@ -0,0 +1,40 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +/** + * @author caceres + * + */ +public class TemporalRequestComparator + implements Comparator +{ + + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + + + public TemporalRequestComparator() + { + + } + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + long serial1 = request1.getSerial(); + long serial2 = request2.getSerial(); + + if(serial1 > serial2) { + return GREATER_THAN; + } else if(serial1 == serial2) { + return EQUALS; + } else { + return LESS_THAN; + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadPool.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadPool.java.svn-base new file mode 100644 index 0000000..f769190 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadPool.java.svn-base @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import es.tid.TIDorbj.util.Trace; + +/** + * Pool of threads. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class ThreadPool + implements QueueReaderManager, ThreadStateListener, POAManagerConfListener +{ + + private Vector m_pool = null; + + private POAManagerImpl m_poa_manager = null; + + private int m_used = 0; + + private int m_active = 0; + + private boolean m_deactivated = false; + + /** + * Constructor. + * + * @param poaManager + * The POAManager which this thread pool belongs to. + */ + public ThreadPool(POAManagerImpl poaManager) + { + m_pool = new Vector(); + m_poa_manager = poaManager; + } + + /** + * Test if another thread should be created. + * + * @return Returns true if another thread has been started, false otherwise. + */ + synchronized public boolean createNewReader() + { + if ((m_used == m_active) + &&(m_used < m_poa_manager.m_conf.getMaxThreads())) { + createThread(); + return true; + } + return false; + } + + synchronized private void createThread() + { + ExecThread t = new ExecThread(m_poa_manager); + m_pool.addElement(t); + t.setThreadStateListener(this); + t.setDaemon(false); + t.start(); + m_used++; + + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { "New thread created, ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_poa_manager.m_conf.getMaxThreads()), + " , min ", + Integer.toString(m_poa_manager.m_conf.getMinThreads()), + ")" + }; + m_poa_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + /** + * Counts the number of active threads (increment). + * + * @param t + * Thread that becomes active. + */ + synchronized public void setActive(Thread t) + { + m_active++; + } + + /** + * Counts the number of active threads (decrement). + * + * @param t + * Thread that becomes inactive. + */ + synchronized public void setInactive(Thread t) + { + m_active--; + } + + /** + * Clean up when a thread dies. + * + * @param t + * Thread that has died. + */ + synchronized public void threadHasDied(Thread t) + { + m_pool.removeElement(t); + m_used--; + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { + "Finalization of thread ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_poa_manager.m_conf.getMaxThreads()), + ", min ", + Integer.toString(m_poa_manager.m_conf.getMinThreads()), + ")" + }; + m_poa_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + synchronized public void deactivation() + { + m_deactivated = true; + } + + synchronized public boolean threadCanDie(Thread t) + { + if (m_deactivated) + return true; + else + return (m_used > m_poa_manager.m_conf.getMinThreads()); + } + + synchronized public void minThreadsHasChanged() + { + while (m_used < m_poa_manager.m_conf.getMinThreads()) { + createThread(); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadStateListener.java.svn-base b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadStateListener.java.svn-base new file mode 100644 index 0000000..8c0cf51 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/.svn/text-base/ThreadStateListener.java.svn-base @@ -0,0 +1,62 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Listener of thread state changes. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +interface ThreadStateListener +{ + + boolean threadCanDie(Thread t); + + void threadHasDied(Thread t); + + void setActive(Thread t); + + void setInactive(Thread t); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/ActiveObjectMap.java b/source/es/tid/TIDorbj/core/poa/ActiveObjectMap.java new file mode 100644 index 0000000..c31b96a --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/ActiveObjectMap.java @@ -0,0 +1,308 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Enumeration; +import java.util.Hashtable; + +/** + * Active Object Map. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class ActiveObjectMap +{ + + protected Hashtable m_table = new Hashtable(); + + /** + * Adds a new oid to the Active Object Map. + * + * @param oid + * Object Id. + * @param servant + * Servant which corresponds to oid. + * @param uniqueId + * True if UNIQUE_ID policy is present in this POA. + * @exception ServantAlreadyActive + * If servant is already in the AOM. + * @exception ObjectAlreadyActive + * If uniqueId is true and oid is already in the AOM. + */ + public void put(OID oid, org.omg.PortableServer.Servant servant, + boolean uniqueId) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive + { + + if (m_table.containsKey(oid)) { + throw new org.omg.PortableServer.POAPackage.ObjectAlreadyActive(); + } + + AOMElement element = new AOMElement(servant); + if (uniqueId && m_table.contains(element)) { + throw new org.omg.PortableServer.POAPackage.ServantAlreadyActive(); + } + + m_table.put(oid, element); + } + + /** + * Gets the servant associated to oid. + * + * @param oid + * Object Id. + * @return The servant. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public org.omg.PortableServer.Servant get(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + return element.servant; + } + + /** + * Removes the servant associated to oid. + * + * @param oid + * Object Id. + * @return Retuns the servant removed (if any). + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public org.omg.PortableServer.Servant remove(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.remove(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + return element.servant; + } + + /** + * Tests if a servant is in the Active Object Map. + * + * @return Retuns true if the servant is in the Active Object Map. + */ + public boolean contains(org.omg.PortableServer.Servant servant) + { + AOMElement element = new AOMElement(servant); + return m_table.contains(element); + } + + /** + * Tests if an oid is in the Active Object Map. + * + * @return Retuns true if the oid is in the Active Object Map. + */ + public boolean isActive(OID oid) + { + return (oid != null) && (m_table.containsKey(oid)); + } + + /** + * Gets the first oid associated to a servant. + * + * @param The + * servant. + * @return The Object Id. + */ + public OID get(org.omg.PortableServer.Servant servant) + { + Enumeration oids = m_table.keys(); + Enumeration AOMelems = m_table.elements(); + for (; AOMelems.hasMoreElements();) { + OID curr_oid = (OID) oids.nextElement(); + AOMElement curr_AOMelems = (AOMElement) AOMelems.nextElement(); + if (curr_AOMelems.servant == servant) + return curr_oid; + } + return null; + } + + /** + * Adds a new user for this oid. + * + * @param The + * Object Id. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public void addUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.num_users++; + } + + /** + * Removes a user for this oid. + * + * @param The + * Object Id. + * @return Returns false if there are still users, otherwise returns true. + * @exception ObjectNotActive + * If oid is not in the AOM. + */ + public boolean removeUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.num_users--; + if (element.num_users <= 0) { + return true; // nobody uses oid anymore + } else { + return false; // someone is still using oid + } + } + + /** + * Marks an oid as "destroying". + * + * @param The + * Object Id. + */ + public void destroy(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + AOMElement element = (AOMElement) m_table.get(oid); + if (element == null) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + element.destroying = true; + } + + /** + * Tests if an oid is "destroying". + * + * @return The entry in the Active Object Map. It may be used for + * synchronization purposes. + */ + public java.lang.Object isDestroying(OID oid) + { + AOMElement element = (AOMElement) m_table.get(oid); + if ((element != null) && (element.destroying)) { + return element; + } else { + return null; + } + } + + /** + * Returns an enumeration of all oids in the Active Object Map. + * + * @return The enumeration. + */ + public java.util.Enumeration getOIDs() + { + return new AOMEnumeration(m_table); + } + + /** + * Inner class for the Active Object Map entries. + */ + public class AOMElement + { + + int num_users = 1; // the first user is the POA where oid is created + + org.omg.PortableServer.Servant servant = null; + + boolean destroying = false; + + public AOMElement(org.omg.PortableServer.Servant servant) + { + this.servant = servant; + } + + public boolean equals(Object other) + { + if (other instanceof AOMElement) { + return servant == ((AOMElement) other).servant; + } else { + return false; + } + } + + } + + /** + * Inner class for the enumeration that getOIDs() returns. + */ + public class AOMEnumeration + implements java.util.Enumeration + { + + private java.util.Enumeration keys; + + public AOMEnumeration(Hashtable table) + { + this.keys = table.keys(); + } + + public boolean hasMoreElements() + { + return keys.hasMoreElements(); + } + + public Object nextElement() + { + return keys.nextElement(); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/CompletionWaiter.java b/source/es/tid/TIDorbj/core/poa/CompletionWaiter.java new file mode 100644 index 0000000..175252c --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/CompletionWaiter.java @@ -0,0 +1,137 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Class to wait until there are no executing requests. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class CompletionWaiter +{ + + private int m_active_requests = 0; + + private boolean m_stop_waiting = false; + + private es.tid.TIDorbj.core.TIDORB m_orb; + + /** + * Constructor. + * + * @param orb + * The ORB. + */ + public CompletionWaiter(es.tid.TIDorbj.core.TIDORB orb) + { + this.m_orb = orb; + } + + /** + * Tests if an operation should wait for completion. + * + * @return Returns true if it must wait. + */ + protected boolean conditionToWait() + { + try { + CurrentImpl current = m_orb.initPOACurrent(); + POAImpl poa = (POAImpl) current.get_POA(); + return poa.m_orb != m_orb; + } + catch (org.omg.PortableServer.CurrentPackage.NoContext e) { + return true; + } + } + + /** + * Begins a new request (increments active request counter). + */ + synchronized protected void beginRequest() + { + m_active_requests++; + } + + /** + * Ends a request (decrements active request counter and notifies). + */ + synchronized protected void endRequest() + { + m_active_requests--; + if (m_active_requests <= 0) { + notify(); + } + } + + /** + * Waits until there are no active requests. + */ + synchronized protected void waitForCompletion() + { + while ((m_active_requests != 0) && !m_stop_waiting) { + try { + wait(); + } + catch (Exception e) {} + } + m_stop_waiting = false; + } + + /** + * Stops waiting for completion. + */ + synchronized protected void stopWaiting() + { + m_stop_waiting = true; + notifyAll(); + } + + /** + * @return Number of active requests. + */ + synchronized protected int getActiveRequests() + { + return m_active_requests; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/CurrentImpl.java b/source/es/tid/TIDorbj/core/poa/CurrentImpl.java new file mode 100644 index 0000000..745a7ff --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/CurrentImpl.java @@ -0,0 +1,186 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.Object; +import org.omg.PortableServer.CurrentLocalBase; +import org.omg.PortableServer.Servant; +import org.omg.PortableServer.CurrentPackage.NoContext; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * TIDORB implementation of the Current CORBA Object. The current object + * accesses to the CurrentInfo stored in the ExecThread, the thread assotiated + * to the servant execution, returning at each moment the current poa and object + * id (if exists). + * + * @see CurrentInfo + * @see ExecThread + * + * @author Juan A. Cáceres + */ + +public class CurrentImpl extends CurrentLocalBase +{ + + private TIDORB m_orb; + + private boolean destroyed; + + public CurrentImpl(TIDORB orb) + { + m_orb = orb; + } + + public synchronized void destroy() + { + m_orb = null; + destroyed = true; + } + + public synchronized org.omg.PortableServer.POA get_POA() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_current_poa; + } + + public synchronized byte[] get_object_id() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_current_oid.toByteArray(); + } + + public org.omg.CORBA.Object getReference() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_servant._this_object(); + } + + public synchronized org.omg.PortableServer.Servant getServant() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + if (destroyed) + throw new OBJECT_NOT_EXIST(); + + return getCurrentInfo().m_servant; + } + + /** + * Looks in the current thread for the CurrentInfo that + * determines the current poa and object id needed by the + * Current object. + * + * @return the CurrentInfo object if exits. + * + * @exception org.omg.PortableServer.CurrentPackage.NoContext + * if the current thread is not an instance of + * ExecThread (it is the orb main thread) or + * it is and it is executing a local request, and there is + * out of a POA-dispatched operation. + */ + + protected CurrentInfo getCurrentInfo() + throws org.omg.PortableServer.CurrentPackage.NoContext + { + Thread th = Thread.currentThread(); + + if (th instanceof ExecThread) { // the current is in a servant + // execthread + + ExecThread exec = (ExecThread) th; + + CurrentInfo info = exec.getCurrentInfo(); + + if (info != null) + + return info; + } + + // error executing a local request or we are in the orb main thread + + throw new org.omg.PortableServer.CurrentPackage.NoContext(); + } + + public boolean inContext() + { + Thread th = Thread.currentThread(); + + if (th instanceof ExecThread) { // the current is in a servant + // execthread + + ExecThread exec = (ExecThread) th; + + CurrentInfo info = exec.getCurrentInfo(); + + return (info != null); + } + + return false; + } + + /* (non-Javadoc) + * @see org.omg.PortableServer.CurrentOperations#get_reference() + */ + public Object get_reference() throws NoContext { + return this.getReference(); + } + + /* (non-Javadoc) + * @see org.omg.PortableServer.CurrentOperations#get_servant() + */ + public Servant get_servant() throws NoContext { + return this.getCurrentInfo().m_servant; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/CurrentInfo.java b/source/es/tid/TIDorbj/core/poa/CurrentInfo.java new file mode 100644 index 0000000..8b03e28 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/CurrentInfo.java @@ -0,0 +1,78 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +public class CurrentInfo +{ + + POAImpl m_current_poa; + + OID m_current_oid; + + boolean m_request_in_poa; + + org.omg.PortableServer.Servant m_servant = null; + + public CurrentInfo(POAImpl current_poa, OID current_oid) + { + this.m_current_poa = current_poa; + this.m_current_oid = current_oid; + this.m_request_in_poa = false; + } + + public boolean isRequestInPOA() + { + return m_request_in_poa; + } + + public void setRequestInPOA(boolean val) + { + m_request_in_poa = val; + } + + public void setServant(org.omg.PortableServer.Servant servant) + { + this.m_servant = servant; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.java b/source/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.java new file mode 100644 index 0000000..797d6e2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/DeadlineRequestComparator.java @@ -0,0 +1,79 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +import org.omg.Messaging.RequestEndTimePolicy; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Comparator that uses the Messaging::RequestEndTimePolicy to decide the order + * in a request queue. In case of there were not any policy to decide, the + * TemporalRequestComparator will be used. + * @author caceres + * + */ +public class DeadlineRequestComparator + implements Comparator +{ + + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + + + TemporalRequestComparator temporalComparator; + + public DeadlineRequestComparator() + { + temporalComparator = new TemporalRequestComparator(); + } + + + + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + PolicyContext context1 = request1.getPolicyContext(); + PolicyContext context2 = request2.getPolicyContext(); + + RequestEndTimePolicy end1 = null; + RequestEndTimePolicy end2 = null; + + if (context1 != null) { + end1 = context1.getRequestEndTimePolicy(); + } + + if (context2 != null) { + end2 = context2.getRequestEndTimePolicy(); + } + + if(end1 == null) { + if(end2 == null) { + return temporalComparator.compare(o1,o2); + } else { + return GREATER_THAN; + } + } else { + if(end2 == null) { + return LESS_THAN; + } else { // both non-null + + long val1 = end1.end_time().time; + long val2 = end2.end_time().time; + + if(val1 > val2) { + return GREATER_THAN; + } else if(val1 == val2) { + return temporalComparator.compare(o1,o2); + } else { + return LESS_THAN; + } + } + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/ExecThread.java b/source/es/tid/TIDorbj/core/poa/ExecThread.java new file mode 100644 index 0000000..0acabc9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/ExecThread.java @@ -0,0 +1,945 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.BooleanHolder; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.NO_IMPLEMENT; +import org.omg.CORBA.NO_RESPONSE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.ServerRequest; +import org.omg.CORBA.TIMEOUT; +import org.omg.CORBA.UNKNOWN; +import org.omg.PortableServer.DynamicImplementation; +import org.omg.PortableServer.POAManager; +import org.omg.PortableServer.Servant; +import org.omg.PortableServer.POAManagerPackage.State; +import org.omg.PortableServer.POAPackage.AdapterNonExistent; +import org.omg.PortableServer.POAPackage.ObjectAlreadyActive; +import org.omg.PortableServer.POAPackage.ObjectNotActive; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +/** + * Execution thread. Gets request from the request queue and executes them. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class ExecThread extends Thread +{ + + private POAManagerImpl m_poa_manager = null; + + private RequestQueue m_queue = null; + + private boolean m_deactivated = false; + + private ThreadStateListener m_thread_state_listener = null; + + private java.util.Stack m_current_info_stack = null; + + private String m_thread_name; + + private TIDORB m_orb; + + private Trace m_trace; + + private long m_max_response_blocked_time; + + private boolean m_qos_enabled; + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this ExecThread belongs. + * @param number + * Id number of this ExecThread. + */ + protected ExecThread(POAManagerImpl poaManager) + { + m_poa_manager = poaManager; + m_queue = m_poa_manager.getRequestQueue(); + m_current_info_stack = new java.util.Stack(); + //TODO: orb referecial by jprojas + m_orb = m_poa_manager.m_orb; + m_trace = m_orb.m_trace; + m_qos_enabled = m_orb.m_conf.qos_enabled; + m_max_response_blocked_time = m_orb.m_conf.max_blocked_time; + } + + /** + * Set the ThreadStateListener. Any ExecThread should have a listener + * (eventually the ThreadPool) before it is started. + * + * @param l + * The listener. + */ + protected void setThreadStateListener(ThreadStateListener l) + { + m_thread_state_listener = l; + } + + /** + * Checks the state of the POAManager. If the state is ACTIVE, then finish + * returning true. If the state is HOLDING, then wait until state is + * diferent from HOLDING. If the state is DISCARDING, then discard the + * request and return false. If the state is INACTIVE, then reject the + * request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + private boolean checkState( QueuedRequest request ) { + + boolean executeRequest = false; + + if (m_trace != null) { + String[] msg = { toString(), " checking state of ", + m_poa_manager.toString() }; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + synchronized (m_poa_manager.m_state_mutex) { + boolean exit = false; + while (!exit) { + org.omg.PortableServer.POAManagerPackage.State state = m_poa_manager.get_state(); + if ((state == org.omg.PortableServer.POAManagerPackage.State.ACTIVE) && !request.getMustDiscard()) { + exit = true; + executeRequest = true; + } else if (state == org.omg.PortableServer.POAManagerPackage.State.HOLDING) { + try { + // wait until state changes + m_poa_manager.m_state_mutex.wait(); + } catch (InterruptedException ie) {} + exit = false; + } else if (state == org.omg.PortableServer.POAManagerPackage.State.INACTIVE) { + // MISSING: define strategy for deactivated POAManagers + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to request becase foreing POAManager is INACTIVE" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } else if ( state == org.omg.PortableServer.POAManagerPackage.State.DISCARDING || + request.getMustDiscard() ){ + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to request becase foreing POAManager is DISCARDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + //TODO: change method signature to return possible errors + //in state check + request.submitResponse( new org.omg.CORBA.TRANSIENT() ); + exit = true; + executeRequest = false; + } + } + } + return executeRequest; + } + + /** + * Execution loop. + */ + public void run() + { + + while (!m_deactivated) { + try { + + if (m_trace != null) { + String[] msg = { toString(), ": getting request..." }; + m_trace.print(Trace.DEEP_DEBUG, msg); + + } + + QueuedRequest thisRequest = m_queue.get(); + + + + if (thisRequest != null) { + // If there is a request, then go!! + m_thread_state_listener.setActive(this); + processRequest(thisRequest); + m_thread_state_listener.setInactive(this); + + } else if (m_thread_state_listener.threadCanDie(this)) { + // If restarted and no request, then commit suicide + m_deactivated = true; + } + + } + catch (Throwable unhandledException) { + // Unhandled exception. Should never happen!! + if (m_trace != null) { + m_trace.printStackTrace(Trace.DEBUG, + toString() + "Unhanled Exception ", + unhandledException); + m_trace.print(Trace.DEBUG, toString() + " dies..."); + } + m_deactivated = true; + } + + + + + } + m_thread_state_listener.threadHasDied(this); + } + + /** + * Process current request. + * + * @return true wherther the request has been queued in + * another POAManager. + */ + private void processRequest(QueuedRequest thisRequest) { + + try { + if (m_trace != null) { + String[] msg = { toString(), " executing request ", thisRequest.toString()}; + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + ObjectKey objectKey; + objectKey = thisRequest.getObjectKey(); + + POAKey poaKey; + try { + poaKey = m_orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + } catch ( Throwable th ){ + poaKey = null; + } + + if ( poaKey != null ) { + thisRequest.setPOAKey( poaKey ); + } else { + throw new OBJECT_NOT_EXIST(); + } + + if ( checkState( thisRequest ) ) { + // find poa + POAImpl poa = null; + try { + poa = findPOA( thisRequest ); + } catch ( AdapterNonExistent ane) { + if (m_trace != null) { + m_trace.printStackTrace( + Trace.DEBUG, + new String[]{ + toString(), + "POA ", + thisRequest.getCurrentChildPOAName(), + " not found" + }, + ane + ); + } + throw new org.omg.CORBA.OBJECT_NOT_EXIST(); + } + + if (poa != null) { + execute(thisRequest, poa); + } + } + } catch (org.omg.CORBA.SystemException e) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting a system exception to Request" }; + m_trace.printStackTrace(Trace.DEEP_DEBUG, msg, e); + } + thisRequest.submitResponse( e ); + } catch (java.lang.Throwable th) { + th.printStackTrace( System.err) ; + thisRequest.submitResponse( + new INTERNAL(th.toString(), 0, thisRequest.getStatus() ) + ); + } + } + + /** + * Finds the POA which corresponds to + * + * @param request. + * If the request belongs to another POAManager it is bypassed to + * it, returning null. + * @param request + * The queued request to be executed. + * @returns POAImpl POA where the request must be executed. + * @exception org.omg.PortableServer.POAPackage.AdapterNonExistent + * If it fails finding the POA. + */ + private POAImpl findPOA( QueuedRequest request ) + throws org.omg.PortableServer.POAPackage.AdapterNonExistent + { + + POAImpl current_poa; + + current_poa = request.getCurrentPOA(); + if( current_poa == null ){ + current_poa = this.m_orb.initPOA(); + request.setCurrentPOA( current_poa ); + } + + boolean bypassed = false; + POAManagerImpl nextPOAManager; + while ( !( bypassed || request.isFinalPOA() ) ) { + current_poa = (POAImpl) current_poa.find_POA( + request.getCurrentChildPOAName(),true + ); + + request.nextChildPOA(current_poa); + + nextPOAManager = (POAManagerImpl) current_poa.the_POAManager(); + + if (nextPOAManager != m_poa_manager) { + // bypass request to nextPOAManager + if (m_trace != null) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), " bypassing request ", request.toString(), + " to ", current_poa.toString() + } + ); + } + nextPOAManager.put(request); + bypassed = true; + } + } + return ( bypassed )?null:current_poa; + } + + /** + * Process local Request in the given POAManager. + * + * @param localRequest + * the Local request + * @param current_manager + * the current POA POAManager + */ + public void processLocalRequest( QueuedRequest localRequest ) + { + if (m_trace != null) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " executing local request ", + localRequest.toString() + } + ); + } + + try { + + ObjectKey objectKey; + objectKey = localRequest.getObjectKey(); + + POAKey poaKey; + try { + poaKey = m_orb.resolvePOAKey( objectKey ); + //TODO: review 'poa's request hierarchy' at this moment, POAKey + // and objectkey ar stored + } catch ( Throwable th ){ + poaKey = null; + } + + if ( poaKey != null ) { + localRequest.setPOAKey( poaKey ); + } else { + throw new OBJECT_NOT_EXIST(); + } + + POAImpl currentPOA = localRequest.getCurrentPOA(); + if ( currentPOA == null ){ + // Start from rootPOA + currentPOA = this.m_orb.initPOA(); + localRequest.setCurrentPOA( currentPOA ); + } + + POAManager currentPOAManager; + currentPOAManager = currentPOA.the_POAManager(); + + if ( currentPOAManager == this.m_poa_manager ) { + if (!checkState(localRequest)) { + return; + } + } else { + if ( !checkForeingState( localRequest ) ) { + return; + } + } + + // find poa + + POAImpl current_poa = localRequest.getCurrentPOA(); + + try { + while (!localRequest.isFinalPOA()) { + current_poa = (POAImpl) + current_poa.find_POA(localRequest.getCurrentChildPOAName(), + true); + + localRequest.nextChildPOA(current_poa); + + POAManagerImpl nextPOAManager = (POAManagerImpl) + current_poa.the_POAManager(); + + if (nextPOAManager != m_poa_manager) { + // bypass request to nextPOAManager + + if (m_trace != null) { + String[] msg = + { toString(), + " bypassing request ", + localRequest.toString(), + " through ", + current_poa.toString()}; + + m_trace.print(Trace.DEEP_DEBUG, msg); + } + + processLocalRequest( localRequest ); + return; + } + } + } + catch (org.omg.PortableServer.POAPackage.AdapterNonExistent ane) { + if (m_trace != null) { + String[] msg = + { toString(), + "POA ", + localRequest.getCurrentChildPOAName(), + " not found, org.omg.CORBA.OBJECT_NOT_EXIST throwed" }; + + m_trace.printStackTrace(Trace.DEBUG, msg, ane); + } + localRequest.submitResponse(new OBJECT_NOT_EXIST() ); + return; + } + + if (current_poa != null) { + execute(localRequest, current_poa); + } + + } catch (org.omg.CORBA.SystemException se) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting a system exception to localRequest" }; + m_trace.printStackTrace(Trace.DEEP_DEBUG, msg, se); + } + localRequest.submitResponse( se ); + } catch (java.lang.Throwable tw) { + tw.printStackTrace(); + localRequest.submitResponse( + new INTERNAL(tw.toString(), 0, localRequest.getStatus() ) + ); + } + } + + /** + * Checks the state of the given POAManager. If the state is ACTIVE, then + * finish returning true. If the state is HOLDING, then wait until state + * changes or the max_blocked_time timeout is reached. If the state is + * DISCARDING, then discard the request and return false. If the state is + * INACTIVE, then reject the request and return false. + * + * @param request + * The request which is being processed. + * @return Returns true if the request must be executed, otherwise returns + * false. + */ + private boolean checkForeingState( QueuedRequest localRequest ) { + if ( m_trace != null ) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Checking foreing POAManager state" + } + ); + } + POAManagerImpl currentPOAManager; + //TODO: add method "getPOAManager" returning a POAManagerImpl to avoid + //castings + currentPOAManager = + ( POAManagerImpl )localRequest.getCurrentPOA().the_POAManager(); + + org.omg.PortableServer.POAManagerPackage.State state = currentPOAManager.get_state(); + + // chech current_manager state + if ( state == org.omg.PortableServer.POAManagerPackage.State.HOLDING ) { + if ( m_trace != null ) { + m_trace.print( + Trace.DEEP_DEBUG, + new String[]{ + toString(), + " Waiting in a foreing POAManager because it is HOLDING" + } + ); + } + + long timeout = m_max_response_blocked_time; + + if (m_qos_enabled) { + + PolicyContext policyContext; + policyContext = localRequest.getPolicyContext(); + + if(policyContext != null) { + + timeout = QoS.checkRequestTime(m_orb, policyContext); + } + } + + if(timeout > 0) { + synchronized ( currentPOAManager.m_state_mutex ) { + try { + //TODO: check if this could be done outside ExecThread's to + //avoid inclusion of requestPolicy in responsehandlers + currentPOAManager.m_state_mutex.wait(timeout); + } catch ( InterruptedException ie ) { } + } + } + + state = currentPOAManager.get_state(); + + currentPOAManager.put( localRequest ); + if ( state == org.omg.PortableServer.POAManagerPackage.State.HOLDING ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting NO_RESPONSE because foreing POAManager is HOLDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new NO_RESPONSE() ); + return false; + } + } + + if ( state == org.omg.PortableServer.POAManagerPackage.State.INACTIVE ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to localRequest becase foreing POAManager is INACTIVE" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new org.omg.CORBA.TRANSIENT() ); + return false; + } + + if ( ( state == org.omg.PortableServer.POAManagerPackage.State.DISCARDING ) || localRequest.getMustDiscard() ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT to localRequest becase foreing POAManager is DISCARDING" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + localRequest.submitResponse( new org.omg.CORBA.TRANSIENT() ); + return false; + } + + return true; + } + + + + /** + * Executes a queued request depending on its type. + * + * @param request + * The queued request to be executed. + */ + private void execute( QueuedRequest request, POAImpl poa ) { + // TODO:temporary check until refactoring complete + + POAKey poaKey = request.getPOAKey(); + if ( poaKey != null ) { + long poaId; + poaId = poaKey.getPOAId(); + /* + * poaId -> persistent poa. Must check if it's not a persistent poa, + * if it's the same 'instance' that holds the 'servant' right now + */ + if ( poaId != 0 && poaId != poa.getId() ) { + if ( m_trace != null ) { + String[] msg = { toString(), + " Submitting OBJECT_NOT_EXIST to request becase poaId isn't int poa" }; + m_trace.print( Trace.DEEP_DEBUG, msg ); + } + request.submitResponse( new org.omg.CORBA.OBJECT_NOT_EXIST() ); + } else { + // execute request + CurrentInfo current; + current = new CurrentInfo( poa, poaKey.getOID() ); + m_current_info_stack.push( current ); + + try { + if ( request instanceof QueuedLocateResponseHandler ) { + execute( ( QueuedLocateResponseHandler ) request, poa ); + } else if ( request instanceof QueuedResponseHandler ){ + execute( ( QueuedResponseHandler )request, poa ); + } + request.setStatus( CompletionStatus.COMPLETED_YES ); + } catch ( org.omg.CORBA.SystemException se ) { + request.submitResponse( se ); + } catch ( java.lang.Throwable tw ) { + request.submitResponse( + new INTERNAL( tw.toString(), 0, request.getStatus() ) + ); + } finally { + m_current_info_stack.pop(); + if ( current.isRequestInPOA() ) { + try { + poa.removeUser( poaKey.getOID() ); + } catch ( Exception e ) { + } + request.destroy(); + } + } + } + } else { + if ( m_orb.m_trace != null ) { + m_orb.printTrace( + Trace.DEEP_DEBUG, + new String[] { + toString(), + " Invalid target ObjectKey in Request[ ", + request.getObjectKey().toString(), + "]" + } + ); + } + } + } + + private void execute( QueuedLocateResponseHandler handler, POAImpl poa ){ + //TODO: send this to the request... + + BooleanHolder servantLocatorUsed = new org.omg.CORBA.BooleanHolder(); + try { + // Current execution context + CurrentInfo current; + current = (CurrentInfo)m_current_info_stack.peek(); + + // Current servant's OID + OID oid; + oid = current.m_current_oid; + + // Servant location + Servant servant; + servant = poa.find_servant( oid, null, null, servantLocatorUsed ); + if (servant != null) { + handler.submitResponse( true ); + } else { + //This should never happen + throw new INTERNAL( + "find_servant() returning null!!", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } catch (org.omg.CORBA.SystemException e) { + throw e; + } catch (org.omg.PortableServer.ForwardRequest e) { + handler.submitResponse( e.forward_reference ); + m_poa_manager.m_orb.printTrace(Trace.DEBUG, "Forwarded: ", e); + } catch (Exception e) { + handler.submitResponse( false ); + } + } + + private void execute( QueuedResponseHandler handler, POAImpl poa ){ + try { + + + + /**/ + // get serverRequest (with params for invocation) + ServerRequest serverRequest; + serverRequest = handler.getServerRequest(); + + // QoS validation + if (m_qos_enabled) { + + if(!QoS.validateServerRequestEndTimePolicy(handler.getPolicyContext())) + { + if (m_trace != null) { + + String[] msg = { toString(), + " discarding ", + serverRequest.toString(), + " due to Messaging::RequestEndTimePolicy: TIMEOUT"}; + + m_trace.print(Trace.DEBUG, msg); + } + + throw new TIMEOUT(); + } + + } + /* + * SERVANT LOCATION + **/ + + // Cookie holder to store "reference" to dynamic incarnated servants + // when using servant locator + CookieHolder cookieHolder; + cookieHolder = new CookieHolder(); + + // Boolean holder, to store previous condition + //TODO: verify with juan + BooleanHolder servantLocatorUsed; + servantLocatorUsed = new org.omg.CORBA.BooleanHolder(); + + // Current execution context + CurrentInfo current; + current = (CurrentInfo)m_current_info_stack.peek(); + + // Target servant's OID + OID oid; + oid = current.m_current_oid; + + + org.omg.PortableServer.Servant servant = null; + try { + servant = poa.find_servant( + oid, + serverRequest.operation(), + cookieHolder, + servantLocatorUsed + ); + + poa.addUser( oid ); + + current.setRequestInPOA(true); + + } catch ( ObjectNotActive one ) { + this.m_orb.printTrace( Trace.DEBUG, "", one ); + //TODO: why is status in ServerRequestImpl + throw new org.omg.CORBA.OBJECT_NOT_EXIST( + one.getMessage(), 1, handler.getStatus() + ); + } catch ( ObjectAlreadyActive oae ) { + this.m_orb.printTrace(Trace.DEBUG, "", oae); + throw new org.omg.CORBA.OBJ_ADAPTER( + oae.getMessage(), 0, handler.getStatus() + ); + } catch ( org.omg.PortableServer.ForwardRequest fr ) { + this.m_orb.printTrace( Trace.DEBUG, "Forwarded: ", fr ); + handler.submitResponse( fr.forward_reference ); + return; + } + + // set servant in current object + current.setServant( servant ); + + handler.setStatus( CompletionStatus.COMPLETED_MAYBE ); + + if ( "_is_a".equals( serverRequest.operation() ) ) { + this.invoke_is_a( poa, servant, serverRequest ); + } else { + if (servant instanceof DynamicImplementation) { + // invoke servant using DII + DynamicImplementation dynServant; + dynServant = (DynamicImplementation) servant; + + if ( poa.isSingleThread() ) { + synchronized ( dynServant._get_delegate() ) { + doInvoke(dynServant, serverRequest); + } + } else { + doInvoke(dynServant, serverRequest); + } + } else { + throw new NO_IMPLEMENT( + "Stream based invocation not implemented", + 0, + CompletionStatus.COMPLETED_NO + ); + } + } + + handler.setStatus(CompletionStatus.COMPLETED_YES); + + // return results (if not oneway) + handler.setPolicyContext(poa.getPolicyContext()); + handler.submitResponse(); + + + // Call postinvoke if necessary + if ( servantLocatorUsed.value ) { + poa.callPostinvoke( + oid.toByteArray(), + serverRequest.operation(), + cookieHolder, + servant + ); + } + /* TODO: why ForwardRequest isn't thrown? + } catch (org.omg.PortableServer.ForwardRequest e) { + handler.submitResponse( e.forward_reference ); + m_poa_manager.m_orb.printTrace(Trace.DEBUG, "Forwarded: ", e); + */ + } catch (org.omg.CORBA.SystemException e) { + throw e; + } catch (Exception e) { + if ( m_trace != null ) { + m_trace.printStackTrace( Trace.DEEP_DEBUG, + " Submitting UNKNOWN exception to handler ", e); + } + + handler.submitResponse( + new UNKNOWN() + ); + } + } + + + + /** + * Executes "_is_a" request on the ServantDelegate. + * + * @param servant + * The target servant of the "_is_a" request. + * @param request + * The queued request to be executed. + */ + private void invoke_is_a(POAImpl poa, + org.omg.PortableServer.Servant servant, + org.omg.CORBA.ServerRequest request) + { + try { + es.tid.TIDorbj.core.poa.ServantDelegate deleg = + (es.tid.TIDorbj.core.poa.ServantDelegate) servant._get_delegate(); + org.omg.CORBA.ORB orb = poa.m_orb; + org.omg.CORBA.NVList params = orb.create_list(1); + org.omg.CORBA.Any $s = orb.create_any(); + $s.type(orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); + params.add_value("s", $s, org.omg.CORBA.ARG_IN.value); + request.arguments(params); + String itf = $s.extract_string(); + boolean result = deleg.is_a(servant, itf); + org.omg.CORBA.Any resultAny = orb.create_any(); + resultAny.insert_boolean(result); + request.set_result(resultAny); + } catch (org.omg.CORBA.SystemException se) { + throw se; + } catch (Throwable th) { + if ( this.m_orb.m_trace != null) { + m_trace.printStackTrace( + Trace.DEBUG, + new String[]{ + toString(), + " Exception in servant invoke \"_is_a\" method, ", + "UNKOWN thrown: " + }, + th + ); + } + throw new org.omg.CORBA.UNKNOWN(); + } + + } + + /** + * @return Returns the string representation of this Thread. + */ + public synchronized String toString() + { + if (m_thread_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append(super.toString()); + buffer.append(" in "); + buffer.append(m_poa_manager.toString()); + m_thread_name = buffer.toString(); + buffer = null; + } + return m_thread_name; + } + + /** + * @return Returns the CurrentInfo in the top of the stack. + */ + public CurrentInfo getCurrentInfo() + { + if (m_current_info_stack.empty()) { + return null; + } + return (CurrentInfo) m_current_info_stack.peek(); + } + + private void doInvoke(DynamicImplementation servant, + org.omg.CORBA.ServerRequest request) + { + try { + servant.invoke(request); + } + catch (org.omg.CORBA.SystemException se) { + throw se; + } + catch (Throwable th) { + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { toString(), + " Exception in servant invoke method, UNKOWN thrown: " + }; + + m_trace.printStackTrace(Trace.DEBUG, msg, th); + } + throw new org.omg.CORBA.UNKNOWN(); + } + } +} diff --git a/source/es/tid/TIDorbj/core/poa/OID.java b/source/es/tid/TIDorbj/core/poa/OID.java new file mode 100644 index 0000000..f102237 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/OID.java @@ -0,0 +1,166 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.util.Base64Codec; + +/** + * General Representation of an Object Indentifier. + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class OID +{ + + protected byte[] m_value; + + protected int m_hash_code; + + protected boolean m_hash_created; + + protected String m_str; + + protected OID() + { + m_value = null; + m_hash_code = 0; + m_hash_created = false; + } + + public OID(byte[] val) + { + this(); + m_value = val; + } + + public byte[] toByteArray() + { + return m_value; + } + + public boolean equals(Object obj) + { + OID other = null; + + if (!(obj instanceof OID)) + return false; + + other = (OID) obj; + + if (m_value == null) { + if (other.m_value == null) + return true; + else + return false; + } + + if (m_value.length != other.m_value.length) + return false; + + for (int i = 0; i < m_value.length; i++) { + if (m_value[i] != other.m_value[i]) + return false; + } + + return true; + } + + public int hashCode() + { + if (!m_hash_created) { + + if (m_value == null) + return 0; + + for (int i = 0; i < m_value.length; i++) + m_hash_code = (31 * m_hash_code) + m_value[i]; + m_hash_created = true; + } + + return m_hash_code; + } + + public static OID fromString(String str) + throws Exception + { + return new OID(Base64Codec.decode(str)); + } + + public String toString() + { + if (m_str == null) { + if ((m_value != null) || (m_value.length > 0)) + m_str = Base64Codec.encode(m_value); + else + m_str = ""; + } + + return m_str; + } + + /* + * public static void main (String[] args) { try { + * + * byte[] bytes = {(byte)0,(byte)0,(byte)0,(byte)0,(byte)1,(byte)23}; + * + * OID oid = new OID(bytes); + * + * String str = oid.toString(); + * + * System.out.println(str); + * + * oid = OID.fromString(str); + * + * + * byte[] oid_bytes = oid.toByteArray(); + * + * for(int i = bytes.length -1 ; i >= 0; i--) if(oid_bytes[i] != bytes[i]) + * System.out.println("Error in bytes"); + * + * System.out.println("final"); } catch (Throwable th) + * {th.printStackTrace();} } + * + */ +} + diff --git a/source/es/tid/TIDorbj/core/poa/POAImpl.java b/source/es/tid/TIDorbj/core/poa/POAImpl.java new file mode 100644 index 0000000..a90aaf6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/POAImpl.java @@ -0,0 +1,1984 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import org.omg.BiDirPolicy.BOTH; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.NORMAL; +import org.omg.CORBA.BAD_INV_ORDER; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.PortableServer.*; +import org.omg.PortableServer.POAPackage.*; +import org.omg.PortableServer.ServantLocatorPackage.CookieHolder; + +import es.tid.TIDorbj.core.comm.CommunicationDelegate; +import es.tid.TIDorbj.core.comm.CommunicationException; +import es.tid.TIDorbj.core.comm.iiop.IIOPCommunicationLayer; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.util.Trace; +import es.tid.TIDorbj.core.messaging.PoliciesComponent; +import es.tid.TIDorbj.core.poa.policies.*; +import es.tid.TIDorbj.core.policy.PolicyContext; + + +/** + * Implementation of RTPortableServer::POA + * + * @autor Javier Fdz. Mejuto + * @autor Juan A. Caceres + * @version 2.0 + */ +public class POAImpl extends org.omg.PortableServer.POALocalBase +{ + + /** + * If true the Object has been destroyed and it will throw a + * org.omg.CORBA.OBJECT_NOT_EXIST exception. + * Many Objects has the destroy method, this method will change this attribute. + */ + + protected boolean m_destroyed; + + // attributes for all POAs + public es.tid.TIDorbj.core.TIDORB m_orb = null; + + private String m_name = null; + + private String m_poa_string_name = null; + + private long m_poa_id = 0; + + private byte[] m_id = null; + + private POAKey m_key_seed = null; + + private Vector m_children = null; + + private org.omg.PortableServer.POA m_parent = null; + + private String[] m_path = null; + + private POAManagerImpl m_poa_manager = null; + + private CompletionWaiter m_completion = null; + + private boolean m_destroying = false; + + private boolean m_etherealize = false; + + // attributes depending on policies + private org.omg.PortableServer.AdapterActivator m_adapter_activator = null; + + private org.omg.PortableServer.ServantManager m_servant_manager = null; + + private org.omg.PortableServer.Servant m_default_servant = null; + + private ActiveObjectMap m_active_object_map = null; + + // OID if SystemPolicy + private SystemOID m_current_OID; + + // policies + private IdAssignmentPolicy m_id_assignment_policy = null; + + private IdUniquenessPolicy m_id_uniqueness_policy = null; + + private ImplicitActivationPolicy m_implicit_activation_policy = null; + + private LifespanPolicy m_lifespan_policy = null; + + private RequestProcessingPolicy m_request_processing_policy = null; + + private ServantRetentionPolicy m_servant_retention_policy = null; + + private ThreadPolicy m_thread_policy = null; + + private PoliciesComponent referencePolicies = null; + + /** + * Constructor. + * + * @param orb + * The ORB. + * @param adapter_name + * The POA name. + * @param a_POAManager + * The POA manager which this POA belongs to. + * @param policies + * The policies to be used in the POA. + * @param parent + * The parent POA of this POA. + * @exception org.omg.PortableServer.POAPackage.InvalidPolicy + * When policies are invalid. + */ + public POAImpl(es.tid.TIDorbj.core.TIDORB orb, + java.lang.String adapter_name, + org.omg.PortableServer.POAManager a_POAManager, + org.omg.CORBA.Policy[] policies, + org.omg.PortableServer.POA parent) + throws org.omg.PortableServer.POAPackage.InvalidPolicy + { + int length; + this.m_orb = orb; + this.m_name = adapter_name; + this.m_poa_id = System.currentTimeMillis(); + this.m_children = new Vector(); + this.m_poa_manager = (POAManagerImpl) a_POAManager; + m_poa_manager.addPOA(this); + this.m_parent = parent; + if (parent == null) + this.m_path = new String[0]; + else { + length = (((POAImpl) parent).getPath()).length; + this.m_path = new String[length + 1]; + System.arraycopy(((POAImpl) parent).getPath(), 0, this.m_path, 0, + length); + this.m_path[length] = adapter_name; + } + this.m_completion = new CompletionWaiter(this.m_orb); + + this.referencePolicies = new PoliciesComponent(new PolicyContext(null)); + + // Set policies + if (policies != null) { + for (int i = 0; i < policies.length; i++) { + if (policies[i] == null) + throw new BAD_PARAM("Null policy reference"); + + switch (policies[i].policy_type()) + { + case ID_ASSIGNMENT_POLICY_ID.value: + if (m_id_assignment_policy != null) { + throw new InvalidPolicy(); + } + m_id_assignment_policy = + (IdAssignmentPolicy) policies[i]; + break; + case ID_UNIQUENESS_POLICY_ID.value: + if (m_id_uniqueness_policy != null) { + throw new InvalidPolicy(); + } + m_id_uniqueness_policy = + (IdUniquenessPolicy) policies[i]; + break; + case IMPLICIT_ACTIVATION_POLICY_ID.value: + if (m_implicit_activation_policy != null) { + throw new InvalidPolicy(); + } + m_implicit_activation_policy = + (ImplicitActivationPolicy) policies[i]; + break; + case org.omg.PortableServer.LIFESPAN_POLICY_ID.value: + if (m_lifespan_policy != null) { + throw new InvalidPolicy(); + } + m_lifespan_policy = (LifespanPolicy) policies[i]; + break; + case REQUEST_PROCESSING_POLICY_ID.value: + if (m_request_processing_policy != null) { + throw new InvalidPolicy(); + } + m_request_processing_policy = + (RequestProcessingPolicy) policies[i]; + break; + case SERVANT_RETENTION_POLICY_ID.value: + if (m_servant_retention_policy != null) { + throw new InvalidPolicy(); + } + m_servant_retention_policy = + (ServantRetentionPolicy) policies[i]; + break; + case THREAD_POLICY_ID.value: + if (m_thread_policy != null) { + throw new InvalidPolicy(); + } + m_thread_policy = (ThreadPolicy) policies[i]; + break; + + default: + try { + referencePolicies.getPolicies().setPolicy(policies[i]); + } + catch (PolicyError e) { + throw new InvalidPolicy(); + } + } + } + } + // Set default policies + if (m_id_assignment_policy == null) { + m_id_assignment_policy = + create_id_assignment_policy(IdAssignmentPolicyValue.SYSTEM_ID); + } + + if (m_id_uniqueness_policy == null) { + m_id_uniqueness_policy = + create_id_uniqueness_policy(IdUniquenessPolicyValue.UNIQUE_ID); + } + + if (m_implicit_activation_policy == null) { + m_implicit_activation_policy = + create_implicit_activation_policy( + ImplicitActivationPolicyValue.NO_IMPLICIT_ACTIVATION); + } + + if (m_lifespan_policy == null) { + m_lifespan_policy = + create_lifespan_policy(LifespanPolicyValue.TRANSIENT); + } + + if (m_request_processing_policy == null) { + m_request_processing_policy = + create_request_processing_policy( + RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY); + } + + if (m_servant_retention_policy == null) { + m_servant_retention_policy = + create_servant_retention_policy( + ServantRetentionPolicyValue.RETAIN); + } + if (m_thread_policy == null) { + m_thread_policy = + create_thread_policy(ThreadPolicyValue.ORB_CTRL_MODEL); + } + + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + + m_active_object_map = new ActiveObjectMap(); + } + + if (m_id_assignment_policy.value() == IdAssignmentPolicyValue.SYSTEM_ID) + m_current_OID = new SystemOID(m_poa_id, 0); + + // Wrong Policies + if ((m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION) + && ((m_id_assignment_policy.value() + == IdAssignmentPolicyValue.USER_ID) + || (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN))) { + throw new InvalidPolicy(); + } + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) + && (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY)) { + throw new InvalidPolicy(); + } + + // Generate id + m_id = createKey(null).toString().getBytes(); + } + + /** + * Create a POA as a children of this POA. + * + * @param adapter_name + * The POA name of the new POA. + * @param a_POAManager + * The POA manager which the new POA belongs to. + * @param policies + * The policies to be used in the new POA. + * @exception org.omg.PortableServer.POAPackage.AdapterAlreadyExists + * When this POA has alreay a children named adapter_name. + * @exception org.omg.PortableServer.POAPackage.InvalidPolicy + * When policies are invalid. + */ + synchronized public org.omg.PortableServer.POA + create_POA(java.lang.String adapter_name, + org.omg.PortableServer.POAManager a_POAManager, + org.omg.CORBA.Policy[] policies) + throws org.omg.PortableServer.POAPackage.AdapterAlreadyExists, + org.omg.PortableServer.POAPackage.InvalidPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((adapter_name == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (findChildren(adapter_name) != null) { + throw new org.omg.PortableServer.POAPackage.AdapterAlreadyExists(); + } + POAManagerImpl POAmgr = null; + if (a_POAManager == null) { + POAmgr = new POAManagerImpl(m_orb); + } else { + if(! (a_POAManager instanceof POAManagerImpl)) { + throw new BAD_PARAM("Invalid POAManager: it is not from TIDORB"); + } + + POAmgr = (POAManagerImpl) a_POAManager; + + if(POAmgr.m_orb != m_orb) { + throw new BAD_PARAM("Invalid POAManager: it is not from the same instance of TIDORB"); + } + + } + POAImpl newPOA = + new POAImpl(m_orb, adapter_name, POAmgr, policies, this); + + if (m_destroying) { + newPOA.destroy(false, false); + } else { + m_children.addElement(newPOA); + } + + if(a_POAManager == null) { // recently created + PolicyContext context = newPOA.getPolicyContext(); + + QueueOrderPolicy queuePolicy = context.getQueueOrderPolicy(); + + if(queuePolicy != null) { + POAmgr.setQueueOrderPolicy(queuePolicy); + } + } + + return newPOA; + } + + /** + * @return + */ + public PolicyContext getPolicyContext() + { + return this.referencePolicies.getPolicies(); + } + + /** + * Find a POA among this POA's children. + * + * @param adapter_name + * The POA name. + * @param activate_it + * If it is true find_POA() will try to activate the POA in case + * it can't find it. + * @exception org.omg.PortableServer.POAPackage.AdapterNonExistent + * When this POA has not a children named adapter_name. + */ + public org.omg.PortableServer.POA find_POA(java.lang.String adapter_name, + boolean activate_it) + throws org.omg.PortableServer.POAPackage.AdapterNonExistent + { + synchronized (this) { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + } + + if (adapter_name == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + org.omg.PortableServer.POA poa = findChildren(adapter_name); + + if (poa == null) { + if ((activate_it) && (m_adapter_activator != null)) { + try { + m_adapter_activator.unknown_adapter(this, adapter_name); + } + catch (Exception e) { + throw new org.omg.CORBA.OBJ_ADAPTER(e.getMessage()); + } + poa = findChildren(adapter_name); + // see if _activator has created the POA + if (poa == null) { + // AdapterActivator failed! + throw new AdapterNonExistent(); + } + + if (m_destroying) + poa.destroy(false, false); + + return poa; + + } else { + // AdapterActivator does not exist! + throw new AdapterNonExistent(); + } + } else + return poa; + } + + /** + * Destroy the POA. + * + * @param etherealize_objects + * If true, it must etherealize all objects. + * @param wait_for_completion + * Wait-for-completion flag. + */ + public void destroy(boolean etherealize_objects, + boolean wait_for_completion) + { + synchronized (this) { + if (!m_destroying) { + for (int i = 0; i < m_children.size(); i++) { + org.omg.PortableServer.POA poa=(org.omg.PortableServer.POA) + m_children.elementAt(i); + poa.destroy(etherealize_objects, wait_for_completion); + } + m_etherealize = etherealize_objects; + } + m_destroying = true; + } + + if (wait_for_completion) { + // Wait until there are no executing requests + if (m_completion.conditionToWait()) { + m_completion.waitForCompletion(); + } else { + throw new BAD_INV_ORDER("Can't waitForCompletion!"); + } + + synchronized (this) { + + if (!m_destroyed) { + // POA has not been destroyed yet -> destroy it now + trueDestroy(); + } + } + } else { + synchronized (this) { + boolean PoaNotInUse = m_completion.getActiveRequests() <= 0; + if (PoaNotInUse) { + trueDestroy(); + } + } + + } + } + + /* ************ Policy creation ************* */ + + public org.omg.PortableServer.ThreadPolicy + create_thread_policy(org.omg.PortableServer.ThreadPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.poa.policies.ThreadPolicyImpl(value); + } + + public org.omg.PortableServer.LifespanPolicy + create_lifespan_policy(org.omg.PortableServer.LifespanPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new es.tid.TIDorbj.core.poa.policies.LifespanPolicyImpl(value); + } + + public org.omg.PortableServer.IdUniquenessPolicy + create_id_uniqueness_policy + (org.omg.PortableServer.IdUniquenessPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.IdUniquenessPolicyImpl(value); + } + + public org.omg.PortableServer.IdAssignmentPolicy + create_id_assignment_policy( + org.omg.PortableServer.IdAssignmentPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.IdAssignmentPolicyImpl(value); + } + + public org.omg.PortableServer.ImplicitActivationPolicy + create_implicit_activation_policy( + org.omg.PortableServer.ImplicitActivationPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.ImplicitActivationPolicyImpl(value); + } + + public org.omg.PortableServer.ServantRetentionPolicy + create_servant_retention_policy( + org.omg.PortableServer.ServantRetentionPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.ServantRetentionPolicyImpl(value); + } + + public org.omg.PortableServer.RequestProcessingPolicy + create_request_processing_policy( + org.omg.PortableServer.RequestProcessingPolicyValue value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (value == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + return new + es.tid.TIDorbj.core.poa.policies.RequestProcessingPolicyImpl(value); + } + + /* ************ Accessors ************* */ + + public long getId() + { + return m_poa_id; + } + + public byte[] id() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_id; + } + + public java.lang.String the_name() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_name; + } + + public org.omg.PortableServer.POA the_parent() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_parent; + } + + public String[] getPath() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_path; + } + + synchronized public org.omg.PortableServer.POA[] the_children() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + org.omg.PortableServer.POA[] childrenArray = + new org.omg.PortableServer.POA[m_children.size()]; + m_children.copyInto(childrenArray); + return childrenArray; + } + + public org.omg.PortableServer.POAManager the_POAManager() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_poa_manager; + } + + synchronized public org.omg.PortableServer.AdapterActivator the_activator() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + return m_adapter_activator; + } + + synchronized public void + the_activator(org.omg.PortableServer.AdapterActivator the_activator) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (the_activator == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + m_adapter_activator = the_activator; + } + + synchronized public org.omg.PortableServer.ServantManager + get_servant_manager() + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + return m_servant_manager; + } + + synchronized public void + set_servant_manager(org.omg.PortableServer.ServantManager imgr) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (imgr == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + if (!(imgr instanceof org.omg.PortableServer.ServantActivator)) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) { + if (!(imgr instanceof org.omg.PortableServer.ServantLocator)) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + if (m_servant_manager != null) { + throw new org.omg.CORBA.BAD_INV_ORDER(); + } + m_servant_manager = imgr; + } + + synchronized public org.omg.PortableServer.Servant get_servant() + throws org.omg.PortableServer.POAPackage.NoServant, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (m_default_servant == null) { + throw new org.omg.PortableServer.POAPackage.NoServant(); + } + return m_default_servant; + } + + synchronized public void + set_servant(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_request_processing_policy.value() + != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + m_default_servant = p_servant; + // Servant delegate creation (oid == null ?) + ServantDelegate delegate = new ServantDelegate(this, null); + m_default_servant._set_delegate(delegate); + } + + /* ************ Activation ************* */ + + /** + * Activate an object in this POA. + * + * @param p_servant + * Servant. + * @return Returns an ORB generated object Id. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] + activate_object(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + != IdAssignmentPolicyValue.SYSTEM_ID) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + OID id = nextOID(); + try { + activate_object_with_id(id, p_servant); + } + catch (org.omg.PortableServer.POAPackage.ObjectAlreadyActive e) { + // this should never happen + throw new + INTERNAL("ObjectAlreadyActive thrown with SYSTEM_ID policy!!"); + } + return id.toByteArray(); + } + + /** + * Activate an object in this POA. + * + * @param id + * User created object Id. + * @param p_servant + * Servant. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If id is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public void + activate_object_with_id(byte[] id, + org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((id == null) || (p_servant == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (id.length == 0) + throw new BAD_PARAM("Invalid id length: 0", 0, + CompletionStatus.COMPLETED_NO); + + activate_object_with_id(new OID(id), p_servant); + + } + + /** + * Activate an object in this POA. + * + * @param id + * User created object Id. + * @param p_servant + * Servant. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If id is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.ServantAlreadyActive + * If p_servant is already active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + + protected void + activate_object_with_id(OID oid, + org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantAlreadyActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + boolean uniqueId = + m_id_uniqueness_policy.value() == IdUniquenessPolicyValue.UNIQUE_ID; + // See if there a destruction process running + + synchronized (m_active_object_map) { + java.lang.Object semaphore = m_active_object_map.isDestroying(oid); + if (semaphore != null) { + synchronized (semaphore) { + try { + semaphore.wait(); + } + catch (Exception e) {} + } + } + } + synchronized (this) { + m_active_object_map.put(oid, p_servant, uniqueId); + // Servant delegate creation + ServantDelegate delegate = new ServantDelegate(this, + oid.toByteArray()); + p_servant._set_delegate(delegate); + } + } + + /** + * Deactivate an object in this POA. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If id is not active in this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public void deactivate_object(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + OID tid_oid = new OID(oid); + + synchronized (m_active_object_map) { + if (m_active_object_map.isDestroying(tid_oid) == null) { + m_active_object_map.destroy(tid_oid); + tryToRemoveObject(tid_oid); + } + } + } + + /* ************ Id conversion ************* */ + + /** + * Create an object reference for a repository Id (using a new object Id). + * + * @param intf + * The repository Id + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object + create_reference(java.lang.String intf) + throws org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (intf == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (intf.length() == 0) + throw new BAD_PARAM("Invalid id length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + != IdAssignmentPolicyValue.SYSTEM_ID) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + OID newOid = nextOID(); + return createReferenceWithIdAux(newOid, intf); + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + */ + public org.omg.CORBA.Object create_reference_with_id(byte[] oid, + java.lang.String intf) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if ((oid == null) || (intf == null)) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + if (intf.length() == 0) + throw new BAD_PARAM("Invalid intf length: 0", 0, + CompletionStatus.COMPLETED_NO); + + return create_reference_with_id(new OID(oid), intf); + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + + synchronized protected org.omg.CORBA.Object + create_reference_with_id(OID oid, + java.lang.String intf) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (m_id_assignment_policy.value() + == IdAssignmentPolicyValue.SYSTEM_ID) { + + SystemOID s_oid = SystemOID.fromOID(oid); + + if (s_oid == null) + throw new BAD_PARAM("Invalid System OID", 0, + CompletionStatus.COMPLETED_NO); + + if (m_lifespan_policy.value() == LifespanPolicyValue.TRANSIENT) { + if ((s_oid.getPOAId() != m_poa_id) + || (currentOID().getSerial() < s_oid.getSerial())) { + throw new org.omg.CORBA.BAD_PARAM(); + } + } else { // PERSISTENT + if ((s_oid.getPOAId() == m_poa_id) + && (currentOID().getSerial() < s_oid.getSerial())) { + throw new org.omg.CORBA.BAD_PARAM(); + } + } + + return createReferenceWithIdAux(s_oid, intf); + } + + return createReferenceWithIdAux(oid, intf); + } + + /** + * Creates a new ObjectKey with the given oid. + *

+ * If the Lifespan policy is TRANSIENT, the poa_id is set to remember that + * the key is only valid in the current poa context. + */ + + protected POAKey createKey(OID oid) + { + if (m_key_seed == null) { + if (m_lifespan_policy.value() == LifespanPolicyValue.TRANSIENT) + m_key_seed = new POAKey(this, m_poa_id, null); + else + m_key_seed = new POAKey(this, 0, null); + } + + POAKey key = null; + + try { + key = (POAKey) m_key_seed.clone(); + } + catch (CloneNotSupportedException cnse) { + throw new org.omg.CORBA.INTERNAL(); + } + + key.setOID(oid); + return key; + } + + /** + * Create an object reference for a repository Id using a user defined + * object Id. + * + * @param oid + * The object Id + * @param intf + * The repository Id + */ + protected org.omg.CORBA.Object createReferenceWithIdAux( OID oid, java.lang.String intf) + { + POAKey poakey = createKey(oid); + IOR ior; + + TaggedComponent[] poaComponents = null; + + if(referencePolicies.getPolicies().getSize() > 0) { + poaComponents = new TaggedComponent[1]; + poaComponents[0] = referencePolicies; + } + + try { + + ior = m_orb.getCommunicationManager() + .getLayerById( IIOPCommunicationLayer.ID ) + .createIOR(intf, poakey, poaComponents); + + } catch ( CommunicationException ce ) { + throw new INTERNAL( + "Unable to create ior:" + ce.getMessage(), + 0, + CompletionStatus.COMPLETED_NO + ); + } + + return es.tid.TIDorbj.core.ObjectImpl.fromIOR(m_orb, ior); + } + + /** + * Get the object Id of a given servant. + * + * @param p_servant + * The servant. + * @exception org.omg.PortableServer.POAPackage.ServantNotActive + * If p_servant is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] + servant_to_id(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + boolean hasRetain = (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN); + + boolean hasUniqueId = (m_id_uniqueness_policy.value() + == IdUniquenessPolicyValue.UNIQUE_ID); + + boolean hasImplicitActivation =(m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + + boolean hasDefaultServant = (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT); + + if (!(hasDefaultServant + || (hasRetain && (hasUniqueId || hasImplicitActivation)))) + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + + if (hasRetain) { + // 1st behaviour + if (hasUniqueId) { + OID oid = m_active_object_map.get(p_servant); + if (oid != null) { + return oid.toByteArray(); + } + } + // 2nd behaviour + if (hasImplicitActivation) { + OID oid = m_active_object_map.get(p_servant); + if ((oid == null) || (!hasUniqueId)) { + OID newOid = nextOID(); + try { + activate_object_with_id(newOid, p_servant); + return newOid.toByteArray(); + } + catch (ObjectAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + catch (ServantAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + } + } + } + // 3rd behaviour + if (hasDefaultServant && (m_default_servant == p_servant)) { + try { + org.omg.PortableServer.Servant servant = + m_orb.initPOACurrent().getServant(); + if (servant == m_default_servant) { + // operation invoked on the default servant + return m_orb.initPOACurrent().get_object_id(); + } + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + } + + // 4th behaviour + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + /** + * Get the object reference of a given servant. + * + * @param p_servant + * The servant. + * @exception org.omg.PortableServer.POAPackage.ServantNotActive + * If p_servant is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object + servant_to_reference(org.omg.PortableServer.Servant p_servant) + throws org.omg.PortableServer.POAPackage.ServantNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (p_servant == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + boolean hasRetain = (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN); + boolean hasUniqueId = (m_id_uniqueness_policy.value() + == IdUniquenessPolicyValue.UNIQUE_ID); + boolean hasImplicitActivation = (m_implicit_activation_policy.value() + == ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + + if (!(hasRetain && (hasUniqueId || hasImplicitActivation))) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + + // 1st behaviour + if (hasUniqueId) { + OID oid = m_active_object_map.get(p_servant); + if (oid != null) { + return create_reference_with_id(oid.toByteArray(), + getRepositoryId(p_servant)); + } + } + + // 2nd behaviour + if (hasImplicitActivation) { + OID oid = m_active_object_map.get(p_servant); + if ((oid == null) || (!hasUniqueId)) { + OID newOid = nextOID(); + try { + activate_object_with_id(newOid, p_servant); + return create_reference_with_id(newOid, + getRepositoryId(p_servant)); + } + catch (ObjectAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + catch (ServantAlreadyActive e) { + throw new org.omg.CORBA.INTERNAL(); + // this should never happen + } + } + } + // 3rd behaviour + try { + org.omg.PortableServer.Servant servant = m_orb.initPOACurrent() + .getServant(); + + if (servant == m_default_servant) { + // operation invoked on the default servant + byte[] currentOID = m_orb.initPOACurrent().get_object_id(); + return create_reference_with_id(currentOID, + getRepositoryId(servant)); + } + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + // 4th behaviour + throw new org.omg.PortableServer.POAPackage.ServantNotActive(); + } + + /** + * Get the servant of a given object reference. + * + * @param reference + * The object reference. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongAdapter + * If the object reference does not belong to this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.PortableServer.Servant + reference_to_servant(org.omg.CORBA.Object reference) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongAdapter, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (reference == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + byte[] oid = reference_to_id(reference); + return id_to_servant(oid); + } + + /** + * Get the object Id of a given object reference. + * + * @param reference + * The object reference. + * @exception org.omg.PortableServer.POAPackage.WrongAdapter + * If the object reference does not belong to this POA. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public byte[] reference_to_id(org.omg.CORBA.Object reference) + throws org.omg.PortableServer.POAPackage.WrongAdapter, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (reference == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + try { + org.omg.CORBA.portable.ObjectImpl obj = + (org.omg.CORBA.portable.ObjectImpl) reference; + CommunicationDelegate delegate = + (CommunicationDelegate) obj + ._get_delegate(); + IOR ior = delegate.getReference(); + + POAKey poaKey = POAKey.createKey( ior.getObjectKey().getMarshaledKey() ); + POAKey poaKey2 = createKey(null); + if (!poaKey2.samePOA(poaKey)) { + throw new org.omg.PortableServer.POAPackage.WrongAdapter(); + } + return poaKey.getOID().toByteArray(); + } + catch (Exception e) { + throw new org.omg.PortableServer.POAPackage.WrongAdapter(); + } + } + + /** + * Get the servant of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + public org.omg.PortableServer.Servant id_to_servant(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + return id_to_servant(new OID(oid)); + } + + /** + * Get the servant of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized protected org.omg.PortableServer.Servant id_to_servant(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (( m_servant_retention_policy.value() != ServantRetentionPolicyValue.RETAIN) && + ( m_request_processing_policy.value() != RequestProcessingPolicyValue.USE_DEFAULT_SERVANT)) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) + && (m_active_object_map.isActive(oid))) { + return m_active_object_map.get(oid); + } + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) + && (m_default_servant != null)) { + // Default servant invocation (oid == current request oid ??) + ServantDelegate srv_delegate = + (ServantDelegate) m_default_servant._get_delegate(); + srv_delegate.setObjectId(oid.toByteArray()); + return m_default_servant; + } + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + + /** + * Get the object reference of a given object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @exception org.omg.PortableServer.POAPackage.WrongPolicy + * If POA policies do not allow this operation. + */ + synchronized public org.omg.CORBA.Object id_to_reference(byte[] oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.WrongPolicy + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (oid == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + if (oid.length == 0) + throw new BAD_PARAM("Invalid oid length: 0", 0, + CompletionStatus.COMPLETED_NO); + + OID tid_oid = new OID(oid); + + if (m_servant_retention_policy.value() + != ServantRetentionPolicyValue.RETAIN) { + throw new org.omg.PortableServer.POAPackage.WrongPolicy(); + } + if (!m_active_object_map.isActive(tid_oid)) { + throw new org.omg.PortableServer.POAPackage.ObjectNotActive(); + } + org.omg.PortableServer.Servant servant = + m_active_object_map.get(tid_oid); + return create_reference_with_id(tid_oid, getRepositoryId(servant)); + } + + + + + /* ************ TIDorb methods ************* */ + + /** + * Finds the servant for an object Id. Executes all needed activations, + * according to the policies of this POA. + * + * @param oid + * The object Id. + * @param operation + * The name of the operation invoked (if any). + * @param cookieHolder + * The CookieHolder (only if ServantLocator is needed). + * @param servantLocatorUsed + * Returns true if ServantLocator has been used. + * @return The servant. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If it tries to use a inactive object. + * @exception org.omg.PortableServer.POAPackage.ObjectAlreadyActive + * If it tries to activate an active object. + * @exception org.omg.PortableServer.ForwardRequest + * It can be thrown by incarnate(). + */ + synchronized protected org.omg.PortableServer.Servant + find_servant(OID oid, + String operation, + CookieHolder cookieHolder, + org.omg.CORBA.BooleanHolder servantLocatorUsed) + throws org.omg.PortableServer.POAPackage.ObjectNotActive, + org.omg.PortableServer.POAPackage.ObjectAlreadyActive, + org.omg.PortableServer.ForwardRequest + { + + servantLocatorUsed.value = false; + org.omg.PortableServer.Servant servant = null; + + try { + + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN)) { + // RETAIN && USE_ACTIVE_OBJECT_MAP_ONLY + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY){ + servant = id_to_servant(oid); + return servant; + } + + // RETAIN && USE_DEFAULT_SERVANT + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + servant = id_to_servant(oid); + return servant; + } + + // RETAIN && USE_SERVANT_MANAGER + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + + try { + // try to get id from the Active Object Map + servant = id_to_servant(oid); + } + catch (ObjectNotActive e){ + // try to use Servant Activator (incarnate) + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) + m_servant_manager; + servant = activator.incarnate(oid.toByteArray(), this); + if (servant == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + try { + // try to activate servant created by Servant + // Activator + activate_object_with_id(oid, servant); + } + catch (ServantAlreadyActive e2) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + } + + return servant; + } + } else { // NON_REATAIN + + // NON_RETAIN && USE_DEFAULT_SERVANT + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_DEFAULT_SERVANT) { + if (m_default_servant == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + // return Default Servant + servant = m_default_servant; + // Default servant invocation (oid == current request oid + // ??) + ServantDelegate srv_delegate = + (ServantDelegate) servant._get_delegate(); + + srv_delegate.setObjectId(oid.toByteArray()); + + return servant; + } + // NON_RETAIN && USE_SERVANT_MANAGER + if (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + // try to use Servant Locator (preinvoke) + org.omg.PortableServer.ServantLocator locator = + (org.omg.PortableServer.ServantLocator) + m_servant_manager; + + servant = locator.preinvoke(oid.toByteArray(), this, + operation, cookieHolder); + + servantLocatorUsed.value = true; + // Servant delegate creation (oid == current request oid ??) + + ServantDelegate delegate = + new ServantDelegate(this,oid.toByteArray()); + + servant._set_delegate(delegate); + + return servant; + } + } + + } + catch (org.omg.PortableServer.POAPackage.WrongPolicy dummy) { + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEEP_DEBUG, + "Unexpected WrongPolicy exception", dummy); + } + + throw new INTERNAL("Unexpected WrongPolicy exception"); + } + + return servant; + } + + /** + * Call postinvoke. This method is only used if there was a preinvoke before + * servant invocation. + * + * @param oid + * The object Id. + * @param operation + * The name of the operation invoked. + * @param cookieHolder + * The CookieHolder + * @param servant + * The servant. + * @return The servant. + */ + synchronized protected void + callPostinvoke(byte[] oid, + String operation, + CookieHolder cookieHolder, + org.omg.PortableServer.Servant servant) + { + if ((m_servant_retention_policy.value() + == ServantRetentionPolicyValue.NON_RETAIN) + && (m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER)) { + if (m_servant_manager == null) { + throw new org.omg.CORBA.OBJ_ADAPTER(); + } + org.omg.PortableServer.ServantLocator locator = + (org.omg.PortableServer.ServantLocator) m_servant_manager; + if (isSingleThread()) { + synchronized (locator) { + locator.postinvoke(oid, this, operation, + cookieHolder.value, servant); + } + } else { + locator.postinvoke(oid, + this, + operation, + cookieHolder.value, + servant); + } + } + } + + /** + * @return True if POA's ThreadPolicy is SINGLE_THREAD. + */ + synchronized protected boolean isSingleThread() + { + return (m_thread_policy.value() + == ThreadPolicyValue.SINGLE_THREAD_MODEL); + } + + /** + * @return True if POA's BidirectionalPolicy is BOTH. + */ + synchronized public boolean isBidirectional() + { + BidirectionalPolicy bidirectional_policy = + referencePolicies.getPolicies().getBidirectionalPolicy(); + + if(bidirectional_policy == null) { + return false; + } else { + return (bidirectional_policy.value() == BOTH.value); + } + } + + /** + * @return True if this POA has an AdapterActivator. + */ + synchronized protected boolean hasAdapterActivator() + { + return m_adapter_activator != null; + } + + /** + * Adds a new user for this oid. This means that there is one more active + * request executing some request with this object Id. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + */ + synchronized protected void addUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + + if (m_active_object_map.isActive(oid)) { + m_active_object_map.addUser(oid); + } + } + + m_completion.beginRequest(); + m_poa_manager.beginRequest(); + } + + /** + * Removes a user for this oid. + * + * @param oid + * The object Id. + * @exception org.omg.PortableServer.POAPackage.ObjectNotActive + * If object is not active yet. + * @see addUser. + */ + protected void removeUser(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + // Decrease # of users of OID + m_completion.endRequest(); + synchronized (this) { + m_poa_manager.endRequest(); + if (m_destroying) { + boolean PoaNotInUse = m_completion.getActiveRequests() <= 0; + if (PoaNotInUse) { + trueDestroy(); + } + } else { + tryToRemoveObject(oid); + } + } + } + + /** + * Etherealizes all objects in this POA manager. + */ + synchronized protected void etherealizeAllObjects() + { + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + java.util.Enumeration oids = m_active_object_map.getOIDs(); + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) + && (m_servant_manager != null)) { + // call etherealize + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) m_servant_manager; + while (oids.hasMoreElements()) { + OID oid = (OID) oids.nextElement(); + try { + org.omg.PortableServer.Servant servant = + m_active_object_map.remove(oid); + if (isSingleThread()) { + synchronized (activator) { + activator.etherealize( + oid.toByteArray(), + this, + servant, + false, + m_active_object_map.contains(servant)); + } + } else { + activator.etherealize( + oid.toByteArray(), + this, + servant, + false, + m_active_object_map.contains(servant)); + } + } + catch (Exception e) { + // should never happen + e.printStackTrace(); + } + } + } + } else { + //nothing to do + } + } + + /** + * Creates the root POA. This method should only be called by + * es.tid.TIDorbj.core.TIDorb.resolve_initial_references() + * + * @param orb + * The ORB. + * @see es.tid.TIDorbj.core.TIDORB#resolve_initial_references + */ + static public POAImpl createRootPOA(es.tid.TIDorbj.core.TIDORB orb) + { + POAImpl rootPOA = null; + org.omg.CORBA.Policy[] policies = new org.omg.CORBA.Policy[8]; + policies[0] = + new IdAssignmentPolicyImpl(IdAssignmentPolicyValue.SYSTEM_ID); + policies[1] = + new IdUniquenessPolicyImpl(IdUniquenessPolicyValue.UNIQUE_ID); + policies[2] = + new ImplicitActivationPolicyImpl( + ImplicitActivationPolicyValue.IMPLICIT_ACTIVATION); + policies[3] = + new LifespanPolicyImpl(LifespanPolicyValue.TRANSIENT); + policies[4] = + new RequestProcessingPolicyImpl( + RequestProcessingPolicyValue.USE_ACTIVE_OBJECT_MAP_ONLY); + policies[5] = + new ServantRetentionPolicyImpl(ServantRetentionPolicyValue.RETAIN); + policies[6] = new ThreadPolicyImpl(ThreadPolicyValue.ORB_CTRL_MODEL); + policies[7] = + new es.tid.TIDorbj.core.BidirectionalPolicyImpl(NORMAL.value); + try { + POAManagerImpl mgr = new POAManagerImpl(orb); + rootPOA = new POAImpl(orb, "rootPOA", mgr, policies, null); + } + catch (org.omg.PortableServer.POAPackage.InvalidPolicy e) { + // this can never happen + } + return rootPOA; + } + + /* ************ Private methods ************* */ + + /** + * Removes an object if there are no executing request using it. + * + * @param oid + * The object Id. + */ + private void tryToRemoveObject(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + if (m_servant_retention_policy.value() + == ServantRetentionPolicyValue.RETAIN) { + if (m_active_object_map.isActive(oid)) { + boolean OidNotInUse = m_active_object_map.removeUser(oid); + if (OidNotInUse) { + trueRemoveObject(oid); + } + } + } + } + + /** + * Removes an object. + * + * @param oid + * The object Id. + */ + private void trueRemoveObject(OID oid) + throws org.omg.PortableServer.POAPackage.ObjectNotActive + { + // Remove OID from ActiveObjectMap + // ///////////////////////////////////////////////////////////// + org.omg.PortableServer.Servant servant = + m_active_object_map.remove(oid); + if (m_orb.m_trace != null) { + m_orb.printTrace(Trace.DEEP_DEBUG, "Removing object: " + + oid.toString()); + } + + // Try to etherealize, if necessary + if ((m_request_processing_policy.value() + == RequestProcessingPolicyValue.USE_SERVANT_MANAGER) + && (m_servant_manager != null)) { + org.omg.PortableServer.ServantActivator activator = + (org.omg.PortableServer.ServantActivator) m_servant_manager; + if (isSingleThread()) { + synchronized (activator) { + activator.etherealize(oid.toByteArray(), + this, + servant, + true, + m_active_object_map.contains(servant)); + } + } else { + activator.etherealize(oid.toByteArray(), + this, servant, + true, + m_active_object_map.contains(servant)); + } + } + // Continue with waiting activations of oid (if any) + synchronized (servant) { + servant.notifyAll(); + } + } + + public void destroy() + { + throw new BAD_OPERATION(); + } + + /** + * Destroys the POA manager. + */ + synchronized public void trueDestroy() + { + m_destroyed = true; + + if (m_etherealize) { + // Etherealize all objects + etherealizeAllObjects(); + } else { + // init activeObjectMap (perhaps this is not necessary) + m_active_object_map = new ActiveObjectMap(); + } + // remove POA from parent + if (m_parent != null) { + ((POAImpl) m_parent).m_children.removeElement(this); + } + m_poa_manager.removePOA(this); + m_poa_manager = null; + } + + /** + * Find a POA among the POA's children. + * + * @param poa_name + * The POA name. + */ + private org.omg.PortableServer.POA findChildren(String poa_name) + { + org.omg.PortableServer.POA poa = null; + for (int i = 0; i < m_children.size(); i++) { + poa = (org.omg.PortableServer.POA) m_children.elementAt(i); + if (poa_name.equals(poa.the_name())) { + return poa; + } + } + return null; + } + + /** + * Returns the repository Id of a servant. + * + * @param servant + * The servant. + * @return The repository Id. + */ + private String getRepositoryId(org.omg.PortableServer.Servant servant) + { + return servant._all_interfaces(this, servant._object_id())[0]; + } + + /** + * @return The current System Object Id. + */ + public SystemOID currentOID() + { + return m_current_OID; + } + + /** + * Generates the next oid. + * + * @return The next Object Id. + */ + public OID nextOID() + { + SystemOID aux = m_current_OID; + m_current_OID = m_current_OID.next(); + return aux; + } + + + + /* ************ ObjectImpl ************* */ + + public String toString() + { + if (m_poa_string_name == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("POA "); + POAKey key = createKey(null); + buffer.append(key.getPOAPath()); + m_poa_string_name = buffer.toString(); + } + + return m_name; + } + + + + +} diff --git a/source/es/tid/TIDorbj/core/poa/POAKey.java b/source/es/tid/TIDorbj/core/poa/POAKey.java new file mode 100644 index 0000000..fc52c10 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/POAKey.java @@ -0,0 +1,332 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.INV_OBJREF; +import org.omg.CORBA.MARSHAL; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; + +public class POAKey extends ObjectKey + implements Cloneable +{ + + /** + * Magic number: start of an POAKey + */ + + public final static byte MAGIC_START = 0x0; + + /** + * Start encapsulated key size to verify if it is an POAKey + */ + + public final static int START_BUFFER_SIZE = + CDR.ULONG_SIZE /* encapsulation size */ + + CDR.BOOLEAN_SIZE /* byte order */ + + (2 * CDR.OCTET_SIZE); /* and 2 magic number */ + + /** + * Sequence of poa names from the rootPOA to the final POA. + */ + private String[] m_poas = null; + + /** + * Rereference durability. If 0 the reference is persistent, otherwise the + * reference is transient, and it lifespan is joined to its POA lifespan. + */ + private long m_poa_id = 0L; + + /** + * Object Id. + */ + private OID m_oid = null; + + private String m_key_name = null; + + private POAKey(){ + + } + + + public POAKey(org.omg.PortableServer.POA poa, long poa_id, OID oid) { + m_poas = ((POAImpl) (poa)).getPath(); + m_poa_id = poa_id; + m_oid = oid; + } + + public POAKey(String[] poas, long poa_id, OID oid) + { + m_poas = poas; + m_poa_id = poa_id; + m_oid = oid; + } + + + public String getPOA(int poa_level) + { + return m_poas[poa_level]; + } + + public int numberOfPOAs() + { + return m_poas.length; + } + + public OID getOID() + { + return m_oid; + } + + public long getPOAId() + { + return m_poa_id; + } + + protected void setOID(OID oid) + { + m_oid = oid; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream output) + { + if ( super.getMarshaledKey() == null ){ + + // create input stream for save the encapsualation + CDRInputStream encapsulation_input; + encapsulation_input = output.inputStreamAtThisPosition(); + + if (m_poas == null) { + throw new INTERNAL("Uncompleted POAKey"); + } + + // begin marshalling + output.enterEncapsulation(); + + // KEY is alwais 1.2 + + GIOPVersion output_version = output.getVersion(); + output.setVersion(GIOPVersion.VERSION_1_2); + + // write magic start 2 bytes with 0 value + output.write_octet(MAGIC_START); + output.write_octet(MAGIC_START); + + // write string[] with poas path + // - number of poas in path + output.write_ulong(m_poas.length); + // - each poa path entry + for (int i = 0; i < m_poas.length; i++) { + output.write_string(m_poas[i]); + } + + // lifespan time + output.write_longlong(m_poa_id); + + // oid + byte[] oid_value = m_oid.toByteArray(); + if (oid_value == null) { + throw new INTERNAL("Uncompleted POAKey"); + } + output.write_ulong(oid_value.length); + output.write_octet_array(oid_value, 0, oid_value.length); + + output.setVersion(output_version); + + // end marshalling + output.exitEncapsulation(); + + super.setMarshaledKey( encapsulation_input.readEncapsulation() ); + + encapsulation_input = null; + + } else { + super.write( output ); + } + + } + + public void read(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + // KEY is alwais 1.2 + + GIOPVersion input_version = input.getVersion(); + + input.setVersion(GIOPVersion.VERSION_1_2); + + // check magic bytes + + byte magic_0 = input.read_octet(); + byte magic_1 = input.read_octet(); + + if ((magic_0 != MAGIC_START) || (magic_1 != MAGIC_START)) + throw new MARSHAL("Not a TIDorb key"); + + // read string[] with poas path + + int length = input.read_ulong(); + + if (length < 0) + throw new INV_OBJREF("Malformed POAKey(bad number of poas)"); + + m_poas = new String[length]; + for (int i = 0; i < m_poas.length; i++) + m_poas[i] = input.read_string(); + + m_poa_id = input.read_longlong(); + + // read byte[] with oid + + length = input.read_ulong(); + + if (length == 0) + throw new org.omg.CORBA.INV_OBJREF("Malformed POAKey"); + + byte[] oid_value = new byte[length]; + input.read_octet_array(oid_value, 0, length); + + m_oid = new OID(oid_value); + + input.setVersion(input_version); + } + + public boolean samePOA(POAKey other) + { + if (m_poa_id != other.m_poa_id) + return false; + if (m_poas.length != other.m_poas.length) + return false; + for (int i = 0; i < m_poas.length; i++) { + if (!m_poas[i].equals(other.m_poas[i])) + return false; + } + return true; + } + + public boolean equals(POAKey other) + { + return m_oid.equals(other.m_oid) && samePOA(other); + } + + public Object clone() + throws CloneNotSupportedException + { + return super.clone(); + } + + public String getPOAPath() + { + StringBuffer str = new StringBuffer("/"); + if (m_poas != null) { + for (int i = 0; i < m_poas.length; i++) { + str.append(m_poas[i]).append("/"); + } + } + + return str.toString(); + } + + public static POAKey createKey(Encapsulation key) + { + if(maybePOAKey(key)) { + POAKey poaKey = new POAKey(); + poaKey.setMarshaledKey( key ); + poaKey.read( key.createInputStream() ); + return poaKey; + } else { + return null; + } + + } + + public static boolean + maybePOAKey(es.tid.TIDorbj.core.cdr.Encapsulation encap) + { + int start = encap.getOffset(); + + if (encap.getLength() < START_BUFFER_SIZE) + return false; + + byte[] start_key_buffer = encap.getOctetSequence(); + + return (start_key_buffer[start + START_BUFFER_SIZE - 1] == MAGIC_START) + && (start_key_buffer[start + START_BUFFER_SIZE - 2] == MAGIC_START); + } + + public synchronized String toString() + { + if (m_key_name == null) { + + StringBuffer str = new StringBuffer("ObjectKey[POA: /"); + + if (m_poas != null) { + for (int i = 0; i < m_poas.length; i++) { + str.append(m_poas[i]).append("/"); + } + } + + if (m_poa_id == 0L) + str.append("; Type: PERSISTENT "); + else { + str.append("; Type: TRANSIENT(POA Id: "); + str.append(m_poa_id); + str.append("); "); + } + + if (m_oid != null) + str.append(m_oid.toString()); + + str.append(']'); + + m_key_name = str.toString(); + } + return m_key_name; + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/POAManagerConf.java b/source/es/tid/TIDorbj/core/poa/POAManagerConf.java new file mode 100644 index 0000000..945d58b --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/POAManagerConf.java @@ -0,0 +1,141 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import org.omg.CORBA.BAD_PARAM; + +/** + * Configuration set for POAManager. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class POAManagerConf +{ + + private int m_min_threads; + + private int m_max_threads; + + private int m_max_queued_requests; + + private int m_starving_time; + + private POAManagerConfListener m_listener = null; + + protected POAManagerConf(int min_threads, int max_threads, + int max_queued_requests, int starving_time) + { + this.m_min_threads = min_threads; + this.m_max_threads = max_threads; + this.m_max_queued_requests = max_queued_requests; + this.m_starving_time = starving_time; + } + + public void setListener(POAManagerConfListener l) + { + m_listener = l; + } + + synchronized public void setMinThreads(int min_threads) + { + if (min_threads < 0) { + throw new BAD_PARAM("min_threads can not be negative."); + } + if (min_threads > this.m_max_threads) { + throw new + BAD_PARAM("min_threads can not be greater than max_threads."); + } + this.m_min_threads = min_threads; + if (m_listener != null) { + m_listener.minThreadsHasChanged(); + } + } + + synchronized public void setMaxThreads(int max_threads) + { + if (max_threads < this.m_min_threads) { + throw new + BAD_PARAM("max_threads can not be less than min_threads."); + } + this.m_max_threads = max_threads; + } + + synchronized public void setMaxQueuedRequests(int max_queued_requests) + { + if (max_queued_requests < this.m_max_queued_requests) { + throw new + BAD_PARAM("max_queued_requests can not be decreased."); + } + this.m_max_queued_requests = max_queued_requests; + } + + synchronized public void setStarvingTime(int millisecs) + { + if (millisecs < 0) { + throw new BAD_PARAM("starving_time can not be negative."); + } + this.m_starving_time = millisecs; + } + + synchronized public int getMaxQueuedRequests() + { + return m_max_queued_requests; + } + + synchronized public int getMaxThreads() + { + return m_max_threads; + } + + synchronized public int getMinThreads() + { + return m_min_threads; + } + + synchronized public int getStarvingTime() + { + return m_starving_time; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/POAManagerConfListener.java b/source/es/tid/TIDorbj/core/poa/POAManagerConfListener.java new file mode 100644 index 0000000..a634d84 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/POAManagerConfListener.java @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +interface POAManagerConfListener +{ + + void minThreadsHasChanged(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/POAManagerImpl.java b/source/es/tid/TIDorbj/core/poa/POAManagerImpl.java new file mode 100644 index 0000000..a586099 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/POAManagerImpl.java @@ -0,0 +1,487 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 13 $ +* Date: $Date: 2006-02-09 10:58:57 +0100 (Thu, 09 Feb 2006) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_DEADLINE; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.PortableServer.POAManagerPackage.AdapterInactive; +import org.omg.PortableServer.POAManagerPackage.State; + +/** + * Implementation of POAManager. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class POAManagerImpl extends org.omg.PortableServer.POAManagerLocalBase + implements es.tid.PortableServer.POAManager +{ + + private boolean destroyed; + + // Relationships + protected es.tid.TIDorbj.core.TIDORB m_orb = null; + + protected POAManagerConf m_conf; + + private Vector m_poas; + + private RequestQueue m_request_queue; + + private ThreadPool m_pool; + + + // Members + private State m_state; + + protected java.lang.Object m_state_mutex; + + protected String m_manager_name; + + static es.tid.TIDorbj.core.util.Counter st_serial = + new es.tid.TIDorbj.core.util.Counter(); + + protected short m_queue_order; + + // waitForCompletion + private CompletionWaiter m_completion; + + /** + * Constructor. + * + * @param orb + * The ORB. + */ + public POAManagerImpl(es.tid.TIDorbj.core.TIDORB orb) + { + m_orb = orb; + synchronized (orb.m_POAManagers) { + orb.m_POAManagers.addElement(this); + } + m_manager_name = "POAManager " + st_serial.inc(); + m_state = State.HOLDING; + m_state_mutex = new Boolean(true); + m_conf = new POAManagerConf(orb.m_conf.poa_min_threads, + orb.m_conf.poa_max_threads, + orb.m_conf.poa_max_queued_requests, + orb.m_conf.poa_starving_time); + m_completion = new CompletionWaiter(orb); + m_poas = new Vector(); + m_pool = new ThreadPool(this); + m_conf.setListener(m_pool); + m_request_queue = new RequestQueue(this, m_pool, new TemporalRequestComparator()); + m_pool.minThreadsHasChanged(); + m_queue_order = ORDER_TEMPORAL.value; + + } + + /** + * Sets the mininum number of execution threads + */ + public void set_min_threads(int min_threads) + { + m_conf.setMinThreads(min_threads); + } + + /** + * Sets the maximun number of execution threads + */ + public void set_max_threads(int max_threads) + { + m_conf.setMaxThreads(max_threads); + } + + /** + * Sets the maximun number of request queued in the POAManager + */ + public void set_max_queued_requests(int max_queued_requests) + { + m_conf.setMaxQueuedRequests(max_queued_requests); + } + + /** + * Sets the maximun time an execution thread is inactive. + */ + public void set_starving_time(int millisecs) + { + m_conf.setStarvingTime(millisecs); + } + + /** + * @return maximun number of request queued in the POAManager + */ + public int get_max_queued_requests() + { + return m_conf.getMaxQueuedRequests(); + } + + /** + * @return the maximun number of execution threads + */ + public int get_max_threads() + { + return m_conf.getMaxThreads(); + } + + /** + * @return the mininum number of execution threads + */ + public int get_min_threads() + { + return m_conf.getMinThreads(); + } + + /** + * @return the maximun time an execution thread is inactive. + */ + public int get_starving_time() + { + return m_conf.getStarvingTime(); + } + + /** + * @return The associated POAManagerConf object. + */ + protected POAManagerConf getConf() + { + return m_conf; + } + + /** + * Adds a POA to this POAManager. + * + * @param poa + * The POA. + */ + protected void addPOA(org.omg.PortableServer.POA poa) + { + m_poas.addElement(poa); + } + + /** + * @return The request queue of this POAManager. + */ + protected RequestQueue getRequestQueue() + { + return m_request_queue; + } + + /** + * @return The thread pool of this POAManager. + */ + protected ThreadPool getThreadPool() + { + return m_pool; + } + + protected void setQueueOrderPolicy(QueueOrderPolicy policy) { + + short order = policy.allowed_orders(); + + set_queue_order(order); + + + } + + public void set_queue_order(short order) { + if(((order ^ ORDER_PRIORITY.value) != 0) + && (m_queue_order != ORDER_PRIORITY.value)){ + m_request_queue.setComparator(new PriorityRequestComparator()); + m_queue_order = ORDER_PRIORITY.value; + } else if (((order ^ ORDER_DEADLINE.value) != 0) + && (m_queue_order != ORDER_DEADLINE.value)){ + m_request_queue.setComparator(new DeadlineRequestComparator()); + m_queue_order = ORDER_DEADLINE.value; + } else if ((m_queue_order != ORDER_TEMPORAL.value) + || (m_queue_order != ORDER_ANY.value)) { + // default comparator will be used + m_request_queue.setComparator(new TemporalRequestComparator()); + } + } + + public short get_queue_order() + { + return m_queue_order; + + } + + + /* ************ State changes ************* */ + + /** + * This operation changes the POA manager to ACTIVE. + * + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void activate() + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> ACTIVE + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.ACTIVE) { + m_completion.stopWaiting(); + m_state = State.ACTIVE; + m_state_mutex.notifyAll(); + } + } + } + + /** + * This operation changes the POA manager to HOLDING. + * + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void hold_requests(boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> HOLDING + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.HOLDING) { + m_completion.stopWaiting(); + m_state = State.HOLDING; + m_state_mutex.notifyAll(); + } + } + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); // synchronized + } + } + + /** + * This operation changes the POA manager to DISCARDING. + * + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void discard_requests(boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + // State change -> DISCARDING + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + if (m_state != State.DISCARDING) { + m_completion.stopWaiting(); + m_state = State.DISCARDING; + m_state_mutex.notifyAll(); + } + } + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); // synchronized + } + } + + /** + * This operation changes the POA manager to DEACTIVATE. + * + * @param etherealize_object + * If it is true, then all objects must be etherealized. + * @param wait_for_completion + * Wait-for-completion flag. + * @exception org.omg.PortableServer.POAManagerPackage.AdapterInactive + * If POA manager state is INACTIVE. + */ + public void deactivate(boolean etherealize_objects, + boolean wait_for_completion) + throws org.omg.PortableServer.POAManagerPackage.AdapterInactive + { + + // State change -> INACTIVE + synchronized (m_state_mutex) { + if (m_state == State.INACTIVE) { + throw new AdapterInactive(); + } + + // reset the last completion waiters + m_completion.stopWaiting(); + + m_pool.deactivation(); + + m_request_queue.deactivation(); + + m_state = State.INACTIVE; + synchronized (m_orb.m_POAManagers) { + for (int i = 0; i < m_orb.m_POAManagers.size(); i++) { + if (m_orb.m_POAManagers.elementAt(i) == this) + m_orb.m_POAManagers.removeElementAt(i); + } + } + } + + // Wait for completion, if necessary + if (wait_for_completion && m_completion.conditionToWait()) { + m_completion.waitForCompletion(); //synchronized + if (etherealize_objects) { + // Etherealize objects (blocking) + etherealizeAllPOAs(); + } + } else if (etherealize_objects) { + // Etherealize in background + EtherealizerThread t = new EtherealizerThread(this); + t.start(); + } + } + + /** + * @return Return the state of the POA manager. + */ + public org.omg.PortableServer.POAManagerPackage.State get_state() + { + return m_state; + } + + /* ************ TIDorb methods - POA Location ************* */ + + /** + * Puts a new request in this POA manager. + * + * @param request + * The request. + */ + public void put(QueuedRequest request) + { + m_request_queue.add(request); + } + + /** + * Removes a POA from this POA manager. + * + * @param poa + * The POA being removed. + */ + protected void removePOA(org.omg.PortableServer.POA poa) + { + m_poas.removeElement(poa); + } + + /** + * Finds a POA in this POA manager. + * + * @param poaName + * The POA name. + */ + protected org.omg.PortableServer.POA findPOA(String poaName) + { + for (int i = 0; i < m_poas.size(); i++) { + org.omg.PortableServer.POA poa = (org.omg.PortableServer.POA) + m_poas.elementAt(i); + if (poa.the_name().equals(poaName)) { + return poa; + } + } + return null; + } + + /** + * Begins the execution of a request. + */ + protected void beginRequest() + { + m_completion.beginRequest(); + } + + /** + * Ends the execution of a request. + */ + protected void endRequest() + { + m_completion.endRequest(); + } + + /** + * Etherealizes all POAs (due to POA manager deactivation). + */ + protected void etherealizeAllPOAs() + { + for (int i = 0; i < m_poas.size(); i++) { + POAImpl poa = (POAImpl) m_poas.elementAt(i); + poa.etherealizeAllObjects(); + } + } + + /** + * Class to etherealize all POAs in background. + */ + public class EtherealizerThread extends Thread + { + + POAManagerImpl poaManager; + + public EtherealizerThread(POAManagerImpl poaManager) + { + this.poaManager = poaManager; + } + + public void run() + { + poaManager.etherealizeAllPOAs(); + } + } + + /* ************ ObjectImpl ************* */ + + public String toString() + { + return m_manager_name; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/PriorityRequestComparator.java b/source/es/tid/TIDorbj/core/poa/PriorityRequestComparator.java new file mode 100644 index 0000000..e1757f6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/PriorityRequestComparator.java @@ -0,0 +1,84 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +import org.omg.Messaging.PriorityRange; +import org.omg.Messaging.RequestPriorityPolicy; + +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Comparator that uses the request priority to decide the order + * in a request queue. In case of simillar priorities, the + * TemporalRequestComparator will be used. + * @author caceres + * + */ +public class PriorityRequestComparator + implements Comparator +{ + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + public final static int DEFAULT_PRIORITY = 0; + + TemporalRequestComparator temporalComparator; + + + /** + * @param policy + */ + public PriorityRequestComparator() + { + temporalComparator = new TemporalRequestComparator(); + } + + protected short getPriority(RequestPriorityPolicy policy) + { + short priority = DEFAULT_PRIORITY; + + + if(policy != null) { + PriorityRange range = policy.priority_range(); + priority = (short) + Math.round((float) (range.max + range.min) / 2.0); + } + + return priority; + } + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + PolicyContext context1 = request1.getPolicyContext(); + PolicyContext context2 = request2.getPolicyContext(); + + RequestPriorityPolicy reqPriority1 = null; + RequestPriorityPolicy reqPriority2 = null; + + if (context1 != null) { + reqPriority1 = context1.getRequestPriorityPolicy(); + } + + if (context2 != null) { + reqPriority2 = context2.getRequestPriorityPolicy(); + } + + short priority1 = getPriority(reqPriority1); + short priority2 = getPriority(reqPriority2); + + + if(priority1 > priority2) { + return LESS_THAN; + } else if(priority1 == priority2) { + + return temporalComparator.compare(o1, o2); + + } else { + return GREATER_THAN; + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/QueueReaderManager.java b/source/es/tid/TIDorbj/core/poa/QueueReaderManager.java new file mode 100644 index 0000000..f3f26ec --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/QueueReaderManager.java @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 8 $ +* Date: $Date: 2006-01-24 17:36:46 +0100 (Tue, 24 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Interface for queue readers that want to be notified of item availability. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public interface QueueReaderManager +{ + + boolean createNewReader(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.java b/source/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.java new file mode 100644 index 0000000..d0321ab --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/QueuedLocateResponseHandler.java @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.core.comm.LocateResponseHandler; + +/** + * @author jprojas + * + * TODO To change the template for this generated type comment go to + * Window - Preferences - Java - Code Style - Code Templates + */ +public abstract class QueuedLocateResponseHandler + extends QueuedResponseHandler + implements LocateResponseHandler { + + private String str; + + public synchronized String toString() { + + if(str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("LocateRequest "); + buffer.append(" to "); + buffer.append(getObjectKey().toString()); + buffer.append(" with order "); + buffer.append(Long.toString(getSerial())); + str = buffer.toString(); + buffer = null; + } + return str; + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/QueuedRequest.java b/source/es/tid/TIDorbj/core/poa/QueuedRequest.java new file mode 100644 index 0000000..f3b4647 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/QueuedRequest.java @@ -0,0 +1,179 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telef?nica Investigaci?n y Desarrollo +* S.A.Unipersonal (Telef?nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + + +import es.tid.TIDorbj.core.comm.ResponseHandler; +import es.tid.TIDorbj.core.policy.PolicyContext; + +/** + * Super class for request that are enqueued for later execution. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public abstract class QueuedRequest implements ResponseHandler +{ + //TODO: Should be removed after refactoring + private POAKey m_poakey; + + private int m_current_child_poa_name_level; + + private boolean m_must_discard = false; + + private org.omg.CORBA.CompletionStatus m_status; + + private POAImpl m_current_poa; + + private PolicyContext m_policy_context; + + private long m_serial; + private short m_priority; + + + //TODO: added by jprojas... + private ResponseHandler responseHandler; + + public QueuedRequest(){ + m_current_child_poa_name_level = 0; + m_poakey = null; + m_status = org.omg.CORBA.CompletionStatus.COMPLETED_NO; + m_current_poa = null; + m_policy_context = null; + m_serial = 0L; + } + + public void setPolicyContext(PolicyContext context) + { + m_policy_context = context; + } + + public PolicyContext getPolicyContext() + { + return m_policy_context; + } + + public void setPriority(short priority) { + m_priority = priority; + } + + public short getPriority () { + return m_priority; + } + + /** + * @param serial the ORB request serial number + */ + public void setSerial(long serial) + { + m_serial = serial; + } + + /** + * @return serial the ORB request serial number + */ + public long getSerial() + { + return m_serial; + } + + + public org.omg.CORBA.CompletionStatus getStatus() { + return m_status; + } + + public void setStatus(org.omg.CORBA.CompletionStatus value) { + if (value != null) { + m_status = value; + } + } + + public void setCurrentPOA( POAImpl currentPOA ){ + this.m_current_poa = currentPOA; + } + + public POAImpl getCurrentPOA() { + return m_current_poa; + } + + //TODO: this method name... igh! + public void nextChildPOA(POAImpl poa) { + m_current_poa = poa; + m_current_child_poa_name_level++; + } + + public String getCurrentChildPOAName() { + return m_poakey.getPOA(m_current_child_poa_name_level); + } + + public void setPOAKey( POAKey key ){ + this.m_poakey = key; + } + + public POAKey getPOAKey() { + return m_poakey; + } + + public OID getOID() { + return m_poakey.getOID(); + } + + public boolean isFinalPOA() { + return m_current_child_poa_name_level >= m_poakey.numberOfPOAs(); + } + + public void setMustDiscard( boolean value ) { + m_must_discard = value; + } + + public boolean getMustDiscard() { + return m_must_discard; + } + + public void destroy() { + //Empty implementation + } + + + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/QueuedResponseHandler.java b/source/es/tid/TIDorbj/core/poa/QueuedResponseHandler.java new file mode 100644 index 0000000..5fa2bbd --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/QueuedResponseHandler.java @@ -0,0 +1,74 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import es.tid.TIDorbj.core.comm.ResponseHandler; + + +/** + * @author jprojas + * + */ +public abstract class QueuedResponseHandler extends QueuedRequest implements + ResponseHandler { + + private String str; + + public synchronized String toString() { + + if(str == null) { + StringBuffer buffer = new StringBuffer(); + buffer.append("ServerRequest "); + buffer.append(this.getServerRequest().operation()); + buffer.append(" to "); + buffer.append(getObjectKey().toString()); + buffer.append(" with order "); + buffer.append(Long.toString(getSerial())); + str = buffer.toString(); + buffer = null; + } + return str; + } + + +} diff --git a/source/es/tid/TIDorbj/core/poa/RequestQueue.java b/source/es/tid/TIDorbj/core/poa/RequestQueue.java new file mode 100644 index 0000000..5888226 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/RequestQueue.java @@ -0,0 +1,181 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 307 $ +* Date: $Date: 2008-10-28 11:06:44 +0100 (Tue, 28 Oct 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; +import java.util.Iterator; +import java.util.TreeSet; + + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.TRANSIENT; + +import es.tid.TIDorbj.util.Trace; + +/** + * Queue of requests to be read by the execution thread. Implements QoS Messaging + * QueueOrderPolicy. + * + * @autor Javier Fdz. Mejuto + * @autor Juan A. Caceres + * @version 2.0 + */ +class RequestQueue { + + // Naive implementation + private TreeSet m_values = null; + + private QueueReaderManager m_queue_read_manager = null; + + private POAManagerImpl m_poa_manager; + + private boolean m_deactivation; + + /** + * Constructor. + * + * @param poaManager + * POAManager to which this RequestQueue belongs. + * @param reader + * Object that manages the creation of new readers for this + * queue. + */ + public RequestQueue(POAManagerImpl poaManager, + QueueReaderManager reader, + Comparator comparator) { + m_values = new TreeSet(comparator); + m_queue_read_manager = reader; + m_poa_manager = poaManager; + m_deactivation = false; + } + + public synchronized void setComparator(Comparator comparator) + { + TreeSet aux = m_values; + m_values = new TreeSet(comparator); + m_values.addAll(aux); + } + + /** + * Adds an new request to the queue. + * + * @param request The request to be added. + */ + synchronized public void add(QueuedRequest request) { + if ( m_deactivation || + m_values.size() >= m_poa_manager.m_conf.getMaxQueuedRequests()) { + TRANSIENT e = new TRANSIENT(null, 1, CompletionStatus.COMPLETED_NO); + if ( m_poa_manager.m_orb.m_trace != null ) { + String[] msg = { toString(), + " Submitting TRANSIENT in request because", + " MaxQueuedRequests ", + Integer.toString(m_poa_manager.m_conf.getMaxQueuedRequests()), + " has been reached" }; + m_poa_manager.m_orb.printTrace(Trace.DEEP_DEBUG, msg); + } + request.submitResponse( e ); + } else { + m_values.add(request); + if (!m_queue_read_manager.createNewReader()) { + notify(); + } + } + } + + /** + * Gets (and removes) the first element of the queue. + * + * @return The first element of the queue. + */ + public synchronized QueuedRequest get() { + if ( m_values.isEmpty() ) { + if (m_deactivation) { + return null; + } else { + try { + wait(m_poa_manager.m_conf.getStarvingTime()); + } catch (InterruptedException ie) {} + if ( m_values.isEmpty() ) { + return null; + } + } + } + //first element out + QueuedRequest req = (QueuedRequest) m_values.first(); + + m_values.remove(req); + + return req; + } + + /** + * @return Number of enqueued elements. + */ + synchronized public int size() { + return m_values.size(); + } + + /** + * Set all request to "discarding". + */ + synchronized public void discardAll() { + + Iterator it = m_values.iterator(); + while (it.hasNext()){ + QueuedRequest req = (QueuedRequest) it.next(); + req.setMustDiscard(true); + } + } + + /** + * The POAManager is being deactivating, notify it to all blocked threads. + */ + + synchronized void deactivation() { + if (!m_deactivation) { + m_deactivation = true; + notifyAll(); + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/ServantDelegate.java b/source/es/tid/TIDorbj/core/poa/ServantDelegate.java new file mode 100644 index 0000000..385d936 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/ServantDelegate.java @@ -0,0 +1,181 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Delegate class for servants. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +public class ServantDelegate + implements org.omg.PortableServer.portable.Delegate +{ + + private org.omg.CORBA.ORB m_orb = null; + + private org.omg.PortableServer.POA m_poa = null; + + private byte[] m_oid = null; + + /** + * Constructor. + * + * @param poa + * The POA. + * @param oid + * The Object Id. + */ + public ServantDelegate(org.omg.PortableServer.POA poa, byte[] oid) + { + this.m_poa = poa; + this.m_orb = ((es.tid.TIDorbj.core.poa.POAImpl) poa).m_orb; + this.m_oid = oid; + } + + /** + * @param self + * The servant. + * @return The ORB. + */ + public org.omg.CORBA.ORB orb(org.omg.PortableServer.Servant self) + { + return this.m_orb; + } + + /** + * @param self + * The servant. + * @return Return an object reference for this servant. + */ + public org.omg.CORBA.Object this_object(org.omg.PortableServer.Servant self) + { + try { + return m_poa.servant_to_reference(self); + } + catch (org.omg.PortableServer.POAPackage.WrongPolicy e) { + return null; + } + catch (org.omg.PortableServer.POAPackage.ServantNotActive e) { + return null; + } + } + + /** + * @param self + * The servant. + * @return This POA. + */ + public org.omg.PortableServer.POA poa(org.omg.PortableServer.Servant self) + { + return this.m_poa; + } + + /** + * @param self + * The servant. + * @return Return the Object Id. + */ + public byte[] object_id(org.omg.PortableServer.Servant self) + { + return m_oid; + } + + /** + * @param self + * The servant. + * @return Return the default POA. + */ + public org.omg.PortableServer.POA + default_POA(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * @param self + * The servant. + * @param repository_id + * The Repository Id. + * @return Return true if the servant is an object with this Repository Id. + */ + public boolean is_a(org.omg.PortableServer.Servant self, + java.lang.String repository_id) + { + String[] reps = self._all_interfaces(m_poa, m_oid); + for (int i = 0; i < reps.length; i++) { + if (repository_id.equals(reps[i])) + return true; + } + return false; + } + + public boolean non_existent(org.omg.PortableServer.Servant self) + { + return false; + } + + public org.omg.CORBA.InterfaceDef + get_interface(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public org.omg.CORBA.Object + get_interface_def(org.omg.PortableServer.Servant self) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Sets object Id (useful for default servants). + * + * @param oid + * The Object Id. + */ + protected void setObjectId(byte[] oid) + { + this.m_oid = oid; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/SystemOID.java b/source/es/tid/TIDorbj/core/poa/SystemOID.java new file mode 100644 index 0000000..b5c95b4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/SystemOID.java @@ -0,0 +1,146 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * System Generated OID. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public class SystemOID extends OID +{ + + private final static int LONG_SIZE = 8; + + private long m_poa_id; + + private long m_serial; + + public SystemOID(long poa_id, long serial) + { + m_poa_id = poa_id; + m_serial = serial; + m_value = new byte[2 * LONG_SIZE]; + write_long(poa_id, m_value, 0); + write_long(serial, m_value, LONG_SIZE); + } + + public SystemOID(long poa_id, long serial, byte[] val) + { + super(val); + this.m_poa_id = poa_id; + this.m_serial = serial; + } + + public SystemOID next() + { + return new SystemOID(m_poa_id, m_serial + 1); + } + + public long getPOAId() + { + return m_poa_id; + } + + public long getSerial() + { + return m_serial; + } + + public static SystemOID fromOID(OID oid) + { + SystemOID other = null; + + try { + other = (SystemOID) oid; + } + catch (ClassCastException cce) { + return fromByteArray(oid.toByteArray()); + } + + return new SystemOID(other.m_poa_id, other.m_serial, other.m_value); + } + + public static SystemOID fromByteArray(byte[] buffer) + { + if ((buffer == null) || (buffer.length != 2 * LONG_SIZE)) + return null; + + long poa_id = read_long(buffer, 0); + + long serial = read_long(buffer, LONG_SIZE); + + return new SystemOID(poa_id, serial, buffer); + } + + public static void write_long(long value, byte[] buffer, int offset) + { + int position = offset; + buffer[position++] = (byte) (value >>> 56); + buffer[position++] = (byte) (value >>> 48); + buffer[position++] = (byte) (value >>> 40); + buffer[position++] = (byte) (value >>> 32); + buffer[position++] = (byte) (value >>> 24); + buffer[position++] = (byte) (value >>> 16); + buffer[position++] = (byte) (value >>> 8); + buffer[position++] = (byte) (value >>> 0); + } + + public static long read_long(byte[] buffer, int offset) + { + + int position = offset; + + return (((long) buffer[position++] & 0xffL) << 56) + | (((long) buffer[position++] & 0xffL) << 48) + | (((long) buffer[position++] & 0xffL) << 40) + | (((long) buffer[position++] & 0xffL) << 32) + | (((long) buffer[position++] & 0xffL) << 24) + | (((long) buffer[position++] & 0xffL) << 16) + | (((long) buffer[position++] & 0xffL) << 8) + | ((long) buffer[position++] & 0xffL); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/TemporalRequestComparator.java b/source/es/tid/TIDorbj/core/poa/TemporalRequestComparator.java new file mode 100644 index 0000000..62cf552 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/TemporalRequestComparator.java @@ -0,0 +1,40 @@ +package es.tid.TIDorbj.core.poa; + +import java.util.Comparator; + +/** + * @author caceres + * + */ +public class TemporalRequestComparator + implements Comparator +{ + + public final static int LESS_THAN = -1; + public final static int EQUALS = 0; + public final static int GREATER_THAN = 1; + + + public TemporalRequestComparator() + { + + } + + public int compare(Object o1, Object o2) + { + QueuedRequest request1 = (QueuedRequest) o1; + QueuedRequest request2 = (QueuedRequest) o2; + + long serial1 = request1.getSerial(); + long serial2 = request2.getSerial(); + + if(serial1 > serial2) { + return GREATER_THAN; + } else if(serial1 == serial2) { + return EQUALS; + } else { + return LESS_THAN; + } + } + +} diff --git a/source/es/tid/TIDorbj/core/poa/ThreadPool.java b/source/es/tid/TIDorbj/core/poa/ThreadPool.java new file mode 100644 index 0000000..3b87bef --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/ThreadPool.java @@ -0,0 +1,190 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +import java.util.Vector; + +import es.tid.TIDorbj.util.Trace; + +/** + * Pool of threads. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +class ThreadPool + implements QueueReaderManager, ThreadStateListener, POAManagerConfListener +{ + + private Vector m_pool = null; + + private POAManagerImpl m_poa_manager = null; + + private int m_used = 0; + + private int m_active = 0; + + private boolean m_deactivated = false; + + /** + * Constructor. + * + * @param poaManager + * The POAManager which this thread pool belongs to. + */ + public ThreadPool(POAManagerImpl poaManager) + { + m_pool = new Vector(); + m_poa_manager = poaManager; + } + + /** + * Test if another thread should be created. + * + * @return Returns true if another thread has been started, false otherwise. + */ + synchronized public boolean createNewReader() + { + if ((m_used == m_active) + &&(m_used < m_poa_manager.m_conf.getMaxThreads())) { + createThread(); + return true; + } + return false; + } + + synchronized private void createThread() + { + ExecThread t = new ExecThread(m_poa_manager); + m_pool.addElement(t); + t.setThreadStateListener(this); + t.setDaemon(false); + t.start(); + m_used++; + + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { "New thread created, ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_poa_manager.m_conf.getMaxThreads()), + " , min ", + Integer.toString(m_poa_manager.m_conf.getMinThreads()), + ")" + }; + m_poa_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + /** + * Counts the number of active threads (increment). + * + * @param t + * Thread that becomes active. + */ + synchronized public void setActive(Thread t) + { + m_active++; + } + + /** + * Counts the number of active threads (decrement). + * + * @param t + * Thread that becomes inactive. + */ + synchronized public void setInactive(Thread t) + { + m_active--; + } + + /** + * Clean up when a thread dies. + * + * @param t + * Thread that has died. + */ + synchronized public void threadHasDied(Thread t) + { + m_pool.removeElement(t); + m_used--; + if (m_poa_manager.m_orb.m_trace != null) { + String[] msg = + { + "Finalization of thread ", + t.toString(), + ": ", + Integer.toString(m_used), + " threads are now actived (max ", + Integer.toString(m_poa_manager.m_conf.getMaxThreads()), + ", min ", + Integer.toString(m_poa_manager.m_conf.getMinThreads()), + ")" + }; + m_poa_manager.m_orb.printTrace(Trace.DEBUG, msg); + } + } + + synchronized public void deactivation() + { + m_deactivated = true; + } + + synchronized public boolean threadCanDie(Thread t) + { + if (m_deactivated) + return true; + else + return (m_used > m_poa_manager.m_conf.getMinThreads()); + } + + synchronized public void minThreadsHasChanged() + { + while (m_used < m_poa_manager.m_conf.getMinThreads()) { + createThread(); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/ThreadStateListener.java b/source/es/tid/TIDorbj/core/poa/ThreadStateListener.java new file mode 100644 index 0000000..f778c7b --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/ThreadStateListener.java @@ -0,0 +1,62 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 8 $ +* Date: $Date: 2006-01-24 17:36:46 +0100 (Tue, 24 Jan 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa; + +/** + * Listener of thread state changes. + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ +interface ThreadStateListener +{ + + boolean threadCanDie(Thread t); + + void threadHasDied(Thread t); + + void setActive(Thread t); + + void setInactive(Thread t); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/all-wcprops b/source/es/tid/TIDorbj/core/poa/policies/.svn/all-wcprops new file mode 100644 index 0000000..75ef143 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/all-wcprops @@ -0,0 +1,47 @@ +K 25 +svn:wc:ra_dav:version-url +V 87 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies +END +ServantRetentionPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 119 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.java +END +ImplicitActivationPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 121 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.java +END +ThreadPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 109 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.java +END +IdAssignmentPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.java +END +LifespanPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.java +END +IdUniquenessPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.java +END +RequestProcessingPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 120 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.java +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/entries b/source/es/tid/TIDorbj/core/poa/policies/.svn/entries new file mode 100644 index 0000000..a256434 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/entries @@ -0,0 +1,266 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/poa/policies +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +LifespanPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +106e55459e08c26ca1c0c1a8a500c397 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2867 + +IdAssignmentPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +0c0fac65bba91480870ba2673946193b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2899 + +RequestProcessingPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +12883c699f49d60430df4e16aae9f089 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2990 + +ThreadPolicyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +71ff661c858d34017fb05f4f7fbf154b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2859 + +ServantRetentionPolicyImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +5d4653973acaa92eb25cfda46fa5b799 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2986 + +IdUniquenessPolicyImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +c21b0927ef6e537e76793774a482e726 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2899 + +ImplicitActivationPolicyImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +bb6a5e2c60b302589de69dfe97e7c152 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3003 + diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdAssignmentPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdAssignmentPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdAssignmentPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdUniquenessPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdUniquenessPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/IdUniquenessPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ImplicitActivationPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ImplicitActivationPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ImplicitActivationPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/LifespanPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/LifespanPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/LifespanPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/RequestProcessingPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/RequestProcessingPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/RequestProcessingPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ServantRetentionPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ServantRetentionPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ServantRetentionPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ThreadPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ThreadPolicyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/prop-base/ThreadPolicyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdAssignmentPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdAssignmentPolicyImpl.java.svn-base new file mode 100644 index 0000000..d60d1ad --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdAssignmentPolicyImpl.java.svn-base @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.IdAssignmentPolicyValue; +import org.omg.PortableServer.IdAssignmentPolicyValueHelper; + +/** + * Implementation of IdAssignmentPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class IdAssignmentPolicyImpl +extends org.omg.PortableServer.IdAssignmentPolicyLocalBase +{ + private IdAssignmentPolicyValue m_value; + + public IdAssignmentPolicyImpl(IdAssignmentPolicyValue value) + { + m_value = value; + } + + public IdAssignmentPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new IdAssignmentPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static IdAssignmentPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + IdAssignmentPolicyValue value = + IdAssignmentPolicyValueHelper.extract(val); + return new IdAssignmentPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdUniquenessPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdUniquenessPolicyImpl.java.svn-base new file mode 100644 index 0000000..b73e2bb --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/IdUniquenessPolicyImpl.java.svn-base @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.IdUniquenessPolicyValue; +import org.omg.PortableServer.IdUniquenessPolicyValueHelper; + +/** + * Implementation of IdUniquenessPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class IdUniquenessPolicyImpl +extends org.omg.PortableServer.IdUniquenessPolicyLocalBase +{ + + private IdUniquenessPolicyValue m_value; + + public IdUniquenessPolicyImpl(IdUniquenessPolicyValue value) + { + m_value = value; + } + + public IdUniquenessPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.ID_UNIQUENESS_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new IdUniquenessPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static IdUniquenessPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + IdUniquenessPolicyValue value = + IdUniquenessPolicyValueHelper.extract(val); + return new IdUniquenessPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ImplicitActivationPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ImplicitActivationPolicyImpl.java.svn-base new file mode 100644 index 0000000..b26bef7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ImplicitActivationPolicyImpl.java.svn-base @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ImplicitActivationPolicyValue; +import org.omg.PortableServer.ImplicitActivationPolicyValueHelper; + +/** + * Implementation of ImplicitActivationPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ImplicitActivationPolicyImpl + extends org.omg.PortableServer.ImplicitActivationPolicyLocalBase +{ + + private ImplicitActivationPolicyValue m_value; + + public ImplicitActivationPolicyImpl(ImplicitActivationPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ImplicitActivationPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.IMPLICIT_ACTIVATION_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ImplicitActivationPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static ImplicitActivationPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + ImplicitActivationPolicyValue value = + ImplicitActivationPolicyValueHelper.extract(val); + return new ImplicitActivationPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/LifespanPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/LifespanPolicyImpl.java.svn-base new file mode 100644 index 0000000..0f3af6d --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/LifespanPolicyImpl.java.svn-base @@ -0,0 +1,99 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.LifespanPolicyValue; +import org.omg.PortableServer.LifespanPolicyValueHelper; + +/** + * Implementation of LifespanPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class LifespanPolicyImpl +extends org.omg.PortableServer.LifespanPolicyLocalBase +{ + + private org.omg.PortableServer.LifespanPolicyValue m_value; + + public LifespanPolicyImpl(org.omg.PortableServer.LifespanPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.LifespanPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.LIFESPAN_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new LifespanPolicyImpl(m_value); + } + + public void destroy() + {} + + public static LifespanPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + LifespanPolicyValue value = LifespanPolicyValueHelper.extract(val); + return new LifespanPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/RequestProcessingPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/RequestProcessingPolicyImpl.java.svn-base new file mode 100644 index 0000000..fff4dfd --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/RequestProcessingPolicyImpl.java.svn-base @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.RequestProcessingPolicyValue; +import org.omg.PortableServer.RequestProcessingPolicyValueHelper; + +/** + * Implementation of RequestProcessingPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class RequestProcessingPolicyImpl +extends org.omg.PortableServer.RequestProcessingPolicyLocalBase +{ + + private RequestProcessingPolicyValue m_value; + + public RequestProcessingPolicyImpl(RequestProcessingPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.RequestProcessingPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.REQUEST_PROCESSING_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RequestProcessingPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RequestProcessingPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + RequestProcessingPolicyValue value = + RequestProcessingPolicyValueHelper.extract(val); + return new RequestProcessingPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ServantRetentionPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ServantRetentionPolicyImpl.java.svn-base new file mode 100644 index 0000000..573564d --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ServantRetentionPolicyImpl.java.svn-base @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ServantRetentionPolicyValue; +import org.omg.PortableServer.ServantRetentionPolicyValueHelper; + +/** + * Implementation of ServantRetentionPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ServantRetentionPolicyImpl +extends org.omg.PortableServer.ServantRetentionPolicyLocalBase +{ + + private ServantRetentionPolicyValue m_value; + + public ServantRetentionPolicyImpl(ServantRetentionPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ServantRetentionPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.SERVANT_RETENTION_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ServantRetentionPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static ServantRetentionPolicyImpl createPolicy (Any val) + throws org.omg.CORBA.PolicyError + { + try { + ServantRetentionPolicyValue value = + ServantRetentionPolicyValueHelper.extract(val); + return new ServantRetentionPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ThreadPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ThreadPolicyImpl.java.svn-base new file mode 100644 index 0000000..fa0733e --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/.svn/text-base/ThreadPolicyImpl.java.svn-base @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ThreadPolicyValue; +import org.omg.PortableServer.ThreadPolicyValueHelper; + +/** + * Implementation of ThreadPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ThreadPolicyImpl +extends org.omg.PortableServer.ThreadPolicyLocalBase +{ + + private org.omg.PortableServer.ThreadPolicyValue m_value; + + public ThreadPolicyImpl(org.omg.PortableServer.ThreadPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ThreadPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.THREAD_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ThreadPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static ThreadPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + ThreadPolicyValue value = ThreadPolicyValueHelper.extract(val); + return new ThreadPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.java new file mode 100644 index 0000000..80d9cc2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/IdAssignmentPolicyImpl.java @@ -0,0 +1,102 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.IdAssignmentPolicyValue; +import org.omg.PortableServer.IdAssignmentPolicyValueHelper; + +/** + * Implementation of IdAssignmentPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class IdAssignmentPolicyImpl +extends org.omg.PortableServer.IdAssignmentPolicyLocalBase +{ + private IdAssignmentPolicyValue m_value; + + public IdAssignmentPolicyImpl(IdAssignmentPolicyValue value) + { + m_value = value; + } + + public IdAssignmentPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new IdAssignmentPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static IdAssignmentPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + IdAssignmentPolicyValue value = + IdAssignmentPolicyValueHelper.extract(val); + return new IdAssignmentPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.java new file mode 100644 index 0000000..a6e8c70 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/IdUniquenessPolicyImpl.java @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.IdUniquenessPolicyValue; +import org.omg.PortableServer.IdUniquenessPolicyValueHelper; + +/** + * Implementation of IdUniquenessPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class IdUniquenessPolicyImpl +extends org.omg.PortableServer.IdUniquenessPolicyLocalBase +{ + + private IdUniquenessPolicyValue m_value; + + public IdUniquenessPolicyImpl(IdUniquenessPolicyValue value) + { + m_value = value; + } + + public IdUniquenessPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.ID_UNIQUENESS_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new IdUniquenessPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static IdUniquenessPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + IdUniquenessPolicyValue value = + IdUniquenessPolicyValueHelper.extract(val); + return new IdUniquenessPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.java new file mode 100644 index 0000000..e47204f --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/ImplicitActivationPolicyImpl.java @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ImplicitActivationPolicyValue; +import org.omg.PortableServer.ImplicitActivationPolicyValueHelper; + +/** + * Implementation of ImplicitActivationPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ImplicitActivationPolicyImpl + extends org.omg.PortableServer.ImplicitActivationPolicyLocalBase +{ + + private ImplicitActivationPolicyValue m_value; + + public ImplicitActivationPolicyImpl(ImplicitActivationPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ImplicitActivationPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.IMPLICIT_ACTIVATION_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ImplicitActivationPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static ImplicitActivationPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + ImplicitActivationPolicyValue value = + ImplicitActivationPolicyValueHelper.extract(val); + return new ImplicitActivationPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.java new file mode 100644 index 0000000..b0c6a2a --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/LifespanPolicyImpl.java @@ -0,0 +1,99 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.LifespanPolicyValue; +import org.omg.PortableServer.LifespanPolicyValueHelper; + +/** + * Implementation of LifespanPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class LifespanPolicyImpl +extends org.omg.PortableServer.LifespanPolicyLocalBase +{ + + private org.omg.PortableServer.LifespanPolicyValue m_value; + + public LifespanPolicyImpl(org.omg.PortableServer.LifespanPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.LifespanPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.LIFESPAN_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new LifespanPolicyImpl(m_value); + } + + public void destroy() + {} + + public static LifespanPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + LifespanPolicyValue value = LifespanPolicyValueHelper.extract(val); + return new LifespanPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.java new file mode 100644 index 0000000..74deb77 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/RequestProcessingPolicyImpl.java @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.RequestProcessingPolicyValue; +import org.omg.PortableServer.RequestProcessingPolicyValueHelper; + +/** + * Implementation of RequestProcessingPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class RequestProcessingPolicyImpl +extends org.omg.PortableServer.RequestProcessingPolicyLocalBase +{ + + private RequestProcessingPolicyValue m_value; + + public RequestProcessingPolicyImpl(RequestProcessingPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.RequestProcessingPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.REQUEST_PROCESSING_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new RequestProcessingPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static RequestProcessingPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError +{ + try { + RequestProcessingPolicyValue value = + RequestProcessingPolicyValueHelper.extract(val); + return new RequestProcessingPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } +} + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.java new file mode 100644 index 0000000..2c6ec4d --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/ServantRetentionPolicyImpl.java @@ -0,0 +1,103 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ServantRetentionPolicyValue; +import org.omg.PortableServer.ServantRetentionPolicyValueHelper; + +/** + * Implementation of ServantRetentionPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ServantRetentionPolicyImpl +extends org.omg.PortableServer.ServantRetentionPolicyLocalBase +{ + + private ServantRetentionPolicyValue m_value; + + public ServantRetentionPolicyImpl(ServantRetentionPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ServantRetentionPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.SERVANT_RETENTION_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ServantRetentionPolicyImpl(m_value); + } + + public void destroy() + { + // do nothing! + } + + public static ServantRetentionPolicyImpl createPolicy (Any val) + throws org.omg.CORBA.PolicyError + { + try { + ServantRetentionPolicyValue value = + ServantRetentionPolicyValueHelper.extract(val); + return new ServantRetentionPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.java b/source/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.java new file mode 100644 index 0000000..cb96de7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/poa/policies/ThreadPolicyImpl.java @@ -0,0 +1,101 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.poa.policies; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.PortableServer.ThreadPolicyValue; +import org.omg.PortableServer.ThreadPolicyValueHelper; + +/** + * Implementation of ThreadPolicy + * + * @autor Javier Fdz. Mejuto + * @version 1.0 + */ + +public class ThreadPolicyImpl +extends org.omg.PortableServer.ThreadPolicyLocalBase +{ + + private org.omg.PortableServer.ThreadPolicyValue m_value; + + public ThreadPolicyImpl(org.omg.PortableServer.ThreadPolicyValue value) + { + m_value = value; + } + + public org.omg.PortableServer.ThreadPolicyValue value() + { + return m_value; + } + + public int policy_type() + { + return org.omg.PortableServer.THREAD_POLICY_ID.value; + } + + public org.omg.CORBA.Policy copy() + { + return new ThreadPolicyImpl(m_value); + } + + public void destroy() + { + //do nothing + } + + public static ThreadPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + ThreadPolicyValue value = ThreadPolicyValueHelper.extract(val); + return new ThreadPolicyImpl(value); + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/.svn/all-wcprops b/source/es/tid/TIDorbj/core/policy/.svn/all-wcprops new file mode 100644 index 0000000..a411bf4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/all-wcprops @@ -0,0 +1,41 @@ +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy +END +PolicyContextManager.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/PolicyContextManager.java +END +PolicyContext.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/PolicyContext.java +END +PolicyCurrentImpl.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.java +END +PolicyFactory.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/PolicyFactory.java +END +UnsuportedPolicy.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/UnsuportedPolicy.java +END +PolicyManagerImpl.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy/PolicyManagerImpl.java +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/entries b/source/es/tid/TIDorbj/core/policy/.svn/entries new file mode 100644 index 0000000..4c40ee2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/entries @@ -0,0 +1,232 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/policy +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +PolicyContextManager.java +file + + + + +2009-05-27T12:24:01.000000Z +cec21e85a94061109b0010e455a57845 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3091 + +PolicyContext.java +file + + + + +2010-04-28T10:50:08.000000Z +21355fc316a921087d74808653b484b9 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +35786 + +PolicyCurrentImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +9f7234a8118abedaf0c06d27ee5b7af5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2667 + +PolicyFactory.java +file + + + + +2010-04-28T11:34:26.000000Z +a1145b06c532d277c640d95dcf41db85 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +9193 + +UnsuportedPolicy.java +file + + + + +2009-05-27T12:24:01.000000Z +b6ad40f637f1f1cebb899829d4dcf274 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +908 + +PolicyManagerImpl.java +file + + + + +2009-05-27T12:24:01.000000Z +b9fcb575f5d1a231a4a23b260e07ff86 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2348 + diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContext.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContext.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContext.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContextManager.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContextManager.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyContextManager.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyCurrentImpl.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyCurrentImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyCurrentImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyFactory.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyFactory.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyFactory.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyManagerImpl.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyManagerImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/PolicyManagerImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/prop-base/UnsuportedPolicy.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/UnsuportedPolicy.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/prop-base/UnsuportedPolicy.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContext.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContext.java.svn-base new file mode 100644 index 0000000..545e962 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContext.java.svn-base @@ -0,0 +1,1054 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.BidirectionalPolicyHelper; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_POLICY; +import org.omg.CORBA.InvalidPolicies; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.CORBA.SetOverrideType; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.Messaging.QueueOrderPolicyHelper; +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_DEADLINE; +import org.omg.Messaging.REBIND_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.Messaging.RebindModeHelper; +import org.omg.Messaging.RebindPolicy; +import org.omg.Messaging.RebindPolicyHelper; +import org.omg.Messaging.TRANSPARENT; +import org.omg.Messaging.NO_REBIND; +import org.omg.Messaging.NO_RECONNECT; +import org.omg.Messaging.RelativeRequestTimeoutPolicy; +import org.omg.Messaging.RelativeRequestTimeoutPolicyHelper; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicy; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicyHelper; +import org.omg.Messaging.RequestEndTimePolicy; +import org.omg.Messaging.RequestEndTimePolicyHelper; +import org.omg.Messaging.RequestPriorityPolicy; +import org.omg.Messaging.RequestPriorityPolicyHelper; +import org.omg.Messaging.RequestStartTimePolicy; +import org.omg.Messaging.RequestStartTimePolicyHelper; +import org.omg.ZIOP.COMPRESSION_ENABLING_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_LOW_VALUE_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_MIN_RATIO_POLICY_ID; +import org.omg.ZIOP.COMPRESSOR_ID_LEVEL_LIST_POLICY_ID; +import org.omg.ZIOP.CompressionEnablingPolicy; +import org.omg.ZIOP.CompressionLowValuePolicy; +import org.omg.ZIOP.CompressionMinRatioPolicy; +import org.omg.ZIOP.CompressorIdLevelListPolicy; +import org.omg.ZIOP.CompressionEnablingPolicyHelper; +import org.omg.ZIOP.CompressionLowValuePolicyHelper; +import org.omg.ZIOP.CompressionMinRatioPolicyHelper; +import org.omg.ZIOP.CompressorIdLevelListPolicyHelper; +import org.omg.ZIOP.CompressionEnablingPolicyValueHelper; +import org.omg.ZIOP.CompressionLowValuePolicyValueHelper; +import org.omg.ZIOP.CompressionMinRatioPolicyValueHelper; +import org.omg.Compression.CompressorIdLevelListHelper; +import org.omg.Compression.CompressorIdLevel; +import es.tid.TIDorbj.core.BidirectionalPolicyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.messaging.QueueOrderPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRequestTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestEndTimePolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestPriorityPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestStartTimePolicyImpl; +import es.tid.TIDorbj.util.UTC; +import es.tid.TIDorbj.core.ziop.CompressionEnablingPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionLowValuePolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionMinRatioPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressorIdLevelListPolicyImpl; + + +public class PolicyContext + +{ + /** + * QoS Policy + */ + BidirectionalPolicy bidirectionalPolicy = null; + RebindPolicy rebindPolicy = null; + RelativeRequestTimeoutPolicy relativeRequestTimeoutPolicy = null; + RelativeRoundtripTimeoutPolicy relativeRoundtripTimeoutPolicy = null; + RequestPriorityPolicy requestPriorityPolicy = null; + RequestStartTimePolicy requestStartTimePolicy = null; + RequestEndTimePolicy requestEndTimePolicy = null; + QueueOrderPolicy queueOrderPolicy = null; + CompressionEnablingPolicy compressionEnablingPolicy = null; + CompressionLowValuePolicy compressionLowValuePolicy = null; + CompressionMinRatioPolicy compressionMinRatioPolicy = null; + CompressorIdLevelListPolicy compressorIdLevelListPolicy = null; + + private PolicyContext m_father_context; + + private int numPolicies; + + + /** + * Constructor. Context may be structured in an hierachy for + * the ORB, reference, request or thread + * + * @param father_context father context (it may be null) + */ + public PolicyContext(PolicyContext father_context) + { + m_father_context = father_context; + bidirectionalPolicy = null; + numPolicies = 0; + + } + + public void setFatherContext(PolicyContext father_context) + { + m_father_context = father_context; + } + + private void clear() + { + bidirectionalPolicy = null; + rebindPolicy = null; + relativeRequestTimeoutPolicy = null; + relativeRoundtripTimeoutPolicy = null; + requestPriorityPolicy = null; + requestStartTimePolicy = null; + requestEndTimePolicy = null; + queueOrderPolicy = null; + compressionEnablingPolicy = null; + compressionLowValuePolicy = null; + compressionMinRatioPolicy = null; + compressorIdLevelListPolicy = null; + } + + + public synchronized void setPolicies(Policy[] policies, + SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + + if (set_add == SetOverrideType.SET_OVERRIDE) { + clear(); + } + + java.util.Vector errors = null; + + for (short i = 0; i < policies.length; i++) { + try { + setPolicy(policies[i]); + } + catch (PolicyError pe) { + if (errors == null) + errors = new java.util.Vector(); + errors.add(new Short(i)); + } + } + + if (errors != null) { + InvalidPolicies ex = new InvalidPolicies(); + + int size = errors.size(); + + ex.indices = new short[size]; + + for (int i = 0; i < size; i++) + ex.indices[i] = ((Short) errors.elementAt(i)).shortValue(); + + throw ex; + } + + } + + public Policy getPolicy(int type) + { + Policy policy = null; + + switch(type) { + + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + policy = getRelativeRequestTimeoutPolicy(); + break; + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + policy = getRelativeRoundtripTimeoutPolicy(); + break; + case REBIND_POLICY_TYPE.value: + policy = getRebindPolicy(); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + policy = getRequestPriorityPolicy(); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + policy = getRequestStartTimePolicy(); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + policy = getRequestEndTimePolicy(); + break; + case QUEUE_ORDER_POLICY_TYPE.value: + policy = getQueueOrderPolicy(); + break; + case BIDIRECTIONAL_POLICY_TYPE.value: + policy = getBidirectionalPolicy(); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + policy = getCompressionEnablingPolicy(); + break; + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + policy = getCompressionLowValuePolicy(); + break; + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + policy = getCompressionMinRatioPolicy(); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + policy = getCompressorIdLevelListPolicy(); + break; + } + + if (policy == null) { + throw new INV_POLICY(); + } else { + return policy; + } + + + + + } + + public Policy[] getPolicies(int[] ts) + { + java.util.Vector list = new java.util.Vector(); + + Policy policy = null; + + for (int i = 0; i < ts.length; i++) { + policy = getPolicy(ts[i]); + if (policy != null) + list.add(policy); + } + + Policy[] result = new Policy[list.size()]; + + list.copyInto(result); + + return result; + + } + + public void setPolicy(Policy policy) + throws PolicyError + { + + if (policy == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + int type = policy.policy_type(); + + switch (type) { + case BIDIRECTIONAL_POLICY_TYPE.value: + bidirectionalPolicy = BidirectionalPolicyHelper.narrow(policy); + break; + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + this.setRelativeRequestTimeoutPolicy(RelativeRequestTimeoutPolicyHelper.narrow(policy)); + break; + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + this.setRelativeRoundtripTimeoutPolicy(RelativeRoundtripTimeoutPolicyHelper.narrow(policy)); + break; + case REBIND_POLICY_TYPE.value: + this.setRebindPolicy(RebindPolicyHelper.narrow(policy)); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + this.setRequestPriorityPolicy(RequestPriorityPolicyHelper.narrow(policy)); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + this.setRequestStartTimePolicy(RequestStartTimePolicyHelper.narrow(policy)); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + this.setRequestEndTimePolicy(RequestEndTimePolicyHelper.narrow(policy)); + break; + case QUEUE_ORDER_POLICY_TYPE.value: + this.setQueueOrderPolicy(QueueOrderPolicyHelper.narrow(policy)); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + this.setCompressionEnablingPolicy(CompressionEnablingPolicyHelper.narrow(policy)); + break; + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + this.setCompressionLowValuePolicy(CompressionLowValuePolicyHelper.narrow(policy)); + break; + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + this.setCompressionMinRatioPolicy(CompressionMinRatioPolicyHelper.narrow(policy)); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + this.setCompressorIdLevelListPolicy(CompressorIdLevelListPolicyHelper.narrow(policy)); + break; + default: + throw new PolicyError(org.omg.CORBA.UNSUPPORTED_POLICY.value); + } + + } + + + /** + * Duplicates completely the PolicyContext. It will be used by Reference + * duplication. + * @return a new PolicyContext + */ + public synchronized PolicyContext duplicate() + { + PolicyContext copy = new PolicyContext(m_father_context); + + copy.bidirectionalPolicy = bidirectionalPolicy; + copy.rebindPolicy = rebindPolicy; + copy.relativeRequestTimeoutPolicy = relativeRequestTimeoutPolicy; + copy.relativeRoundtripTimeoutPolicy = relativeRoundtripTimeoutPolicy; + copy.requestPriorityPolicy = requestPriorityPolicy; + copy.requestStartTimePolicy = requestStartTimePolicy; + copy.requestEndTimePolicy = requestEndTimePolicy; + copy.queueOrderPolicy = queueOrderPolicy; + copy.compressionEnablingPolicy = compressionEnablingPolicy; + copy.compressionLowValuePolicy = compressionLowValuePolicy; + copy.compressionMinRatioPolicy = compressionMinRatioPolicy; + copy.compressorIdLevelListPolicy = compressorIdLevelListPolicy; + + copy.numPolicies = numPolicies; + + return copy; + } + + + /** + * @return Returns the rebindPolicy. + */ + public RebindPolicy getRebindPolicy() + { + if(rebindPolicy != null) { + return rebindPolicy; + } else if(m_father_context != null) { + return m_father_context.getRebindPolicy(); + } else { + return null; + } + } + + + /** + * @param rebindPolicy The rebindPolicy to set. + */ + public void setRebindPolicy(RebindPolicy rebindPolicy) + { + if(this.rebindPolicy == null) { + numPolicies++; + } + if(rebindPolicy == null) { + numPolicies--; + } + + this.rebindPolicy = rebindPolicy; + } + + /** + * @return Returns the relativeRequestTimeoutPolicy. + */ + public RelativeRequestTimeoutPolicy getRelativeRequestTimeoutPolicy() + { + if(relativeRequestTimeoutPolicy != null) { + return relativeRequestTimeoutPolicy; + } else if(m_father_context != null) { + return m_father_context.getRelativeRequestTimeoutPolicy(); + } else { + return null; + } + } + + /** + * @param relativeRequestTimeoutPolicy The relativeRequestTimeoutPolicy to set. + */ + public void + setRelativeRequestTimeoutPolicy(RelativeRequestTimeoutPolicy relativeRequestTimeoutPolicy) + { + if(this.relativeRequestTimeoutPolicy == null) { + numPolicies++; + } + if(relativeRequestTimeoutPolicy == null) { + numPolicies--; + } + + this.relativeRequestTimeoutPolicy = relativeRequestTimeoutPolicy; + } + + /** + * @return Returns the relativeRountripTimeoutPolicy. + */ + public RelativeRoundtripTimeoutPolicy getRelativeRoundtripTimeoutPolicy() + { + if(relativeRoundtripTimeoutPolicy != null) { + return relativeRoundtripTimeoutPolicy; + } else if(m_father_context != null) { + return m_father_context.getRelativeRoundtripTimeoutPolicy(); + } else { + return null; + } + } + + /** + * @param relativeRequestTimeoutPolicy The relativeRequestTimeoutPolicy to set. + */ + public void + setRelativeRoundtripTimeoutPolicy(RelativeRoundtripTimeoutPolicy relativeRoundtripTimeoutPolicy) + { + if(this.relativeRoundtripTimeoutPolicy == null) { + numPolicies++; + } + if(relativeRoundtripTimeoutPolicy == null) { + numPolicies--; + } + + this.relativeRoundtripTimeoutPolicy = relativeRoundtripTimeoutPolicy; + } + + + /** + * @param requestEndTimePolicy The requestEndTimePolicy to set. + */ + public void setRequestEndTimePolicy(RequestEndTimePolicy requestEndTimePolicy) + { + if(this.requestEndTimePolicy == null) { + numPolicies++; + } + if(requestEndTimePolicy == null) { + numPolicies--; + } + + this.requestEndTimePolicy = requestEndTimePolicy; + } + + /** + * @return Returns the requestEndTimePolicy. + */ + public RequestEndTimePolicy getRequestEndTimePolicy() + { + if(requestEndTimePolicy != null) { + return requestEndTimePolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestEndTimePolicy(); + } else { + return null; + } + } + + /** + * @param requestPriorityPolicy The RequestPriorityPolicy to set. + */ + public void setRequestPriorityPolicy(RequestPriorityPolicy requestPriorityPolicy) + { + if(this.requestPriorityPolicy == null) { + numPolicies++; + } + if(requestPriorityPolicy == null) { + numPolicies--; + } + + this.requestPriorityPolicy = requestPriorityPolicy; + } + + /** + * @return Returns the requestPriorityPolicy. + */ + public RequestPriorityPolicy getRequestPriorityPolicy() + { + if(requestPriorityPolicy != null) { + return requestPriorityPolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestPriorityPolicy(); + } else { + return null; + } + } + + /** + * @param requestStartTimePolicy The requestStartTimePolicy to set. + */ + public void setRequestStartTimePolicy( + RequestStartTimePolicy requestStartTimePolicy) + { + if(this.requestStartTimePolicy == null) { + numPolicies++; + } + if(requestStartTimePolicy == null) { + numPolicies--; + } + this.requestStartTimePolicy = requestStartTimePolicy; + } + + /** + * @return Returns the requestStartTimePolicy. + */ + public RequestStartTimePolicy getRequestStartTimePolicy() + { + if(requestStartTimePolicy != null) { + return requestStartTimePolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestStartTimePolicy(); + } else { + return null; + } + } + + + + + + /** + * @return Returns the queueOrderPolicy. + */ + public QueueOrderPolicy getQueueOrderPolicy() + { + if(queueOrderPolicy != null) { + return queueOrderPolicy; + } else if(m_father_context != null) { + return m_father_context.getQueueOrderPolicy(); + } else { + return null; + } + } + + /** + * @param rebindPolicy The queueOrderPolicy to set. + */ + public void setQueueOrderPolicy(QueueOrderPolicy queueOrderPolicy) + { + if(this.queueOrderPolicy == null) { + numPolicies++; + } + if(queueOrderPolicy == null) { + numPolicies--; + } + + this.queueOrderPolicy = queueOrderPolicy; + } + + + + + + /** + * @param priorityModelPolicy The queueOrderPolicy to set. + */ + public void setBidirectionalPolicy(BidirectionalPolicy bidirectionalPolicy) + { + if(this.bidirectionalPolicy == null) { + numPolicies++; + } + if(bidirectionalPolicy == null) { + numPolicies--; + } + + this.bidirectionalPolicy = bidirectionalPolicy; + } + + /** + * @return Returns the queueOrderPolicy. + */ + public BidirectionalPolicy getBidirectionalPolicy() + { + if(bidirectionalPolicy != null) { + return bidirectionalPolicy; + } else if(m_father_context != null) { + return m_father_context.getBidirectionalPolicy(); + } else { + return null; + } + } + + /** + * @param compressionEnablingPolicy The compressionEnablingPolicy to set. + */ + public void setCompressionEnablingPolicy(CompressionEnablingPolicy compressionEnablingPolicy) + { + if(this.compressionEnablingPolicy == null) { + numPolicies++; + } + if(compressionEnablingPolicy == null) { + numPolicies--; + } + + this.compressionEnablingPolicy = compressionEnablingPolicy; + } + + /** + * @return Returns the compressionEnablingPolicy. + */ + public CompressionEnablingPolicy getCompressionEnablingPolicy() + { + if(compressionEnablingPolicy != null) { + return compressionEnablingPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionEnablingPolicy(); + } else { + return null; + } + } + + /** + * @param compressionLowValuePolicy The compressionLowValuePolicy to set. + */ + public void setCompressionLowValuePolicy(CompressionLowValuePolicy compressionLowValuePolicy) + { + if(this.compressionLowValuePolicy == null) { + numPolicies++; + } + if(compressionLowValuePolicy == null) { + numPolicies--; + } + + this.compressionLowValuePolicy = compressionLowValuePolicy; + } + + /** + * @return Returns the compressionLowValuePolicy. + */ + public CompressionLowValuePolicy getCompressionLowValuePolicy() + { + if(compressionLowValuePolicy != null) { + return compressionLowValuePolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionLowValuePolicy(); + } else { + return null; + } + } + + /** + * @param compressionMinRatioPolicy The compressionMinRatioPolicy to set. + */ + public void setCompressionMinRatioPolicy(CompressionMinRatioPolicy compressionMinRatioPolicy) + { + if(this.compressionMinRatioPolicy == null) { + numPolicies++; + } + if(compressionMinRatioPolicy == null) { + numPolicies--; + } + + this.compressionMinRatioPolicy = compressionMinRatioPolicy; + } + + /** + * @return Returns the compressionMinRatioPolicy. + */ + public CompressionMinRatioPolicy getCompressionMinRatioPolicy() + { + if(compressionMinRatioPolicy != null) { + return compressionMinRatioPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionMinRatioPolicy(); + } else { + return null; + } + } + + /** + * @param compressorIdLevelListPolicy The compressorIdLevelListPolicy to set. + */ + public void setCompressorIdLevelListPolicy(CompressorIdLevelListPolicy compressorIdLevelListPolicy) + { + if(this.compressorIdLevelListPolicy == null) { + numPolicies++; + } + if(compressorIdLevelListPolicy == null) { + numPolicies--; + } + + this.compressorIdLevelListPolicy = compressorIdLevelListPolicy; + } + + /** + * @return Returns the compressorIdLevelListPolicy. + */ + public CompressorIdLevelListPolicy getCompressorIdLevelListPolicy() + { + if(compressorIdLevelListPolicy != null) { + return compressorIdLevelListPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressorIdLevelListPolicy(); + } else { + return null; + } + } + + + + public InvocationPoliciesContext getInvocationPolicyServiceContext() + { + RequestEndTimePolicy endPolicy = + QoS.getEffectiveRequestEndTimePolicy(this); + + RequestPriorityPolicy priorityPolicy = getRequestPriorityPolicy(); + + if((endPolicy != null) || (priorityPolicy != null)){ + PolicyContext invocationPolicies = new PolicyContext(null); + if(endPolicy != null) { + invocationPolicies.setRequestEndTimePolicy(endPolicy); + } + if(priorityPolicy != null) { + invocationPolicies.setRequestPriorityPolicy(priorityPolicy); + } + return new InvocationPoliciesContext(invocationPolicies); + } else { + return null; + } + } + + + + + public synchronized void dump(java.io.PrintWriter writer) + { + if(bidirectionalPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(BidirectionalPolicyHelper.id()); + writer.print('='); + short bidir_value = bidirectionalPolicy.value(); + if (bidir_value == org.omg.BiDirPolicy.NORMAL.value) { + writer.print("NORMAL"); + } else { + writer.print("BOTH"); + } + } + + if(relativeRoundtripTimeoutPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RelativeRequestTimeoutPolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + relativeRoundtripTimeoutPolicy.relative_expiry())); + writer.print(" ms."); + } + + if (rebindPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RebindPolicyHelper.id()); + writer.print('='); + short rebind_value = rebindPolicy.rebind_mode(); + switch (rebind_value){ + case org.omg.Messaging.TRANSPARENT.value: + writer.print("TRANSPARENT"); + break; + case org.omg.Messaging.NO_REBIND.value: + writer.print("NO_REBIND"); + break; + case org.omg.Messaging.NO_RECONNECT.value: + writer.print("NO_RECONNECT"); + break; + } + } + + if (relativeRequestTimeoutPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RelativeRequestTimeoutPolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + relativeRequestTimeoutPolicy.relative_expiry())); + writer.print(" ms."); + } + + if (requestPriorityPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestPriorityPolicyHelper.id()); + writer.print('='); + writer.print("[" + requestPriorityPolicy.priority_range().min + "," + + requestPriorityPolicy.priority_range().max + "]"); + } + + if (requestStartTimePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestStartTimePolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + requestStartTimePolicy.start_time().time)); + writer.print(" ms."); + } + + if (requestEndTimePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestEndTimePolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + requestEndTimePolicy.end_time().time)); + writer.print(" ms."); + } + + if (queueOrderPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(QueueOrderPolicyHelper.id()); + writer.print('='); + short value = queueOrderPolicy.allowed_orders(); + switch (value) { + case org.omg.Messaging.ORDER_ANY.value: + writer.print("ORDER_ANY"); + break; + case org.omg.Messaging.ORDER_TEMPORAL.value: + writer.print("ORDER_TEMPORAL"); + break; + case org.omg.Messaging.ORDER_PRIORITY.value: + writer.print("ORDER_PRIORITY"); + break; + case org.omg.Messaging.ORDER_DEADLINE.value: + writer.print("ORDER_DEADLINE"); + break; + } + } + + + if (compressionEnablingPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionEnablingPolicyHelper.id()); + writer.print('='); + writer.print(compressionEnablingPolicy.compression_enabled()); + } + + if (compressionLowValuePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionLowValuePolicyHelper.id()); + writer.print('='); + writer.print(compressionLowValuePolicy.low_value()); + } + + if (compressionMinRatioPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionMinRatioPolicyHelper.id()); + writer.print('='); + writer.print(compressionMinRatioPolicy.ratio()); + } + + if (compressorIdLevelListPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressorIdLevelListPolicyHelper.id()); + writer.print('='); + CompressorIdLevel[] compressors = + compressorIdLevelListPolicy.compressor_ids(); + for (int i=0; i < compressors.length; i++) { + writer.print("(" + compressors[i].compressor_id + "," + + compressors[i].compression_level + ")" ); + } + } + } + + + /** + * Reads the policies as a pair PolicyType/encapsuled policy data + * @param input + */ + public void partialRead(CDRInputStream input) + { + int size = input.read_ulong(); + + Policy policy = null; + for (int i = 0; i< size; i++) { + policy = PolicyFactory.readPolicy(input); + if(policy != null) { + try { + setPolicy(policy); + } + catch (PolicyError e) {//unreachable + } + } + } + } + + /** + * Writes the policies as a pair PolicyType/encalsuled policy data + * @param output the outputstream + */ + public void write(CDROutputStream output) + { + output.write_ulong(numPolicies); + + if(rebindPolicy != null) { + // write PolicyType + output.write_ulong(rebindPolicy.policy_type()); + output.enterEncapsulation(); + RebindModeHelper.write(output, rebindPolicy.rebind_mode()); + output.exitEncapsulation(); + } + + + if(relativeRequestTimeoutPolicy != null) { + // write PolicyType + output.write_ulong(relativeRequestTimeoutPolicy.policy_type()); + output.enterEncapsulation(); + RelativeRequestTimeoutPolicyImpl.write(output,relativeRequestTimeoutPolicy); + output.exitEncapsulation(); + } + + if(relativeRoundtripTimeoutPolicy != null) { + // write PolicyType + output.write_ulong(relativeRoundtripTimeoutPolicy.policy_type()); + output.enterEncapsulation(); + RelativeRoundtripTimeoutPolicyImpl.write(output, + relativeRoundtripTimeoutPolicy); + output.exitEncapsulation(); + } + + if(requestStartTimePolicy != null) { + // write PolicyType + output.write_ulong(requestStartTimePolicy.policy_type()); + output.enterEncapsulation(); + RequestStartTimePolicyImpl.write(output, requestStartTimePolicy); + output.exitEncapsulation(); + } + + if(requestPriorityPolicy != null) { + // write PolicyType + output.write_ulong(requestPriorityPolicy.policy_type()); + output.enterEncapsulation(); + RequestPriorityPolicyImpl.write(output, requestPriorityPolicy); + output.exitEncapsulation(); + } + + if(requestEndTimePolicy != null) { + // write PolicyType + output.write_ulong(requestEndTimePolicy.policy_type()); + // write Encapsulation + output.enterEncapsulation(); + RequestEndTimePolicyImpl.write(output, requestEndTimePolicy); + output.exitEncapsulation(); + } + + if(queueOrderPolicy != null) { + // write PolicyType + output.write_ulong(queueOrderPolicy.policy_type()); + output.enterEncapsulation(); + QueueOrderPolicyImpl.write(output,queueOrderPolicy ); + output.exitEncapsulation(); + } + + if(compressionEnablingPolicy != null) { + // write PolicyType + output.write_ulong(compressionEnablingPolicy.policy_type()); + output.enterEncapsulation(); + CompressionEnablingPolicyImpl.write(output, compressionEnablingPolicy); + output.exitEncapsulation(); + } + + if(compressionLowValuePolicy != null) { + // write PolicyType + output.write_ulong(compressionLowValuePolicy.policy_type()); + output.enterEncapsulation(); + CompressionLowValuePolicyImpl.write(output, compressionLowValuePolicy); + output.exitEncapsulation(); + } + + if(compressionMinRatioPolicy != null) { + // write PolicyType + output.write_ulong(compressionMinRatioPolicy.policy_type()); + output.enterEncapsulation(); + CompressionMinRatioPolicyImpl.write(output, compressionMinRatioPolicy); + output.exitEncapsulation(); + } + + if(compressorIdLevelListPolicy != null) { + // write PolicyType + output.write_ulong(compressorIdLevelListPolicy.policy_type()); + output.enterEncapsulation(); + CompressorIdLevelListPolicyImpl.write(output, compressorIdLevelListPolicy); + output.exitEncapsulation(); + } + + if(this.bidirectionalPolicy != null) { + // write PolicyType + output.write_ulong(bidirectionalPolicy.policy_type()); + output.enterEncapsulation(); + BidirectionalPolicyImpl.write(output,bidirectionalPolicy ); + output.exitEncapsulation(); + } + } + + /** + * @return + */ + public int getSize() + { + return this.numPolicies; + } + + +} diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContextManager.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContextManager.java.svn-base new file mode 100644 index 0000000..9b43a70 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyContextManager.java.svn-base @@ -0,0 +1,107 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import java.util.Hashtable; + +import es.tid.TIDorbj.core.TIDORB; + +public class PolicyContextManager +{ + + public final static int CLEANUP_ROUND = 100; + + TIDORB m_orb; + + Hashtable m_thread_contexts; + + int m_cleanup_round; + + public PolicyContextManager(TIDORB orb) + { + this.m_orb = orb; + m_thread_contexts = new Hashtable(); + + m_cleanup_round = 0; + } + + public synchronized PolicyContext getThreadContext(Thread th) + { + PolicyContext context = (PolicyContext) m_thread_contexts.get(th); + + if (context == null) { + // Thread PolicyContext overrides ORB policies (that is has + // the ORB PolicyContext as father + context = new PolicyContext(m_orb.m_conf.getPolicyContext()); + m_thread_contexts.put(th, context); + + // Start cleaner thread + if ((++m_cleanup_round) > CLEANUP_ROUND) { + m_cleanup_round = 0; + clear_contexts(); + } + } + + return context; + } + + public synchronized PolicyContext tryToGetThreadContext(Thread th) + { + return (PolicyContext) m_thread_contexts.get(th); + } + + private void clear_contexts() + { + Object[] keys = m_thread_contexts.keySet().toArray(); + + Thread th = null; + + for (int i = 0; i < keys.length; i++) { + th = (Thread) keys[i]; + if (!th.isAlive()) + m_thread_contexts.remove(th); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyCurrentImpl.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyCurrentImpl.java.svn-base new file mode 100644 index 0000000..e73b945 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyCurrentImpl.java.svn-base @@ -0,0 +1,86 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyCurrentLocalBase; + +public class PolicyCurrentImpl extends PolicyCurrentLocalBase +{ + + PolicyContextManager m_manager; + + final static Policy[] st_empty_list = {}; + + public PolicyCurrentImpl(PolicyContextManager manager) + { + m_manager = manager; + } + + public org.omg.CORBA.Policy[] get_policy_overrides(int[] ts) + { + PolicyContext context = + m_manager.tryToGetThreadContext(Thread.currentThread()); + + if (context == null) + return st_empty_list; + + return context.getPolicies(ts); + } + + public void set_policy_overrides(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + PolicyContext context = + m_manager.getThreadContext(Thread.currentThread()); + + context.setPolicies(policies, set_add); + } + + public PolicyContext getPolicyContext() + { + return m_manager.tryToGetThreadContext(Thread.currentThread()); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyFactory.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyFactory.java.svn-base new file mode 100644 index 0000000..3418a25 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyFactory.java.svn-base @@ -0,0 +1,220 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.REBIND_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID; +import org.omg.PortableServer.ID_UNIQUENESS_POLICY_ID; +import org.omg.PortableServer.LIFESPAN_POLICY_ID; +import org.omg.PortableServer.REQUEST_PROCESSING_POLICY_ID; +import org.omg.PortableServer.SERVANT_RETENTION_POLICY_ID; +import org.omg.PortableServer.THREAD_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_ENABLING_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_LOW_VALUE_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_MIN_RATIO_POLICY_ID; +import org.omg.ZIOP.COMPRESSOR_ID_LEVEL_LIST_POLICY_ID; + +import es.tid.TIDorbj.core.BidirectionalPolicyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.messaging.QueueOrderPolicyImpl; +import es.tid.TIDorbj.core.messaging.RebindPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRequestTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestEndTimePolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestStartTimePolicyImpl; +import es.tid.TIDorbj.core.poa.policies.IdAssignmentPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.IdUniquenessPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.LifespanPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.RequestProcessingPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.ServantRetentionPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.ThreadPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestPriorityPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionEnablingPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionLowValuePolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionMinRatioPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressorIdLevelListPolicyImpl; + +/** + * Methods used to instantiate ORB policies. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public class PolicyFactory +{ + + + /** + * Attempts to instanciate a CORBA policy. + * + * @param type + * the CORBA policy identifier + * @param val + * the policy value inserted in a Any + * @throws org.omg.CORBA.PolicyError + */ + + public static org.omg.CORBA.Policy createPolicy(int type, Any val) + throws org.omg.CORBA.PolicyError + { + + if (val == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + switch (type) { + case ID_UNIQUENESS_POLICY_ID.value: + return IdUniquenessPolicyImpl.createPolicy(val); + case ID_ASSIGNMENT_POLICY_ID.value: + return IdAssignmentPolicyImpl.createPolicy(val); + case LIFESPAN_POLICY_ID.value: + return LifespanPolicyImpl.createPolicy(val); + case REBIND_POLICY_TYPE.value: + return RebindPolicyImpl.createPolicy(val); + case BIDIRECTIONAL_POLICY_TYPE.value: + return BidirectionalPolicyImpl.createPolicy(val); + case QUEUE_ORDER_POLICY_TYPE.value: + return QueueOrderPolicyImpl.createPolicy(val); + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + return RelativeRequestTimeoutPolicyImpl.createPolicy(val); + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + return RelativeRoundtripTimeoutPolicyImpl.createPolicy(val); + case REQUEST_PROCESSING_POLICY_ID.value: + return RequestProcessingPolicyImpl.createPolicy(val); + case REQUEST_PRIORITY_POLICY_TYPE.value: + return RequestPriorityPolicyImpl.createPolicy(val); + case REQUEST_START_TIME_POLICY_TYPE.value: + return RequestStartTimePolicyImpl.createPolicy(val); + case REQUEST_END_TIME_POLICY_TYPE.value: + return RequestEndTimePolicyImpl.createPolicy(val); + case SERVANT_RETENTION_POLICY_ID.value: + return ServantRetentionPolicyImpl.createPolicy(val); + case THREAD_POLICY_ID.value: + return ThreadPolicyImpl.createPolicy(val); + case COMPRESSION_ENABLING_POLICY_ID.value: + return CompressionEnablingPolicyImpl.createPolicy(val); + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + return CompressionLowValuePolicyImpl.createPolicy(val); + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + return CompressionMinRatioPolicyImpl.createPolicy(val); + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + return CompressorIdLevelListPolicyImpl.createPolicy(val); + default: + throw new PolicyError(org.omg.CORBA.UNSUPPORTED_POLICY.value); + } + + } + + /** + * + * Reads a policy from an INVOCATION_POLICY ServiceContext encapsulation. + * See QoS section: "22.3 Propagation of Messaging QoS" + * + * @param input + * @return + */ + public static Policy readPolicy(CDRInputStream input) + { + int policy_type = input.read_ulong(); + Policy policy = null; + + + switch (policy_type) { + case BIDIRECTIONAL_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = BidirectionalPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestEndTimePolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestStartTimePolicyImpl.read(input); + input.exitEncapsulation(); + break; + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RelativeRequestTimeoutPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestPriorityPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + input.enterEncapsulation(); + policy = CompressionEnablingPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + input.enterEncapsulation(); + policy = CompressorIdLevelListPolicyImpl.read(input); + input.exitEncapsulation(); + break; + default: // policy not supported skip + input.skipEncapsulation(); + return null; + } + + return policy; + } + +} diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyManagerImpl.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyManagerImpl.java.svn-base new file mode 100644 index 0000000..61dd1ce --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/PolicyManagerImpl.java.svn-base @@ -0,0 +1,76 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.CORBA.PolicyManagerLocalBase; + +import es.tid.TIDorbj.core.TIDORB; + +public class PolicyManagerImpl extends PolicyManagerLocalBase +{ + + TIDORB m_orb; + + public PolicyManagerImpl(TIDORB orb) + { + this.m_orb = orb; + } + + public org.omg.CORBA.Policy[] get_policy_overrides(int[] ts) + { + return m_orb.m_conf.getPolicyContext().getPolicies(ts); + } + + public void set_policy_overrides(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + m_orb.m_conf.getPolicyContext().setPolicies(policies, set_add); + } + + public PolicyContext getPolicyContext() + { + return m_orb.m_conf.getPolicyContext(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/.svn/text-base/UnsuportedPolicy.java.svn-base b/source/es/tid/TIDorbj/core/policy/.svn/text-base/UnsuportedPolicy.java.svn-base new file mode 100644 index 0000000..ccbd540 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/.svn/text-base/UnsuportedPolicy.java.svn-base @@ -0,0 +1,56 @@ +package es.tid.TIDorbj.core.policy; + + +import org.omg.CORBA.LocalObject; +import org.omg.CORBA.Policy; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; + + +/** + * @author caceres + * + */ +public class UnsuportedPolicy extends LocalObject + implements Policy +{ + + int type; + Encapsulation value; + + + public int policy_type() + { + return type; + } + + + public Policy copy() + { + return this; + } + + + public void destroy() + { + + } + + public void partialRead(CDRInputStream input) { + value = input.readEncapsulation(); + + } + + public void write(CDROutputStream output) + { + output.write_ulong(type); + if(value != null) { + output.writeEncapsulation(value); + } + } + + + +} diff --git a/source/es/tid/TIDorbj/core/policy/PolicyContext.java b/source/es/tid/TIDorbj/core/policy/PolicyContext.java new file mode 100644 index 0000000..6c51a2a --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/PolicyContext.java @@ -0,0 +1,1054 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE; +import org.omg.BiDirPolicy.BidirectionalPolicy; +import org.omg.BiDirPolicy.BidirectionalPolicyHelper; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INV_POLICY; +import org.omg.CORBA.InvalidPolicies; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.CORBA.SetOverrideType; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.QueueOrderPolicy; +import org.omg.Messaging.QueueOrderPolicyHelper; +import org.omg.Messaging.ORDER_ANY; +import org.omg.Messaging.ORDER_TEMPORAL; +import org.omg.Messaging.ORDER_PRIORITY; +import org.omg.Messaging.ORDER_DEADLINE; +import org.omg.Messaging.REBIND_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.Messaging.RebindModeHelper; +import org.omg.Messaging.RebindPolicy; +import org.omg.Messaging.RebindPolicyHelper; +import org.omg.Messaging.TRANSPARENT; +import org.omg.Messaging.NO_REBIND; +import org.omg.Messaging.NO_RECONNECT; +import org.omg.Messaging.RelativeRequestTimeoutPolicy; +import org.omg.Messaging.RelativeRequestTimeoutPolicyHelper; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicy; +import org.omg.Messaging.RelativeRoundtripTimeoutPolicyHelper; +import org.omg.Messaging.RequestEndTimePolicy; +import org.omg.Messaging.RequestEndTimePolicyHelper; +import org.omg.Messaging.RequestPriorityPolicy; +import org.omg.Messaging.RequestPriorityPolicyHelper; +import org.omg.Messaging.RequestStartTimePolicy; +import org.omg.Messaging.RequestStartTimePolicyHelper; +import org.omg.ZIOP.COMPRESSION_ENABLING_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_LOW_VALUE_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_MIN_RATIO_POLICY_ID; +import org.omg.ZIOP.COMPRESSOR_ID_LEVEL_LIST_POLICY_ID; +import org.omg.ZIOP.CompressionEnablingPolicy; +import org.omg.ZIOP.CompressionLowValuePolicy; +import org.omg.ZIOP.CompressionMinRatioPolicy; +import org.omg.ZIOP.CompressorIdLevelListPolicy; +import org.omg.ZIOP.CompressionEnablingPolicyHelper; +import org.omg.ZIOP.CompressionLowValuePolicyHelper; +import org.omg.ZIOP.CompressionMinRatioPolicyHelper; +import org.omg.ZIOP.CompressorIdLevelListPolicyHelper; +import org.omg.ZIOP.CompressionEnablingPolicyValueHelper; +import org.omg.ZIOP.CompressionLowValuePolicyValueHelper; +import org.omg.ZIOP.CompressionMinRatioPolicyValueHelper; +import org.omg.Compression.CompressorIdLevelListHelper; +import org.omg.Compression.CompressorIdLevel; +import es.tid.TIDorbj.core.BidirectionalPolicyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.comm.giop.InvocationPoliciesContext; +import es.tid.TIDorbj.core.messaging.QoS; +import es.tid.TIDorbj.core.messaging.QueueOrderPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRequestTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestEndTimePolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestPriorityPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestStartTimePolicyImpl; +import es.tid.TIDorbj.util.UTC; +import es.tid.TIDorbj.core.ziop.CompressionEnablingPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionLowValuePolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionMinRatioPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressorIdLevelListPolicyImpl; + + +public class PolicyContext + +{ + /** + * QoS Policy + */ + BidirectionalPolicy bidirectionalPolicy = null; + RebindPolicy rebindPolicy = null; + RelativeRequestTimeoutPolicy relativeRequestTimeoutPolicy = null; + RelativeRoundtripTimeoutPolicy relativeRoundtripTimeoutPolicy = null; + RequestPriorityPolicy requestPriorityPolicy = null; + RequestStartTimePolicy requestStartTimePolicy = null; + RequestEndTimePolicy requestEndTimePolicy = null; + QueueOrderPolicy queueOrderPolicy = null; + CompressionEnablingPolicy compressionEnablingPolicy = null; + CompressionLowValuePolicy compressionLowValuePolicy = null; + CompressionMinRatioPolicy compressionMinRatioPolicy = null; + CompressorIdLevelListPolicy compressorIdLevelListPolicy = null; + + private PolicyContext m_father_context; + + private int numPolicies; + + + /** + * Constructor. Context may be structured in an hierachy for + * the ORB, reference, request or thread + * + * @param father_context father context (it may be null) + */ + public PolicyContext(PolicyContext father_context) + { + m_father_context = father_context; + bidirectionalPolicy = null; + numPolicies = 0; + + } + + public void setFatherContext(PolicyContext father_context) + { + m_father_context = father_context; + } + + private void clear() + { + bidirectionalPolicy = null; + rebindPolicy = null; + relativeRequestTimeoutPolicy = null; + relativeRoundtripTimeoutPolicy = null; + requestPriorityPolicy = null; + requestStartTimePolicy = null; + requestEndTimePolicy = null; + queueOrderPolicy = null; + compressionEnablingPolicy = null; + compressionLowValuePolicy = null; + compressionMinRatioPolicy = null; + compressorIdLevelListPolicy = null; + } + + + public synchronized void setPolicies(Policy[] policies, + SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + + if (set_add == SetOverrideType.SET_OVERRIDE) { + clear(); + } + + java.util.Vector errors = null; + + for (short i = 0; i < policies.length; i++) { + try { + setPolicy(policies[i]); + } + catch (PolicyError pe) { + if (errors == null) + errors = new java.util.Vector(); + errors.add(new Short(i)); + } + } + + if (errors != null) { + InvalidPolicies ex = new InvalidPolicies(); + + int size = errors.size(); + + ex.indices = new short[size]; + + for (int i = 0; i < size; i++) + ex.indices[i] = ((Short) errors.elementAt(i)).shortValue(); + + throw ex; + } + + } + + public Policy getPolicy(int type) + { + Policy policy = null; + + switch(type) { + + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + policy = getRelativeRequestTimeoutPolicy(); + break; + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + policy = getRelativeRoundtripTimeoutPolicy(); + break; + case REBIND_POLICY_TYPE.value: + policy = getRebindPolicy(); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + policy = getRequestPriorityPolicy(); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + policy = getRequestStartTimePolicy(); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + policy = getRequestEndTimePolicy(); + break; + case QUEUE_ORDER_POLICY_TYPE.value: + policy = getQueueOrderPolicy(); + break; + case BIDIRECTIONAL_POLICY_TYPE.value: + policy = getBidirectionalPolicy(); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + policy = getCompressionEnablingPolicy(); + break; + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + policy = getCompressionLowValuePolicy(); + break; + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + policy = getCompressionMinRatioPolicy(); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + policy = getCompressorIdLevelListPolicy(); + break; + } + + if (policy == null) { + throw new INV_POLICY(); + } else { + return policy; + } + + + + + } + + public Policy[] getPolicies(int[] ts) + { + java.util.Vector list = new java.util.Vector(); + + Policy policy = null; + + for (int i = 0; i < ts.length; i++) { + policy = getPolicy(ts[i]); + if (policy != null) + list.add(policy); + } + + Policy[] result = new Policy[list.size()]; + + list.copyInto(result); + + return result; + + } + + public void setPolicy(Policy policy) + throws PolicyError + { + + if (policy == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + int type = policy.policy_type(); + + switch (type) { + case BIDIRECTIONAL_POLICY_TYPE.value: + bidirectionalPolicy = BidirectionalPolicyHelper.narrow(policy); + break; + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + this.setRelativeRequestTimeoutPolicy(RelativeRequestTimeoutPolicyHelper.narrow(policy)); + break; + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + this.setRelativeRoundtripTimeoutPolicy(RelativeRoundtripTimeoutPolicyHelper.narrow(policy)); + break; + case REBIND_POLICY_TYPE.value: + this.setRebindPolicy(RebindPolicyHelper.narrow(policy)); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + this.setRequestPriorityPolicy(RequestPriorityPolicyHelper.narrow(policy)); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + this.setRequestStartTimePolicy(RequestStartTimePolicyHelper.narrow(policy)); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + this.setRequestEndTimePolicy(RequestEndTimePolicyHelper.narrow(policy)); + break; + case QUEUE_ORDER_POLICY_TYPE.value: + this.setQueueOrderPolicy(QueueOrderPolicyHelper.narrow(policy)); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + this.setCompressionEnablingPolicy(CompressionEnablingPolicyHelper.narrow(policy)); + break; + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + this.setCompressionLowValuePolicy(CompressionLowValuePolicyHelper.narrow(policy)); + break; + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + this.setCompressionMinRatioPolicy(CompressionMinRatioPolicyHelper.narrow(policy)); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + this.setCompressorIdLevelListPolicy(CompressorIdLevelListPolicyHelper.narrow(policy)); + break; + default: + throw new PolicyError(org.omg.CORBA.UNSUPPORTED_POLICY.value); + } + + } + + + /** + * Duplicates completely the PolicyContext. It will be used by Reference + * duplication. + * @return a new PolicyContext + */ + public synchronized PolicyContext duplicate() + { + PolicyContext copy = new PolicyContext(m_father_context); + + copy.bidirectionalPolicy = bidirectionalPolicy; + copy.rebindPolicy = rebindPolicy; + copy.relativeRequestTimeoutPolicy = relativeRequestTimeoutPolicy; + copy.relativeRoundtripTimeoutPolicy = relativeRoundtripTimeoutPolicy; + copy.requestPriorityPolicy = requestPriorityPolicy; + copy.requestStartTimePolicy = requestStartTimePolicy; + copy.requestEndTimePolicy = requestEndTimePolicy; + copy.queueOrderPolicy = queueOrderPolicy; + copy.compressionEnablingPolicy = compressionEnablingPolicy; + copy.compressionLowValuePolicy = compressionLowValuePolicy; + copy.compressionMinRatioPolicy = compressionMinRatioPolicy; + copy.compressorIdLevelListPolicy = compressorIdLevelListPolicy; + + copy.numPolicies = numPolicies; + + return copy; + } + + + /** + * @return Returns the rebindPolicy. + */ + public RebindPolicy getRebindPolicy() + { + if(rebindPolicy != null) { + return rebindPolicy; + } else if(m_father_context != null) { + return m_father_context.getRebindPolicy(); + } else { + return null; + } + } + + + /** + * @param rebindPolicy The rebindPolicy to set. + */ + public void setRebindPolicy(RebindPolicy rebindPolicy) + { + if(this.rebindPolicy == null) { + numPolicies++; + } + if(rebindPolicy == null) { + numPolicies--; + } + + this.rebindPolicy = rebindPolicy; + } + + /** + * @return Returns the relativeRequestTimeoutPolicy. + */ + public RelativeRequestTimeoutPolicy getRelativeRequestTimeoutPolicy() + { + if(relativeRequestTimeoutPolicy != null) { + return relativeRequestTimeoutPolicy; + } else if(m_father_context != null) { + return m_father_context.getRelativeRequestTimeoutPolicy(); + } else { + return null; + } + } + + /** + * @param relativeRequestTimeoutPolicy The relativeRequestTimeoutPolicy to set. + */ + public void + setRelativeRequestTimeoutPolicy(RelativeRequestTimeoutPolicy relativeRequestTimeoutPolicy) + { + if(this.relativeRequestTimeoutPolicy == null) { + numPolicies++; + } + if(relativeRequestTimeoutPolicy == null) { + numPolicies--; + } + + this.relativeRequestTimeoutPolicy = relativeRequestTimeoutPolicy; + } + + /** + * @return Returns the relativeRountripTimeoutPolicy. + */ + public RelativeRoundtripTimeoutPolicy getRelativeRoundtripTimeoutPolicy() + { + if(relativeRoundtripTimeoutPolicy != null) { + return relativeRoundtripTimeoutPolicy; + } else if(m_father_context != null) { + return m_father_context.getRelativeRoundtripTimeoutPolicy(); + } else { + return null; + } + } + + /** + * @param relativeRequestTimeoutPolicy The relativeRequestTimeoutPolicy to set. + */ + public void + setRelativeRoundtripTimeoutPolicy(RelativeRoundtripTimeoutPolicy relativeRoundtripTimeoutPolicy) + { + if(this.relativeRoundtripTimeoutPolicy == null) { + numPolicies++; + } + if(relativeRoundtripTimeoutPolicy == null) { + numPolicies--; + } + + this.relativeRoundtripTimeoutPolicy = relativeRoundtripTimeoutPolicy; + } + + + /** + * @param requestEndTimePolicy The requestEndTimePolicy to set. + */ + public void setRequestEndTimePolicy(RequestEndTimePolicy requestEndTimePolicy) + { + if(this.requestEndTimePolicy == null) { + numPolicies++; + } + if(requestEndTimePolicy == null) { + numPolicies--; + } + + this.requestEndTimePolicy = requestEndTimePolicy; + } + + /** + * @return Returns the requestEndTimePolicy. + */ + public RequestEndTimePolicy getRequestEndTimePolicy() + { + if(requestEndTimePolicy != null) { + return requestEndTimePolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestEndTimePolicy(); + } else { + return null; + } + } + + /** + * @param requestPriorityPolicy The RequestPriorityPolicy to set. + */ + public void setRequestPriorityPolicy(RequestPriorityPolicy requestPriorityPolicy) + { + if(this.requestPriorityPolicy == null) { + numPolicies++; + } + if(requestPriorityPolicy == null) { + numPolicies--; + } + + this.requestPriorityPolicy = requestPriorityPolicy; + } + + /** + * @return Returns the requestPriorityPolicy. + */ + public RequestPriorityPolicy getRequestPriorityPolicy() + { + if(requestPriorityPolicy != null) { + return requestPriorityPolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestPriorityPolicy(); + } else { + return null; + } + } + + /** + * @param requestStartTimePolicy The requestStartTimePolicy to set. + */ + public void setRequestStartTimePolicy( + RequestStartTimePolicy requestStartTimePolicy) + { + if(this.requestStartTimePolicy == null) { + numPolicies++; + } + if(requestStartTimePolicy == null) { + numPolicies--; + } + this.requestStartTimePolicy = requestStartTimePolicy; + } + + /** + * @return Returns the requestStartTimePolicy. + */ + public RequestStartTimePolicy getRequestStartTimePolicy() + { + if(requestStartTimePolicy != null) { + return requestStartTimePolicy; + } else if(m_father_context != null) { + return m_father_context.getRequestStartTimePolicy(); + } else { + return null; + } + } + + + + + + /** + * @return Returns the queueOrderPolicy. + */ + public QueueOrderPolicy getQueueOrderPolicy() + { + if(queueOrderPolicy != null) { + return queueOrderPolicy; + } else if(m_father_context != null) { + return m_father_context.getQueueOrderPolicy(); + } else { + return null; + } + } + + /** + * @param rebindPolicy The queueOrderPolicy to set. + */ + public void setQueueOrderPolicy(QueueOrderPolicy queueOrderPolicy) + { + if(this.queueOrderPolicy == null) { + numPolicies++; + } + if(queueOrderPolicy == null) { + numPolicies--; + } + + this.queueOrderPolicy = queueOrderPolicy; + } + + + + + + /** + * @param priorityModelPolicy The queueOrderPolicy to set. + */ + public void setBidirectionalPolicy(BidirectionalPolicy bidirectionalPolicy) + { + if(this.bidirectionalPolicy == null) { + numPolicies++; + } + if(bidirectionalPolicy == null) { + numPolicies--; + } + + this.bidirectionalPolicy = bidirectionalPolicy; + } + + /** + * @return Returns the queueOrderPolicy. + */ + public BidirectionalPolicy getBidirectionalPolicy() + { + if(bidirectionalPolicy != null) { + return bidirectionalPolicy; + } else if(m_father_context != null) { + return m_father_context.getBidirectionalPolicy(); + } else { + return null; + } + } + + /** + * @param compressionEnablingPolicy The compressionEnablingPolicy to set. + */ + public void setCompressionEnablingPolicy(CompressionEnablingPolicy compressionEnablingPolicy) + { + if(this.compressionEnablingPolicy == null) { + numPolicies++; + } + if(compressionEnablingPolicy == null) { + numPolicies--; + } + + this.compressionEnablingPolicy = compressionEnablingPolicy; + } + + /** + * @return Returns the compressionEnablingPolicy. + */ + public CompressionEnablingPolicy getCompressionEnablingPolicy() + { + if(compressionEnablingPolicy != null) { + return compressionEnablingPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionEnablingPolicy(); + } else { + return null; + } + } + + /** + * @param compressionLowValuePolicy The compressionLowValuePolicy to set. + */ + public void setCompressionLowValuePolicy(CompressionLowValuePolicy compressionLowValuePolicy) + { + if(this.compressionLowValuePolicy == null) { + numPolicies++; + } + if(compressionLowValuePolicy == null) { + numPolicies--; + } + + this.compressionLowValuePolicy = compressionLowValuePolicy; + } + + /** + * @return Returns the compressionLowValuePolicy. + */ + public CompressionLowValuePolicy getCompressionLowValuePolicy() + { + if(compressionLowValuePolicy != null) { + return compressionLowValuePolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionLowValuePolicy(); + } else { + return null; + } + } + + /** + * @param compressionMinRatioPolicy The compressionMinRatioPolicy to set. + */ + public void setCompressionMinRatioPolicy(CompressionMinRatioPolicy compressionMinRatioPolicy) + { + if(this.compressionMinRatioPolicy == null) { + numPolicies++; + } + if(compressionMinRatioPolicy == null) { + numPolicies--; + } + + this.compressionMinRatioPolicy = compressionMinRatioPolicy; + } + + /** + * @return Returns the compressionMinRatioPolicy. + */ + public CompressionMinRatioPolicy getCompressionMinRatioPolicy() + { + if(compressionMinRatioPolicy != null) { + return compressionMinRatioPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressionMinRatioPolicy(); + } else { + return null; + } + } + + /** + * @param compressorIdLevelListPolicy The compressorIdLevelListPolicy to set. + */ + public void setCompressorIdLevelListPolicy(CompressorIdLevelListPolicy compressorIdLevelListPolicy) + { + if(this.compressorIdLevelListPolicy == null) { + numPolicies++; + } + if(compressorIdLevelListPolicy == null) { + numPolicies--; + } + + this.compressorIdLevelListPolicy = compressorIdLevelListPolicy; + } + + /** + * @return Returns the compressorIdLevelListPolicy. + */ + public CompressorIdLevelListPolicy getCompressorIdLevelListPolicy() + { + if(compressorIdLevelListPolicy != null) { + return compressorIdLevelListPolicy; + } else if(m_father_context != null) { + return m_father_context.getCompressorIdLevelListPolicy(); + } else { + return null; + } + } + + + + public InvocationPoliciesContext getInvocationPolicyServiceContext() + { + RequestEndTimePolicy endPolicy = + QoS.getEffectiveRequestEndTimePolicy(this); + + RequestPriorityPolicy priorityPolicy = getRequestPriorityPolicy(); + + if((endPolicy != null) || (priorityPolicy != null)){ + PolicyContext invocationPolicies = new PolicyContext(null); + if(endPolicy != null) { + invocationPolicies.setRequestEndTimePolicy(endPolicy); + } + if(priorityPolicy != null) { + invocationPolicies.setRequestPriorityPolicy(priorityPolicy); + } + return new InvocationPoliciesContext(invocationPolicies); + } else { + return null; + } + } + + + + + public synchronized void dump(java.io.PrintWriter writer) + { + if(bidirectionalPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(BidirectionalPolicyHelper.id()); + writer.print('='); + short bidir_value = bidirectionalPolicy.value(); + if (bidir_value == org.omg.BiDirPolicy.NORMAL.value) { + writer.print("NORMAL"); + } else { + writer.print("BOTH"); + } + } + + if(relativeRoundtripTimeoutPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RelativeRequestTimeoutPolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + relativeRoundtripTimeoutPolicy.relative_expiry())); + writer.print(" ms."); + } + + if (rebindPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RebindPolicyHelper.id()); + writer.print('='); + short rebind_value = rebindPolicy.rebind_mode(); + switch (rebind_value){ + case org.omg.Messaging.TRANSPARENT.value: + writer.print("TRANSPARENT"); + break; + case org.omg.Messaging.NO_REBIND.value: + writer.print("NO_REBIND"); + break; + case org.omg.Messaging.NO_RECONNECT.value: + writer.print("NO_RECONNECT"); + break; + } + } + + if (relativeRequestTimeoutPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RelativeRequestTimeoutPolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + relativeRequestTimeoutPolicy.relative_expiry())); + writer.print(" ms."); + } + + if (requestPriorityPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestPriorityPolicyHelper.id()); + writer.print('='); + writer.print("[" + requestPriorityPolicy.priority_range().min + "," + + requestPriorityPolicy.priority_range().max + "]"); + } + + if (requestStartTimePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestStartTimePolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + requestStartTimePolicy.start_time().time)); + writer.print(" ms."); + } + + if (requestEndTimePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(RequestEndTimePolicyHelper.id()); + writer.print('='); + writer.print(UTC.toTimeInMillis( + requestEndTimePolicy.end_time().time)); + writer.print(" ms."); + } + + if (queueOrderPolicy != null) { + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(QueueOrderPolicyHelper.id()); + writer.print('='); + short value = queueOrderPolicy.allowed_orders(); + switch (value) { + case org.omg.Messaging.ORDER_ANY.value: + writer.print("ORDER_ANY"); + break; + case org.omg.Messaging.ORDER_TEMPORAL.value: + writer.print("ORDER_TEMPORAL"); + break; + case org.omg.Messaging.ORDER_PRIORITY.value: + writer.print("ORDER_PRIORITY"); + break; + case org.omg.Messaging.ORDER_DEADLINE.value: + writer.print("ORDER_DEADLINE"); + break; + } + } + + + if (compressionEnablingPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionEnablingPolicyHelper.id()); + writer.print('='); + writer.print(compressionEnablingPolicy.compression_enabled()); + } + + if (compressionLowValuePolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionLowValuePolicyHelper.id()); + writer.print('='); + writer.print(compressionLowValuePolicy.low_value()); + } + + if (compressionMinRatioPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressionMinRatioPolicyHelper.id()); + writer.print('='); + writer.print(compressionMinRatioPolicy.ratio()); + } + + if (compressorIdLevelListPolicy != null){ + writer.print('\n'); + writer.print('\t'); + writer.print('\t'); + writer.print(CompressorIdLevelListPolicyHelper.id()); + writer.print('='); + CompressorIdLevel[] compressors = + compressorIdLevelListPolicy.compressor_ids(); + for (int i=0; i < compressors.length; i++) { + writer.print("(" + compressors[i].compressor_id + "," + + compressors[i].compression_level + ")" ); + } + } + } + + + /** + * Reads the policies as a pair PolicyType/encapsuled policy data + * @param input + */ + public void partialRead(CDRInputStream input) + { + int size = input.read_ulong(); + + Policy policy = null; + for (int i = 0; i< size; i++) { + policy = PolicyFactory.readPolicy(input); + if(policy != null) { + try { + setPolicy(policy); + } + catch (PolicyError e) {//unreachable + } + } + } + } + + /** + * Writes the policies as a pair PolicyType/encalsuled policy data + * @param output the outputstream + */ + public void write(CDROutputStream output) + { + output.write_ulong(numPolicies); + + if(rebindPolicy != null) { + // write PolicyType + output.write_ulong(rebindPolicy.policy_type()); + output.enterEncapsulation(); + RebindModeHelper.write(output, rebindPolicy.rebind_mode()); + output.exitEncapsulation(); + } + + + if(relativeRequestTimeoutPolicy != null) { + // write PolicyType + output.write_ulong(relativeRequestTimeoutPolicy.policy_type()); + output.enterEncapsulation(); + RelativeRequestTimeoutPolicyImpl.write(output,relativeRequestTimeoutPolicy); + output.exitEncapsulation(); + } + + if(relativeRoundtripTimeoutPolicy != null) { + // write PolicyType + output.write_ulong(relativeRoundtripTimeoutPolicy.policy_type()); + output.enterEncapsulation(); + RelativeRoundtripTimeoutPolicyImpl.write(output, + relativeRoundtripTimeoutPolicy); + output.exitEncapsulation(); + } + + if(requestStartTimePolicy != null) { + // write PolicyType + output.write_ulong(requestStartTimePolicy.policy_type()); + output.enterEncapsulation(); + RequestStartTimePolicyImpl.write(output, requestStartTimePolicy); + output.exitEncapsulation(); + } + + if(requestPriorityPolicy != null) { + // write PolicyType + output.write_ulong(requestPriorityPolicy.policy_type()); + output.enterEncapsulation(); + RequestPriorityPolicyImpl.write(output, requestPriorityPolicy); + output.exitEncapsulation(); + } + + if(requestEndTimePolicy != null) { + // write PolicyType + output.write_ulong(requestEndTimePolicy.policy_type()); + // write Encapsulation + output.enterEncapsulation(); + RequestEndTimePolicyImpl.write(output, requestEndTimePolicy); + output.exitEncapsulation(); + } + + if(queueOrderPolicy != null) { + // write PolicyType + output.write_ulong(queueOrderPolicy.policy_type()); + output.enterEncapsulation(); + QueueOrderPolicyImpl.write(output,queueOrderPolicy ); + output.exitEncapsulation(); + } + + if(compressionEnablingPolicy != null) { + // write PolicyType + output.write_ulong(compressionEnablingPolicy.policy_type()); + output.enterEncapsulation(); + CompressionEnablingPolicyImpl.write(output, compressionEnablingPolicy); + output.exitEncapsulation(); + } + + if(compressionLowValuePolicy != null) { + // write PolicyType + output.write_ulong(compressionLowValuePolicy.policy_type()); + output.enterEncapsulation(); + CompressionLowValuePolicyImpl.write(output, compressionLowValuePolicy); + output.exitEncapsulation(); + } + + if(compressionMinRatioPolicy != null) { + // write PolicyType + output.write_ulong(compressionMinRatioPolicy.policy_type()); + output.enterEncapsulation(); + CompressionMinRatioPolicyImpl.write(output, compressionMinRatioPolicy); + output.exitEncapsulation(); + } + + if(compressorIdLevelListPolicy != null) { + // write PolicyType + output.write_ulong(compressorIdLevelListPolicy.policy_type()); + output.enterEncapsulation(); + CompressorIdLevelListPolicyImpl.write(output, compressorIdLevelListPolicy); + output.exitEncapsulation(); + } + + if(this.bidirectionalPolicy != null) { + // write PolicyType + output.write_ulong(bidirectionalPolicy.policy_type()); + output.enterEncapsulation(); + BidirectionalPolicyImpl.write(output,bidirectionalPolicy ); + output.exitEncapsulation(); + } + } + + /** + * @return + */ + public int getSize() + { + return this.numPolicies; + } + + +} diff --git a/source/es/tid/TIDorbj/core/policy/PolicyContextManager.java b/source/es/tid/TIDorbj/core/policy/PolicyContextManager.java new file mode 100644 index 0000000..d08b6f8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/PolicyContextManager.java @@ -0,0 +1,107 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import java.util.Hashtable; + +import es.tid.TIDorbj.core.TIDORB; + +public class PolicyContextManager +{ + + public final static int CLEANUP_ROUND = 100; + + TIDORB m_orb; + + Hashtable m_thread_contexts; + + int m_cleanup_round; + + public PolicyContextManager(TIDORB orb) + { + this.m_orb = orb; + m_thread_contexts = new Hashtable(); + + m_cleanup_round = 0; + } + + public synchronized PolicyContext getThreadContext(Thread th) + { + PolicyContext context = (PolicyContext) m_thread_contexts.get(th); + + if (context == null) { + // Thread PolicyContext overrides ORB policies (that is has + // the ORB PolicyContext as father + context = new PolicyContext(m_orb.m_conf.getPolicyContext()); + m_thread_contexts.put(th, context); + + // Start cleaner thread + if ((++m_cleanup_round) > CLEANUP_ROUND) { + m_cleanup_round = 0; + clear_contexts(); + } + } + + return context; + } + + public synchronized PolicyContext tryToGetThreadContext(Thread th) + { + return (PolicyContext) m_thread_contexts.get(th); + } + + private void clear_contexts() + { + Object[] keys = m_thread_contexts.keySet().toArray(); + + Thread th = null; + + for (int i = 0; i < keys.length; i++) { + th = (Thread) keys[i]; + if (!th.isAlive()) + m_thread_contexts.remove(th); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.java b/source/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.java new file mode 100644 index 0000000..b11e183 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/PolicyCurrentImpl.java @@ -0,0 +1,86 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyCurrentLocalBase; + +public class PolicyCurrentImpl extends PolicyCurrentLocalBase +{ + + PolicyContextManager m_manager; + + final static Policy[] st_empty_list = {}; + + public PolicyCurrentImpl(PolicyContextManager manager) + { + m_manager = manager; + } + + public org.omg.CORBA.Policy[] get_policy_overrides(int[] ts) + { + PolicyContext context = + m_manager.tryToGetThreadContext(Thread.currentThread()); + + if (context == null) + return st_empty_list; + + return context.getPolicies(ts); + } + + public void set_policy_overrides(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + PolicyContext context = + m_manager.getThreadContext(Thread.currentThread()); + + context.setPolicies(policies, set_add); + } + + public PolicyContext getPolicyContext() + { + return m_manager.tryToGetThreadContext(Thread.currentThread()); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/PolicyFactory.java b/source/es/tid/TIDorbj/core/policy/PolicyFactory.java new file mode 100644 index 0000000..a648bdb --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/PolicyFactory.java @@ -0,0 +1,220 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 395 $ +* Date: $Date: 2009-05-27 16:10:32 +0200 (Wed, 27 May 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.Policy; +import org.omg.CORBA.PolicyError; +import org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE; +import org.omg.Messaging.REBIND_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE; +import org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE; +import org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE; +import org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE; +import org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID; +import org.omg.PortableServer.ID_UNIQUENESS_POLICY_ID; +import org.omg.PortableServer.LIFESPAN_POLICY_ID; +import org.omg.PortableServer.REQUEST_PROCESSING_POLICY_ID; +import org.omg.PortableServer.SERVANT_RETENTION_POLICY_ID; +import org.omg.PortableServer.THREAD_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_ENABLING_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_LOW_VALUE_POLICY_ID; +import org.omg.ZIOP.COMPRESSION_MIN_RATIO_POLICY_ID; +import org.omg.ZIOP.COMPRESSOR_ID_LEVEL_LIST_POLICY_ID; + +import es.tid.TIDorbj.core.BidirectionalPolicyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.messaging.QueueOrderPolicyImpl; +import es.tid.TIDorbj.core.messaging.RebindPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRequestTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RelativeRoundtripTimeoutPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestEndTimePolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestStartTimePolicyImpl; +import es.tid.TIDorbj.core.poa.policies.IdAssignmentPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.IdUniquenessPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.LifespanPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.RequestProcessingPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.ServantRetentionPolicyImpl; +import es.tid.TIDorbj.core.poa.policies.ThreadPolicyImpl; +import es.tid.TIDorbj.core.messaging.RequestPriorityPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionEnablingPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionLowValuePolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressionMinRatioPolicyImpl; +import es.tid.TIDorbj.core.ziop.CompressorIdLevelListPolicyImpl; + +/** + * Methods used to instantiate ORB policies. + * + * @author Juan A. Cáceres + * @version 1.0 + */ + +public class PolicyFactory +{ + + + /** + * Attempts to instanciate a CORBA policy. + * + * @param type + * the CORBA policy identifier + * @param val + * the policy value inserted in a Any + * @throws org.omg.CORBA.PolicyError + */ + + public static org.omg.CORBA.Policy createPolicy(int type, Any val) + throws org.omg.CORBA.PolicyError + { + + if (val == null) + throw new BAD_PARAM("Null reference", 0, + CompletionStatus.COMPLETED_NO); + + switch (type) { + case ID_UNIQUENESS_POLICY_ID.value: + return IdUniquenessPolicyImpl.createPolicy(val); + case ID_ASSIGNMENT_POLICY_ID.value: + return IdAssignmentPolicyImpl.createPolicy(val); + case LIFESPAN_POLICY_ID.value: + return LifespanPolicyImpl.createPolicy(val); + case REBIND_POLICY_TYPE.value: + return RebindPolicyImpl.createPolicy(val); + case BIDIRECTIONAL_POLICY_TYPE.value: + return BidirectionalPolicyImpl.createPolicy(val); + case QUEUE_ORDER_POLICY_TYPE.value: + return QueueOrderPolicyImpl.createPolicy(val); + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + return RelativeRequestTimeoutPolicyImpl.createPolicy(val); + case RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: + return RelativeRoundtripTimeoutPolicyImpl.createPolicy(val); + case REQUEST_PROCESSING_POLICY_ID.value: + return RequestProcessingPolicyImpl.createPolicy(val); + case REQUEST_PRIORITY_POLICY_TYPE.value: + return RequestPriorityPolicyImpl.createPolicy(val); + case REQUEST_START_TIME_POLICY_TYPE.value: + return RequestStartTimePolicyImpl.createPolicy(val); + case REQUEST_END_TIME_POLICY_TYPE.value: + return RequestEndTimePolicyImpl.createPolicy(val); + case SERVANT_RETENTION_POLICY_ID.value: + return ServantRetentionPolicyImpl.createPolicy(val); + case THREAD_POLICY_ID.value: + return ThreadPolicyImpl.createPolicy(val); + case COMPRESSION_ENABLING_POLICY_ID.value: + return CompressionEnablingPolicyImpl.createPolicy(val); + case COMPRESSION_LOW_VALUE_POLICY_ID.value: + return CompressionLowValuePolicyImpl.createPolicy(val); + case COMPRESSION_MIN_RATIO_POLICY_ID.value: + return CompressionMinRatioPolicyImpl.createPolicy(val); + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + return CompressorIdLevelListPolicyImpl.createPolicy(val); + default: + throw new PolicyError(org.omg.CORBA.UNSUPPORTED_POLICY.value); + } + + } + + /** + * + * Reads a policy from an INVOCATION_POLICY ServiceContext encapsulation. + * See QoS section: "22.3 Propagation of Messaging QoS" + * + * @param input + * @return + */ + public static Policy readPolicy(CDRInputStream input) + { + int policy_type = input.read_ulong(); + Policy policy = null; + + + switch (policy_type) { + case BIDIRECTIONAL_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = BidirectionalPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_END_TIME_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestEndTimePolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_START_TIME_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestStartTimePolicyImpl.read(input); + input.exitEncapsulation(); + break; + case RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RelativeRequestTimeoutPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case REQUEST_PRIORITY_POLICY_TYPE.value: + input.enterEncapsulation(); + policy = RequestPriorityPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case COMPRESSION_ENABLING_POLICY_ID.value: + input.enterEncapsulation(); + policy = CompressionEnablingPolicyImpl.read(input); + input.exitEncapsulation(); + break; + case COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value: + input.enterEncapsulation(); + policy = CompressorIdLevelListPolicyImpl.read(input); + input.exitEncapsulation(); + break; + default: // policy not supported skip + input.skipEncapsulation(); + return null; + } + + return policy; + } + +} diff --git a/source/es/tid/TIDorbj/core/policy/PolicyManagerImpl.java b/source/es/tid/TIDorbj/core/policy/PolicyManagerImpl.java new file mode 100644 index 0000000..e33ed6d --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/PolicyManagerImpl.java @@ -0,0 +1,76 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.policy; + +import org.omg.CORBA.PolicyManagerLocalBase; + +import es.tid.TIDorbj.core.TIDORB; + +public class PolicyManagerImpl extends PolicyManagerLocalBase +{ + + TIDORB m_orb; + + public PolicyManagerImpl(TIDORB orb) + { + this.m_orb = orb; + } + + public org.omg.CORBA.Policy[] get_policy_overrides(int[] ts) + { + return m_orb.m_conf.getPolicyContext().getPolicies(ts); + } + + public void set_policy_overrides(org.omg.CORBA.Policy[] policies, + org.omg.CORBA.SetOverrideType set_add) + throws org.omg.CORBA.InvalidPolicies + { + m_orb.m_conf.getPolicyContext().setPolicies(policies, set_add); + } + + public PolicyContext getPolicyContext() + { + return m_orb.m_conf.getPolicyContext(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/policy/UnsuportedPolicy.java b/source/es/tid/TIDorbj/core/policy/UnsuportedPolicy.java new file mode 100644 index 0000000..ccbd540 --- /dev/null +++ b/source/es/tid/TIDorbj/core/policy/UnsuportedPolicy.java @@ -0,0 +1,56 @@ +package es.tid.TIDorbj.core.policy; + + +import org.omg.CORBA.LocalObject; +import org.omg.CORBA.Policy; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; + + +/** + * @author caceres + * + */ +public class UnsuportedPolicy extends LocalObject + implements Policy +{ + + int type; + Encapsulation value; + + + public int policy_type() + { + return type; + } + + + public Policy copy() + { + return this; + } + + + public void destroy() + { + + } + + public void partialRead(CDRInputStream input) { + value = input.readEncapsulation(); + + } + + public void write(CDROutputStream output) + { + output.write_ulong(type); + if(value != null) { + output.writeEncapsulation(value); + } + } + + + +} diff --git a/source/es/tid/TIDorbj/core/security/.svn/all-wcprops b/source/es/tid/TIDorbj/core/security/.svn/all-wcprops new file mode 100644 index 0000000..e08bbee --- /dev/null +++ b/source/es/tid/TIDorbj/core/security/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/security +END +CSIComponent.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/security/CSIComponent.java +END diff --git a/source/es/tid/TIDorbj/core/security/.svn/entries b/source/es/tid/TIDorbj/core/security/.svn/entries new file mode 100644 index 0000000..2cf2282 --- /dev/null +++ b/source/es/tid/TIDorbj/core/security/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +478 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/security +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +CSIComponent.java +file + + + + +2011-03-27T14:11:14.000000Z +8372013974a27408a1489a9a4b94027a +2011-04-29T14:42:47.025714Z +478 +avega + + + + + + + + + + + + + + + + + + + + + +11798 + diff --git a/source/es/tid/TIDorbj/core/security/.svn/text-base/CSIComponent.java.svn-base b/source/es/tid/TIDorbj/core/security/.svn/text-base/CSIComponent.java.svn-base new file mode 100644 index 0000000..1858deb --- /dev/null +++ b/source/es/tid/TIDorbj/core/security/.svn/text-base/CSIComponent.java.svn-base @@ -0,0 +1,335 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.security; + +import java.io.StringWriter; +import java.io.PrintWriter; +import java.lang.Byte; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; +import org.omg.CSIIOP.CompoundSecMechList; +import org.omg.CSIIOP.CompoundSecMechListHelper; +import org.omg.CSIIOP.ServiceConfiguration; +import org.omg.CSI.ITTAbsent; +import org.omg.CSI.ITTAnonymous; +import org.omg.CSI.ITTPrincipalName; +import org.omg.CSI.ITTX509CertChain; +import org.omg.CSI.ITTDistinguishedName; + + + +/** + * CSIComponent data struct defined in the GIOP Module. + * + * @autor + * @version 1.0 + */ +public class CSIComponent extends TaggedComponent +{ + + private CompoundSecMechList m_mec_list; + + public CSIComponent() + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = new CompoundSecMechList(); + } + + public CSIComponent(CompoundSecMechList mec_list) + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = mec_list; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + CompoundSecMechListHelper.write(out, m_mec_list); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_mec_list = CompoundSecMechListHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("stateful: "); + print_buffer.print(m_mec_list.stateful); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + for (int i = 0; i < m_mec_list.mechanism_list.length; i++) { + print_buffer.print("mechanism: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" transport_mech: " + + CSIComponent.print_TransportMechTag( + m_mec_list.mechanism_list[i].transport_mech.tag)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" as_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" client_authentication_mech: " + + print_OID(m_mec_list.mechanism_list[i].as_context_mech.client_authentication_mech)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_name: " + + print_GSS_NT_ExportedName( + m_mec_list.mechanism_list[i].as_context_mech.target_name)); + + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" sas_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" privilege_authorities: " + + CSIComponent.print_PrivilegeAuthorities( + m_mec_list.mechanism_list[i].sas_context_mech.privilege_authorities)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_naming_mechanims: " + + print_OIDList( + m_mec_list.mechanism_list[i].sas_context_mech.supported_naming_mechanisms)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_identity_types: " + + print_IdentityTokenTypes( + m_mec_list.mechanism_list[i].sas_context_mech.supported_identity_types)); + } + return buffer.toString(); + } + + + + public static String print_PrivilegeAuthorities(ServiceConfiguration[] privilege_authorities) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < privilege_authorities.length; i++) { + print_buffer.print("\n \t \t \t sintax: " + privilege_authorities[i].syntax); + print_buffer.print("\n \t \t \t name: " + privilege_authorities[i].name); + } + + return buffer.toString(); + } + + public static String print_OID(byte[] oid) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t OID: "); + + for (int i = 0; i < oid.length; i++) { + //print_buffer.print(oid[i]); + String hex = Integer.toHexString(oid[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + } + + return buffer.toString(); + } + + + public static String print_OIDList(byte[][] oid_list) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < oid_list.length; i++) { + print_buffer.print(print_OID(oid_list[i])); + } + + return buffer.toString(); + } + + public static String print_IdentityTokenTypes(int type) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(type) { + case org.omg.CSI.ITTAbsent.value: + print_buffer.print("\n \t \t \t Absent"); + break; + case org.omg.CSI.ITTAnonymous.value: + print_buffer.print("\n \t \t \t Anonymous"); + break; + case org.omg.CSI.ITTPrincipalName.value: + print_buffer.print("\n \t \t \t PrincipalName"); + break; + case org.omg.CSI.ITTX509CertChain.value: + print_buffer.print("\n \t \t \t ITTX509CertChain"); + break; + case org.omg.CSI.ITTDistinguishedName.value: + print_buffer.print("\n \t \t \t ITTDistinguishedName"); + break; + } + return buffer.toString(); + } + + + public static String print_TransportMechTag(int tag) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(tag) { + case org.omg.IOP.TAG_SSL_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_SSL_SEC_TRANS"); + break; + case org.omg.IOP.TAG_TLS_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_TLS_SEC_TRANS"); + break; + case org.omg.IOP.TAG_NULL_TAG.value: + print_buffer.print("\n \t \t \t TAG_NULL_TAG"); + break; + } + return buffer.toString(); + } + + + public static String print_GSS_NT_ExportedName(byte[] name) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t "); + + for (int i = 0; i < name.length; i++) { + //print_buffer.print(name[i]); + + String hex = Integer.toHexString(name[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + + } + + return buffer.toString(); + + } + + +} diff --git a/source/es/tid/TIDorbj/core/security/CSIComponent.java b/source/es/tid/TIDorbj/core/security/CSIComponent.java new file mode 100644 index 0000000..1858deb --- /dev/null +++ b/source/es/tid/TIDorbj/core/security/CSIComponent.java @@ -0,0 +1,335 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 397 $ +* Date: $Date: 2009-06-18 08:42:11 +0200 (Thu, 18 Jun 2009) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.security; + +import java.io.StringWriter; +import java.io.PrintWriter; +import java.lang.Byte; + +import es.tid.TIDorbj.core.ConfORB; +import es.tid.TIDorbj.core.iop.TaggedComponent; +import es.tid.TIDorbj.core.comm.ssliop.SSLComponent; +import org.omg.IOP.TAG_CSI_SEC_MECH_LIST; +import org.omg.CSIIOP.CompoundSecMechList; +import org.omg.CSIIOP.CompoundSecMechListHelper; +import org.omg.CSIIOP.ServiceConfiguration; +import org.omg.CSI.ITTAbsent; +import org.omg.CSI.ITTAnonymous; +import org.omg.CSI.ITTPrincipalName; +import org.omg.CSI.ITTX509CertChain; +import org.omg.CSI.ITTDistinguishedName; + + + +/** + * CSIComponent data struct defined in the GIOP Module. + * + * @autor + * @version 1.0 + */ +public class CSIComponent extends TaggedComponent +{ + + private CompoundSecMechList m_mec_list; + + public CSIComponent() + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = new CompoundSecMechList(); + } + + public CSIComponent(CompoundSecMechList mec_list) + { + super(TAG_CSI_SEC_MECH_LIST.value); + m_mec_list = mec_list; + } + + public void write(es.tid.TIDorbj.core.cdr.CDROutputStream out) + { + out.write_ulong(m_tag); + + // enter ecapsulation + + out.enterEncapsulation(); + + CompoundSecMechListHelper.write(out, m_mec_list); + + out.exitEncapsulation(); + } + + public void partialRead(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.enterEncapsulation(); + m_mec_list = CompoundSecMechListHelper.read(input); + input.exitEncapsulation(); + } + + public String toString() + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print("stateful: "); + print_buffer.print(m_mec_list.stateful); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + for (int i = 0; i < m_mec_list.mechanism_list.length; i++) { + print_buffer.print("mechanism: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" transport_mech: " + + CSIComponent.print_TransportMechTag( + m_mec_list.mechanism_list[i].transport_mech.tag)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" as_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].as_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" client_authentication_mech: " + + print_OID(m_mec_list.mechanism_list[i].as_context_mech.client_authentication_mech)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_name: " + + print_GSS_NT_ExportedName( + m_mec_list.mechanism_list[i].as_context_mech.target_name)); + + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" sas_context_mech: "); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_supports: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_supports)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" target_requires: " + + SSLComponent.print_AssociationOptions( + m_mec_list.mechanism_list[i].sas_context_mech.target_requires)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" privilege_authorities: " + + CSIComponent.print_PrivilegeAuthorities( + m_mec_list.mechanism_list[i].sas_context_mech.privilege_authorities)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_naming_mechanims: " + + print_OIDList( + m_mec_list.mechanism_list[i].sas_context_mech.supported_naming_mechanisms)); + print_buffer.print('\n'); + print_buffer.print('\t'); + print_buffer.print('\t'); + print_buffer.print(" supported_identity_types: " + + print_IdentityTokenTypes( + m_mec_list.mechanism_list[i].sas_context_mech.supported_identity_types)); + } + return buffer.toString(); + } + + + + public static String print_PrivilegeAuthorities(ServiceConfiguration[] privilege_authorities) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < privilege_authorities.length; i++) { + print_buffer.print("\n \t \t \t sintax: " + privilege_authorities[i].syntax); + print_buffer.print("\n \t \t \t name: " + privilege_authorities[i].name); + } + + return buffer.toString(); + } + + public static String print_OID(byte[] oid) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t OID: "); + + for (int i = 0; i < oid.length; i++) { + //print_buffer.print(oid[i]); + String hex = Integer.toHexString(oid[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + } + + return buffer.toString(); + } + + + public static String print_OIDList(byte[][] oid_list) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + for (int i = 0; i < oid_list.length; i++) { + print_buffer.print(print_OID(oid_list[i])); + } + + return buffer.toString(); + } + + public static String print_IdentityTokenTypes(int type) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(type) { + case org.omg.CSI.ITTAbsent.value: + print_buffer.print("\n \t \t \t Absent"); + break; + case org.omg.CSI.ITTAnonymous.value: + print_buffer.print("\n \t \t \t Anonymous"); + break; + case org.omg.CSI.ITTPrincipalName.value: + print_buffer.print("\n \t \t \t PrincipalName"); + break; + case org.omg.CSI.ITTX509CertChain.value: + print_buffer.print("\n \t \t \t ITTX509CertChain"); + break; + case org.omg.CSI.ITTDistinguishedName.value: + print_buffer.print("\n \t \t \t ITTDistinguishedName"); + break; + } + return buffer.toString(); + } + + + public static String print_TransportMechTag(int tag) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + switch(tag) { + case org.omg.IOP.TAG_SSL_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_SSL_SEC_TRANS"); + break; + case org.omg.IOP.TAG_TLS_SEC_TRANS.value: + print_buffer.print("\n \t \t \t TAG_TLS_SEC_TRANS"); + break; + case org.omg.IOP.TAG_NULL_TAG.value: + print_buffer.print("\n \t \t \t TAG_NULL_TAG"); + break; + } + return buffer.toString(); + } + + + public static String print_GSS_NT_ExportedName(byte[] name) { + + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + print_buffer.print("\n \t \t \t "); + + for (int i = 0; i < name.length; i++) { + //print_buffer.print(name[i]); + + String hex = Integer.toHexString(name[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + print_buffer.print("0" + hex); + break; + case 2: + print_buffer.print(hex); + break; + default: + print_buffer.print(hex.substring(hlength-2, hlength)); + } + print_buffer.print(" "); + + } + + return buffer.toString(); + + } + + +} diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/all-wcprops b/source/es/tid/TIDorbj/core/typecode/.svn/all-wcprops new file mode 100644 index 0000000..3b6114f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/all-wcprops @@ -0,0 +1,149 @@ +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode +END +WStringTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/WStringTypeCode.java +END +EnumTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/EnumTypeCode.java +END +SequenceTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/SequenceTypeCode.java +END +TypeCodeDumper.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeDumper.java +END +TypeCodeImpl.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeImpl.java +END +TransparentAliasTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.java +END +TypeCodeMarshaler.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.java +END +TypeCodeFactory.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeFactory.java +END +TypeCodeHandler.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeHandler.java +END +ValueBoxTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.java +END +ArrayTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ArrayTypeCode.java +END +AbstractInterfaceTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.java +END +NativeTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/NativeTypeCode.java +END +StructTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/StructTypeCode.java +END +FixedTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/FixedTypeCode.java +END +ObjectRefTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.java +END +TypeCodeCache.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/TypeCodeCache.java +END +RecursiveTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.java +END +StringTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/StringTypeCode.java +END +ValueTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ValueTypeCode.java +END +AliasTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/AliasTypeCode.java +END +ComplexTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ComplexTypeCode.java +END +ExceptionTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.java +END +UnionTypeCode.java +K 25 +svn:wc:ra_dav:version-url +V 102 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode/UnionTypeCode.java +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/entries b/source/es/tid/TIDorbj/core/typecode/.svn/entries new file mode 100644 index 0000000..ecbf1de --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/entries @@ -0,0 +1,844 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/typecode +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2005-12-19T07:58:21.000000Z +2 +caceres + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TypeCodeCache.java +file + + + + +2009-05-27T12:24:01.000000Z +082576893a3db275a679e53c17dcc17d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3360 + +ObjectRefTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +dfc439005b9d609ebde0405be9271d47 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6585 + +EnumTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +622c928d6a0e494cc78d131ec136ca8d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +10926 + +StringTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +3306cbdd9b8876937c14a25ca7b1fce3 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7939 + +RecursiveTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +00c6942f58aafe1a070e996611bd5e46 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5546 + +ComplexTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +440a9c3065ad2482e0434becfec5eede +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9167 + +TypeCodeFactory.java +file + + + + +2009-05-27T12:24:01.000000Z +28bcc6f03b12e9de37931003b27febd8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8051 + +SequenceTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +e878b117a6cfe957c9af4feb0050e729 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9192 + +TransparentAliasTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +c88ec4d549343e47247c6f3219633569 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4647 + +ValueTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +57376b831baeb131a1a3006307554f88 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +13504 + +TypeCodeHandler.java +file + + + + +2009-05-27T12:24:01.000000Z +c7eb26f453fc0b23384cc02b16d95a1e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1945 + +ArrayTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +07a3feb23475c39cf7ceba18010da5fe +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9966 + +TypeCodeMarshaler.java +file + + + + +2009-05-27T12:24:01.000000Z +7379f068b6cf833daeb868e152cdb27e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +17033 + +StructTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +b3c4ddaa32aab64977374363c28ecf15 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +13516 + +AbstractInterfaceTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +bf01330796c88af41492b6830455d141 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3682 + +ValueBoxTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +ad11c736525defb3cfc9fb74d98231fb +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7999 + +NativeTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +a35d518453b7848079e094bf71c00b3d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2054 + +UnionTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +6426ede7d12cd54e20a2ff409a4fd14c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +18519 + +AliasTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +c0a057e7a50af4fc5ba235507acd062d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8336 + +TypeCodeDumper.java +file + + + + +2009-05-27T12:24:01.000000Z +852e14885ff77bebf4bc0b2f2fc7964a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6447 + +WStringTypeCode.java +file + + + + +2009-05-27T12:24:01.000000Z +6d98a002040d5f6c0a20dc33370d6243 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6236 + +ExceptionTypeCode.java +file + + + + +2009-05-27T12:24:02.000000Z +61d78c87318f529693a4005217c0201c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7767 + +FixedTypeCode.java +file + + + + +2009-05-27T12:24:02.000000Z +10dc0ce0769d1094cd23905f1cd698b6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8391 + +TypeCodeImpl.java +file + + + + +2009-05-27T12:24:02.000000Z +3ac39734db70dd985dbefbc410294c7a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +21293 + diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AbstractInterfaceTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AbstractInterfaceTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AbstractInterfaceTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AliasTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AliasTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/AliasTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ArrayTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ArrayTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ArrayTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ComplexTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ComplexTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ComplexTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/EnumTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/EnumTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/EnumTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ExceptionTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ExceptionTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ExceptionTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/FixedTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/FixedTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/FixedTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/NativeTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/NativeTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/NativeTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ObjectRefTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ObjectRefTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ObjectRefTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/RecursiveTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/RecursiveTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/RecursiveTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/SequenceTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/SequenceTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/SequenceTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StringTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StringTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StringTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StructTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StructTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/StructTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TransparentAliasTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TransparentAliasTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TransparentAliasTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeCache.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeCache.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeCache.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeDumper.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeDumper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeDumper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeFactory.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeFactory.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeFactory.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeHandler.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeHandler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeHandler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeImpl.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeMarshaler.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeMarshaler.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/TypeCodeMarshaler.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/UnionTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/UnionTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/UnionTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueBoxTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueBoxTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueBoxTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/ValueTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/WStringTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/WStringTypeCode.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/prop-base/WStringTypeCode.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AbstractInterfaceTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AbstractInterfaceTypeCode.java.svn-base new file mode 100644 index 0000000..9b56763 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AbstractInterfaceTypeCode.java.svn-base @@ -0,0 +1,120 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The AbstractInterfaceTypeCode class represents a + * TypeCode object which is associated with an IDL abstract + * interface. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AbstractInterfaceTypeCode extends ComplexTypeCode +{ + + public AbstractInterfaceTypeCode() + { + super(TCKind.tk_abstract_interface); + } + + public AbstractInterfaceTypeCode(String repositoryId, String name) + { + super(TCKind.tk_abstract_interface, repositoryId, name); + } + + /** + * Dumps the description of a given ComplexTypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a ComplexTypeCode. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[TYPECODE]{abstract interface: "); + ComplexTypeCode.dumpParams(type, output); + output.print('}'); + } + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + input.read_abstract_interface(); + return true; + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean + dump_value(TypeCode type, + org.omg.CORBA_2_3.portable.InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + java.lang.Object obj = input.read_abstract_interface(); + + dump(type, output); + output.print("[VALUE] {--}"); + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AliasTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AliasTypeCode.java.svn-base new file mode 100644 index 0000000..3f029d1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/AliasTypeCode.java.svn-base @@ -0,0 +1,266 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The AliasTypeCode class represents a TypeCode + * object which is associated with an IDL typedef. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AliasTypeCode extends ComplexTypeCode +{ + + protected TypeCode _type; + + public AliasTypeCode() + { + super(TCKind.tk_alias); + _type = null; + } + + public AliasTypeCode(String repositoryId, String name, TypeCode type) + { + super(TCKind.tk_alias, repositoryId, name); + _type = type; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + + if (!super.equal(tc)) + return false; + try { + return _type.equal(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + return _type.equivalent(tc); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type; + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + _type = input.read_TypeCode(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValue(type.content_type(), input); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an alias type + */ + + public static void write_params(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + output.write_TypeCode(type.content_type()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshal_value(TypeCode type, InputStream input, + OutputStream output) + { + try { + TypeCodeMarshaler.remarshalValue(type.content_type(), + input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an alias type. + */ + + public static boolean values_equal(org.omg.CORBA.TypeCode type, + InputStream input_a, + InputStream input_b) + { + try { + return TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a ComplexTypeCode. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{typedef: "); + ComplexTypeCode.dumpParams(type, output); + output.print(" , type= "); + TypeCodeDumper.dump(type.content_type(), output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an alias type + * @return true if if has been possible dump the value. + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + + try { + output.print("[VALUE]{typedef "); + output.print(type.name()); + output.print(": "); + TypeCodeDumper.dumpValue(type.content_type(), input, output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ArrayTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ArrayTypeCode.java.svn-base new file mode 100644 index 0000000..cec2cfa --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ArrayTypeCode.java.svn-base @@ -0,0 +1,321 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ArrayTypeCode class represents a TypeCode + * object which is associated with an IDL array. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ArrayTypeCode extends TypeCodeImpl +{ + + protected TypeCode _element_type; + + protected int _length; + + public ArrayTypeCode() + { + super(TCKind.tk_array); + _element_type = null; + _length = 0; + } + + public ArrayTypeCode(TypeCode element_type, int length) + { + super(TCKind.tk_array); + _element_type = element_type; + _length = length; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (_element_type.equal(tc.content_type()) + && (_length == tc.length())); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _length; + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _element_type; + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public static void skip_params(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int length = input.read_ulong(); + input.skip(length); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + input.enterEncapsulation(); + + _element_type = input.read_TypeCode(); + _length = input.read_ulong(); + + input.exitEncapsulation(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValueArray(type.content_type(), input, + type.length()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + // write TCKind + output.write_long(type.kind().value()); + + // copy the output for insert the encapsulation length later + + CDROutputStream encapsulation = output.copy(); + + // marshalling of params + + output.enterEncapsulation(); + + output.write_TypeCode(type.content_type()); + output.write_ulong(type.length()); + + output.exitEncapsulation(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void remarshal_value(TypeCode type, InputStream input, + OutputStream output) + { + try { + int length = type.length(); + for (int i = 0; i < length; i++) + TypeCodeMarshaler.remarshalValue(type.content_type(), input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an array type. + */ + + public static boolean values_equal(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int length = type.length(); + + for (int i = 0; i < length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an array type. + */ + + public static void dump(org.omg.CORBA.TypeCode type, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{"); + TypeCodeDumper.dump(type.content_type(), output); + output.print('['); + output.print(type.length()); + output.print("]}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Array type expected to invoke length()" + + "and content_type()."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an array type + * @return true if if has been possible dump the value. + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int length = type.length(); + org.omg.CORBA.TypeCode elements_type = type.content_type(); + output.print("[VALUE]{"); + for (int i = 0; i < length; i++) { + output.print('('); + output.print(i); + output.print(") "); + if (!TypeCodeDumper.dumpValue(elements_type, input, output)) + return false; + output.print(" | "); + } + + output.print(" END_ARRAY-}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Array type expected to invoke length()" + + "and content_type()."); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ComplexTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ComplexTypeCode.java.svn-base new file mode 100644 index 0000000..b96cf9c --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ComplexTypeCode.java.svn-base @@ -0,0 +1,328 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.cdr.PointerCDR; + +/** + * The ComplexTypeCode class is base class the base for + * constructing complex TypeCode classes as + * StructTypeCode,AliasTypeCode, etc. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ComplexTypeCode extends TypeCodeImpl +{ + + protected String m_repository_id; + + protected String m_name; + + protected Encapsulation m_encapsuled_params; + + public ComplexTypeCode(TCKind type) + { + super(type); + m_repository_id = null; + m_name = null; + m_encapsuled_params = null; + } + + public ComplexTypeCode(TCKind type, String repositoryId, String name) + { + super(type); + m_repository_id = repositoryId; + m_name = name; + m_encapsuled_params = null; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (m_repository_id.equals(tc.id()) + && m_name.equals(tc.name())); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + } + + + + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_repository_id; + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_name; + } + + public int hashCode() + { + return m_repository_id.hashCode(); + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + output.write_string(type.id()); + output.write_string(type.name()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("TypeCode has not params"); + } + } + + public void readParams(CDRInputStream input) + { + m_repository_id = input.read_string(); + m_name = input.read_string(); + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int length = input.read_ulong(); + input.skip(length); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + CDRInputStream encap_input = input.copy(); + + input.enterEncapsulation(); + + readParams(input); + + if (!input.getContextCDR().hasExternalIndirections()) { + m_encapsuled_params = encap_input.readEncapsulation(); + } + + encap_input = null; + + input.exitEncapsulation(); + + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a complex type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + // views if the typecode has been marshaled before + + PointerCDR previous_position = null; + + // "Indirections are not "freestanding", but only exist inside some + // other encoded TypeCode + + if (!output.getContextCDR().isRootContext()) { + + try { + previous_position = output.getContextCDR() + .lookupPosition(type.id()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("type.id() fails."); + } + } + + if (previous_position != null) { // marshal indirection + + output.writeIndirection(previous_position); + return; + } + + // aligns to get the typeCode position + + output.alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + PointerCDR typecode_position; + + typecode_position = output.getPointer(); + + try { + // saves the typecode position + output.getContextCDR().putObject(type.id(), typecode_position); + } + catch (BadKind bk) {} + + // write the tc_kind value and un + + output.write_long(type.kind().value()); + + // if the typecode has a copy of the params marshaled write its + // encapsulation + if (type instanceof ComplexTypeCode) { + + synchronized (type) { + // esto se debe cambiar a una tabla de typecodes para tratar + // typecodes de + // otros ORBs + Encapsulation encap = + ((ComplexTypeCode) type).m_encapsuled_params; + + if (encap != null) { + output.writeEncapsulation(encap); + return; + } + + // create input stream for save the encapsualation + + boolean read_encapsulation = false; + + CDRInputStream encapsulation_input; + + encapsulation_input = output.inputStreamAtThisPosition(); + + // marshalling of params + + output.enterEncapsulation(); + + TypeCodeMarshaler.writeParams(type, output); + + read_encapsulation = !output.getContextCDR() + .hasExternalIndirections(); + + output.exitEncapsulation(); + + // if the typecode can be saved, because it does not have any + // indirection out + // of the scope of the encapsulation, save it + + if (read_encapsulation) + ((ComplexTypeCode) type).m_encapsuled_params = + encapsulation_input.readEncapsulation(); + + try { + encapsulation_input.close(); + } + catch (Exception e) {} + } + + return; + + } + + output.enterEncapsulation(); + + TypeCodeMarshaler.writeParams(type, output); + + output.exitEncapsulation(); + + } + + /** + * Dumps the description of a given ComplexTypeCode. Fails if it is not + * overriden by a child class. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Dumps the parameters description of a a given complex TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the value will be dumped + */ + + protected static void dumpParams(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("repositoryId= "); + output.print(type.id()); + output.print(", name="); + output.print(type.name()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Complex type expected."); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/EnumTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/EnumTypeCode.java.svn-base new file mode 100644 index 0000000..1a0c8b0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/EnumTypeCode.java.svn-base @@ -0,0 +1,363 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The EnumTypeCode class represents a TypeCode + * object which is associated with an IDL enum. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class EnumTypeCode extends ComplexTypeCode +{ + + protected String[] m_members; + + public EnumTypeCode() + { + super(TCKind.tk_enum); + m_members = null; + + } + + public EnumTypeCode(String id, String name, String[] members) + { + super(TCKind.tk_enum, id, name); + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!m_members[i].equals(tc.member_name(i))) + return false; + } + // all rigth + return true; + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!m_members[i].equals(tc.member_name(i))) + return false; + } + // all rigth + return true; + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index]; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + int length = input.read_ulong(); + + m_members = new String[length]; + for (int i = 0; i < length; i++) + m_members[i] = input.read_string(); + + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipUlong(); + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an enum type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + ComplexTypeCode.writeParams(type, output); + + try { + + int length = type.member_count(); + + output.write_ulong(length); + for (int i = 0; i < length; i++) + output.write_string(type.member_name(i)); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an enum type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + int value = input.read_ulong(); + + try { + + if (value >= type.member_count()) + throw new MARSHAL("Enum discriminator value out of range."); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + + output.write_ulong(value); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an alias type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int value = input_a.read_ulong(); + if (value >= type.member_count()) + throw new MARSHAL("Enum discriminator value out of range."); + + return value == input_b.read_ulong(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + + output.print("[TYPECODE]{enum "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + int length = type.member_count(); + + output.print(type.member_name(0)); + for (int i = 1; i < length; i++) { + output.print(" ,"); + output.print(type.member_name(i)); + } + output.print("} }"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an enum type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{enum "); + output.print(type.id()); + output.print(": "); + output.print(input.read_ulong()); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ExceptionTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ExceptionTypeCode.java.svn-base new file mode 100644 index 0000000..84dca9b --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ExceptionTypeCode.java.svn-base @@ -0,0 +1,237 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The ExceptionTypeCode class represents a TypeCode + * object which is associated with an IDL exception. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ExceptionTypeCode extends StructTypeCode +{ + + public ExceptionTypeCode() + { + m_kind = TCKind.tk_except; + } + + public ExceptionTypeCode(String repositoryId, String name, + org.omg.CORBA.StructMember[] members) + { + super(repositoryId, name, members); + m_kind = TCKind.tk_except; + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + // skip the id + input.skipString(); + // skip the members + return StructTypeCode.skipValue(type, input); + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a struct type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + // exception id + output.write_string(input.read_string()); + StructTypeCode.remarshalValue(type, input, output); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a struct type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + if (input_a.read_string().equals(input_b.read_string())) + return StructTypeCode.valuesEqual(type, input_a, input_b); + else + return false; + + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a exception type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[TYPECODE]{exception ("); + output.print(member_length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < member_length; i++) { + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bds.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an exception type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[VALUE]{exception "); + output.print(type.name()); + output.print(": "); + + output.print("(exception id)"); + output.print(input.read_string()); + output.print(" - "); + + for (int i = 0; i < member_length; i++) { + output.print('('); + output.print(i); + output.print(") "); + output.print(type.member_name(i)); + output.print(": "); + if (!TypeCodeDumper.dumpValue(type.member_type(i), input, + output)) + return false; + output.print(" | "); + } + output.print(" END_STRUCT-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bds.toString()); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/FixedTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/FixedTypeCode.java.svn-base new file mode 100644 index 0000000..b4ebc5f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/FixedTypeCode.java.svn-base @@ -0,0 +1,277 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The FixedTypeCode class represents a TypeCode + * object which is associated with an IDL fixed. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class FixedTypeCode extends TypeCodeImpl +{ + + protected short m_digits; + + protected short m_scale; + + public FixedTypeCode() + { + super(TCKind.tk_fixed); + } + + public FixedTypeCode(short digits, short scale) + { + super(TCKind.tk_fixed); + this.m_digits = digits; + this.m_scale = scale; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + try { + return super.equal(tc) && (m_digits == tc.fixed_digits()) + && (m_scale == tc.fixed_scale()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_digits; + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_scale; + } + + //TIDORB operations + + public static int valueLength(TypeCode type) + { + try { + int fix_digits = type.fixed_digits(); + + return (fix_digits + (fix_digits % 2)) / 2; //it must have a odd + // number of octets + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operation fixed_digits()."); + } + } + + public boolean isSimple() + { + return false; + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUshort(); + input.skipShort(); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_digits = input.read_ushort(); + m_scale = input.read_short(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + int length = valueLength(type); + input.skipOctetArray(length); + return true; + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a fixed type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + output.write_long(type.kind().value()); + output.write_ushort(type.fixed_digits()); + output.write_short(type.fixed_scale()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operations."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a fixed type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + int length = valueLength(type); + for (int i = 0; i < length; i++) + output.write_octet(input.read_octet()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a fixed type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + int length = valueLength(type); + for (int i = 0; i < length; i++) + if (input_a.read_octet() != input_b.read_octet()) + return false; + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a fixed type. + */ + + public static void dump(org.omg.CORBA.TypeCode type, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{fixed<"); + output.print(type.fixed_digits()); + output.print(','); + output.print(type.fixed_scale()); + output.print(">}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operations."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a fixed type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[VALUE]{fixed: "); + int length = valueLength(type); + + for (int i = 0; i < length; i++) + output.print(input.read_octet()); + + output.print("}"); + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/NativeTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/NativeTypeCode.java.svn-base new file mode 100644 index 0000000..922850e --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/NativeTypeCode.java.svn-base @@ -0,0 +1,68 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; + +/** + * The NativeTypeCode class represents a TypeCode + * object which is associated with an IDL native. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class NativeTypeCode extends ComplexTypeCode +{ + + public NativeTypeCode() + { + super(TCKind.tk_native); + } + + public NativeTypeCode(String repositoryId, String name) + { + super(TCKind.tk_native, repositoryId, name); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ObjectRefTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ObjectRefTypeCode.java.svn-base new file mode 100644 index 0000000..db00e39 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ObjectRefTypeCode.java.svn-base @@ -0,0 +1,211 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +/** + * The ArrayTypeCode class represents a TypeCode + * object which is associated with an IDL reference. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ObjectRefTypeCode extends ComplexTypeCode +{ + + public ObjectRefTypeCode() + { + super(TCKind.tk_objref); + } + + public ObjectRefTypeCode(String repositoryId, String name) + { + super(TCKind.tk_objref, repositoryId, name); + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[TYPECODE]{obj_reference:"); + ComplexTypeCode.dumpParams(type, output); + output.print('}'); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + // skip the IOR + IOR.skip(input); + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + + output.write_Object(input.read_Object()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an array type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + //compare two objects + return input_a.read_Object()._is_equivalent(input_b.read_Object()); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an array type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + IOR ior = null; + + if (input instanceof CDRInputStream) { + ior = new DefaultIOR(); + ior.read((CDRInputStream) input); + } else { + org.omg.CORBA.Object obj = input.read_Object(); + String str = input.orb().object_to_string(obj); + ior = DefaultIOR.fromString(null, str); + } + + try { + + int size = ior.memberCount(); + + if (size == 0) { + output.print("[VALUE]{IOR: nil}"); + } else { + output.print("[VALUE]{IOR Repository Id: "); + output.print(ior.getTypeId()); + output.print(" ("); + output.print(size); + output.print(" Profiles )"); + + for (int i = 0; i < size; i++) { + output.print(size); + output.print(" | "); + output.print(ior.getProfile(i).toString()); + } + + output.print("-}"); + + } + } + catch (Exception e) { + return false; + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/RecursiveTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/RecursiveTypeCode.java.svn-base new file mode 100644 index 0000000..f81d7b9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/RecursiveTypeCode.java.svn-base @@ -0,0 +1,179 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.PointerCDR; + +/** + * The RecursiveTypeCode class represents a TypeCode + * object which is associated with an IDL recursion in a typecode definition. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class RecursiveTypeCode extends TypeCodeImpl +{ + + protected String m_repository_id; + + public RecursiveTypeCode() + { + m_repository_id = ""; + } + + public RecursiveTypeCode(String id) + { + //it is not a real typecode!!!! + m_repository_id = id; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (tc instanceof RecursiveTypeCode) + return m_repository_id.equals( + ((RecursiveTypeCode) tc).m_repository_id); + else + return false; + } + + //TIDORB operations + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a recursisve type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + PointerCDR previous_position = null; + + previous_position = output.getContextCDR() + .lookupPosition(type.id()); + + if (previous_position == null) + throw new MARSHAL("Invalid Recursive TypeCode: " + type.id() + + " is not yet marshaled."); + + output.writeIndirection(previous_position); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operations:" + + bk.toString()); + } + + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{obj_reference:"); + ComplexTypeCode.dumpParams(type.content_type(), output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operation:" + + bk.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("Indirection to " + type.id() + + "[CAN'T PROCESS MORE."); + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operation:" + + bk.toString()); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/SequenceTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/SequenceTypeCode.java.svn-base new file mode 100644 index 0000000..d41452f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/SequenceTypeCode.java.svn-base @@ -0,0 +1,275 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The SequenceTypeCode class represents a TypeCode + * object which is associated with an IDL sequence. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SequenceTypeCode extends ArrayTypeCode +{ + + public SequenceTypeCode() + { + m_kind = TCKind.tk_sequence; + } + + public SequenceTypeCode(TypeCode element_type, int length) + { + super(element_type, length); + m_kind = TCKind.tk_sequence; + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + + int length = input.read_ulong(); + + int type_length = type.length(); + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + "indicated in typecode."); + + return TypeCodeMarshaler.skipValueArray(type.content_type(), + input, + length); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a sequence type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + + int length = input.read_ulong(); + + int type_length = type.length(); + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + output.write_ulong(length); + + for (int i = 0; i < length; i++) + TypeCodeMarshaler.remarshalValue(type.content_type(), input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a sequence type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int a_length = input_a.read_ulong(); + int b_length = input_b.read_ulong(); + + if (a_length != b_length) + return false; + + int type_length = type.length(); + + if ((type_length > 0) && (a_length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + for (int i = 0; i < a_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length() " + + "and content_type()."); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a sequence type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{sequence "); + + output.print('<'); + + if (type.length() != 0) { + output.print(type.length()); + output.print(","); + } + TypeCodeDumper.dump(type.content_type(), output); + output.print('>'); + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length() " + + "and content_type()."); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a sequence type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int length = input.read_ulong(); + + int type_length = type.length(); + + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + output.print('['); + output.print(length); + output.print(" VALUES]"); + output.print('{'); + for (int i = 0; i < length; i++) { + output.print('('); + output.print(i); + output.print(") "); + if (!TypeCodeDumper.dumpValue(type.content_type(), + input, + output)) + return false; + output.print(" | "); + } + + output.print(" END_SEQUENCE-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StringTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StringTypeCode.java.svn-base new file mode 100644 index 0000000..d89714f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StringTypeCode.java.svn-base @@ -0,0 +1,270 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The StringTypeCode class represents a TypeCode + * object which is associated with an IDL string. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class StringTypeCode extends TypeCodeImpl +{ + + /** + * Max length of the string, or 0 if unbounded. + */ + + protected int m_length; + + public StringTypeCode() + { + super(TCKind.tk_string); + m_length = 0; + } + + public StringTypeCode(int length) + { + super(TCKind.tk_string); + m_length = length; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (m_length == tc.length()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_length; + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + m_length = input.read_ulong(); + + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + //skip length + input.skipUlong(); + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a string type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + output.write_long(type.kind().value()); + output.write_long(type.length()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a string type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + output.write_string(input.read_string()); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipString(); + return true; + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a string type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + return (input_a.read_string()).equals(input_b.read_string()); + } + + /** + * Dumps the description of a given string TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a string type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]{string"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in string operations:" + + bk.toString()); + } + + output.print('}'); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a string type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[VALUE]{string"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in string operations:" + + bk.toString()); + } + + output.print(": \""); + output.print(input.read_string()); + output.print("\"}"); + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StructTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StructTypeCode.java.svn-base new file mode 100644 index 0000000..73f0ca1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/StructTypeCode.java.svn-base @@ -0,0 +1,431 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The StructTypeCode class represents a TypeCode + * object which is associated with an IDL struct. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class StructTypeCode extends ComplexTypeCode +{ + + protected StructMember[] m_members; + + public StructTypeCode() + { + super(TCKind.tk_struct); + m_members = null; + } + + public StructTypeCode(String repositoryId, String name, + StructMember[] members) + { + super(TCKind.tk_struct, repositoryId, name); + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (!(m_members[i].type.equal(tc.member_type(i)))) + return false; + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (!(m_members[i].type.equivalent(tc.member_type(i)))) + return false; + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + + int length = input.read_ulong(); + + m_members = new StructMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i] = new StructMember(); + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + int member_length = type.member_count(); + for (int i = 0; i < member_length; i++) { + if (!TypeCodeMarshaler.skipValue(type.member_type(i), input)) + return false; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a struct type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + + ComplexTypeCode.writeParams(type, output); + try { + int member_length = type.member_count(); + output.write_ulong(member_length); + for (int i = 0; i < member_length; i++) { + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a struct type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + TypeCodeMarshaler.remarshalValue(type.member_type(i), input, + output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a struct type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.member_type(i), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an struct type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[TYPECODE]{struct ("); + output.print(member_length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < member_length; i++) { + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a struct type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[VALUE]{struct "); + output.print(type.name()); + output.print(": "); + for (int i = 0; i < member_length; i++) { + output.print('('); + output.print(i); + output.print(") "); + output.print(type.member_name(i)); + output.print(": "); + if (!TypeCodeDumper.dumpValue(type.member_type(i), input, + output)) + return false; + output.print(" | "); + } + output.print(" END_STRUCT-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TransparentAliasTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TransparentAliasTypeCode.java.svn-base new file mode 100644 index 0000000..ccd1349 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TransparentAliasTypeCode.java.svn-base @@ -0,0 +1,173 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +public class TransparentAliasTypeCode extends AliasTypeCode +{ + + public TransparentAliasTypeCode() + { + super(); + } + + public TransparentAliasTypeCode(String repositoryId, String name, + TypeCodeImpl type) + { + super(repositoryId, name, type); + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + return _type.equal(tc); + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + return _type.equivalent(tc); + } + + public org.omg.CORBA.TypeCode get_compact_typecode() + { + return _type.get_compact_typecode(); + } + + public org.omg.CORBA.TCKind kind() + { + return _type.kind(); + } + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.id(); + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.name(); + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.member_count(); + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_name(index); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_type(index); + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_label(index); + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.discriminator_type(); + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.default_index(); + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.length(); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.content_type(); + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.fixed_digits(); + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.fixed_scale(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_visibility(index); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.type_modifier(); + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.concrete_base_type(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeCache.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeCache.java.svn-base new file mode 100644 index 0000000..d596182 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeCache.java.svn-base @@ -0,0 +1,116 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.UseTable; + +public class TypeCodeCache +{ + + protected UseTable m_table; + + public TypeCodeCache(int max) + { + m_table = new UseTable(max); + } + + public synchronized TypeCode find(String rep_id) + { + if (m_table.object_exist(rep_id)) { + TypeCodeHandler handler = (TypeCodeHandler) m_table.get(rep_id); + + m_table.use(rep_id); + return handler.getTypeCode(); + } + + return null; + } + + /** + * Tries to insert one TypeCode in the TypeCodeCache. + * + * @param type + * @return if there is also a TypeCode with the same id, returns the + * TypeCode cached otherwise, the same Typecode put. * + */ + public synchronized TypeCode put(TypeCode type) + { + String rep_id = null; + try { + rep_id = type.id(); + } + catch (BadKind badKind) { + throw new + INTERNAL("Only Complex Typecodes can be put in the cache"); + } + + if (rep_id == null) + throw new org.omg.CORBA.INTERNAL("Cannot get RepositoryId"); + + if (m_table.object_exist(rep_id)) { + m_table.use(rep_id); + return ((TypeCodeHandler) m_table.get(rep_id)).getTypeCode(); + } else { + try { + m_table.append(rep_id, new TypeCodeHandler(type)); + return type; + } + catch (FullUseTableException e) { + //ignore it + } + } + + return type; + + } + + public synchronized void destroy() + { + m_table = null; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeDumper.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeDumper.java.svn-base new file mode 100644 index 0000000..de82d45 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeDumper.java.svn-base @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; + +/** + * Dumps the description of a TypeCode and the marshaled value asociated to it. + *

+ * For example, a 5 long elements array typecode will be dumed as: + *

+ * [TYPECODE]{[TYPECODE]{long}[5]} + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class TypeCodeDumper +{ + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.dump(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.dump(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.dump(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.dump(type, output); + break; + case TCKind._tk_string: + StringTypeCode.dump(type, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.dump(type, output); + break; + case TCKind._tk_array: + ArrayTypeCode.dump(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.dump(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.dump(type, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.dump(type, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.dump(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.dump(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.dump(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.dump(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.dump(type, output); + break; + default: + TypeCodeImpl.dump(type, output); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.dumpValue(type, input, output); + case TCKind._tk_objref: + return ObjectRefTypeCode.dumpValue(type, input, output); + case TCKind._tk_union: + return UnionTypeCode.dumpValue(type, input, output); + case TCKind._tk_enum: + return EnumTypeCode.dumpValue(type, input, output); + case TCKind._tk_string: + return StringTypeCode.dumpValue(type, input, output); + case TCKind._tk_sequence: + return SequenceTypeCode.dumpValue(type, input, output); + case TCKind._tk_array: + return ArrayTypeCode.dump_value(type, input, output); + case TCKind._tk_alias: + return AliasTypeCode.dump_value(type, input, output); + case TCKind._tk_except: + return ExceptionTypeCode.dumpValue(type, input, output); + case TCKind._tk_wstring: + return WStringTypeCode.dumpValue(type, input, output); + case TCKind._tk_fixed: + return FixedTypeCode.dumpValue(type, input, output); + case TCKind._tk_value: + return ValueTypeCode.dump_value(type, input, output); + case TCKind._tk_value_box: + return ValueBoxTypeCode.dumpValue(type, input, output); + case TCKind._tk_native: + return NativeTypeCode.dump_value(type, input, output); + case TCKind._tk_abstract_interface: + return + AbstractInterfaceTypeCode.dump_value(type, input, output); + default: + return TypeCodeImpl.dump_value(type, input, output); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeFactory.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeFactory.java.svn-base new file mode 100644 index 0000000..0ca59c3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeFactory.java.svn-base @@ -0,0 +1,233 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; + +/** + * Factory of basic and complex typecodes. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class TypeCodeFactory +{ + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getBasicTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_null: + return tc_null; + case TCKind._tk_objref: + return tc_objref; + case TCKind._tk_any: + return tc_any; + case TCKind._tk_TypeCode: + return tc_TypeCode; + case TCKind._tk_void: + return tc_void; + case TCKind._tk_short: + return tc_short; + case TCKind._tk_long: + return tc_long; + case TCKind._tk_ushort: + return tc_ushort; + case TCKind._tk_ulong: + return tc_ulong; + case TCKind._tk_float: + return tc_float; + case TCKind._tk_double: + return tc_double; + case TCKind._tk_boolean: + return tc_boolean; + case TCKind._tk_char: + return tc_char; + case TCKind._tk_octet: + return tc_octet; + case TCKind._tk_longlong: + return tc_longlong; + case TCKind._tk_ulonglong: + return tc_ulonglong; + case TCKind._tk_longdouble: + return tc_longdouble; + case TCKind._tk_wchar: + return tc_wchar; + case TCKind._tk_string: + return tc_string; + case TCKind._tk_wstring: + return tc_wstring; + default: + return null; + } + } + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getComplexTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_struct: + return new StructTypeCode(); + case TCKind._tk_objref: + return new ObjectRefTypeCode(); + case TCKind._tk_union: + return new UnionTypeCode(); + case TCKind._tk_enum: + return new EnumTypeCode(); + case TCKind._tk_alias: + // return new TransparentAliasTypeCode(); + return new AliasTypeCode(); + // this is a transparent alias it will be the content type for user + case TCKind._tk_except: + return new ExceptionTypeCode(); + case TCKind._tk_value: + return new ValueTypeCode(); + case TCKind._tk_value_box: + return new ValueBoxTypeCode(); + case TCKind._tk_native: + return new NativeTypeCode(); + case TCKind._tk_abstract_interface: + return new AbstractInterfaceTypeCode(); + default: + return null; + } + } + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getSemiComplexTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_string: + return new StringTypeCode(); + case TCKind._tk_sequence: + return new SequenceTypeCode(); + case TCKind._tk_array: + return new ArrayTypeCode(); + case TCKind._tk_wstring: + return new WStringTypeCode(); + case TCKind._tk_fixed: + return new FixedTypeCode(); + default: + return null; + } + } + + public static final boolean isComplex(TCKind kind) + { + switch (kind.value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + return true; + default: + return false; + } + } + + public static final boolean isSemiComplex(TCKind kind) + { + + switch (kind.value()) + { + case TCKind._tk_sequence: + case TCKind._tk_string: + case TCKind._tk_array: + case TCKind._tk_wstring: + case TCKind._tk_fixed: + return true; + default: + return false; + } + } + + public static final TypeCodeImpl tc_null = new TypeCodeImpl(TCKind.tk_null); + + public static final TypeCodeImpl tc_objref = + new ObjectRefTypeCode("IDL:omg/org/CORBA/Object:1.0", + "Object"); + + public static final TypeCodeImpl tc_any = new TypeCodeImpl(TCKind.tk_any); + public static final TypeCodeImpl tc_TypeCode = + new TypeCodeImpl(TCKind.tk_TypeCode); + public static final TypeCodeImpl tc_void = new TypeCodeImpl(TCKind.tk_void); + public static final TypeCodeImpl tc_short = new TypeCodeImpl(TCKind.tk_short); + public static final TypeCodeImpl tc_long = new TypeCodeImpl(TCKind.tk_long); + public static final TypeCodeImpl tc_ushort = + new TypeCodeImpl(TCKind.tk_ushort); + public static final TypeCodeImpl tc_ulong = + new TypeCodeImpl(TCKind.tk_ulong); + public static final TypeCodeImpl tc_float = + new TypeCodeImpl(TCKind.tk_float); + public static final TypeCodeImpl tc_double = + new TypeCodeImpl(TCKind.tk_double); + public static final TypeCodeImpl tc_boolean = + new TypeCodeImpl(TCKind.tk_boolean); + public static final TypeCodeImpl tc_char = new TypeCodeImpl(TCKind.tk_char); + public static final TypeCodeImpl tc_octet = + new TypeCodeImpl(TCKind.tk_octet); + public static final TypeCodeImpl tc_longlong = + new TypeCodeImpl(TCKind.tk_longlong); + public static final TypeCodeImpl tc_ulonglong = + new TypeCodeImpl(TCKind.tk_ulonglong); + public static final TypeCodeImpl tc_longdouble = + new TypeCodeImpl(TCKind.tk_longdouble); + public static final TypeCodeImpl tc_wchar = + new TypeCodeImpl(TCKind.tk_wchar); + public static final StringTypeCode tc_string = + (StringTypeCode) getSemiComplexTypeCode(TCKind.tk_string); + public static final WStringTypeCode tc_wstring = + (WStringTypeCode) getSemiComplexTypeCode(TCKind.tk_wstring); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeHandler.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeHandler.java.svn-base new file mode 100644 index 0000000..598d6a4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeHandler.java.svn-base @@ -0,0 +1,66 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TypeCode; + +public class TypeCodeHandler + implements es.tid.TIDorbj.core.util.RemovableObject +{ + TypeCode m_typecode; + + public TypeCodeHandler(TypeCode tc) + { + m_typecode = tc; + } + + public TypeCode getTypeCode() + { + return m_typecode; + } + + public boolean canBeRemoved() + { + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeImpl.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeImpl.java.svn-base new file mode 100644 index 0000000..6e31c86 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeImpl.java.svn-base @@ -0,0 +1,655 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The TypeCode class represents a TypeCode object + * which is associated with an IDL of a basic type. It is the base class to the + * rest of simple and complex typecodes. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class TypeCodeImpl extends org.omg.CORBA.TypeCode +{ + + TCKind m_kind; + + boolean m_exhaustive_equal = false; + + protected TypeCodeImpl() + { + m_kind = TCKind.tk_null; + } + + public TypeCodeImpl(TCKind kind) + { + m_kind = kind; + } + + public void setExhaustiveEqual(boolean value) + { + m_exhaustive_equal = value; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + return (m_kind.value() == tc.kind().value()); + } + + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } else { + return equals(tc); + } + } + + public org.omg.CORBA.TypeCode get_compact_typecode() + { + return this; + } + + public org.omg.CORBA.TCKind kind() + { + return m_kind; + } + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + //TIDORB operations + + public boolean isSimple() + { + return true; + } + + /** + * TypeCode Marshaling. + */ + + public static void marshal(org.omg.CORBA.TypeCode type, + CDROutputStream output) + { + output.write_ulong(type.kind().value()); + } + + /** + * TypeCode parameters demarshaling. In this case, theres nothing to do. + * This operation will throw the INTERNAL exception. + */ + public void partialUnmarshal(CDRInputStream input) + { + throw new org.omg.CORBA.INTERNAL("Nothing to unmarshal", 0, + CompletionStatus.COMPLETED_NO); + } + + /** + * Skips the TypeCode parameters. + */ + + public static void skipParams(CDRInputStream input) + { + //nothing to do + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + input.skipShort(); + break; + case TCKind._tk_long: + input.skipLong(); + break; + case TCKind._tk_longlong: + input.skip_longlong(); + break; + case TCKind._tk_ushort: + input.skipUshort(); + break; + case TCKind._tk_ulong: + input.skipUlong(); + break; + case TCKind._tk_ulonglong: + input.skipUlonglong(); + break; + case TCKind._tk_float: + input.skipFloat(); + break; + case TCKind._tk_double: + input.skipDouble(); + break; + case TCKind._tk_boolean: + input.skipBoolean(); + break; + case TCKind._tk_char: + input.skipChar(); + break; + case TCKind._tk_wchar: + input.skipWchar(); + break; + case TCKind._tk_octet: + input.skipOctet(); + break; + case TCKind._tk_any: + input.skipAny(); + break; + case TCKind._tk_TypeCode: + input.skipTypeCode(); + break; + case TCKind._tk_Principal: + input.skipPrincipal(); + break; + case TCKind._tk_null: + case TCKind._tk_void: + break; + default: + throw new INTERNAL("TypeCode is not basic.", 0, + CompletionStatus.COMPLETED_NO); + } + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a basic type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + output.write_short(input.read_short()); + break; + case TCKind._tk_long: + output.write_long(input.read_long()); + break; + case TCKind._tk_longlong: + output.write_longlong(input.read_longlong()); + break; + case TCKind._tk_ushort: + output.write_ushort(input.read_ushort()); + break; + case TCKind._tk_ulong: + output.write_ulong(input.read_ulong()); + break; + case TCKind._tk_ulonglong: + output.write_ulonglong(input.read_ulonglong()); + break; + case TCKind._tk_float: + output.write_float(input.read_float()); + break; + case TCKind._tk_double: + output.write_double(input.read_double()); + break; + case TCKind._tk_boolean: + output.write_boolean(input.read_boolean()); + break; + case TCKind._tk_char: + output.write_char(input.read_char()); + break; + case TCKind._tk_wchar: + output.write_wchar(input.read_wchar()); + break; + case TCKind._tk_octet: + output.write_octet(input.read_octet()); + break; + case TCKind._tk_any: + output.write_any(input.read_any()); + break; + case TCKind._tk_objref: + output.write_Object(input.read_Object()); + break; + case TCKind._tk_string: + output.write_string(input.read_string()); + break; + case TCKind._tk_wstring: + output.write_wstring(input.read_wstring()); + break; + case TCKind._tk_TypeCode: + output.write_TypeCode(input.read_TypeCode()); + break; + case TCKind._tk_Principal: + output.write_Principal(input.read_Principal()); + break; + case TCKind._tk_null: + case TCKind._tk_void: + break; + default: + throw new org.omg.CORBA.INTERNAL("TypeCode is not basic", 0, + CompletionStatus.COMPLETED_NO); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a basic type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream a_input, InputStream b_input) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + return a_input.read_short() == b_input.read_short(); + case TCKind._tk_long: + return a_input.read_long() == b_input.read_long(); + case TCKind._tk_longlong: + return a_input.read_longlong() == b_input.read_longlong(); + case TCKind._tk_ushort: + return a_input.read_ushort() == b_input.read_ushort(); + case TCKind._tk_ulong: + return a_input.read_ulong() == b_input.read_ulong(); + case TCKind._tk_ulonglong: + return a_input.read_ulonglong() == b_input.read_ulonglong(); + case TCKind._tk_float: + return a_input.read_float() == b_input.read_float(); + case TCKind._tk_double: + return a_input.read_double() == b_input.read_double(); + case TCKind._tk_boolean: + return a_input.read_boolean() == b_input.read_boolean(); + case TCKind._tk_char: + return a_input.read_char() == b_input.read_char(); + case TCKind._tk_wchar: + return a_input.read_wchar() == b_input.read_wchar(); + case TCKind._tk_octet: + return a_input.read_octet() == b_input.read_octet(); + case TCKind._tk_any: + TypeCode tc_a, + tc_b; + tc_a = a_input.read_TypeCode(); + tc_b = b_input.read_TypeCode(); + if (tc_a.equal(tc_b)) + return TypeCodeMarshaler + .valuesEqual(tc_a, a_input, b_input); + else + return false; + case TCKind._tk_TypeCode: + return (a_input.read_TypeCode()).equal(b_input.read_TypeCode()); + case TCKind._tk_Principal: + return + (a_input.read_Principal()).equals(b_input.read_Principal()); + case TCKind._tk_null: + case TCKind._tk_void: + return true; + default: + throw new org.omg.CORBA.MARSHAL("TypeCode is not basic", 0, + CompletionStatus.COMPLETED_NO); + + } + + } + + /** + * Dumps the description of a given string TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a string type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]"); + switch (type.kind().value()) + { + case TCKind._tk_short: + output.print("{short}"); + break; + case TCKind._tk_long: + output.print("{long}"); + break; + case TCKind._tk_longlong: + output.print("{longlong}"); + break; + case TCKind._tk_ushort: + output.print("{ushort}"); + break; + case TCKind._tk_ulong: + output.print("{ulong}"); + break; + case TCKind._tk_ulonglong: + output.print("{ulonglong}"); + break; + case TCKind._tk_float: + output.print("{float}"); + break; + case TCKind._tk_double: + output.print("{double}"); + break; + case TCKind._tk_boolean: + output.print("{boolean}"); + break; + case TCKind._tk_char: + output.print("{char}"); + break; + case TCKind._tk_wchar: + output.print("{wchar}"); + break; + case TCKind._tk_octet: + output.print("{octet}"); + break; + case TCKind._tk_any: + output.print("{any}"); + break; + case TCKind._tk_string: + output.print("{string}"); + break; + case TCKind._tk_wstring: + output.print("{wstring}"); + break; + case TCKind._tk_TypeCode: + output.print("{TypeCode}"); + break; + case TCKind._tk_Principal: + output.print("{Principal}"); + case TCKind._tk_null: + output.print("{null}"); + break; + case TCKind._tk_void: + output.print("{void}"); + break; + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a simple type + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + + { + switch (type.kind().value()) + { + case TCKind._tk_null: + output.print("{null value}"); + return true; + case TCKind._tk_short: + output.print("{short: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_long: + output.print("{long: "); + output.print(input.read_long()); + output.print("}"); + return true; + case TCKind._tk_longlong: + output.print("{longlong: "); + output.print(input.read_longlong()); + output.print("}"); + return true; + case TCKind._tk_ushort: + output.print("{ushort: "); + output.print(input.read_ushort()); + output.print("}"); + return true; + case TCKind._tk_ulong: + output.print("{ulong: "); + output.print(input.read_ulong()); + output.print("}"); + return true; + case TCKind._tk_ulonglong: + output.print("{ulonglong: "); + output.print(input.read_ulonglong()); + output.print("}"); + return true; + case TCKind._tk_float: + output.print("{float: "); + output.print(input.read_float()); + output.print("}"); + return true; + case TCKind._tk_double: + output.print("{double: "); + output.print(input.read_double()); + output.print("}"); + return true; + case TCKind._tk_boolean: + output.print("{boolean: "); + output.print(input.read_boolean()); + output.print("}"); + return true; + case TCKind._tk_char: + output.print("{char: "); + output.print(input.read_char()); + output.print("}"); + return true; + case TCKind._tk_wchar: + output.print("{wchar: "); + output.print(input.read_wchar()); + output.print("}"); + return true; + case TCKind._tk_octet: + output.print("{octet: "); + output.print(input.read_octet()); + output.print("}"); + return true; + case TCKind._tk_any: + output.print("{any: "); + AnyImpl.dump(input.read_any(), output); + output.print("}"); + return true; + case TCKind._tk_string: + output.print("{string: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_wstring: + output.print("{wstring: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_TypeCode: + output.print("{TypeCode: "); + TypeCodeDumper.dump(input.read_TypeCode(), output); + output.print("}"); + return true; + case TCKind._tk_Principal: + output.print("{Principal: "); + output.print(input.read_Principal()); + output.print("}"); + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeMarshaler.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeMarshaler.java.svn-base new file mode 100644 index 0000000..e5fa15f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/TypeCodeMarshaler.java.svn-base @@ -0,0 +1,476 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * General TypeCode marshalling operations. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class TypeCodeMarshaler +{ + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + putInCache(type, output); + + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.marshal(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.marshal(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.marshal(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.marshal(type, output); + break; + case TCKind._tk_string: + StringTypeCode.marshal(type, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.marshal(type, output); + break; + case TCKind._tk_array: + ArrayTypeCode.marshal(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.marshal(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.marshal(type, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.marshal(type, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.marshal(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.marshal(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.marshal(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.marshal(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.marshal(type, output); + break; + default: + TypeCodeImpl.marshal(type, output); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.writeParams(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.writeParams(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.writeParams(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.writeParams(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.write_params(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.writeParams(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.writeParams(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.writeParams(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.writeParams(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.writeParams(type, output); + break; + default: + throw new org.omg.CORBA.INTERNAL("TypeCode has not params"); + } + } + + public static void skipParams(TCKind kind, CDRInputStream input) + { + switch (kind.value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + ComplexTypeCode.skipParams(input); + break; + case TCKind._tk_sequence: + SequenceTypeCode.skip_params(input); + break; + case TCKind._tk_array: + ArrayTypeCode.skip_params(input); + break; + case TCKind._tk_string: + StringTypeCode.skipParams(input); + break; + case TCKind._tk_wstring: + WStringTypeCode.skipParams(input); + break; + case TCKind._tk_fixed: + FixedTypeCode.skipParams(input); + break; + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, OutputStream output) + { + + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_union: + UnionTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_enum: + EnumTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_string: + StringTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_array: + ArrayTypeCode.remarshal_value(type, input, output); + break; + case TCKind._tk_alias: + AliasTypeCode.remarshal_value(type, input, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_value: + ValueTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_native: + NativeTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.remarshalValue(type, input, output); + break; + default: + TypeCodeImpl.remarshalValue(type, input, output); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_objref: + return ObjectRefTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_union: + return UnionTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_enum: + return EnumTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_string: + return StringTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_sequence: + return SequenceTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_array: + return ArrayTypeCode.values_equal(type, input_a, input_b); + case TCKind._tk_alias: + return AliasTypeCode.values_equal(type, input_a, input_b); + case TCKind._tk_except: + return ExceptionTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_wstring: + return WStringTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_fixed: + return FixedTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_value: + return ValueTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_value_box: + return ValueBoxTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_native: + return NativeTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_abstract_interface: + return AbstractInterfaceTypeCode.valuesEqual(type, input_a, + input_b); + default: + return TypeCodeImpl.valuesEqual(type, input_a, input_b); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.skipValue(type, input); + case TCKind._tk_objref: + return ObjectRefTypeCode.skipValue(type, input); + case TCKind._tk_union: + return UnionTypeCode.skipValue(type, input); + case TCKind._tk_enum: + return EnumTypeCode.skipValue(type, input); + case TCKind._tk_string: + return StringTypeCode.skipValue(type, input); + case TCKind._tk_sequence: + return SequenceTypeCode.skipValue(type, input); + case TCKind._tk_array: + return ArrayTypeCode.skip_value(type, input); + case TCKind._tk_alias: + return AliasTypeCode.skip_value(type, input); + case TCKind._tk_except: + return ExceptionTypeCode.skip_value(type, input); + case TCKind._tk_wstring: + return WStringTypeCode.skipValue(type, input); + case TCKind._tk_fixed: + return FixedTypeCode.skipValue(type, input); + case TCKind._tk_value: + return ValueTypeCode.skipValue(type, input); + case TCKind._tk_value_box: + return ValueBoxTypeCode.skipValue(type, input); + case TCKind._tk_native: + return NativeTypeCode.skipValue(type, input); + case TCKind._tk_abstract_interface: + return AbstractInterfaceTypeCode.skip_value(type, input); + default: + return TypeCodeImpl.skipValue(type, input); + } + } + + /** + * Skips a value array asociated to the TypeCode. This operation is used by + * the TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + public static boolean skipValueArray(TypeCode type, CDRInputStream input, + int n) + { + + switch (type.kind().value()) + { + case TCKind._tk_short: + input.skipShortArray(n); + break; + case TCKind._tk_long: + input.skipLongArray(n); + break; + case TCKind._tk_longlong: + input.skipLonglongArray(n); + break; + case TCKind._tk_ushort: + input.skipUshortArray(n); + break; + case TCKind._tk_ulong: + input.skipUlongArray(n); + break; + case TCKind._tk_ulonglong: + input.skipUlonglongArray(n); + break; + case TCKind._tk_float: + input.skipFloatArray(n); + break; + case TCKind._tk_double: + input.skipDoubleArray(n); + break; + case TCKind._tk_boolean: + input.skipBooleanArray(n); + break; + case TCKind._tk_char: + input.skipCharArray(n); + break; + case TCKind._tk_wchar: + input.skipWcharArray(n); + break; + case TCKind._tk_octet: + input.skipOctetArray(n); + break; + default: + for (int i = 0; i < n; i++) + if (!skipValue(type, input)) + return false; + } + + return true; + } + + public static void putInCache(TypeCode type, CDROutputStream output) + { + org.omg.CORBA.ORB input_orb = output.orb(); + + if (input_orb == null) + return; + + TypeCodeCache cache = null; + + if (input_orb instanceof TIDORB) + cache = ((TIDORB) input_orb).getTypeCodeCache(); + + if (cache != null) { + switch (type.kind().value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + cache.put(type); + } + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/UnionTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/UnionTypeCode.java.svn-base new file mode 100644 index 0000000..ae50611 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/UnionTypeCode.java.svn-base @@ -0,0 +1,579 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UnionMember; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The UnionTypeCode class represents a TypeCode + * object which is associated with an IDL union. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class UnionTypeCode extends ComplexTypeCode +{ + + protected TypeCode m_discriminator_type; + + protected int m_default_used; + + protected UnionMember[] m_members; + + public UnionTypeCode() + { + super(TCKind.tk_union); + m_discriminator_type = null; + m_members = null; + } + + public UnionTypeCode(String repositoryId, String name, + TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + super(TCKind.tk_union, repositoryId, name); + m_discriminator_type = discriminator_type; + + boolean thereis_default = false; + int i = 0; + + m_default_used = -1; // default_used mecanism not explicited in CORBA + // 2.3 + + TypeCode tc_default = TypeCodeFactory.tc_octet; + + for (i = 0; i < members.length; i++) { + if (tc_default.equal(members[i].label.type())) { + m_default_used = i; + break; + } + } + + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + + if (!m_discriminator_type.equal(tc.discriminator_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + if (m_default_used != tc.default_index()) + return false; + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + } + + // all rigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (!m_discriminator_type.equivalent(tc.discriminator_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + if (m_default_used != tc.default_index()) + return false; + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equivalent(tc.member_type(i))) + return false; + } + + // all rigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_discriminator_type; + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_default_used; + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].label; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + + m_discriminator_type = input.read_TypeCode(); + m_default_used = input.read_long(); + int length = input.read_ulong(); + + m_members = new UnionMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i] = new org.omg.CORBA.UnionMember(); + // Change, only the the value of label is marshaled + //_members[i].label = input.read_any(); + m_members[i].label = input.orb().create_any(); + m_members[i].label.read_value(input, m_discriminator_type); + if (!m_discriminator_type.equal(m_members[i].label.type())) { + if (m_members[i].label.type().kind().value() + == TCKind._tk_octet) { + if (m_default_used != i) + throw new MARSHAL( + "Bad label: Union does not have any " + + "defalt member.", + 0, CompletionStatus.COMPLETED_NO); + } else { + throw new MARSHAL("Invalid Union discriminator TypeCode", + 0, CompletionStatus.COMPLETED_NO); + } + } + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + + try { + Any discriminator = input.orb().create_any(); + + discriminator.read_value(input, type.discriminator_type()); + + int member_index = searchMemberIndex(type, discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + return TypeCodeMarshaler.skipValue(type.member_type(member_index), + input); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an union type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_TypeCode(type.discriminator_type()); + output.write_long(type.default_index()); + + int length = type.member_count(); + + output.write_ulong(length); + + for (int i = 0; i < length; i++) { + // Change, only the value of discriminator is marshalled + // output.write_any(type.member_label(i)); + type.member_label(i).write_value(output); + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + Any discriminator = input.orb().create_any(); + + discriminator.read_value(input, type.discriminator_type()); + + int member_index = searchMemberIndex(type, discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + discriminator.write_value(output); + + TypeCodeMarshaler.remarshalValue(type.member_type(member_index), + input, output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an union type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + Any a_discriminator = input_a.orb().create_any(); + + a_discriminator.read_value(input_a, type.discriminator_type()); + + Any b_discriminator = input_b.orb().create_any(); + + b_discriminator.read_value(input_b, type.discriminator_type()); + + if (!a_discriminator.equal(b_discriminator)) + return false; + + int member_index = searchMemberIndex(type, a_discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + return + TypeCodeMarshaler.valuesEqual(type.member_type(member_index), + input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an union type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{union ("); + + int length = type.member_count(); + + output.print(length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < length; i++) { + output.print(" case "); + AnyImpl.dump(type.member_label(i), output); + + output.print(": "); + output.print(type.member_name(i)); + output.print(" -> "); + TypeCodeDumper.dump(type.member_type(i), output); + output.print(" | "); + } + + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a struct type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{union "); + output.print(type.name()); + output.print(" discriminator: "); + Any disc_any = input.orb().create_any(); + disc_any.read_value(input, type.discriminator_type()); + AnyImpl.dump(disc_any, output); + + int member_index = searchMemberIndex(type, disc_any); + + if (member_index < 0) + throw new MARSHAL("TypeCode with no default case."); + + if (member_index == type.default_index()) + output.print(" /default/ "); + output.print(type.member_name(member_index)); + output.print(" -> "); + + if (!TypeCodeDumper.dumpValue(type.member_type(member_index), + input, output)) + return false; + + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + return true; + } + + public static int searchMemberIndex(TypeCode type, + org.omg.CORBA.Any discriminator) + { + try { + int length = type.member_count(); + for (int i = 0; i < length; i++) + if (discriminator.equal(type.member_label(i))) + return i; + + return type.default_index(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueBoxTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueBoxTypeCode.java.svn-base new file mode 100644 index 0000000..996b428 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueBoxTypeCode.java.svn-base @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ValueBoxTypeCode class represents a TypeCode + * object which is associated with an IDL valuebox. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class ValueBoxTypeCode extends ComplexTypeCode +{ + + TypeCode m_type; + + public ValueBoxTypeCode() + { + super(TCKind.tk_value_box); + m_type = null; + } + + public ValueBoxTypeCode(String repositoryId, String name, TypeCode type) + { + super(TCKind.tk_value_box, repositoryId, name); + m_type = type; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + return m_type.equal(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + /* unreachable */ + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + try { + return m_type.equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + /* unreachable */ + return false; + } + + } + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_type; + } + + //TIDORB operations + + public void readParams(CDRInputStream input) + { + super.readParams(input); + m_type = input.read_TypeCode(); + } + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValue(type.content_type(), input); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a valuebox type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_TypeCode(type.content_type()); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in valuebox operations:" + + bk.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, CDROutputStream output) + { + try { + TypeCodeMarshaler.remarshalValue(type.content_type(), + input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a valuebox type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + return TypeCodeMarshaler.valuesEqual(type.content_type(), input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in valuebox operations:" + + bk.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an alias type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{valuebox "); + output.print(type.name()); + output.print(": "); + TypeCodeDumper.dumpValue(type.content_type(), input, output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueTypeCode.java.svn-base new file mode 100644 index 0000000..3a0b30f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/ValueTypeCode.java.svn-base @@ -0,0 +1,437 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ValueTypeCode class represents a TypeCode + * object which is associated with an IDL value. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ValueTypeCode extends ComplexTypeCode +{ + + protected short m_value_modifier; + + protected TypeCode m_concrete_base; + + protected ValueMember[] m_members; + + public ValueTypeCode() + { + super(TCKind.tk_value); + m_concrete_base = null; + m_members = null; + + } + + public ValueTypeCode(String repositoryId, String name, + short value_modifier, TypeCode concrete_base, + ValueMember[] members) + { + super(TCKind.tk_value, repositoryId, name); + m_value_modifier = value_modifier; + m_concrete_base = concrete_base; + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_value_modifier != tc.type_modifier()) + return false; + if (!m_concrete_base.equal(tc.concrete_base_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + if (m_members[i].access != tc.member_visibility(i)) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_value_modifier != tc.type_modifier()) + return false; + if (!m_concrete_base.equivalent(tc.concrete_base_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equivalent(tc.member_type(i))) + return false; + if (m_members[i].access != tc.member_visibility(i)) + return false; + + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].access; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_value_modifier; + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_concrete_base; + + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + m_value_modifier = input.read_short(); + m_concrete_base = input.read_TypeCode(); + + int length = input.read_ulong(); + + m_members = new ValueMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + m_members[i].access = input.read_short(); + } + } + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + int member_length = type.member_count(); + for (int i = 0; i < member_length; i++) { + if (!TypeCodeMarshaler.skipValue(type.member_type(i), input)) + return false; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a value type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_short(type.type_modifier()); + output.write_TypeCode(type.concrete_base_type()); + + int length = type.member_count(); + output.write_ulong(length); + + for (int i = 0; i < length; i++) { + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + output.write_short(type.member_visibility(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value type operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value type operations:" + + bds.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, CDROutputStream output) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + TypeCodeMarshaler.remarshalValue(type.member_type(i), input, + output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a value type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.member_type(i), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{value "); + ComplexTypeCode.dumpParams(type, output); + output.print(", visibility= "); + output.print(type.type_modifier()); + output.print(", concrete base= "); + TypeCodeDumper.dump(type.concrete_base_type(), output); + + output.print(" {"); + + int length = type.member_count(); + + for (int i = 0; i < length; i++) { + output.print(type.member_visibility(i)); + output.print(' '); + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/.svn/text-base/WStringTypeCode.java.svn-base b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/WStringTypeCode.java.svn-base new file mode 100644 index 0000000..a4859ce --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/.svn/text-base/WStringTypeCode.java.svn-base @@ -0,0 +1,198 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The WStringTypeCode class represents a TypeCode + * object which is associated with an IDL wstring. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class WStringTypeCode extends StringTypeCode +{ + + public WStringTypeCode() + { + m_kind = TCKind.tk_wstring; + } + + public WStringTypeCode(int length) + { + super(length); + m_kind = TCKind.tk_wstring; + + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipWstring(); + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an wstring type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + output.write_wstring(input.read_wstring()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a wstring type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + return (input_a.read_wstring()).equals(input_a.read_wstring()); + } + + /** + * Dumps the description of a given wstring TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an wstring type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]{wstring"); + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + + output.print('}'); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a wstring type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[VALUE]{wstring"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + output.print(": \""); + output.print(input.read_wstring()); + output.print("\"}"); + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.java b/source/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.java new file mode 100644 index 0000000..c624409 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/AbstractInterfaceTypeCode.java @@ -0,0 +1,120 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The AbstractInterfaceTypeCode class represents a + * TypeCode object which is associated with an IDL abstract + * interface. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AbstractInterfaceTypeCode extends ComplexTypeCode +{ + + public AbstractInterfaceTypeCode() + { + super(TCKind.tk_abstract_interface); + } + + public AbstractInterfaceTypeCode(String repositoryId, String name) + { + super(TCKind.tk_abstract_interface, repositoryId, name); + } + + /** + * Dumps the description of a given ComplexTypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a ComplexTypeCode. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[TYPECODE]{abstract interface: "); + ComplexTypeCode.dumpParams(type, output); + output.print('}'); + } + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + input.read_abstract_interface(); + return true; + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean + dump_value(TypeCode type, + org.omg.CORBA_2_3.portable.InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + java.lang.Object obj = input.read_abstract_interface(); + + dump(type, output); + output.print("[VALUE] {--}"); + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/AliasTypeCode.java b/source/es/tid/TIDorbj/core/typecode/AliasTypeCode.java new file mode 100644 index 0000000..6052549 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/AliasTypeCode.java @@ -0,0 +1,266 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The AliasTypeCode class represents a TypeCode + * object which is associated with an IDL typedef. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class AliasTypeCode extends ComplexTypeCode +{ + + protected TypeCode _type; + + public AliasTypeCode() + { + super(TCKind.tk_alias); + _type = null; + } + + public AliasTypeCode(String repositoryId, String name, TypeCode type) + { + super(TCKind.tk_alias, repositoryId, name); + _type = type; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + + if (!super.equal(tc)) + return false; + try { + return _type.equal(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + return _type.equivalent(tc); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type; + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + _type = input.read_TypeCode(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValue(type.content_type(), input); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an alias type + */ + + public static void write_params(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + output.write_TypeCode(type.content_type()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshal_value(TypeCode type, InputStream input, + OutputStream output) + { + try { + TypeCodeMarshaler.remarshalValue(type.content_type(), + input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an alias type. + */ + + public static boolean values_equal(org.omg.CORBA.TypeCode type, + InputStream input_a, + InputStream input_b) + { + try { + return TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a ComplexTypeCode. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{typedef: "); + ComplexTypeCode.dumpParams(type, output); + output.print(" , type= "); + TypeCodeDumper.dump(type.content_type(), output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an alias type + * @return true if if has been possible dump the value. + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + + try { + output.print("[VALUE]{typedef "); + output.print(type.name()); + output.print(": "); + TypeCodeDumper.dumpValue(type.content_type(), input, output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ArrayTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ArrayTypeCode.java new file mode 100644 index 0000000..3e46439 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ArrayTypeCode.java @@ -0,0 +1,321 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ArrayTypeCode class represents a TypeCode + * object which is associated with an IDL array. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ArrayTypeCode extends TypeCodeImpl +{ + + protected TypeCode _element_type; + + protected int _length; + + public ArrayTypeCode() + { + super(TCKind.tk_array); + _element_type = null; + _length = 0; + } + + public ArrayTypeCode(TypeCode element_type, int length) + { + super(TCKind.tk_array); + _element_type = element_type; + _length = length; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (_element_type.equal(tc.content_type()) + && (_length == tc.length())); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _length; + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _element_type; + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public static void skip_params(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int length = input.read_ulong(); + input.skip(length); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + input.enterEncapsulation(); + + _element_type = input.read_TypeCode(); + _length = input.read_ulong(); + + input.exitEncapsulation(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValueArray(type.content_type(), input, + type.length()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + // write TCKind + output.write_long(type.kind().value()); + + // copy the output for insert the encapsulation length later + + CDROutputStream encapsulation = output.copy(); + + // marshalling of params + + output.enterEncapsulation(); + + output.write_TypeCode(type.content_type()); + output.write_ulong(type.length()); + + output.exitEncapsulation(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void remarshal_value(TypeCode type, InputStream input, + OutputStream output) + { + try { + int length = type.length(); + for (int i = 0; i < length; i++) + TypeCodeMarshaler.remarshalValue(type.content_type(), input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an array type. + */ + + public static boolean values_equal(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int length = type.length(); + + for (int i = 0; i < length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault in Array type operation: " + + bk.toString()); + } + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an array type. + */ + + public static void dump(org.omg.CORBA.TypeCode type, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{"); + TypeCodeDumper.dump(type.content_type(), output); + output.print('['); + output.print(type.length()); + output.print("]}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Array type expected to invoke length()" + + "and content_type()."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an array type + * @return true if if has been possible dump the value. + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int length = type.length(); + org.omg.CORBA.TypeCode elements_type = type.content_type(); + output.print("[VALUE]{"); + for (int i = 0; i < length; i++) { + output.print('('); + output.print(i); + output.print(") "); + if (!TypeCodeDumper.dumpValue(elements_type, input, output)) + return false; + output.print(" | "); + } + + output.print(" END_ARRAY-}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Array type expected to invoke length()" + + "and content_type()."); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ComplexTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ComplexTypeCode.java new file mode 100644 index 0000000..8f07e53 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ComplexTypeCode.java @@ -0,0 +1,328 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.Encapsulation; +import es.tid.TIDorbj.core.cdr.PointerCDR; + +/** + * The ComplexTypeCode class is base class the base for + * constructing complex TypeCode classes as + * StructTypeCode,AliasTypeCode, etc. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ComplexTypeCode extends TypeCodeImpl +{ + + protected String m_repository_id; + + protected String m_name; + + protected Encapsulation m_encapsuled_params; + + public ComplexTypeCode(TCKind type) + { + super(type); + m_repository_id = null; + m_name = null; + m_encapsuled_params = null; + } + + public ComplexTypeCode(TCKind type, String repositoryId, String name) + { + super(type); + m_repository_id = repositoryId; + m_name = name; + m_encapsuled_params = null; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (m_repository_id.equals(tc.id()) + && m_name.equals(tc.name())); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + } + + + + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_repository_id; + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_name; + } + + public int hashCode() + { + return m_repository_id.hashCode(); + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + output.write_string(type.id()); + output.write_string(type.name()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("TypeCode has not params"); + } + } + + public void readParams(CDRInputStream input) + { + m_repository_id = input.read_string(); + m_name = input.read_string(); + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + int length = input.read_ulong(); + input.skip(length); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + CDRInputStream encap_input = input.copy(); + + input.enterEncapsulation(); + + readParams(input); + + if (!input.getContextCDR().hasExternalIndirections()) { + m_encapsuled_params = encap_input.readEncapsulation(); + } + + encap_input = null; + + input.exitEncapsulation(); + + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a complex type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + // views if the typecode has been marshaled before + + PointerCDR previous_position = null; + + // "Indirections are not "freestanding", but only exist inside some + // other encoded TypeCode + + if (!output.getContextCDR().isRootContext()) { + + try { + previous_position = output.getContextCDR() + .lookupPosition(type.id()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("type.id() fails."); + } + } + + if (previous_position != null) { // marshal indirection + + output.writeIndirection(previous_position); + return; + } + + // aligns to get the typeCode position + + output.alignment(CDR.LONG_SIZE); + + // calculate the typecode position + + PointerCDR typecode_position; + + typecode_position = output.getPointer(); + + try { + // saves the typecode position + output.getContextCDR().putObject(type.id(), typecode_position); + } + catch (BadKind bk) {} + + // write the tc_kind value and un + + output.write_long(type.kind().value()); + + // if the typecode has a copy of the params marshaled write its + // encapsulation + if (type instanceof ComplexTypeCode) { + + synchronized (type) { + // esto se debe cambiar a una tabla de typecodes para tratar + // typecodes de + // otros ORBs + Encapsulation encap = + ((ComplexTypeCode) type).m_encapsuled_params; + + if (encap != null) { + output.writeEncapsulation(encap); + return; + } + + // create input stream for save the encapsualation + + boolean read_encapsulation = false; + + CDRInputStream encapsulation_input; + + encapsulation_input = output.inputStreamAtThisPosition(); + + // marshalling of params + + output.enterEncapsulation(); + + TypeCodeMarshaler.writeParams(type, output); + + read_encapsulation = !output.getContextCDR() + .hasExternalIndirections(); + + output.exitEncapsulation(); + + // if the typecode can be saved, because it does not have any + // indirection out + // of the scope of the encapsulation, save it + + if (read_encapsulation) + ((ComplexTypeCode) type).m_encapsuled_params = + encapsulation_input.readEncapsulation(); + + try { + encapsulation_input.close(); + } + catch (Exception e) {} + } + + return; + + } + + output.enterEncapsulation(); + + TypeCodeMarshaler.writeParams(type, output); + + output.exitEncapsulation(); + + } + + /** + * Dumps the description of a given ComplexTypeCode. Fails if it is not + * overriden by a child class. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Dumps the parameters description of a a given complex TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the value will be dumped + */ + + protected static void dumpParams(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("repositoryId= "); + output.print(type.id()); + output.print(", name="); + output.print(type.name()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Complex type expected."); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/EnumTypeCode.java b/source/es/tid/TIDorbj/core/typecode/EnumTypeCode.java new file mode 100644 index 0000000..22b1f67 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/EnumTypeCode.java @@ -0,0 +1,363 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The EnumTypeCode class represents a TypeCode + * object which is associated with an IDL enum. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class EnumTypeCode extends ComplexTypeCode +{ + + protected String[] m_members; + + public EnumTypeCode() + { + super(TCKind.tk_enum); + m_members = null; + + } + + public EnumTypeCode(String id, String name, String[] members) + { + super(TCKind.tk_enum, id, name); + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!m_members[i].equals(tc.member_name(i))) + return false; + } + // all rigth + return true; + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!m_members[i].equals(tc.member_name(i))) + return false; + } + // all rigth + return true; + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index]; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + int length = input.read_ulong(); + + m_members = new String[length]; + for (int i = 0; i < length; i++) + m_members[i] = input.read_string(); + + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipUlong(); + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an enum type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + ComplexTypeCode.writeParams(type, output); + + try { + + int length = type.member_count(); + + output.write_ulong(length); + for (int i = 0; i < length; i++) + output.write_string(type.member_name(i)); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an enum type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + int value = input.read_ulong(); + + try { + + if (value >= type.member_count()) + throw new MARSHAL("Enum discriminator value out of range."); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + + output.write_ulong(value); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an alias type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int value = input_a.read_ulong(); + if (value >= type.member_count()) + throw new MARSHAL("Enum discriminator value out of range."); + + return value == input_b.read_ulong(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + + output.print("[TYPECODE]{enum "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + int length = type.member_count(); + + output.print(type.member_name(0)); + for (int i = 1; i < length; i++) { + output.print(" ,"); + output.print(type.member_name(i)); + } + output.print("} }"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in enum operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an enum type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{enum "); + output.print(type.id()); + output.print(": "); + output.print(input.read_ulong()); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in enum operations:" + bk.toString()); + } + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.java new file mode 100644 index 0000000..771e249 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ExceptionTypeCode.java @@ -0,0 +1,237 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The ExceptionTypeCode class represents a TypeCode + * object which is associated with an IDL exception. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class ExceptionTypeCode extends StructTypeCode +{ + + public ExceptionTypeCode() + { + m_kind = TCKind.tk_except; + } + + public ExceptionTypeCode(String repositoryId, String name, + org.omg.CORBA.StructMember[] members) + { + super(repositoryId, name, members); + m_kind = TCKind.tk_except; + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skip_value(TypeCode type, CDRInputStream input) + { + // skip the id + input.skipString(); + // skip the members + return StructTypeCode.skipValue(type, input); + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a struct type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + // exception id + output.write_string(input.read_string()); + StructTypeCode.remarshalValue(type, input, output); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a struct type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + if (input_a.read_string().equals(input_b.read_string())) + return StructTypeCode.valuesEqual(type, input_a, input_b); + else + return false; + + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a exception type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[TYPECODE]{exception ("); + output.print(member_length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < member_length; i++) { + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bds.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an exception type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[VALUE]{exception "); + output.print(type.name()); + output.print(": "); + + output.print("(exception id)"); + output.print(input.read_string()); + output.print(" - "); + + for (int i = 0; i < member_length; i++) { + output.print('('); + output.print(i); + output.print(") "); + output.print(type.member_name(i)); + output.print(": "); + if (!TypeCodeDumper.dumpValue(type.member_type(i), input, + output)) + return false; + output.print(" | "); + } + output.print(" END_STRUCT-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in exception operations:" + + bds.toString()); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/FixedTypeCode.java b/source/es/tid/TIDorbj/core/typecode/FixedTypeCode.java new file mode 100644 index 0000000..03fe673 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/FixedTypeCode.java @@ -0,0 +1,277 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The FixedTypeCode class represents a TypeCode + * object which is associated with an IDL fixed. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class FixedTypeCode extends TypeCodeImpl +{ + + protected short m_digits; + + protected short m_scale; + + public FixedTypeCode() + { + super(TCKind.tk_fixed); + } + + public FixedTypeCode(short digits, short scale) + { + super(TCKind.tk_fixed); + this.m_digits = digits; + this.m_scale = scale; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + try { + return super.equal(tc) && (m_digits == tc.fixed_digits()) + && (m_scale == tc.fixed_scale()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_digits; + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_scale; + } + + //TIDORB operations + + public static int valueLength(TypeCode type) + { + try { + int fix_digits = type.fixed_digits(); + + return (fix_digits + (fix_digits % 2)) / 2; //it must have a odd + // number of octets + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operation fixed_digits()."); + } + } + + public boolean isSimple() + { + return false; + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + input.skipUshort(); + input.skipShort(); + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + m_digits = input.read_ushort(); + m_scale = input.read_short(); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + int length = valueLength(type); + input.skipOctetArray(length); + return true; + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a fixed type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + output.write_long(type.kind().value()); + output.write_ushort(type.fixed_digits()); + output.write_short(type.fixed_scale()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operations."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a fixed type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + int length = valueLength(type); + for (int i = 0; i < length; i++) + output.write_octet(input.read_octet()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a fixed type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + int length = valueLength(type); + for (int i = 0; i < length; i++) + if (input_a.read_octet() != input_b.read_octet()) + return false; + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a fixed type. + */ + + public static void dump(org.omg.CORBA.TypeCode type, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{fixed<"); + output.print(type.fixed_digits()); + output.print(','); + output.print(type.fixed_scale()); + output.print(">}"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in Fixed operations."); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a fixed type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[VALUE]{fixed: "); + int length = valueLength(type); + + for (int i = 0; i < length; i++) + output.print(input.read_octet()); + + output.print("}"); + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/NativeTypeCode.java b/source/es/tid/TIDorbj/core/typecode/NativeTypeCode.java new file mode 100644 index 0000000..41384cf --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/NativeTypeCode.java @@ -0,0 +1,68 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; + +/** + * The NativeTypeCode class represents a TypeCode + * object which is associated with an IDL native. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class NativeTypeCode extends ComplexTypeCode +{ + + public NativeTypeCode() + { + super(TCKind.tk_native); + } + + public NativeTypeCode(String repositoryId, String name) + { + super(TCKind.tk_native, repositoryId, name); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.java new file mode 100644 index 0000000..bd2e24f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ObjectRefTypeCode.java @@ -0,0 +1,211 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +/** + * The ArrayTypeCode class represents a TypeCode + * object which is associated with an IDL reference. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ObjectRefTypeCode extends ComplexTypeCode +{ + + public ObjectRefTypeCode() + { + super(TCKind.tk_objref); + } + + public ObjectRefTypeCode(String repositoryId, String name) + { + super(TCKind.tk_objref, repositoryId, name); + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[TYPECODE]{obj_reference:"); + ComplexTypeCode.dumpParams(type, output); + output.print('}'); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + // skip the IOR + IOR.skip(input); + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an array type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + + output.write_Object(input.read_Object()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an array type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + //compare two objects + return input_a.read_Object()._is_equivalent(input_b.read_Object()); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an array type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + IOR ior = null; + + if (input instanceof CDRInputStream) { + ior = new DefaultIOR(); + ior.read((CDRInputStream) input); + } else { + org.omg.CORBA.Object obj = input.read_Object(); + String str = input.orb().object_to_string(obj); + ior = DefaultIOR.fromString(null, str); + } + + try { + + int size = ior.memberCount(); + + if (size == 0) { + output.print("[VALUE]{IOR: nil}"); + } else { + output.print("[VALUE]{IOR Repository Id: "); + output.print(ior.getTypeId()); + output.print(" ("); + output.print(size); + output.print(" Profiles )"); + + for (int i = 0; i < size; i++) { + output.print(size); + output.print(" | "); + output.print(ior.getProfile(i).toString()); + } + + output.print("-}"); + + } + } + catch (Exception e) { + return false; + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.java b/source/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.java new file mode 100644 index 0000000..63ec4f2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/RecursiveTypeCode.java @@ -0,0 +1,179 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.PointerCDR; + +/** + * The RecursiveTypeCode class represents a TypeCode + * object which is associated with an IDL recursion in a typecode definition. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class RecursiveTypeCode extends TypeCodeImpl +{ + + protected String m_repository_id; + + public RecursiveTypeCode() + { + m_repository_id = ""; + } + + public RecursiveTypeCode(String id) + { + //it is not a real typecode!!!! + m_repository_id = id; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (tc instanceof RecursiveTypeCode) + return m_repository_id.equals( + ((RecursiveTypeCode) tc).m_repository_id); + else + return false; + } + + //TIDORB operations + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a recursisve type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + PointerCDR previous_position = null; + + previous_position = output.getContextCDR() + .lookupPosition(type.id()); + + if (previous_position == null) + throw new MARSHAL("Invalid Recursive TypeCode: " + type.id() + + " is not yet marshaled."); + + output.writeIndirection(previous_position); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operations:" + + bk.toString()); + } + + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{obj_reference:"); + ComplexTypeCode.dumpParams(type.content_type(), output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operation:" + + bk.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("Indirection to " + type.id() + + "[CAN'T PROCESS MORE."); + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in recursive operation:" + + bk.toString()); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/SequenceTypeCode.java b/source/es/tid/TIDorbj/core/typecode/SequenceTypeCode.java new file mode 100644 index 0000000..62e119f --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/SequenceTypeCode.java @@ -0,0 +1,275 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The SequenceTypeCode class represents a TypeCode + * object which is associated with an IDL sequence. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SequenceTypeCode extends ArrayTypeCode +{ + + public SequenceTypeCode() + { + m_kind = TCKind.tk_sequence; + } + + public SequenceTypeCode(TypeCode element_type, int length) + { + super(element_type, length); + m_kind = TCKind.tk_sequence; + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + + int length = input.read_ulong(); + + int type_length = type.length(); + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + "indicated in typecode."); + + return TypeCodeMarshaler.skipValueArray(type.content_type(), + input, + length); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a sequence type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + + int length = input.read_ulong(); + + int type_length = type.length(); + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + output.write_ulong(length); + + for (int i = 0; i < length; i++) + TypeCodeMarshaler.remarshalValue(type.content_type(), input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a sequence type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int a_length = input_a.read_ulong(); + int b_length = input_b.read_ulong(); + + if (a_length != b_length) + return false; + + int type_length = type.length(); + + if ((type_length > 0) && (a_length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + for (int i = 0; i < a_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.content_type(), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length() " + + "and content_type()."); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a sequence type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{sequence "); + + output.print('<'); + + if (type.length() != 0) { + output.print(type.length()); + output.print(","); + } + TypeCodeDumper.dump(type.content_type(), output); + output.print('>'); + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length() " + + "and content_type()."); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a sequence type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int length = input.read_ulong(); + + int type_length = type.length(); + + if ((type_length > 0) && (length > type_length)) //fixed size + throw new MARSHAL("Sequence length greater than maximum length" + + " indicated in typecode."); + + output.print('['); + output.print(length); + output.print(" VALUES]"); + output.print('{'); + for (int i = 0; i < length; i++) { + output.print('('); + output.print(i); + output.print(") "); + if (!TypeCodeDumper.dumpValue(type.content_type(), + input, + output)) + return false; + output.print(" | "); + } + + output.print(" END_SEQUENCE-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Sequence type expected to invoke length()" + + " and content_type()."); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/StringTypeCode.java b/source/es/tid/TIDorbj/core/typecode/StringTypeCode.java new file mode 100644 index 0000000..aecec34 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/StringTypeCode.java @@ -0,0 +1,270 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The StringTypeCode class represents a TypeCode + * object which is associated with an IDL string. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class StringTypeCode extends TypeCodeImpl +{ + + /** + * Max length of the string, or 0 if unbounded. + */ + + protected int m_length; + + public StringTypeCode() + { + super(TCKind.tk_string); + m_length = 0; + } + + public StringTypeCode(int length) + { + super(TCKind.tk_string); + m_length = length; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + try { + return (m_length == tc.length()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind e) { + return false; + } + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_length; + } + + //TIDORB operations + + public boolean isSimple() + { + return false; + } + + public void partialUnmarshal(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + + m_length = input.read_ulong(); + + } + + public static void skipParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + //skip length + input.skipUlong(); + } + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream via the TypeCodeMarshaler. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a string type + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + try { + output.write_long(type.kind().value()); + output.write_long(type.length()); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a string type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + output.write_string(input.read_string()); + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipString(); + return true; + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a string type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + return (input_a.read_string()).equals(input_b.read_string()); + } + + /** + * Dumps the description of a given string TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a string type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]{string"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in string operations:" + + bk.toString()); + } + + output.print('}'); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a string type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + + output.print("[VALUE]{string"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in string operations:" + + bk.toString()); + } + + output.print(": \""); + output.print(input.read_string()); + output.print("\"}"); + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/StructTypeCode.java b/source/es/tid/TIDorbj/core/typecode/StructTypeCode.java new file mode 100644 index 0000000..13ce65d --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/StructTypeCode.java @@ -0,0 +1,431 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.StructMember; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The StructTypeCode class represents a TypeCode + * object which is associated with an IDL struct. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class StructTypeCode extends ComplexTypeCode +{ + + protected StructMember[] m_members; + + public StructTypeCode() + { + super(TCKind.tk_struct); + m_members = null; + } + + public StructTypeCode(String repositoryId, String name, + StructMember[] members) + { + super(TCKind.tk_struct, repositoryId, name); + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (!(m_members[i].type.equal(tc.member_type(i)))) + return false; + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (!(m_members[i].type.equivalent(tc.member_type(i)))) + return false; + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + + int length = input.read_ulong(); + + m_members = new StructMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i] = new StructMember(); + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + int member_length = type.member_count(); + for (int i = 0; i < member_length; i++) { + if (!TypeCodeMarshaler.skipValue(type.member_type(i), input)) + return false; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a struct type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + + ComplexTypeCode.writeParams(type, output); + try { + int member_length = type.member_count(); + output.write_ulong(member_length); + for (int i = 0; i < member_length; i++) { + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a struct type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + TypeCodeMarshaler.remarshalValue(type.member_type(i), input, + output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a struct type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.member_type(i), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an struct type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[TYPECODE]{struct ("); + output.print(member_length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < member_length; i++) { + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a struct type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + int member_length = type.member_count(); + + output.print("[VALUE]{struct "); + output.print(type.name()); + output.print(": "); + for (int i = 0; i < member_length; i++) { + output.print('('); + output.print(i); + output.print(") "); + output.print(type.member_name(i)); + output.print(": "); + if (!TypeCodeDumper.dumpValue(type.member_type(i), input, + output)) + return false; + output.print(" | "); + } + output.print(" END_STRUCT-}"); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.java b/source/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.java new file mode 100644 index 0000000..41641a4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TransparentAliasTypeCode.java @@ -0,0 +1,173 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +public class TransparentAliasTypeCode extends AliasTypeCode +{ + + public TransparentAliasTypeCode() + { + super(); + } + + public TransparentAliasTypeCode(String repositoryId, String name, + TypeCodeImpl type) + { + super(repositoryId, name, type); + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + return _type.equal(tc); + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + return _type.equivalent(tc); + } + + public org.omg.CORBA.TypeCode get_compact_typecode() + { + return _type.get_compact_typecode(); + } + + public org.omg.CORBA.TCKind kind() + { + return _type.kind(); + } + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.id(); + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.name(); + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.member_count(); + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_name(index); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_type(index); + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_label(index); + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.discriminator_type(); + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.default_index(); + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.length(); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.content_type(); + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.fixed_digits(); + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.fixed_scale(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + return _type.member_visibility(index); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.type_modifier(); + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return _type.concrete_base_type(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeCache.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeCache.java new file mode 100644 index 0000000..1dc9447 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeCache.java @@ -0,0 +1,116 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.util.FullUseTableException; +import es.tid.TIDorbj.core.util.UseTable; + +public class TypeCodeCache +{ + + protected UseTable m_table; + + public TypeCodeCache(int max) + { + m_table = new UseTable(max); + } + + public synchronized TypeCode find(String rep_id) + { + if (m_table.object_exist(rep_id)) { + TypeCodeHandler handler = (TypeCodeHandler) m_table.get(rep_id); + + m_table.use(rep_id); + return handler.getTypeCode(); + } + + return null; + } + + /** + * Tries to insert one TypeCode in the TypeCodeCache. + * + * @param type + * @return if there is also a TypeCode with the same id, returns the + * TypeCode cached otherwise, the same Typecode put. * + */ + public synchronized TypeCode put(TypeCode type) + { + String rep_id = null; + try { + rep_id = type.id(); + } + catch (BadKind badKind) { + throw new + INTERNAL("Only Complex Typecodes can be put in the cache"); + } + + if (rep_id == null) + throw new org.omg.CORBA.INTERNAL("Cannot get RepositoryId"); + + if (m_table.object_exist(rep_id)) { + m_table.use(rep_id); + return ((TypeCodeHandler) m_table.get(rep_id)).getTypeCode(); + } else { + try { + m_table.append(rep_id, new TypeCodeHandler(type)); + return type; + } + catch (FullUseTableException e) { + //ignore it + } + } + + return type; + + } + + public synchronized void destroy() + { + m_table = null; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeDumper.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeDumper.java new file mode 100644 index 0000000..f26a7f6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeDumper.java @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; + +/** + * Dumps the description of a TypeCode and the marshaled value asociated to it. + *

+ * For example, a 5 long elements array typecode will be dumed as: + *

+ * [TYPECODE]{[TYPECODE]{long}[5]} + * + * @author Juan A. Cáceres + * @version 1.0 + */ +public class TypeCodeDumper +{ + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.dump(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.dump(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.dump(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.dump(type, output); + break; + case TCKind._tk_string: + StringTypeCode.dump(type, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.dump(type, output); + break; + case TCKind._tk_array: + ArrayTypeCode.dump(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.dump(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.dump(type, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.dump(type, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.dump(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.dump(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.dump(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.dump(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.dump(type, output); + break; + default: + TypeCodeImpl.dump(type, output); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.dumpValue(type, input, output); + case TCKind._tk_objref: + return ObjectRefTypeCode.dumpValue(type, input, output); + case TCKind._tk_union: + return UnionTypeCode.dumpValue(type, input, output); + case TCKind._tk_enum: + return EnumTypeCode.dumpValue(type, input, output); + case TCKind._tk_string: + return StringTypeCode.dumpValue(type, input, output); + case TCKind._tk_sequence: + return SequenceTypeCode.dumpValue(type, input, output); + case TCKind._tk_array: + return ArrayTypeCode.dump_value(type, input, output); + case TCKind._tk_alias: + return AliasTypeCode.dump_value(type, input, output); + case TCKind._tk_except: + return ExceptionTypeCode.dumpValue(type, input, output); + case TCKind._tk_wstring: + return WStringTypeCode.dumpValue(type, input, output); + case TCKind._tk_fixed: + return FixedTypeCode.dumpValue(type, input, output); + case TCKind._tk_value: + return ValueTypeCode.dump_value(type, input, output); + case TCKind._tk_value_box: + return ValueBoxTypeCode.dumpValue(type, input, output); + case TCKind._tk_native: + return NativeTypeCode.dump_value(type, input, output); + case TCKind._tk_abstract_interface: + return + AbstractInterfaceTypeCode.dump_value(type, input, output); + default: + return TypeCodeImpl.dump_value(type, input, output); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeFactory.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeFactory.java new file mode 100644 index 0000000..9003119 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeFactory.java @@ -0,0 +1,233 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; + +/** + * Factory of basic and complex typecodes. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class TypeCodeFactory +{ + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getBasicTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_null: + return tc_null; + case TCKind._tk_objref: + return tc_objref; + case TCKind._tk_any: + return tc_any; + case TCKind._tk_TypeCode: + return tc_TypeCode; + case TCKind._tk_void: + return tc_void; + case TCKind._tk_short: + return tc_short; + case TCKind._tk_long: + return tc_long; + case TCKind._tk_ushort: + return tc_ushort; + case TCKind._tk_ulong: + return tc_ulong; + case TCKind._tk_float: + return tc_float; + case TCKind._tk_double: + return tc_double; + case TCKind._tk_boolean: + return tc_boolean; + case TCKind._tk_char: + return tc_char; + case TCKind._tk_octet: + return tc_octet; + case TCKind._tk_longlong: + return tc_longlong; + case TCKind._tk_ulonglong: + return tc_ulonglong; + case TCKind._tk_longdouble: + return tc_longdouble; + case TCKind._tk_wchar: + return tc_wchar; + case TCKind._tk_string: + return tc_string; + case TCKind._tk_wstring: + return tc_wstring; + default: + return null; + } + } + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getComplexTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_struct: + return new StructTypeCode(); + case TCKind._tk_objref: + return new ObjectRefTypeCode(); + case TCKind._tk_union: + return new UnionTypeCode(); + case TCKind._tk_enum: + return new EnumTypeCode(); + case TCKind._tk_alias: + // return new TransparentAliasTypeCode(); + return new AliasTypeCode(); + // this is a transparent alias it will be the content type for user + case TCKind._tk_except: + return new ExceptionTypeCode(); + case TCKind._tk_value: + return new ValueTypeCode(); + case TCKind._tk_value_box: + return new ValueBoxTypeCode(); + case TCKind._tk_native: + return new NativeTypeCode(); + case TCKind._tk_abstract_interface: + return new AbstractInterfaceTypeCode(); + default: + return null; + } + } + + public static final es.tid.TIDorbj.core.typecode.TypeCodeImpl + getSemiComplexTypeCode(TCKind tcKind) + { + switch (tcKind.value()) + { + case TCKind._tk_string: + return new StringTypeCode(); + case TCKind._tk_sequence: + return new SequenceTypeCode(); + case TCKind._tk_array: + return new ArrayTypeCode(); + case TCKind._tk_wstring: + return new WStringTypeCode(); + case TCKind._tk_fixed: + return new FixedTypeCode(); + default: + return null; + } + } + + public static final boolean isComplex(TCKind kind) + { + switch (kind.value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + return true; + default: + return false; + } + } + + public static final boolean isSemiComplex(TCKind kind) + { + + switch (kind.value()) + { + case TCKind._tk_sequence: + case TCKind._tk_string: + case TCKind._tk_array: + case TCKind._tk_wstring: + case TCKind._tk_fixed: + return true; + default: + return false; + } + } + + public static final TypeCodeImpl tc_null = new TypeCodeImpl(TCKind.tk_null); + + public static final TypeCodeImpl tc_objref = + new ObjectRefTypeCode("IDL:omg/org/CORBA/Object:1.0", + "Object"); + + public static final TypeCodeImpl tc_any = new TypeCodeImpl(TCKind.tk_any); + public static final TypeCodeImpl tc_TypeCode = + new TypeCodeImpl(TCKind.tk_TypeCode); + public static final TypeCodeImpl tc_void = new TypeCodeImpl(TCKind.tk_void); + public static final TypeCodeImpl tc_short = new TypeCodeImpl(TCKind.tk_short); + public static final TypeCodeImpl tc_long = new TypeCodeImpl(TCKind.tk_long); + public static final TypeCodeImpl tc_ushort = + new TypeCodeImpl(TCKind.tk_ushort); + public static final TypeCodeImpl tc_ulong = + new TypeCodeImpl(TCKind.tk_ulong); + public static final TypeCodeImpl tc_float = + new TypeCodeImpl(TCKind.tk_float); + public static final TypeCodeImpl tc_double = + new TypeCodeImpl(TCKind.tk_double); + public static final TypeCodeImpl tc_boolean = + new TypeCodeImpl(TCKind.tk_boolean); + public static final TypeCodeImpl tc_char = new TypeCodeImpl(TCKind.tk_char); + public static final TypeCodeImpl tc_octet = + new TypeCodeImpl(TCKind.tk_octet); + public static final TypeCodeImpl tc_longlong = + new TypeCodeImpl(TCKind.tk_longlong); + public static final TypeCodeImpl tc_ulonglong = + new TypeCodeImpl(TCKind.tk_ulonglong); + public static final TypeCodeImpl tc_longdouble = + new TypeCodeImpl(TCKind.tk_longdouble); + public static final TypeCodeImpl tc_wchar = + new TypeCodeImpl(TCKind.tk_wchar); + public static final StringTypeCode tc_string = + (StringTypeCode) getSemiComplexTypeCode(TCKind.tk_string); + public static final WStringTypeCode tc_wstring = + (WStringTypeCode) getSemiComplexTypeCode(TCKind.tk_wstring); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeHandler.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeHandler.java new file mode 100644 index 0000000..4e5e16a --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeHandler.java @@ -0,0 +1,66 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TypeCode; + +public class TypeCodeHandler + implements es.tid.TIDorbj.core.util.RemovableObject +{ + TypeCode m_typecode; + + public TypeCodeHandler(TypeCode tc) + { + m_typecode = tc; + } + + public TypeCode getTypeCode() + { + return m_typecode; + } + + public boolean canBeRemoved() + { + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeImpl.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeImpl.java new file mode 100644 index 0000000..0eedd42 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeImpl.java @@ -0,0 +1,655 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The TypeCode class represents a TypeCode object + * which is associated with an IDL of a basic type. It is the base class to the + * rest of simple and complex typecodes. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class TypeCodeImpl extends org.omg.CORBA.TypeCode +{ + + TCKind m_kind; + + boolean m_exhaustive_equal = false; + + protected TypeCodeImpl() + { + m_kind = TCKind.tk_null; + } + + public TypeCodeImpl(TCKind kind) + { + m_kind = kind; + } + + public void setExhaustiveEqual(boolean value) + { + m_exhaustive_equal = value; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + return (m_kind.value() == tc.kind().value()); + } + + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } else { + return equals(tc); + } + } + + public org.omg.CORBA.TypeCode get_compact_typecode() + { + return this; + } + + public org.omg.CORBA.TCKind kind() + { + return m_kind; + } + + public java.lang.String id() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public java.lang.String name() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public int length() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short fixed_digits() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short fixed_scale() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + throw new org.omg.CORBA.TypeCodePackage.BadKind(); + } + + //TIDORB operations + + public boolean isSimple() + { + return true; + } + + /** + * TypeCode Marshaling. + */ + + public static void marshal(org.omg.CORBA.TypeCode type, + CDROutputStream output) + { + output.write_ulong(type.kind().value()); + } + + /** + * TypeCode parameters demarshaling. In this case, theres nothing to do. + * This operation will throw the INTERNAL exception. + */ + public void partialUnmarshal(CDRInputStream input) + { + throw new org.omg.CORBA.INTERNAL("Nothing to unmarshal", 0, + CompletionStatus.COMPLETED_NO); + } + + /** + * Skips the TypeCode parameters. + */ + + public static void skipParams(CDRInputStream input) + { + //nothing to do + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + input.skipShort(); + break; + case TCKind._tk_long: + input.skipLong(); + break; + case TCKind._tk_longlong: + input.skip_longlong(); + break; + case TCKind._tk_ushort: + input.skipUshort(); + break; + case TCKind._tk_ulong: + input.skipUlong(); + break; + case TCKind._tk_ulonglong: + input.skipUlonglong(); + break; + case TCKind._tk_float: + input.skipFloat(); + break; + case TCKind._tk_double: + input.skipDouble(); + break; + case TCKind._tk_boolean: + input.skipBoolean(); + break; + case TCKind._tk_char: + input.skipChar(); + break; + case TCKind._tk_wchar: + input.skipWchar(); + break; + case TCKind._tk_octet: + input.skipOctet(); + break; + case TCKind._tk_any: + input.skipAny(); + break; + case TCKind._tk_TypeCode: + input.skipTypeCode(); + break; + case TCKind._tk_Principal: + input.skipPrincipal(); + break; + case TCKind._tk_null: + case TCKind._tk_void: + break; + default: + throw new INTERNAL("TypeCode is not basic.", 0, + CompletionStatus.COMPLETED_NO); + } + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be a basic type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + output.write_short(input.read_short()); + break; + case TCKind._tk_long: + output.write_long(input.read_long()); + break; + case TCKind._tk_longlong: + output.write_longlong(input.read_longlong()); + break; + case TCKind._tk_ushort: + output.write_ushort(input.read_ushort()); + break; + case TCKind._tk_ulong: + output.write_ulong(input.read_ulong()); + break; + case TCKind._tk_ulonglong: + output.write_ulonglong(input.read_ulonglong()); + break; + case TCKind._tk_float: + output.write_float(input.read_float()); + break; + case TCKind._tk_double: + output.write_double(input.read_double()); + break; + case TCKind._tk_boolean: + output.write_boolean(input.read_boolean()); + break; + case TCKind._tk_char: + output.write_char(input.read_char()); + break; + case TCKind._tk_wchar: + output.write_wchar(input.read_wchar()); + break; + case TCKind._tk_octet: + output.write_octet(input.read_octet()); + break; + case TCKind._tk_any: + output.write_any(input.read_any()); + break; + case TCKind._tk_objref: + output.write_Object(input.read_Object()); + break; + case TCKind._tk_string: + output.write_string(input.read_string()); + break; + case TCKind._tk_wstring: + output.write_wstring(input.read_wstring()); + break; + case TCKind._tk_TypeCode: + output.write_TypeCode(input.read_TypeCode()); + break; + case TCKind._tk_Principal: + output.write_Principal(input.read_Principal()); + break; + case TCKind._tk_null: + case TCKind._tk_void: + break; + default: + throw new org.omg.CORBA.INTERNAL("TypeCode is not basic", 0, + CompletionStatus.COMPLETED_NO); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a basic type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream a_input, InputStream b_input) + { + switch (type.kind().value()) + { + case TCKind._tk_short: + return a_input.read_short() == b_input.read_short(); + case TCKind._tk_long: + return a_input.read_long() == b_input.read_long(); + case TCKind._tk_longlong: + return a_input.read_longlong() == b_input.read_longlong(); + case TCKind._tk_ushort: + return a_input.read_ushort() == b_input.read_ushort(); + case TCKind._tk_ulong: + return a_input.read_ulong() == b_input.read_ulong(); + case TCKind._tk_ulonglong: + return a_input.read_ulonglong() == b_input.read_ulonglong(); + case TCKind._tk_float: + return a_input.read_float() == b_input.read_float(); + case TCKind._tk_double: + return a_input.read_double() == b_input.read_double(); + case TCKind._tk_boolean: + return a_input.read_boolean() == b_input.read_boolean(); + case TCKind._tk_char: + return a_input.read_char() == b_input.read_char(); + case TCKind._tk_wchar: + return a_input.read_wchar() == b_input.read_wchar(); + case TCKind._tk_octet: + return a_input.read_octet() == b_input.read_octet(); + case TCKind._tk_any: + TypeCode tc_a, + tc_b; + tc_a = a_input.read_TypeCode(); + tc_b = b_input.read_TypeCode(); + if (tc_a.equal(tc_b)) + return TypeCodeMarshaler + .valuesEqual(tc_a, a_input, b_input); + else + return false; + case TCKind._tk_TypeCode: + return (a_input.read_TypeCode()).equal(b_input.read_TypeCode()); + case TCKind._tk_Principal: + return + (a_input.read_Principal()).equals(b_input.read_Principal()); + case TCKind._tk_null: + case TCKind._tk_void: + return true; + default: + throw new org.omg.CORBA.MARSHAL("TypeCode is not basic", 0, + CompletionStatus.COMPLETED_NO); + + } + + } + + /** + * Dumps the description of a given string TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be a string type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]"); + switch (type.kind().value()) + { + case TCKind._tk_short: + output.print("{short}"); + break; + case TCKind._tk_long: + output.print("{long}"); + break; + case TCKind._tk_longlong: + output.print("{longlong}"); + break; + case TCKind._tk_ushort: + output.print("{ushort}"); + break; + case TCKind._tk_ulong: + output.print("{ulong}"); + break; + case TCKind._tk_ulonglong: + output.print("{ulonglong}"); + break; + case TCKind._tk_float: + output.print("{float}"); + break; + case TCKind._tk_double: + output.print("{double}"); + break; + case TCKind._tk_boolean: + output.print("{boolean}"); + break; + case TCKind._tk_char: + output.print("{char}"); + break; + case TCKind._tk_wchar: + output.print("{wchar}"); + break; + case TCKind._tk_octet: + output.print("{octet}"); + break; + case TCKind._tk_any: + output.print("{any}"); + break; + case TCKind._tk_string: + output.print("{string}"); + break; + case TCKind._tk_wstring: + output.print("{wstring}"); + break; + case TCKind._tk_TypeCode: + output.print("{TypeCode}"); + break; + case TCKind._tk_Principal: + output.print("{Principal}"); + case TCKind._tk_null: + output.print("{null}"); + break; + case TCKind._tk_void: + output.print("{void}"); + break; + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a simple type + */ + + public static boolean dump_value(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + + { + switch (type.kind().value()) + { + case TCKind._tk_null: + output.print("{null value}"); + return true; + case TCKind._tk_short: + output.print("{short: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_long: + output.print("{long: "); + output.print(input.read_long()); + output.print("}"); + return true; + case TCKind._tk_longlong: + output.print("{longlong: "); + output.print(input.read_longlong()); + output.print("}"); + return true; + case TCKind._tk_ushort: + output.print("{ushort: "); + output.print(input.read_ushort()); + output.print("}"); + return true; + case TCKind._tk_ulong: + output.print("{ulong: "); + output.print(input.read_ulong()); + output.print("}"); + return true; + case TCKind._tk_ulonglong: + output.print("{ulonglong: "); + output.print(input.read_ulonglong()); + output.print("}"); + return true; + case TCKind._tk_float: + output.print("{float: "); + output.print(input.read_float()); + output.print("}"); + return true; + case TCKind._tk_double: + output.print("{double: "); + output.print(input.read_double()); + output.print("}"); + return true; + case TCKind._tk_boolean: + output.print("{boolean: "); + output.print(input.read_boolean()); + output.print("}"); + return true; + case TCKind._tk_char: + output.print("{char: "); + output.print(input.read_char()); + output.print("}"); + return true; + case TCKind._tk_wchar: + output.print("{wchar: "); + output.print(input.read_wchar()); + output.print("}"); + return true; + case TCKind._tk_octet: + output.print("{octet: "); + output.print(input.read_octet()); + output.print("}"); + return true; + case TCKind._tk_any: + output.print("{any: "); + AnyImpl.dump(input.read_any(), output); + output.print("}"); + return true; + case TCKind._tk_string: + output.print("{string: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_wstring: + output.print("{wstring: "); + output.print(input.read_short()); + output.print("}"); + return true; + case TCKind._tk_TypeCode: + output.print("{TypeCode: "); + TypeCodeDumper.dump(input.read_TypeCode(), output); + output.print("}"); + return true; + case TCKind._tk_Principal: + output.print("{Principal: "); + output.print(input.read_Principal()); + output.print("}"); + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.java b/source/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.java new file mode 100644 index 0000000..55b2171 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/TypeCodeMarshaler.java @@ -0,0 +1,476 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * General TypeCode marshalling operations. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class TypeCodeMarshaler +{ + + /** + * Marshal the given typecode in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void marshal(TypeCode type, CDROutputStream output) + { + putInCache(type, output); + + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.marshal(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.marshal(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.marshal(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.marshal(type, output); + break; + case TCKind._tk_string: + StringTypeCode.marshal(type, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.marshal(type, output); + break; + case TCKind._tk_array: + ArrayTypeCode.marshal(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.marshal(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.marshal(type, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.marshal(type, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.marshal(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.marshal(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.marshal(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.marshal(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.marshal(type, output); + break; + default: + TypeCodeImpl.marshal(type, output); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.writeParams(type, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.writeParams(type, output); + break; + case TCKind._tk_union: + UnionTypeCode.writeParams(type, output); + break; + case TCKind._tk_enum: + EnumTypeCode.writeParams(type, output); + break; + case TCKind._tk_alias: + AliasTypeCode.write_params(type, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.writeParams(type, output); + break; + case TCKind._tk_value: + ValueTypeCode.writeParams(type, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.writeParams(type, output); + break; + case TCKind._tk_native: + NativeTypeCode.writeParams(type, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.writeParams(type, output); + break; + default: + throw new org.omg.CORBA.INTERNAL("TypeCode has not params"); + } + } + + public static void skipParams(TCKind kind, CDRInputStream input) + { + switch (kind.value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + ComplexTypeCode.skipParams(input); + break; + case TCKind._tk_sequence: + SequenceTypeCode.skip_params(input); + break; + case TCKind._tk_array: + ArrayTypeCode.skip_params(input); + break; + case TCKind._tk_string: + StringTypeCode.skipParams(input); + break; + case TCKind._tk_wstring: + WStringTypeCode.skipParams(input); + break; + case TCKind._tk_fixed: + FixedTypeCode.skipParams(input); + break; + } + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, OutputStream output) + { + + switch (type.kind().value()) + { + case TCKind._tk_struct: + StructTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_objref: + ObjectRefTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_union: + UnionTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_enum: + EnumTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_string: + StringTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_sequence: + SequenceTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_array: + ArrayTypeCode.remarshal_value(type, input, output); + break; + case TCKind._tk_alias: + AliasTypeCode.remarshal_value(type, input, output); + break; + case TCKind._tk_except: + ExceptionTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_wstring: + WStringTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_fixed: + FixedTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_value: + ValueTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_value_box: + ValueBoxTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_native: + NativeTypeCode.remarshalValue(type, input, output); + break; + case TCKind._tk_abstract_interface: + AbstractInterfaceTypeCode.remarshalValue(type, input, output); + break; + default: + TypeCodeImpl.remarshalValue(type, input, output); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_objref: + return ObjectRefTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_union: + return UnionTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_enum: + return EnumTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_string: + return StringTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_sequence: + return SequenceTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_array: + return ArrayTypeCode.values_equal(type, input_a, input_b); + case TCKind._tk_alias: + return AliasTypeCode.values_equal(type, input_a, input_b); + case TCKind._tk_except: + return ExceptionTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_wstring: + return WStringTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_fixed: + return FixedTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_value: + return ValueTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_value_box: + return ValueBoxTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_native: + return NativeTypeCode.valuesEqual(type, input_a, input_b); + case TCKind._tk_abstract_interface: + return AbstractInterfaceTypeCode.valuesEqual(type, input_a, + input_b); + default: + return TypeCodeImpl.valuesEqual(type, input_a, input_b); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + switch (type.kind().value()) + { + case TCKind._tk_struct: + return StructTypeCode.skipValue(type, input); + case TCKind._tk_objref: + return ObjectRefTypeCode.skipValue(type, input); + case TCKind._tk_union: + return UnionTypeCode.skipValue(type, input); + case TCKind._tk_enum: + return EnumTypeCode.skipValue(type, input); + case TCKind._tk_string: + return StringTypeCode.skipValue(type, input); + case TCKind._tk_sequence: + return SequenceTypeCode.skipValue(type, input); + case TCKind._tk_array: + return ArrayTypeCode.skip_value(type, input); + case TCKind._tk_alias: + return AliasTypeCode.skip_value(type, input); + case TCKind._tk_except: + return ExceptionTypeCode.skip_value(type, input); + case TCKind._tk_wstring: + return WStringTypeCode.skipValue(type, input); + case TCKind._tk_fixed: + return FixedTypeCode.skipValue(type, input); + case TCKind._tk_value: + return ValueTypeCode.skipValue(type, input); + case TCKind._tk_value_box: + return ValueBoxTypeCode.skipValue(type, input); + case TCKind._tk_native: + return NativeTypeCode.skipValue(type, input); + case TCKind._tk_abstract_interface: + return AbstractInterfaceTypeCode.skip_value(type, input); + default: + return TypeCodeImpl.skipValue(type, input); + } + } + + /** + * Skips a value array asociated to the TypeCode. This operation is used by + * the TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + public static boolean skipValueArray(TypeCode type, CDRInputStream input, + int n) + { + + switch (type.kind().value()) + { + case TCKind._tk_short: + input.skipShortArray(n); + break; + case TCKind._tk_long: + input.skipLongArray(n); + break; + case TCKind._tk_longlong: + input.skipLonglongArray(n); + break; + case TCKind._tk_ushort: + input.skipUshortArray(n); + break; + case TCKind._tk_ulong: + input.skipUlongArray(n); + break; + case TCKind._tk_ulonglong: + input.skipUlonglongArray(n); + break; + case TCKind._tk_float: + input.skipFloatArray(n); + break; + case TCKind._tk_double: + input.skipDoubleArray(n); + break; + case TCKind._tk_boolean: + input.skipBooleanArray(n); + break; + case TCKind._tk_char: + input.skipCharArray(n); + break; + case TCKind._tk_wchar: + input.skipWcharArray(n); + break; + case TCKind._tk_octet: + input.skipOctetArray(n); + break; + default: + for (int i = 0; i < n; i++) + if (!skipValue(type, input)) + return false; + } + + return true; + } + + public static void putInCache(TypeCode type, CDROutputStream output) + { + org.omg.CORBA.ORB input_orb = output.orb(); + + if (input_orb == null) + return; + + TypeCodeCache cache = null; + + if (input_orb instanceof TIDORB) + cache = ((TIDORB) input_orb).getTypeCodeCache(); + + if (cache != null) { + switch (type.kind().value()) + { + case TCKind._tk_struct: + case TCKind._tk_objref: + case TCKind._tk_union: + case TCKind._tk_enum: + case TCKind._tk_alias: + case TCKind._tk_except: + case TCKind._tk_value: + case TCKind._tk_value_box: + case TCKind._tk_native: + case TCKind._tk_abstract_interface: + cache.put(type); + } + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/UnionTypeCode.java b/source/es/tid/TIDorbj/core/typecode/UnionTypeCode.java new file mode 100644 index 0000000..07a4a23 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/UnionTypeCode.java @@ -0,0 +1,579 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.UnionMember; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The UnionTypeCode class represents a TypeCode + * object which is associated with an IDL union. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class UnionTypeCode extends ComplexTypeCode +{ + + protected TypeCode m_discriminator_type; + + protected int m_default_used; + + protected UnionMember[] m_members; + + public UnionTypeCode() + { + super(TCKind.tk_union); + m_discriminator_type = null; + m_members = null; + } + + public UnionTypeCode(String repositoryId, String name, + TypeCode discriminator_type, + org.omg.CORBA.UnionMember[] members) + { + super(TCKind.tk_union, repositoryId, name); + m_discriminator_type = discriminator_type; + + boolean thereis_default = false; + int i = 0; + + m_default_used = -1; // default_used mecanism not explicited in CORBA + // 2.3 + + TypeCode tc_default = TypeCodeFactory.tc_octet; + + for (i = 0; i < members.length; i++) { + if (tc_default.equal(members[i].label.type())) { + m_default_used = i; + break; + } + } + + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + + if (!m_discriminator_type.equal(tc.discriminator_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + if (m_default_used != tc.default_index()) + return false; + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + } + + // all rigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (!m_discriminator_type.equivalent(tc.discriminator_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + if (m_default_used != tc.default_index()) + return false; + for (int i = 0; i < m_members.length; i++) { + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equivalent(tc.member_type(i))) + return false; + } + + // all rigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public org.omg.CORBA.TypeCode discriminator_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_discriminator_type; + } + + public int default_index() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_default_used; + } + + public org.omg.CORBA.Any member_label(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].label; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + + m_discriminator_type = input.read_TypeCode(); + m_default_used = input.read_long(); + int length = input.read_ulong(); + + m_members = new UnionMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i] = new org.omg.CORBA.UnionMember(); + // Change, only the the value of label is marshaled + //_members[i].label = input.read_any(); + m_members[i].label = input.orb().create_any(); + m_members[i].label.read_value(input, m_discriminator_type); + if (!m_discriminator_type.equal(m_members[i].label.type())) { + if (m_members[i].label.type().kind().value() + == TCKind._tk_octet) { + if (m_default_used != i) + throw new MARSHAL( + "Bad label: Union does not have any " + + "defalt member.", + 0, CompletionStatus.COMPLETED_NO); + } else { + throw new MARSHAL("Invalid Union discriminator TypeCode", + 0, CompletionStatus.COMPLETED_NO); + } + } + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + } + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + + try { + Any discriminator = input.orb().create_any(); + + discriminator.read_value(input, type.discriminator_type()); + + int member_index = searchMemberIndex(type, discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + return TypeCodeMarshaler.skipValue(type.member_type(member_index), + input); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be an union type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_TypeCode(type.discriminator_type()); + output.write_long(type.default_index()); + + int length = type.member_count(); + + output.write_ulong(length); + + for (int i = 0; i < length; i++) { + // Change, only the value of discriminator is marshalled + // output.write_any(type.member_label(i)); + type.member_label(i).write_value(output); + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + try { + Any discriminator = input.orb().create_any(); + + discriminator.read_value(input, type.discriminator_type()); + + int member_index = searchMemberIndex(type, discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + discriminator.write_value(output); + + TypeCodeMarshaler.remarshalValue(type.member_type(member_index), + input, output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be an union type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + Any a_discriminator = input_a.orb().create_any(); + + a_discriminator.read_value(input_a, type.discriminator_type()); + + Any b_discriminator = input_b.orb().create_any(); + + b_discriminator.read_value(input_b, type.discriminator_type()); + + if (!a_discriminator.equal(b_discriminator)) + return false; + + int member_index = searchMemberIndex(type, a_discriminator); + + if (member_index <= -1) + throw new MARSHAL("TypeCode with no default case."); + + return + TypeCodeMarshaler.valuesEqual(type.member_type(member_index), + input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an union type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{union ("); + + int length = type.member_count(); + + output.print(length); + output.print(" members) "); + ComplexTypeCode.dumpParams(type, output); + output.print(" {"); + + for (int i = 0; i < length; i++) { + output.print(" case "); + AnyImpl.dump(type.member_label(i), output); + + output.print(": "); + output.print(type.member_name(i)); + output.print(" -> "); + TypeCodeDumper.dump(type.member_type(i), output); + output.print(" | "); + } + + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a struct type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{union "); + output.print(type.name()); + output.print(" discriminator: "); + Any disc_any = input.orb().create_any(); + disc_any.read_value(input, type.discriminator_type()); + AnyImpl.dump(disc_any, output); + + int member_index = searchMemberIndex(type, disc_any); + + if (member_index < 0) + throw new MARSHAL("TypeCode with no default case."); + + if (member_index == type.default_index()) + output.print(" /default/ "); + output.print(type.member_name(member_index)); + output.print(" -> "); + + if (!TypeCodeDumper.dumpValue(type.member_type(member_index), + input, output)) + return false; + + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + return true; + } + + public static int searchMemberIndex(TypeCode type, + org.omg.CORBA.Any discriminator) + { + try { + int length = type.member_count(); + for (int i = 0; i < length; i++) + if (discriminator.equal(type.member_label(i))) + return i; + + return type.default_index(); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in union operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in union operations:" + + bds.toString()); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.java new file mode 100644 index 0000000..34bc436 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ValueBoxTypeCode.java @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ValueBoxTypeCode class represents a TypeCode + * object which is associated with an IDL valuebox. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class ValueBoxTypeCode extends ComplexTypeCode +{ + + TypeCode m_type; + + public ValueBoxTypeCode() + { + super(TCKind.tk_value_box); + m_type = null; + } + + public ValueBoxTypeCode(String repositoryId, String name, TypeCode type) + { + super(TCKind.tk_value_box, repositoryId, name); + m_type = type; + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + try { + return m_type.equal(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + /* unreachable */ + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + try { + return m_type.equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + /* unreachable */ + return false; + } + + } + public org.omg.CORBA.TypeCode content_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_type; + } + + //TIDORB operations + + public void readParams(CDRInputStream input) + { + super.readParams(input); + m_type = input.read_TypeCode(); + } + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + return TypeCodeMarshaler.skipValue(type.content_type(), input); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a valuebox type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_TypeCode(type.content_type()); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in valuebox operations:" + + bk.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, CDROutputStream output) + { + try { + TypeCodeMarshaler.remarshalValue(type.content_type(), + input, + output); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a valuebox type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + return TypeCodeMarshaler.valuesEqual(type.content_type(), input_a, + input_b); + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in valuebox operations:" + + bk.toString()); + } + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be an alias type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[VALUE]{valuebox "); + output.print(type.name()); + output.print(": "); + TypeCodeDumper.dumpValue(type.content_type(), input, output); + output.print('}'); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(" Fault ivoking content_type()."); + } + return true; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/ValueTypeCode.java b/source/es/tid/TIDorbj/core/typecode/ValueTypeCode.java new file mode 100644 index 0000000..4eb1bb2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/ValueTypeCode.java @@ -0,0 +1,437 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.ValueMember; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * The ValueTypeCode class represents a TypeCode + * object which is associated with an IDL value. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class ValueTypeCode extends ComplexTypeCode +{ + + protected short m_value_modifier; + + protected TypeCode m_concrete_base; + + protected ValueMember[] m_members; + + public ValueTypeCode() + { + super(TCKind.tk_value); + m_concrete_base = null; + m_members = null; + + } + + public ValueTypeCode(String repositoryId, String name, + short value_modifier, TypeCode concrete_base, + ValueMember[] members) + { + super(TCKind.tk_value, repositoryId, name); + m_value_modifier = value_modifier; + m_concrete_base = concrete_base; + m_members = members; + + } + + public boolean equal(org.omg.CORBA.TypeCode tc) + { + if (!super.equal(tc)) + return false; + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_value_modifier != tc.type_modifier()) + return false; + if (!m_concrete_base.equal(tc.concrete_base_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + if (m_members[i].access != tc.member_visibility(i)) + return false; + if (m_members[i].type.equal(tc.member_type(i))) + return false; + + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public boolean equivalent(org.omg.CORBA.TypeCode tc) + { + if (tc.kind().value() == TCKind._tk_alias) { + try { // the exception must never be throwed, but, it is in the + // definition. + return equivalent(tc.content_type()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { + return false; + } + } + + if (m_kind.value() != tc.kind().value()) { + return false; + } + + if (!m_exhaustive_equal) + return true; + + try { + + if (m_value_modifier != tc.type_modifier()) + return false; + if (!m_concrete_base.equivalent(tc.concrete_base_type())) + return false; + if (m_members.length != tc.member_count()) + return false; + + for (int i = 0; i < m_members.length; i++) { + + if (!(m_members[i].name).equals(tc.member_name(i))) + return false; + if (m_members[i].type.equivalent(tc.member_type(i))) + return false; + if (m_members[i].access != tc.member_visibility(i)) + return false; + + } + + // allrigth + return true; + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + return false; + } + catch (org.omg.CORBA.TypeCodePackage.Bounds bk) { + return false; + } + + } + + public int member_count() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_members.length; + } + + public java.lang.String member_name(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].name; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public org.omg.CORBA.TypeCode member_type(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].type; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public short member_visibility(int index) + throws org.omg.CORBA.TypeCodePackage.BadKind, + org.omg.CORBA.TypeCodePackage.Bounds + { + if (index < m_members.length) + return m_members[index].access; + else + throw new org.omg.CORBA.TypeCodePackage.Bounds(); + } + + public short type_modifier() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_value_modifier; + } + + public org.omg.CORBA.TypeCode concrete_base_type() + throws org.omg.CORBA.TypeCodePackage.BadKind + { + return m_concrete_base; + + } + + //TIDORB operations + + public void readParams(es.tid.TIDorbj.core.cdr.CDRInputStream input) + { + super.readParams(input); + m_value_modifier = input.read_short(); + m_concrete_base = input.read_TypeCode(); + + int length = input.read_ulong(); + + m_members = new ValueMember[length]; + + for (int i = 0; i < length; i++) { + m_members[i].name = input.read_string(); + m_members[i].type = input.read_TypeCode(); + m_members[i].access = input.read_short(); + } + } + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + try { + int member_length = type.member_count(); + for (int i = 0; i < member_length; i++) { + if (!TypeCodeMarshaler.skipValue(type.member_type(i), input)) + return false; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + return true; + } + + /** + * Marshal the given typecode params in a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the TypeCode + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the the TypeCode must be a value type + */ + + public static void writeParams(TypeCode type, CDROutputStream output) + { + try { + ComplexTypeCode.writeParams(type, output); + + output.write_short(type.type_modifier()); + output.write_TypeCode(type.concrete_base_type()); + + int length = type.member_count(); + output.write_ulong(length); + + for (int i = 0; i < length; i++) { + output.write_string(type.member_name(i)); + output.write_TypeCode(type.member_type(i)); + output.write_short(type.member_visibility(i)); + } + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value type operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value type operations:" + + bds.toString()); + } + + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an alias type + */ + + public static void remarshalValue(org.omg.CORBA.TypeCode type, + InputStream input, CDROutputStream output) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + TypeCodeMarshaler.remarshalValue(type.member_type(i), input, + output); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a value type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + try { + int member_length = type.member_count(); + + for (int i = 0; i < member_length; i++) + if (!TypeCodeMarshaler.valuesEqual(type.member_type(i), + input_a, input_b)) + return false; + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in struct operations:" + + bds.toString()); + } + + return true; + } + + /** + * Dumps the description of a given TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an enum type. + */ + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + try { + output.print("[TYPECODE]{value "); + ComplexTypeCode.dumpParams(type, output); + output.print(", visibility= "); + output.print(type.type_modifier()); + output.print(", concrete base= "); + TypeCodeDumper.dump(type.concrete_base_type(), output); + + output.print(" {"); + + int length = type.member_count(); + + for (int i = 0; i < length; i++) { + output.print(type.member_visibility(i)); + output.print(' '); + output.print(type.member_name(i)); + output.print(": "); + TypeCodeDumper.dump(type.member_type(i), output); + } + output.print('}'); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in value operations:" + + bk.toString()); + + } + catch (Bounds bds) { + throw new BAD_TYPECODE("Fault in value operations:" + + bds.toString()); + } + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/typecode/WStringTypeCode.java b/source/es/tid/TIDorbj/core/typecode/WStringTypeCode.java new file mode 100644 index 0000000..78fc019 --- /dev/null +++ b/source/es/tid/TIDorbj/core/typecode/WStringTypeCode.java @@ -0,0 +1,198 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.typecode; + +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.OutputStream; + +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * The WStringTypeCode class represents a TypeCode + * object which is associated with an IDL wstring. + * + * @autor Juan A. Ca´ceres + * @version 1.0 + */ + +public class WStringTypeCode extends StringTypeCode +{ + + public WStringTypeCode() + { + m_kind = TCKind.tk_wstring; + } + + public WStringTypeCode(int length) + { + super(length); + m_kind = TCKind.tk_wstring; + + } + + /** + * Skips the value asociated to the TypeCode. This operation is used by the + * TIDorb's Any implementation an the subclass skip_value() + * operations. + * + * @param input + * must be alwais a reference to a CDRInputStream object. + */ + + public static boolean skipValue(TypeCode type, CDRInputStream input) + { + input.skipWstring(); + return true; + } + + /** + * Copies and remarshals the given typecode value marshaled in an + * InputStream to a es.tid.TIDorbj.core.CDRInputStream. This + * method will alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input + * the InputStream where the value is marshaled + * @param output + * the es.tid.TIDorbj.core.CDRInputStream + * @pre the TypeCode must be an wstring type + */ + + public static void remarshalValue(TypeCode type, InputStream input, + OutputStream output) + { + output.write_wstring(input.read_wstring()); + } + + /** + * Compares two InputStream marshaled values of a given TypeCode to a + * es.tid.TIDorbj.core.CDRInputStream. This method will + * alwais be invoked by this stream. + * + * @param type + * the value TypeCode + * @param input_a + * the InputStream where one value is marshaled + * @param input_b + * the InputStream where the value value is + * marshaled + * @pre type must be a wstring type. + */ + + public static boolean valuesEqual(org.omg.CORBA.TypeCode type, + InputStream input_a, InputStream input_b) + { + return (input_a.read_wstring()).equals(input_a.read_wstring()); + } + + /** + * Dumps the description of a given wstring TypeCode. + * + * @param type + * the TypeCode + * @param output + * the output stream where the TypeCode will be dumped + * @pre type must be an wstring type. + */ + + public static void dump(TypeCode type, java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[TYPECODE]{wstring"); + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + + output.print('}'); + } + + /** + * Dumps the description of a the marshaled value of a given TypeCode. + * + * @param type + * the TypeCode + * @param input + * the input stream where the value is marshaled + * @param output + * the output stream where the value will be dumped + * @pre the typecode must be a wstring type + * @return true if if has been possible dump the value. + */ + + public static boolean dumpValue(TypeCode type, InputStream input, + java.io.PrintWriter output) + throws java.io.IOException + { + output.print("[VALUE]{wstring"); + + try { + if (type.length() != 0) { + output.print('<'); + output.print(type.length()); + output.print('>'); + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE("Fault in length() operation:" + + bk.toString()); + } + output.print(": \""); + output.print(input.read_wstring()); + output.print("\"}"); + return true; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/all-wcprops b/source/es/tid/TIDorbj/core/util/.svn/all-wcprops new file mode 100644 index 0000000..c47887b --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/all-wcprops @@ -0,0 +1,167 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util +END +Mutex.java +K 25 +svn:wc:ra_dav:version-url +V 90 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/Mutex.java +END +EnumHolder.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/EnumHolder.java +END +ULongLongHolder.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/ULongLongHolder.java +END +WCharHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/WCharHolder.java +END +LinkedList.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/LinkedList.java +END +RemovableObject.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/RemovableObject.java +END +StringHolder.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/StringHolder.java +END +DestructionState.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/DestructionState.java +END +UseTable.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/UseTable.java +END +FullUseTableException.java +K 25 +svn:wc:ra_dav:version-url +V 106 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/FullUseTableException.java +END +InitialReference.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/InitialReference.java +END +ValueHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/ValueHolder.java +END +HashedLinkedList.java +K 25 +svn:wc:ra_dav:version-url +V 101 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/HashedLinkedList.java +END +Counter.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/Counter.java +END +ULongHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/ULongHolder.java +END +OnlyOneThreadCanWait.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.java +END +AbstractInterfaceHolder.java +K 25 +svn:wc:ra_dav:version-url +V 108 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.java +END +UShortHolder.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/UShortHolder.java +END +Corbaloc.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/478/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/Corbaloc.java +END +BoxedValueHelperFinder.java +K 25 +svn:wc:ra_dav:version-url +V 107 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.java +END +Corbaname.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/Corbaname.java +END +CodeBaseURL.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/CodeBaseURL.java +END +OperationCompletion.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/OperationCompletion.java +END +WStringHolder.java +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/WStringHolder.java +END +RepositoryId.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/RepositoryId.java +END +FixedHolder.java +K 25 +svn:wc:ra_dav:version-url +V 96 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/FixedHolder.java +END +UserExceptionEncoder.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/UserExceptionEncoder.java +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/entries b/source/es/tid/TIDorbj/core/util/.svn/entries new file mode 100644 index 0000000..8a07fca --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/entries @@ -0,0 +1,949 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2007-02-12T15:07:48.674225Z +45 +iredondo + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +WCharHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +8019f1015dc264b1025ba85b442289ea +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2282 + +ULongLongHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +f39daa3131491d45112adbc8458086fb +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2309 + +EnumHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +9ebd588f20357ab3c2f0491a4def172e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2465 + +LinkedList.java +file + + + + +2009-05-27T12:24:02.000000Z +9306034ff357ced25ca8ac83dfa3e18b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6455 + +Mutex.java +file + + + + +2009-05-27T12:24:02.000000Z +598d5727c6b52287e5ecc3994fa6206b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1946 + +RemovableObject.java +file + + + + +2009-05-27T12:24:02.000000Z +745103a181e956ea47ba7c2273ddef38 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1642 + +UseTable.java +file + + + + +2009-05-27T12:24:02.000000Z +6fd1a4cfccb5366cbb8714e35d2897d7 +2007-02-12T15:07:48.674225Z +45 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +8166 + +StringHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +96d4f3879b1b53a1e0b2d188cbd7ace2 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3288 + +DestructionState.java +file + + + + +2009-05-27T12:24:02.000000Z +b82ec57f14ab3a8ac1076770bdc26f2d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1882 + +FullUseTableException.java +file + + + + +2009-05-27T12:24:02.000000Z +f91e33f754a91750aa3bcc4d3f982004 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1771 + +InitialReference.java +file + + + + +2009-05-27T12:24:02.000000Z +8792b4625e70677dcc67a237e46c8cb0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2506 + +ValueHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +c10e0368bd74d39389b193a2a070b502 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3322 + +exception +dir + +Counter.java +file + + + + +2009-05-27T12:24:02.000000Z +18a6cf50d19fb4db705e106b001e1651 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3014 + +HashedLinkedList.java +file + + + + +2009-05-27T12:24:02.000000Z +d81d7271b4b16e78eba52caec429e34f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4244 + +OnlyOneThreadCanWait.java +file + + + + +2009-05-27T12:24:02.000000Z +dca2b1fa3be144fa8de16bff88b5b60f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1817 + +AbstractInterfaceHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +79d60fd9462e85e787ac59658c24132c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3106 + +ULongHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +add7eb150c7dfccac26013e184629dd1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2283 + +UShortHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +3f430c0f1aada26f8c39d4f4da5e9b8d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2290 + +Corbaloc.java +file +478 + + + +2011-04-29T14:42:47.000000Z +c34e01cfa66cb7006728196662bc4c58 +2011-04-29T14:42:47.025714Z +478 +avega +has-props + + + + + + + + + + + + + + + + + + + + +9352 + +BoxedValueHelperFinder.java +file + + + + +2009-05-27T12:24:02.000000Z +14e32e4935cb7ac507cee022f33586c6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2508 + +Corbaname.java +file + + + + +2009-05-27T12:24:02.000000Z +686640edf6ea5acb13e21426df9e2187 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5235 + +CodeBaseURL.java +file + + + + +2009-05-27T12:24:02.000000Z +5e1eb84afe4680847d3856e2fdd57548 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1698 + +OperationCompletion.java +file + + + + +2009-05-27T12:24:02.000000Z +e0668a76dc1e2e131039239cab4f6e89 +2006-08-25T11:13:29.033495Z +35 +ldlfd +has-props + + + + + + + + + + + + + + + + + + + + +3538 + +WStringHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +3d7112933b5d6ce9a9fdc8e788724f4c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3578 + +RepositoryId.java +file + + + + +2009-05-27T12:24:02.000000Z +40fdb1f8d0ddb70dbb8968103695d7da +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6625 + +FixedHolder.java +file + + + + +2009-05-27T12:24:02.000000Z +c247fc751338f53806dd6f256c805f4c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6273 + +UserExceptionEncoder.java +file + + + + +2009-05-27T12:24:02.000000Z +63b3885b8508782ed8ba8c3b679a157b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3087 + diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/AbstractInterfaceHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/AbstractInterfaceHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/AbstractInterfaceHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/BoxedValueHelperFinder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/BoxedValueHelperFinder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/BoxedValueHelperFinder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/CodeBaseURL.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/CodeBaseURL.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/CodeBaseURL.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaloc.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaloc.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaloc.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaname.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaname.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Corbaname.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/Counter.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Counter.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Counter.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/DestructionState.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/DestructionState.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/DestructionState.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/EnumHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/EnumHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/EnumHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/FixedHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/FixedHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/FixedHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/FullUseTableException.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/FullUseTableException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/FullUseTableException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/HashedLinkedList.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/HashedLinkedList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/HashedLinkedList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/InitialReference.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/InitialReference.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/InitialReference.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/LinkedList.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/LinkedList.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/LinkedList.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/Mutex.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Mutex.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/Mutex.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/OnlyOneThreadCanWait.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/OnlyOneThreadCanWait.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/OnlyOneThreadCanWait.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/OperationCompletion.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/OperationCompletion.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/OperationCompletion.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/RemovableObject.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/RemovableObject.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/RemovableObject.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/RepositoryId.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/RepositoryId.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/RepositoryId.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/StringHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/StringHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/StringHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongLongHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongLongHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ULongLongHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/UShortHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UShortHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UShortHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/UseTable.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UseTable.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UseTable.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/UserExceptionEncoder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UserExceptionEncoder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/UserExceptionEncoder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/ValueHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ValueHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/ValueHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/WCharHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/WCharHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/WCharHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/prop-base/WStringHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/prop-base/WStringHolder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/prop-base/WStringHolder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/AbstractInterfaceHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/AbstractInterfaceHolder.java.svn-base new file mode 100644 index 0000000..bc7d13c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/AbstractInterfaceHolder.java.svn-base @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.TypeCode; + +/** + * Particular Holder for ValueTypes, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class AbstractInterfaceHolder + implements org.omg.CORBA.portable.Streamable +{ + + public java.lang.Object value; + + public TypeCode abstract_typecode; + + public AbstractInterfaceHolder(TypeCode type) + { + abstract_typecode = type; + } + + public AbstractInterfaceHolder(TypeCode type, java.lang.Object initial) + { + abstract_typecode = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + if (is instanceof org.omg.CORBA_2_3.portable.InputStream) { + org.omg.CORBA_2_3.portable.InputStream in_2_3 = + (org.omg.CORBA_2_3.portable.InputStream) is; + value = + in_2_3.read_abstract_interface(); + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (os instanceof org.omg.CORBA_2_3.portable.OutputStream) { + org.omg.CORBA_2_3.portable.OutputStream os_2_3 = + (org.omg.CORBA_2_3.portable.OutputStream) os; + os_2_3.write_abstract_interface(value); + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return abstract_typecode; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/BoxedValueHelperFinder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/BoxedValueHelperFinder.java.svn-base new file mode 100644 index 0000000..5e214c0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/BoxedValueHelperFinder.java.svn-base @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public abstract class BoxedValueHelperFinder +{ + public static Class findHelper(java.io.Serializable boxed_value) + { + StringBuffer buff = new StringBuffer(); + + Package pkg = boxed_value.getClass().getPackage(); + + if (pkg != null) { + + String pkg_str = pkg.getName(); + + if (pkg_str.length() > 0) { + buff.append(pkg_str); + buff.append('.'); + } + } + + buff.append(boxed_value.getClass().getName()); + buff.append("Helper"); + + String helper_name = buff.toString(); + + try { + return Class.forName(helper_name); + + } + catch (ClassNotFoundException cnf) { + return null; + } + catch (OutOfMemoryError om) { + throw new org.omg.CORBA.NO_MEMORY(); + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/CodeBaseURL.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/CodeBaseURL.java.svn-base new file mode 100644 index 0000000..57c4fb9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/CodeBaseURL.java.svn-base @@ -0,0 +1,53 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class CodeBaseURL +{ + public CodeBaseURL(String url) + { + m_url = url; + } + + public String m_url; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaloc.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaloc.java.svn-base new file mode 100644 index 0000000..92fd629 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaloc.java.svn-base @@ -0,0 +1,274 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.StringTokenizer; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.ListenPoint; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.poa.OID; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.TranslateURLEscapes; + +//TODO: put this together with into IIOPCorbaloc +public class Corbaloc +{ + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc; + String addr; + String path; + String v; + String l; + + ObjectKey objectkey; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:tidorbj:")) { + corbaloc = corbaloc_URL.substring(17); + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = parseVersion(v); + } + } + l = staddr.nextToken(); + listener = parseListenPoint(l); + path = corbaloc.substring(slashposition + 1); + objectkey = parsePOAPath(path); + } else + throw new InvalidName("Invalid TIDorbJ corbaloc"); + profiles = new IIOPProfile[1]; + profiles[0] = new IIOPProfile(version, listener, objectkey, null); + return new IIOPIOR( "", profiles ); + } + + private static ObjectKey parsePOAPath(String poa_path) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String[] poa_path_a; + String path; + String oid_str; + int ntokens; + OID oid; + POAKey poakey; + ObjectKey objectkey; + path = TranslateURLEscapes.putEscapes(poa_path); + if (path.indexOf("//") != -1) + throw new org.omg.CORBA.ORBPackage.InvalidName("Invalid POA Name"); + StringTokenizer stpath = new StringTokenizer(path, "/", false); + ntokens = stpath.countTokens(); + poa_path_a = new String[ntokens - 1]; + for (int i = 0; i < ntokens - 1; i++) { + poa_path_a[i] = + TranslateURLEscapes.translateUnicode( + TranslateURLEscapes.resolveEscapes(stpath.nextToken())); + } + oid_str = TranslateURLEscapes.resolveEscapes(stpath.nextToken()); + try { + oid = OID.fromString(oid_str); + } + catch (java.lang.Exception e) { + throw new org.omg.CORBA.ORBPackage.InvalidName("Invalid OID"); + } + poakey = new POAKey(poa_path_a, 0L, oid); + return poakey; + } + + public static GIOPVersion parseVersion(String v) + throws org.omg.CORBA.ORBPackage.InvalidName + { + int major, minor; + int ntokens; + GIOPVersion version; + StringTokenizer stversion = new StringTokenizer(v, ".", false); + ntokens = stversion.countTokens(); + if (ntokens == 2) { + major = Integer.parseInt(stversion.nextToken()); + minor = Integer.parseInt(stversion.nextToken()); + if (major == 1) { + if (minor == 0) + version = GIOPVersion.VERSION_1_0; + else if (minor == 1) + version = GIOPVersion.VERSION_1_1; + else if (minor == 2) + version = GIOPVersion.VERSION_1_2; + else + throw new InvalidName("Invalid Minor GIOPVersion Number"); + + } else + throw new InvalidName("Invalid Major GIOPVersion Number"); + } else + throw new InvalidName("Invalid GIOPVersion"); + return version; + } + + + public static ListenPoint parseListenPoint(String listenp) + throws org.omg.CORBA.ORBPackage.InvalidName + { + System.out.println("IIOPCorbaloc parseListenPoint"); + String host; + int port; + int ntokens; + /*StringTokenizer stlistenpoint = + new StringTokenizer(listenp, ":", false); + ntokens = stlistenpoint.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Listener Name"); + else {*/ + int ipv6SeperatorStart = -1; + int ipv6SeperatorEnd = -1; + int sep; + ipv6SeperatorStart = listenp.indexOf('['); + if (ipv6SeperatorStart != -1) + { + ipv6SeperatorEnd = listenp.indexOf(']'); + if (ipv6SeperatorEnd == -1) + { + throw new InvalidName("Invalid Listener Name"); + } + } + + sep = listenp.indexOf(':'); + if( sep != -1 ) + { + if (ipv6SeperatorStart != -1) //IPv6 + { + host=listenp.substring(ipv6SeperatorStart+1, ipv6SeperatorEnd); + if (listenp.charAt(ipv6SeperatorEnd+1) == ':') + { + try + { + port=(short)Integer.parseInt(listenp.substring(ipv6SeperatorEnd+2)); + } + catch( NumberFormatException ill ) + { + throw new InvalidName("Invalid Listener Name"); + } + } + else + { + throw new InvalidName("Invalid Listener Name"); + } + } + else //IPv4 or hostname + { + try + { + port =(short)Integer.parseInt(listenp.substring(sep+1)); + host = listenp.substring(0, sep); + } + catch( NumberFormatException ill ) + { + throw new InvalidName("Invalid Listener Name"); + } + } + } + //mcpg - end + else + { + host = listenp; + port = 2809; + } + /*host = stlistenpoint.nextToken(); + if (ntokens == 1) { + port = 2809; + } else { + port = Integer.parseInt(stlistenpoint.nextToken()); + }*/ + + return new ListenPoint(host, port); + } + + public static String toURL(IOR ior) + { + String corbaloc = "corbaloc:tidorbj:"; + IIOPProfile p = (IIOPProfile) ior.getProfile(0); + GIOPVersion v = p.getVersion(); + ListenPoint l = p.getListenPoint(); + ObjectKey o = p.getObjectKey(); + + POAKey k; + try { + k = POAKey.createKey( o.getMarshaledKey() ); + } catch ( Throwable th ){ + throw new BAD_PARAM( + "Non persistent reference", 0, CompletionStatus.COMPLETED_NO + ); + } + + if (k.getPOAId() != 0L) { + throw new BAD_PARAM( + "Non persistent reference", 0, CompletionStatus.COMPLETED_NO); + } + OID oid = k.getOID(); + corbaloc += v.getMajor() + "." + v.getMinor() + "@"; + corbaloc += l.m_host + ":" + l.m_port + "/"; + for (int i = 0; i < k.numberOfPOAs(); i++) + corbaloc += TranslateURLEscapes.stringfy(k.getPOA(i)) + "/"; + corbaloc += TranslateURLEscapes.stringfy(oid.toString()); + return corbaloc; + } + +} diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaname.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaname.java.svn-base new file mode 100644 index 0000000..8ef00e9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/Corbaname.java.svn-base @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.StringTokenizer; + +import org.omg.CosNaming.NameComponent; +import org.omg.CosNaming.NamingContextPackage.InvalidName; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.TranslateURLEscapes; + +public class Corbaname +{ + + public static org.omg.CORBA.Object toObject(TIDORB tidorb, + String corbaname_URL) + throws org.omg.CosNaming.NamingContextPackage.InvalidName, + org.omg.CosNaming.NamingContextPackage.NotFound, + org.omg.CosNaming.NamingContextPackage.CannotProceed, + org.omg.CORBA.ORBPackage.InvalidName + { + String corbaname; + int nameposition; + org.omg.CosNaming.NameComponent[] name_path; + org.omg.CosNaming.NamingContext ncontext; + if (corbaname_URL.startsWith("corbaname:")) { + corbaname = corbaname_URL.substring(10); + nameposition = corbaname.indexOf('#'); + ncontext = + parseProtocol(tidorb, corbaname.substring(0, + nameposition)); + name_path = toName(corbaname.substring(nameposition + 1)); + return ncontext.resolve(name_path); + } else + throw new InvalidName(); /* Invalid corbaname" */ + + } + + private static org.omg.CosNaming.NamingContext + parseProtocol(TIDORB tidorb, + String protocol) + throws org.omg.CosNaming.NamingContextPackage.InvalidName, + org.omg.CORBA.ORBPackage.InvalidName + { + if (protocol.equals("rir:") || protocol.equals("rir:/NameService")) { + org.omg.CORBA.Object naming_ref = + tidorb.resolve_initial_references("NameService"); + return org.omg.CosNaming.NamingContextHelper.narrow(naming_ref); + } else + throw new InvalidName(); + } + + public static org.omg.CosNaming.NameComponent[] toName(String sn) + throws org.omg.CosNaming.NamingContextPackage.InvalidName + { + int ntokensn, ntokenscmp; + String name = ""; + String component = ""; + String id; + String kind; + name = TranslateURLEscapes.putEscapes(sn); + if (name.indexOf("//") != -1) + throw new InvalidName(); + StringTokenizer stname = new StringTokenizer(name, "/", false); + ntokensn = stname.countTokens(); + org.omg.CosNaming.NameComponent[] n = + new org.omg.CosNaming.NameComponent[ntokensn]; + for (int i = 0; i < ntokensn; i++) { + id = ""; + kind = ""; + component = stname.nextToken(); + StringTokenizer stcomp = new StringTokenizer(component, ".", false); + ntokenscmp = stcomp.countTokens(); + if (ntokenscmp > 2) + throw new InvalidName(); + if (!(ntokenscmp <= 1 && component.charAt(0) == '.')) + id = TranslateURLEscapes.resolveEscapes(stcomp.nextToken()); + if (stcomp.countTokens() == 1) + kind = TranslateURLEscapes.resolveEscapes(stcomp.nextToken()); + n[i] = new NameComponent(id, kind); + } + return n; + } + + public static String toString(org.omg.CosNaming.NameComponent[] n) + { + String id; + String kind; + String sn = ""; + for (int i = 0; i < n.length; i++) { + id = TranslateURLEscapes.stringfy(n[i].id); + kind = TranslateURLEscapes.stringfy(n[i].kind); + sn = sn + id; + if (!kind.equals("")) + sn = sn + "." + kind; + if (i < n.length - 1) + sn = sn + "/"; + } + return sn; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/Counter.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/Counter.java.svn-base new file mode 100644 index 0000000..4be3c49 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/Counter.java.svn-base @@ -0,0 +1,130 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Simple syncrhonized counter. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class Counter +{ + + /** + * IIOPConnection state. + */ + private int m_value; + + public Counter() + { + m_value = 0; + } + + synchronized public int getValue() + { + return m_value; + } + + synchronized public boolean isZero() + { + return (m_value == 0); + } + + synchronized public boolean isNonZero() + { + return (m_value != 0); + } + + /** + * Increments the counter 1 unity. + * + * @return the new value of the counter. + */ + synchronized public int inc() + { + m_value++; + return m_value; + } + + /** + * Decrements the counter 1 unity. + * + * @return the new value of the counter. + */ + synchronized public int dec() + { + if (m_value > 0) + m_value--; + return m_value; + } + + /** + * Increments the counter 1 unity. + * + * @return the previous value of the counter. + */ + synchronized public int postInc() + { + int post_value = m_value; + m_value++; + return post_value; + } + + /** + * Decrements the counter 1 unity. + * + * @return the previous value of the counter. + */ + + synchronized public int postDec() + { + int post_value = m_value; + + if (m_value > 0) + m_value--; + return post_value; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/DestructionState.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/DestructionState.java.svn-base new file mode 100644 index 0000000..353ba5f --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/DestructionState.java.svn-base @@ -0,0 +1,64 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class DestructionState +{ + + private boolean m_destroyed; + + public DestructionState() + { + m_destroyed = false; + } + + synchronized public void destroy() + { + m_destroyed = true; + } + + synchronized public boolean isDestroyed() + { + return m_destroyed; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/EnumHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/EnumHolder.java.svn-base new file mode 100644 index 0000000..08ce69a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/EnumHolder.java.svn-base @@ -0,0 +1,88 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Particular Holder for ULong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class EnumHolder + implements org.omg.CORBA.portable.Streamable +{ + + public int value; + + public es.tid.TIDorbj.core.typecode.EnumTypeCode enum_type; + + public EnumHolder(es.tid.TIDorbj.core.typecode.EnumTypeCode type) + { + value = 0; + enum_type = type; + } + + public EnumHolder(es.tid.TIDorbj.core.typecode.EnumTypeCode type, + int initial) + { + value = initial; + enum_type = type; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return enum_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/FixedHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/FixedHolder.java.svn-base new file mode 100644 index 0000000..695cdc2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/FixedHolder.java.svn-base @@ -0,0 +1,208 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * Particular Holder for FixedType. + * + * @autor Juan A. Ca´ceres + * @version 0.1 + */ + +public class FixedHolder + implements org.omg.CORBA.portable.Streamable +{ + + TypeCode m_fixed_type; + + public java.math.BigDecimal value; + + public FixedHolder(TypeCode type) + { + m_fixed_type = type; + value = null; + } + + public FixedHolder(TypeCode type, java.math.BigDecimal initial) + { + m_fixed_type = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + int value_length = FixedTypeCode.valueLength(m_fixed_type); + + StringBuffer buffer = new StringBuffer(value_length); + + int pairs = value_length / 2; + + try { + + for (int i = 1; i < pairs; i++) { + byte octet = is.read_octet(); + buffer.append(Base16Codec.getDigit(0xf & (octet >> 4))); + buffer.append(Base16Codec.getDigit(0xf & octet)); + } + + // last pair + byte octet = is.read_octet(); + + buffer.append(Base16Codec.getDigit(0xf & (octet >> 4))); + + boolean positive; + switch (0xf & octet) + { + case 0xD: + positive = false; + break; + case 0xC: + positive = true; + break; + default: + throw new MARSHAL("Fixed_read: Invalid signum value", 0, + CompletionStatus.COMPLETED_NO); + } + + BigInteger value_int = new BigInteger(buffer.toString()); + + if (positive) + value = new BigDecimal(value_int, m_fixed_type.fixed_scale()); + else + value = new BigDecimal(value_int.negate(), + m_fixed_type.fixed_scale()); + + } + catch (MARSHAL m) { + throw m; + } + catch (Exception e) { + throw new MARSHAL(e.getMessage(), 0, CompletionStatus.COMPLETED_NO); + } + + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (value == null) + value = new BigDecimal(0.0); + + int value_length = FixedTypeCode.valueLength(m_fixed_type); + + int digits = 0; + try { + + digits = m_fixed_type.fixed_digits(); + } + catch (BadKind bk) {/* unreachable */} + + BigInteger unscaled = value.setScale(0).toBigInteger(); + + char[] literal = unscaled.toString().toCharArray(); + + int literal_count = (value.signum() < 0) ? 1 : 0;//skip the signum char + + int literal_digits = literal.length - literal_count; + + if (digits < literal_digits) + throw new MARSHAL("Fixed Overflow.", 0, + CompletionStatus.COMPLETED_NO); + + int value_pairs = (literal_digits - 1) / 2; // number of digit_digit + // octets + // 1 is substracted from literals represents + //the last digit int digit_signum pair + + int zero_value_pairs = (literal_digits - 1) % 2; // 0_digit octet is 0 + // or 1 + int zero_pairs = (value_length / 2) - zero_value_pairs - value_pairs + - 1; + // 0_0 octets + // 1 is substracted from zero_pairs represents the zero_signum pair + + for (int i = 0; i < zero_pairs; i++) + write_pair(os, 0, 0); + + try { + if (zero_value_pairs != 0) + write_pair(os, 0, + Base16Codec.getValue(literal[literal_count++])); + + for (int i = 0; i < zero_pairs; i++) + write_pair(os, Base16Codec.getValue(literal[literal_count++]), + Base16Codec.getValue(literal[literal_count++])); + + write_pair(os, Base16Codec.getValue(literal[literal_count++]), + (value.signum() < 0) ? 0xD : 0xC); + } + catch (MARSHAL m) { + throw m; + } + catch (Exception e) { + throw new MARSHAL(e.getMessage(), 0, CompletionStatus.COMPLETED_NO); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return m_fixed_type; + } + + static void write_pair(org.omg.CORBA.portable.OutputStream os, int digit1, + int digit2) + { + os.write_octet((byte) ((digit1 << 4) | (digit2))); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/FullUseTableException.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/FullUseTableException.java.svn-base new file mode 100644 index 0000000..c62b154 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/FullUseTableException.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class FullUseTableException extends Exception +{ + + public FullUseTableException() + { + super(); + } + + public FullUseTableException(String s) + { + super(s); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/HashedLinkedList.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/HashedLinkedList.java.svn-base new file mode 100644 index 0000000..5075d87 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/HashedLinkedList.java.svn-base @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class HashedLinkedList extends LinkedList +{ + + public HashedLinkedList(int maximumSize) + { + super(maximumSize); + m_table = new java.util.Hashtable(); + } + + /** + * @param object + * represents the key & item to be saved in the hashtable + */ + public void append(Object object) + throws Exception + { + append(object, object); + } + + public void append(Object key, Object item) + throws Exception + { + super.append(item); + m_table.put(key, new Integer(getLast())); + } + + public Object get(Object key) + { + Integer index = (Integer) m_table.get(key); + return getObjectAt(index.intValue()); + } + + public boolean object_exist(Object key) + { + return (m_table.get(key) != null); + } + + protected int getIndex(Object key) + { + Integer index = (Integer) m_table.get(key); + + if (index == null) + return -1; + + return index.intValue(); + } + + public Object remove(Object key) + { + + Integer index = (Integer) m_table.get(key); + if (index == null) { + return null; + } + Object removed = internalRemove(index.intValue()); + m_table.remove(key); + return removed; + } + + public Object removeFirst() + { + Object removed = super.removeFirst(); + m_table.remove(removed); + return removed; + } + + public Object removeLast() + { + Object removed = super.removeLast(); + m_table.remove(removed); + return removed; + } + + public java.util.Enumeration getKeys() + { + return m_table.keys(); + } + + /* + * public void dump(java.io.PrintStream os) { super.dump(os); + * os.print("Keys: ["); for (java.util.Enumeration enum = _table.keys(); + * enum.hasMoreElements(); ) { os.print(enum.nextElement()); if + * (enum.hasMoreElements()) os.print(", "); } os.println("]"); } + */ + + protected java.util.Hashtable m_table; + + /* + * public static void main(String[] args) { HashedLinkedList l = new + * HashedLinkedList(10); l.append(new Integer(1)); l.append(new Integer(2)); + * l.append(new Integer(3)); l.append(new Integer(4)); l.append(new + * Integer(5)); l.append(new Integer(6)); l.append(new Integer(7)); + * l.append(new Integer(8)); l.append(new Integer(9)); l.append(new + * Integer(10)); System.out.println("-------"); l.dump(System.out); + * l.remove(new Integer(7)); System.out.println("-------"); + * l.dump(System.out); l.removeFirst(); System.out.println("-------"); + * l.dump(System.out); System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/InitialReference.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/InitialReference.java.svn-base new file mode 100644 index 0000000..f78e24a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/InitialReference.java.svn-base @@ -0,0 +1,89 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.BAD_PARAM; + +public class InitialReference +{ + String m_service_name; + + String m_service_url; + + public InitialReference() + { + m_service_name = null; + m_service_url = null; + } + + public InitialReference(String name, String url) + { + m_service_name = name; + m_service_url = url; + } + + public String getName() + { + return m_service_name; + } + + public String getURL() + { + return m_service_url; + } + + public void parse(String value) + { + java.util.StringTokenizer tokenizer = + new java.util.StringTokenizer(value, "="); + + if (tokenizer.countTokens() != 2) + throw new BAD_PARAM( "Invalid -ORBInitRef value: it does not match" + + " = pattern"); + + m_service_name = tokenizer.nextToken(); + m_service_url = tokenizer.nextToken(); + } + +} + diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/LinkedList.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/LinkedList.java.svn-base new file mode 100644 index 0000000..9b8d5d2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/LinkedList.java.svn-base @@ -0,0 +1,239 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class LinkedList +{ + + protected static int NULL = -1; + + public LinkedList(int maximumSize) + { + m_maximum_size = maximumSize; + m_next = new int[maximumSize]; + m_previous = new int[maximumSize]; + m_free_indexes = new int[maximumSize]; + m_objects = new Object[maximumSize]; + m_last_free = maximumSize - 1; + for (int i = 0; i < maximumSize; i++) { + m_free_indexes[i] = i; + } + m_first = NULL; + m_last = NULL; + } + + public void append(Object object) + throws Exception + { + if (m_last_free < 0) { + throw new Exception("Not enough space in linked list of size " + + m_maximum_size + "!!"); + } + int index = m_free_indexes[m_last_free]; + m_last_free -= 1; + if (m_first >= 0) { + m_next[m_last] = index; + m_objects[index] = object; + m_next[index] = NULL; + m_previous[index] = m_last; + m_last = index; + } else { + m_first = index; + m_last = index; + m_objects[index] = object; + m_next[index] = NULL; + m_previous[index] = NULL; + } + } + + public Object removeFirst() + { + return internalRemove(m_first); + } + + public Object removeLast() + { + return internalRemove(m_last); + } + + public java.util.Enumeration elements() + { + return new LinkedListEnumeration(this); + } + + public int getSize() + { + return m_maximum_size - m_last_free - 1; + } + + public int getMaximumSize() + { + return m_maximum_size; + } + + public void dump(java.io.PrintStream os) + { + int i = m_first; + os.print("["); + while (i > NULL) { + os.print(m_objects[i]); + i = m_next[i]; + if (i > NULL) + os.print(", "); + } + os.println("]"); + } + + /** + * @param pos + * internal index of object to remove (it must be a legal + * position) + */ + protected Object internalRemove(int pos) + { + Object removed = m_objects[pos]; + if (pos != m_first) + m_next[m_previous[pos]] = m_next[pos]; + else + m_first = m_next[pos]; + if (pos != m_last) + m_previous[m_next[pos]] = m_previous[pos]; + else + m_last = m_previous[pos]; + m_last_free += 1; + m_free_indexes[m_last_free] = pos; + return removed; + } + + protected int getLast() + { + return m_last; + } + + protected int getFirst() + { + return m_first; + } + + protected int getNext(int index) + { + return m_next[index]; + } + + protected int getPrevious(int index) + { + return m_previous[index]; + } + + protected Object getObjectAt(int index) + { + return m_objects[index]; + } + + // Maximum size + private int m_maximum_size; + + // Arrays for objects and indexes + private int[] m_next = null; + + private int[] m_previous = null; + + private int[] m_free_indexes = null; + + private Object[] m_objects = null; + + // Indexes + private int m_last_free; + + private int m_first; + + private int m_last; + + /** + * Enumeration support. + */ + protected class LinkedListEnumeration + implements java.util.Enumeration + { + + public LinkedListEnumeration(LinkedList list) + { + _list = list; + _index = _list.m_first; + } + + public boolean hasMoreElements() + { + return (_index != NULL); + } + + public Object nextElement() + { + int i = _index; + _index = _list.m_next[_index]; + return _list.m_objects[i]; + } + + private int _index; + + private LinkedList _list; + } + + // Main - test method + /* + * public static void main(String[] args) { LinkedList l = new + * LinkedList(10); l.append(new Integer(1)); l.append(new Integer(2)); + * l.append(new Integer(3)); l.append(new Integer(4)); l.append(new + * Integer(5)); l.append(new Integer(6)); l.append(new Integer(7)); + * l.append(new Integer(8)); l.append(new Integer(9)); l.append(new + * Integer(10)); System.out.println("-------"); l.dump(System.out); + * l.removeLast(); System.out.println("-------"); l.dump(System.out); + * l.removeFirst(); System.out.println("-------"); l.dump(System.out); + * l.append(new Integer(11)); System.out.println("-------"); + * l.dump(System.out); l.append(new Integer(12)); + * System.out.println("-------"); l.dump(System.out); l.removeFirst(); + * System.out.println("-------"); l.dump(System.out); l.removeLast(); + * System.out.println("-------"); l.dump(System.out); + * System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/Mutex.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/Mutex.java.svn-base new file mode 100644 index 0000000..b918409 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/Mutex.java.svn-base @@ -0,0 +1,69 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class Mutex +{ + + boolean m_value; + + public Mutex() + { + m_value = false; + } + + public synchronized void enter() + throws java.lang.InterruptedException + { + while (m_value) { + wait(); + } + m_value = false; + } + + public synchronized void exit() + { + m_value = false; + notify(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/OnlyOneThreadCanWait.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/OnlyOneThreadCanWait.java.svn-base new file mode 100644 index 0000000..6c1bf3c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/OnlyOneThreadCanWait.java.svn-base @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * It is thrown if the restriction of a OperationCompletion than only one thread + * can wait, has been violated. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class OnlyOneThreadCanWait extends java.lang.Exception +{ + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/OperationCompletion.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/OperationCompletion.java.svn-base new file mode 100644 index 0000000..2aaf35f --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/OperationCompletion.java.svn-base @@ -0,0 +1,131 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Manages the completion status of an operation. + *

+ * Also, makes one thread to wait the completion. + *

+ * The status are: + *

    + *
  • INITIAL: the operation is not completed and there is not + * any Thread waiting for the completion + *
  • WAITING: there is a Thread that is waiting for the completion + *
  • COMPLETED: the operation is completed. + *
+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class OperationCompletion +{ + + public final static int INITIAL = 0; + + public final static int WAITING = 1; + + public final static int COMPLETED = 2; + + /** + * The Completion status. + */ + int m_state; + + public OperationCompletion() + { + m_state = INITIAL; + } + + /** + * @return whether or not the operation is completed + */ + public synchronized boolean isCompleted() + { + return m_state == COMPLETED; + } + + /** + * The operation is completed. + *

+ * If there is a thread waiting for the completion notifies it. + */ + public synchronized void setCompleted() + { + int actual_state = m_state; + + m_state = COMPLETED; + + if (actual_state == WAITING) + notify(); + } + + /** + * Makes a thread wait for the operation completion (with a timeout). + * + * @timeout the timeout + */ + public synchronized void waitForCompletion(long timeout) + throws java.lang.InterruptedException, + es.tid.TIDorbj.core.util.OnlyOneThreadCanWait + { + if (m_state == INITIAL) { + m_state = WAITING; + wait(timeout); + } else if (m_state == WAITING) { + throw new es.tid.TIDorbj.core.util.OnlyOneThreadCanWait(); + } + // else do nothing, is completed + } + + /** + * If there is a thread waiting for the completion notifies it. + * + */ + public synchronized void interruptWaiting() + { + notify(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/RemovableObject.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/RemovableObject.java.svn-base new file mode 100644 index 0000000..e0321bf --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/RemovableObject.java.svn-base @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public interface RemovableObject +{ + + boolean canBeRemoved(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/RepositoryId.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/RepositoryId.java.svn-base new file mode 100644 index 0000000..b9cf981 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/RepositoryId.java.svn-base @@ -0,0 +1,207 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class RepositoryId +{ + + public String m_value; + + public RepositoryId(String value) + { + m_value = value; + } + + public static String className(String repId) + { + if (repId.equals("IDL:omg.org/CORBA/WStringValue:1.0")) { + return "java.lang.String"; + } else if (repId.startsWith("IDL:")) { + // cut "IDL:" and version + // and swap "org.omg" if necessary + + String id_base = repId.substring(4, repId.lastIndexOf(':')); + if (id_base.startsWith("omg.org")) + return ir2scopes("org.omg", id_base.substring(7)); + else + return ir2scopes("", id_base); + } else if (repId.startsWith("RMI:")) { + return repId.substring(4, repId.indexOf(':', 4)); + } else { + throw new RuntimeException("unrecognized RepositoryID: " + repId); + } + } + + /** + * @return java.lang.String + */ + + private static String ir2scopes(String prefix, String s) + { + if (s.indexOf("/") < 0) + return s; + java.util.StringTokenizer strtok = + new java.util.StringTokenizer(s, "/"); + + int count = strtok.countTokens(); + StringBuffer sb = new StringBuffer(); + sb.append(prefix); + + for (int i = 0; strtok.hasMoreTokens(); i++) { + String sc = strtok.nextToken(); + Class c = null; + if (sb.toString().length() > 0) + c = loadClass(sb.toString() + "." + sc); + else + c = loadClass(sc); + if (c == null) + if (sb.toString().length() > 0) + sb.append("." + sc); + else + sb.append(sc); + else if (i < count - 1) + sb.append("." + sc + "Package"); + else + sb.append("." + sc); + } + + return sb.toString(); + } + + public static String repId(Class c) + { + if (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)) { + String className = c.getName(); + String head = ""; + String body = ""; + + // add "IDL:" and ":1.0" + // and swap "org.omg" if necessary + + if (className.startsWith("org.omg") + || className.startsWith("org/omg")) { + if (className.length() > 7) + body = className.substring(7); + return "IDL:omg.org/" + scopesToIR(body) + ":1.0"; + } else + return "IDL:" + scopesToIR(className) + ":1.0"; + } else + return javax.rmi.CORBA.Util.createValueHandler() + .getRMIRepositoryID(c); + } + + private static String scopesToIR(String s) + { + if (s.indexOf(".") < 0) + return s; + java.util.StringTokenizer strtok = + new java.util.StringTokenizer(s, "."); + + String scopes[] = new String[strtok.countTokens()]; + + for (int i = 0; strtok.hasMoreTokens(); i++) { + String sc = strtok.nextToken(); + if (sc.endsWith("Package")) + scopes[i] = sc.substring(0, sc.indexOf("Package")); + else + scopes[i] = sc; + } + + StringBuffer sb = new StringBuffer(); + if (scopes.length > 1) { + for (int i = 0; i < scopes.length - 1; i++) + sb.append(scopes[i] + "/"); + } + + sb.append(scopes[scopes.length - 1]); + return sb.toString(); + } + + /** + * convert a class name to a Repository ID
+ * classname - the class name to convert resolveClass - indicates whether + * the method should try to resolve and load the class. If true and the + * class could not be loaded, an IllegalArgumentException will be thrown + */ + + public static String toRepositoryID(String className, boolean resolveClass) + { + if (className.equals("") || className.startsWith("IDL:") + || className.startsWith("RMI:")) + return className; + else { + if (resolveClass) { + + Class c = loadClass(className); + if (c == null) + throw new IllegalArgumentException("cannot find class: " + + className); + else + return repId(c); + } + return "IDL:" + className + ":1.0"; + } + } + + public static String toRepositoryID(String className) + { + return toRepositoryID(className, true); + } + + /** + * Loads class `name' using an appropriate class loader. Returns the + * corresponding class object, or null if the class loader cannot find a + * class by that name. + */ + private static Class loadClass(String name) + { + try { + return Thread.currentThread().getContextClassLoader() + .loadClass(name); + } + catch (ClassNotFoundException e) { + return null; + } + } +} + diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/StringHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/StringHolder.java.svn-base new file mode 100644 index 0000000..2e63024 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/StringHolder.java.svn-base @@ -0,0 +1,117 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WString, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class StringHolder + implements org.omg.CORBA.portable.Streamable +{ + + public TypeCode string_type; + + public String value = null; + + public StringHolder() + { + string_type = TypeCodeFactory.tc_string; + } + + public StringHolder(TypeCode type) + { + string_type = type; + } + + public StringHolder(TypeCode type, String initial) + { + string_type = type; + value = initial; + } + + public StringHolder(String initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_string(); + try { + if (string_type.length() != 0) + if (value.length() > string_type.length()) + throw new MARSHAL("String out of bounds."); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + if (string_type.length() != 0) + if (value.length() > string_type.length()) + throw new MARSHAL("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + os.write_string(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return string_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongHolder.java.svn-base new file mode 100644 index 0000000..577549a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongHolder.java.svn-base @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for ULongLong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ULongHolder + implements org.omg.CORBA.portable.Streamable +{ + + public int value; + + public ULongHolder() + {} + + public ULongHolder(int initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ulong; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongLongHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongLongHolder.java.svn-base new file mode 100644 index 0000000..e73c45a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/ULongLongHolder.java.svn-base @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for ULongLong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ULongLongHolder + implements org.omg.CORBA.portable.Streamable +{ + + public long value; + + public ULongLongHolder() + {} + + public ULongLongHolder(long initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulonglong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulonglong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ulonglong; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/UShortHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/UShortHolder.java.svn-base new file mode 100644 index 0000000..f303068 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/UShortHolder.java.svn-base @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for UShort, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ +final public class UShortHolder + implements org.omg.CORBA.portable.Streamable +{ + + public short value; + + public UShortHolder() + {} + + public UShortHolder(short initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ushort(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ushort(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ushort; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/UseTable.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/UseTable.java.svn-base new file mode 100644 index 0000000..a2f3933 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/UseTable.java.svn-base @@ -0,0 +1,247 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.Enumeration; +import java.util.Vector; + +public class UseTable extends HashedLinkedList +{ + + public UseTable(int maximumSize) + { + super(maximumSize); + m_use = new int[maximumSize]; + m_round = 0; + m_used_conections = 0; + m_removed_objects = null; + } + + synchronized public void append(Object object) + throws FullUseTableException + { + append(object, object); + } + + synchronized public void append(Object key, Object item) + throws FullUseTableException + { + // Remove elements if needed + m_removed_objects = removeOldObjects(); + + /* + * if (_removedObjects != null) { + * System.out.println("Round: " + _round + + * "Eliminando conexiones: " + _removedObjects.length); } + */ + + if (getSize() == getMaximumSize()) { + throw new + FullUseTableException("Not enough space to append a new object"); + } + + // Append new element + try { + super.append(key, item); + } + catch (Exception e) { + // should never happen!! + } + if (m_round == Integer.MAX_VALUE) { + // Should check if count == maxInteger !! + } + // Initialize round + m_use[getLast()] = m_round - 1; + } + + synchronized public void use(Object key) + { + // Update round + int i = getIndex(key); + + if (i < 0) + return; + + if (m_use[i] != m_round) { + m_used_conections++; + if (m_used_conections > (getMaximumSize() / 2)) { + m_round++; + m_used_conections = 0; + } + } + + // Update linked list of elements + Object removed = remove(key); + try { + append(key, removed); + } + catch (Exception e) { + // should never happen! + } + m_use[getLast()] = m_round; + } + + synchronized public Object[] getRemovedObjects() + { + return m_removed_objects; + } + + protected Object[] removeOldObjects() + { + + Vector removed = new Vector(); + Vector reinsertedKeys = new Vector(); + Vector reinsertedObjects = new Vector(); + + if (getSize() > getMaximumSize() * 0.8) { + do { + int firstRound = m_use[getFirst()]; + int maxRemoved = (int) (getMaximumSize() * 0.5); + for (Enumeration myenum = getKeys(); myenum.hasMoreElements();) { + Object obj = myenum.nextElement(); + int i = getIndex(obj); + if (m_use[i] <= (m_round - 4)) { + removed.addElement(obj); + } + } + + for (int j = 0; j < removed.size(); j++) { + Object key = removed.elementAt(j); + if (key instanceof RemovableObject) { + RemovableObject removableKey = (RemovableObject) key; + if (!removableKey.canBeRemoved()) { + Object obj = get(key); + reinsertedKeys.addElement(key); + reinsertedObjects.addElement(obj); + removed.removeElement(key); + } + } + remove(key); + } + + if ((getSize() + reinsertedKeys.size()) >= getMaximumSize()) { + m_round++; + } + } while ((getSize() > 0) + && (getSize() + reinsertedKeys.size()) + >= getMaximumSize()); + } + + try { + for (int j = 0; j < reinsertedKeys.size(); j++) { + super.append(reinsertedKeys.elementAt(j), + reinsertedObjects.elementAt(j)); + } + } + catch (Exception e) { + // should never happen!! + } + + if (reinsertedKeys.size() == getSize()) { + return null; + } + + if (removed.size() != 0) { + Object[] res = new Object[removed.size()]; + removed.copyInto(res); + return res; + } else + return null; + } + + public void dump(java.io.PrintStream os) + { + super.dump(os); + int i = getFirst(); + os.print("Uses: ["); + while (i > NULL) { + os.print(m_use[i]); + i = getNext(i); + if (i > NULL) + os.print(", "); + } + os.println("]"); + } + + private int[] m_use; + + private int m_round; + + private int m_used_conections; + + private Object[] m_removed_objects; + + /* + * public static void main(String[] args) { try { + * + * UseTable l = new UseTable(10); l.append(new Integer(1), new String("a")); + * l.append(new Integer(2), new String("b")); l.append(new Integer(3), new + * String("c")); l.append(new Integer(4), new String("d")); l.append(new + * Integer(5), new String("e")); l.append(new Integer(6), new String("f")); + * l.append(new Integer(7), new String("g")); l.append(new Integer(8), new + * String("h")); System.out.println("-------"); l.dump(System.out); + * System.out.println("Objeto: " + l.get(new Integer(5))); + * + * l.use(new Integer(4)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(5)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(1)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(7)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(2)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(3)); System.out.println("-------"); l.dump(System.out); + * + * l.append(new Integer(9), new String("i")); l.append(new Integer(10), new + * String("j")); System.out.println("-------"); l.dump(System.out); + * l.append(new Integer(11), new String("k")); + * System.out.println("-------"); l.dump(System.out); l.append(new + * Integer(12), new String("p")); System.out.println("-------"); + * l.dump(System.out); l.append(new Integer(13), new String("q")); } catch + * (Throwable t) { t.printStackTrace(); } + * + * + * l.remove(new Integer(5)); System.out.println("-------"); + * l.dump(System.out); l.use(new Integer(6)); System.out.println("-------"); + * l.dump(System.out); l.use(new Integer(11)); + * System.out.println("-------"); l.dump(System.out); + * System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/UserExceptionEncoder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/UserExceptionEncoder.java.svn-base new file mode 100644 index 0000000..2766915 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/UserExceptionEncoder.java.svn-base @@ -0,0 +1,92 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA.TypeCodePackage.BadKind; + +/** + * Helper class for inserting/extracting user exceptons in a stream. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +class UserSystemExceptionEncoder +{ + public static void write(org.omg.CORBA.portable.OutputStream out, + org.omg.CORBA.SystemException sys) + { + out.write_string(sys.getClass().getName()); + out.write_ulong(sys.minor); + out.write_ulong(sys.completed.value()); + } + + public static org.omg.CORBA.UnknownUserException + read(org.omg.CORBA.portable.InputStream in, + org.omg.CORBA.TypeCode[] types) + { + String name = in.read_string(); + + try { + if (types != null) + for (int i = 0; i < types.length; i++) { + if (types[i].kind().value() != TCKind._tk_except) + throw new + BAD_PARAM("Bad ExceptionList: not Exception TypeCode"); + + if (name.equals(types[i].name())) { + Any any = in.orb().create_any(); + any.read_value(in, types[i]); + return new UnknownUserException(any); + } + } + } + catch (BadKind bk) {} + throw new UNKNOWN("Unexpected exception: " + name); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/ValueHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/ValueHolder.java.svn-base new file mode 100644 index 0000000..e64db86 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/ValueHolder.java.svn-base @@ -0,0 +1,107 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.TypeCode; + +/** + * Particular Holder for ValueTypes, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ValueHolder + implements org.omg.CORBA.portable.Streamable +{ + + public java.io.Serializable value; + + public TypeCode value_type_typecode; + + public ValueHolder(TypeCode type) + { + value_type_typecode = type; + } + + public ValueHolder(TypeCode type, java.io.Serializable initial) + { + value_type_typecode = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + + if (is instanceof org.omg.CORBA_2_3.portable.InputStream) { + + try { + org.omg.CORBA_2_3.portable.InputStream is_2_3 = + (org.omg.CORBA_2_3.portable.InputStream) is; + value = is_2_3.read_value(value_type_typecode.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (os instanceof org.omg.CORBA_2_3.portable.OutputStream) { + try { + org.omg.CORBA_2_3.portable.OutputStream os_2_3 = + (org.omg.CORBA_2_3.portable.OutputStream) os; + os_2_3.write_value(value,value_type_typecode.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return value_type_typecode; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/WCharHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/WCharHolder.java.svn-base new file mode 100644 index 0000000..1198741 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/WCharHolder.java.svn-base @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WChar, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class WCharHolder + implements org.omg.CORBA.portable.Streamable +{ + + public char value; + + public WCharHolder() + {} + + public WCharHolder(char initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_wchar(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_wchar(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_wchar; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/.svn/text-base/WStringHolder.java.svn-base b/source/es/tid/TIDorbj/core/util/.svn/text-base/WStringHolder.java.svn-base new file mode 100644 index 0000000..e27d80b --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/.svn/text-base/WStringHolder.java.svn-base @@ -0,0 +1,122 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WString, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class WStringHolder + implements org.omg.CORBA.portable.Streamable +{ + + public TypeCode wstring_type; + + public String value = null; + + public WStringHolder() + { + wstring_type = TypeCodeFactory.tc_wstring; + } + + public WStringHolder(TypeCode type) + { + wstring_type = type; + } + + public WStringHolder(TypeCode type, String initial) + { + wstring_type = type; + value = initial; + } + + public WStringHolder(String initial) + { + wstring_type = TypeCodeFactory.tc_wstring; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_wstring(); + try { + if (wstring_type.length() != 0) + if (value.length() > (wstring_type.length() / CDR.WCHAR_SIZE)) + throw new MARSHAL("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + if (wstring_type.length() != 0) + if (value.length() > (wstring_type.length() / CDR.WCHAR_SIZE)) + throw new BAD_PARAM("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + os.write_wstring(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return wstring_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.java b/source/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.java new file mode 100644 index 0000000..df30a05 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/AbstractInterfaceHolder.java @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.TypeCode; + +/** + * Particular Holder for ValueTypes, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class AbstractInterfaceHolder + implements org.omg.CORBA.portable.Streamable +{ + + public java.lang.Object value; + + public TypeCode abstract_typecode; + + public AbstractInterfaceHolder(TypeCode type) + { + abstract_typecode = type; + } + + public AbstractInterfaceHolder(TypeCode type, java.lang.Object initial) + { + abstract_typecode = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + if (is instanceof org.omg.CORBA_2_3.portable.InputStream) { + org.omg.CORBA_2_3.portable.InputStream in_2_3 = + (org.omg.CORBA_2_3.portable.InputStream) is; + value = + in_2_3.read_abstract_interface(); + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (os instanceof org.omg.CORBA_2_3.portable.OutputStream) { + org.omg.CORBA_2_3.portable.OutputStream os_2_3 = + (org.omg.CORBA_2_3.portable.OutputStream) os; + os_2_3.write_abstract_interface(value); + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return abstract_typecode; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.java b/source/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.java new file mode 100644 index 0000000..2c7615c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/BoxedValueHelperFinder.java @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public abstract class BoxedValueHelperFinder +{ + public static Class findHelper(java.io.Serializable boxed_value) + { + StringBuffer buff = new StringBuffer(); + + Package pkg = boxed_value.getClass().getPackage(); + + if (pkg != null) { + + String pkg_str = pkg.getName(); + + if (pkg_str.length() > 0) { + buff.append(pkg_str); + buff.append('.'); + } + } + + buff.append(boxed_value.getClass().getName()); + buff.append("Helper"); + + String helper_name = buff.toString(); + + try { + return Class.forName(helper_name); + + } + catch (ClassNotFoundException cnf) { + return null; + } + catch (OutOfMemoryError om) { + throw new org.omg.CORBA.NO_MEMORY(); + } + catch (Throwable th) { + throw new org.omg.CORBA.UNKNOWN(th.toString()); + } + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/CodeBaseURL.java b/source/es/tid/TIDorbj/core/util/CodeBaseURL.java new file mode 100644 index 0000000..b1be004 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/CodeBaseURL.java @@ -0,0 +1,53 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class CodeBaseURL +{ + public CodeBaseURL(String url) + { + m_url = url; + } + + public String m_url; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/Corbaloc.java b/source/es/tid/TIDorbj/core/util/Corbaloc.java new file mode 100644 index 0000000..f898970 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/Corbaloc.java @@ -0,0 +1,274 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 478 $ +* Date: $Date: 2011-04-29 16:42:47 +0200 (Fri, 29 Apr 2011) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.StringTokenizer; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.ORBPackage.InvalidName; + +import es.tid.TIDorbj.core.ObjectKey; +import es.tid.TIDorbj.core.comm.giop.GIOPVersion; +import es.tid.TIDorbj.core.comm.iiop.IIOPIOR; +import es.tid.TIDorbj.core.comm.iiop.ListenPoint; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; +import es.tid.TIDorbj.core.iop.IOR; +import es.tid.TIDorbj.core.poa.OID; +import es.tid.TIDorbj.core.poa.POAKey; +import es.tid.TIDorbj.util.TranslateURLEscapes; + +//TODO: put this together with into IIOPCorbaloc +public class Corbaloc +{ + + public static IOR getIOR(String corbaloc_URL) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String corbaloc; + String addr; + String path; + String v; + String l; + + ObjectKey objectkey; + GIOPVersion version; + ListenPoint listener; + IIOPProfile[] profiles; + int slashposition, ntokens; + if (corbaloc_URL.startsWith("corbaloc:tidorbj:")) { + corbaloc = corbaloc_URL.substring(17); + slashposition = corbaloc.indexOf('/'); + addr = corbaloc.substring(0, slashposition); + StringTokenizer staddr = new StringTokenizer(addr, "@", false); + ntokens = staddr.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Address Name"); + else { + if (ntokens == 1) { + version = parseVersion("1.0"); + } else { + v = staddr.nextToken(); + version = parseVersion(v); + } + } + l = staddr.nextToken(); + listener = parseListenPoint(l); + path = corbaloc.substring(slashposition + 1); + objectkey = parsePOAPath(path); + } else + throw new InvalidName("Invalid TIDorbJ corbaloc"); + profiles = new IIOPProfile[1]; + profiles[0] = new IIOPProfile(version, listener, objectkey, null); + return new IIOPIOR( "", profiles ); + } + + private static ObjectKey parsePOAPath(String poa_path) + throws org.omg.CORBA.ORBPackage.InvalidName + { + String[] poa_path_a; + String path; + String oid_str; + int ntokens; + OID oid; + POAKey poakey; + ObjectKey objectkey; + path = TranslateURLEscapes.putEscapes(poa_path); + if (path.indexOf("//") != -1) + throw new org.omg.CORBA.ORBPackage.InvalidName("Invalid POA Name"); + StringTokenizer stpath = new StringTokenizer(path, "/", false); + ntokens = stpath.countTokens(); + poa_path_a = new String[ntokens - 1]; + for (int i = 0; i < ntokens - 1; i++) { + poa_path_a[i] = + TranslateURLEscapes.translateUnicode( + TranslateURLEscapes.resolveEscapes(stpath.nextToken())); + } + oid_str = TranslateURLEscapes.resolveEscapes(stpath.nextToken()); + try { + oid = OID.fromString(oid_str); + } + catch (java.lang.Exception e) { + throw new org.omg.CORBA.ORBPackage.InvalidName("Invalid OID"); + } + poakey = new POAKey(poa_path_a, 0L, oid); + return poakey; + } + + public static GIOPVersion parseVersion(String v) + throws org.omg.CORBA.ORBPackage.InvalidName + { + int major, minor; + int ntokens; + GIOPVersion version; + StringTokenizer stversion = new StringTokenizer(v, ".", false); + ntokens = stversion.countTokens(); + if (ntokens == 2) { + major = Integer.parseInt(stversion.nextToken()); + minor = Integer.parseInt(stversion.nextToken()); + if (major == 1) { + if (minor == 0) + version = GIOPVersion.VERSION_1_0; + else if (minor == 1) + version = GIOPVersion.VERSION_1_1; + else if (minor == 2) + version = GIOPVersion.VERSION_1_2; + else + throw new InvalidName("Invalid Minor GIOPVersion Number"); + + } else + throw new InvalidName("Invalid Major GIOPVersion Number"); + } else + throw new InvalidName("Invalid GIOPVersion"); + return version; + } + + + public static ListenPoint parseListenPoint(String listenp) + throws org.omg.CORBA.ORBPackage.InvalidName + { + System.out.println("IIOPCorbaloc parseListenPoint"); + String host; + int port; + int ntokens; + /*StringTokenizer stlistenpoint = + new StringTokenizer(listenp, ":", false); + ntokens = stlistenpoint.countTokens(); + if (ntokens > 2) + throw new InvalidName("Invalid Listener Name"); + else {*/ + int ipv6SeperatorStart = -1; + int ipv6SeperatorEnd = -1; + int sep; + ipv6SeperatorStart = listenp.indexOf('['); + if (ipv6SeperatorStart != -1) + { + ipv6SeperatorEnd = listenp.indexOf(']'); + if (ipv6SeperatorEnd == -1) + { + throw new InvalidName("Invalid Listener Name"); + } + } + + sep = listenp.indexOf(':'); + if( sep != -1 ) + { + if (ipv6SeperatorStart != -1) //IPv6 + { + host=listenp.substring(ipv6SeperatorStart+1, ipv6SeperatorEnd); + if (listenp.charAt(ipv6SeperatorEnd+1) == ':') + { + try + { + port=(short)Integer.parseInt(listenp.substring(ipv6SeperatorEnd+2)); + } + catch( NumberFormatException ill ) + { + throw new InvalidName("Invalid Listener Name"); + } + } + else + { + throw new InvalidName("Invalid Listener Name"); + } + } + else //IPv4 or hostname + { + try + { + port =(short)Integer.parseInt(listenp.substring(sep+1)); + host = listenp.substring(0, sep); + } + catch( NumberFormatException ill ) + { + throw new InvalidName("Invalid Listener Name"); + } + } + } + //mcpg - end + else + { + host = listenp; + port = 2809; + } + /*host = stlistenpoint.nextToken(); + if (ntokens == 1) { + port = 2809; + } else { + port = Integer.parseInt(stlistenpoint.nextToken()); + }*/ + + return new ListenPoint(host, port); + } + + public static String toURL(IOR ior) + { + String corbaloc = "corbaloc:tidorbj:"; + IIOPProfile p = (IIOPProfile) ior.getProfile(0); + GIOPVersion v = p.getVersion(); + ListenPoint l = p.getListenPoint(); + ObjectKey o = p.getObjectKey(); + + POAKey k; + try { + k = POAKey.createKey( o.getMarshaledKey() ); + } catch ( Throwable th ){ + throw new BAD_PARAM( + "Non persistent reference", 0, CompletionStatus.COMPLETED_NO + ); + } + + if (k.getPOAId() != 0L) { + throw new BAD_PARAM( + "Non persistent reference", 0, CompletionStatus.COMPLETED_NO); + } + OID oid = k.getOID(); + corbaloc += v.getMajor() + "." + v.getMinor() + "@"; + corbaloc += l.m_host + ":" + l.m_port + "/"; + for (int i = 0; i < k.numberOfPOAs(); i++) + corbaloc += TranslateURLEscapes.stringfy(k.getPOA(i)) + "/"; + corbaloc += TranslateURLEscapes.stringfy(oid.toString()); + return corbaloc; + } + +} diff --git a/source/es/tid/TIDorbj/core/util/Corbaname.java b/source/es/tid/TIDorbj/core/util/Corbaname.java new file mode 100644 index 0000000..e6d3a2a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/Corbaname.java @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.StringTokenizer; + +import org.omg.CosNaming.NameComponent; +import org.omg.CosNaming.NamingContextPackage.InvalidName; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.util.TranslateURLEscapes; + +public class Corbaname +{ + + public static org.omg.CORBA.Object toObject(TIDORB tidorb, + String corbaname_URL) + throws org.omg.CosNaming.NamingContextPackage.InvalidName, + org.omg.CosNaming.NamingContextPackage.NotFound, + org.omg.CosNaming.NamingContextPackage.CannotProceed, + org.omg.CORBA.ORBPackage.InvalidName + { + String corbaname; + int nameposition; + org.omg.CosNaming.NameComponent[] name_path; + org.omg.CosNaming.NamingContext ncontext; + if (corbaname_URL.startsWith("corbaname:")) { + corbaname = corbaname_URL.substring(10); + nameposition = corbaname.indexOf('#'); + ncontext = + parseProtocol(tidorb, corbaname.substring(0, + nameposition)); + name_path = toName(corbaname.substring(nameposition + 1)); + return ncontext.resolve(name_path); + } else + throw new InvalidName(); /* Invalid corbaname" */ + + } + + private static org.omg.CosNaming.NamingContext + parseProtocol(TIDORB tidorb, + String protocol) + throws org.omg.CosNaming.NamingContextPackage.InvalidName, + org.omg.CORBA.ORBPackage.InvalidName + { + if (protocol.equals("rir:") || protocol.equals("rir:/NameService")) { + org.omg.CORBA.Object naming_ref = + tidorb.resolve_initial_references("NameService"); + return org.omg.CosNaming.NamingContextHelper.narrow(naming_ref); + } else + throw new InvalidName(); + } + + public static org.omg.CosNaming.NameComponent[] toName(String sn) + throws org.omg.CosNaming.NamingContextPackage.InvalidName + { + int ntokensn, ntokenscmp; + String name = ""; + String component = ""; + String id; + String kind; + name = TranslateURLEscapes.putEscapes(sn); + if (name.indexOf("//") != -1) + throw new InvalidName(); + StringTokenizer stname = new StringTokenizer(name, "/", false); + ntokensn = stname.countTokens(); + org.omg.CosNaming.NameComponent[] n = + new org.omg.CosNaming.NameComponent[ntokensn]; + for (int i = 0; i < ntokensn; i++) { + id = ""; + kind = ""; + component = stname.nextToken(); + StringTokenizer stcomp = new StringTokenizer(component, ".", false); + ntokenscmp = stcomp.countTokens(); + if (ntokenscmp > 2) + throw new InvalidName(); + if (!(ntokenscmp <= 1 && component.charAt(0) == '.')) + id = TranslateURLEscapes.resolveEscapes(stcomp.nextToken()); + if (stcomp.countTokens() == 1) + kind = TranslateURLEscapes.resolveEscapes(stcomp.nextToken()); + n[i] = new NameComponent(id, kind); + } + return n; + } + + public static String toString(org.omg.CosNaming.NameComponent[] n) + { + String id; + String kind; + String sn = ""; + for (int i = 0; i < n.length; i++) { + id = TranslateURLEscapes.stringfy(n[i].id); + kind = TranslateURLEscapes.stringfy(n[i].kind); + sn = sn + id; + if (!kind.equals("")) + sn = sn + "." + kind; + if (i < n.length - 1) + sn = sn + "/"; + } + return sn; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/Counter.java b/source/es/tid/TIDorbj/core/util/Counter.java new file mode 100644 index 0000000..2b34727 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/Counter.java @@ -0,0 +1,130 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Simple syncrhonized counter. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ + +public class Counter +{ + + /** + * IIOPConnection state. + */ + private int m_value; + + public Counter() + { + m_value = 0; + } + + synchronized public int getValue() + { + return m_value; + } + + synchronized public boolean isZero() + { + return (m_value == 0); + } + + synchronized public boolean isNonZero() + { + return (m_value != 0); + } + + /** + * Increments the counter 1 unity. + * + * @return the new value of the counter. + */ + synchronized public int inc() + { + m_value++; + return m_value; + } + + /** + * Decrements the counter 1 unity. + * + * @return the new value of the counter. + */ + synchronized public int dec() + { + if (m_value > 0) + m_value--; + return m_value; + } + + /** + * Increments the counter 1 unity. + * + * @return the previous value of the counter. + */ + synchronized public int postInc() + { + int post_value = m_value; + m_value++; + return post_value; + } + + /** + * Decrements the counter 1 unity. + * + * @return the previous value of the counter. + */ + + synchronized public int postDec() + { + int post_value = m_value; + + if (m_value > 0) + m_value--; + return post_value; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/DestructionState.java b/source/es/tid/TIDorbj/core/util/DestructionState.java new file mode 100644 index 0000000..2920c0a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/DestructionState.java @@ -0,0 +1,64 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class DestructionState +{ + + private boolean m_destroyed; + + public DestructionState() + { + m_destroyed = false; + } + + synchronized public void destroy() + { + m_destroyed = true; + } + + synchronized public boolean isDestroyed() + { + return m_destroyed; + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/EnumHolder.java b/source/es/tid/TIDorbj/core/util/EnumHolder.java new file mode 100644 index 0000000..bdd4ea0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/EnumHolder.java @@ -0,0 +1,88 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Particular Holder for ULong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class EnumHolder + implements org.omg.CORBA.portable.Streamable +{ + + public int value; + + public es.tid.TIDorbj.core.typecode.EnumTypeCode enum_type; + + public EnumHolder(es.tid.TIDorbj.core.typecode.EnumTypeCode type) + { + value = 0; + enum_type = type; + } + + public EnumHolder(es.tid.TIDorbj.core.typecode.EnumTypeCode type, + int initial) + { + value = initial; + enum_type = type; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return enum_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/FixedHolder.java b/source/es/tid/TIDorbj/core/util/FixedHolder.java new file mode 100644 index 0000000..913238d --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/FixedHolder.java @@ -0,0 +1,208 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.math.BigDecimal; +import java.math.BigInteger; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.typecode.FixedTypeCode; +import es.tid.TIDorbj.util.Base16Codec; + +/** + * Particular Holder for FixedType. + * + * @autor Juan A. Ca´ceres + * @version 0.1 + */ + +public class FixedHolder + implements org.omg.CORBA.portable.Streamable +{ + + TypeCode m_fixed_type; + + public java.math.BigDecimal value; + + public FixedHolder(TypeCode type) + { + m_fixed_type = type; + value = null; + } + + public FixedHolder(TypeCode type, java.math.BigDecimal initial) + { + m_fixed_type = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + int value_length = FixedTypeCode.valueLength(m_fixed_type); + + StringBuffer buffer = new StringBuffer(value_length); + + int pairs = value_length / 2; + + try { + + for (int i = 1; i < pairs; i++) { + byte octet = is.read_octet(); + buffer.append(Base16Codec.getDigit(0xf & (octet >> 4))); + buffer.append(Base16Codec.getDigit(0xf & octet)); + } + + // last pair + byte octet = is.read_octet(); + + buffer.append(Base16Codec.getDigit(0xf & (octet >> 4))); + + boolean positive; + switch (0xf & octet) + { + case 0xD: + positive = false; + break; + case 0xC: + positive = true; + break; + default: + throw new MARSHAL("Fixed_read: Invalid signum value", 0, + CompletionStatus.COMPLETED_NO); + } + + BigInteger value_int = new BigInteger(buffer.toString()); + + if (positive) + value = new BigDecimal(value_int, m_fixed_type.fixed_scale()); + else + value = new BigDecimal(value_int.negate(), + m_fixed_type.fixed_scale()); + + } + catch (MARSHAL m) { + throw m; + } + catch (Exception e) { + throw new MARSHAL(e.getMessage(), 0, CompletionStatus.COMPLETED_NO); + } + + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (value == null) + value = new BigDecimal(0.0); + + int value_length = FixedTypeCode.valueLength(m_fixed_type); + + int digits = 0; + try { + + digits = m_fixed_type.fixed_digits(); + } + catch (BadKind bk) {/* unreachable */} + + BigInteger unscaled = value.setScale(0).toBigInteger(); + + char[] literal = unscaled.toString().toCharArray(); + + int literal_count = (value.signum() < 0) ? 1 : 0;//skip the signum char + + int literal_digits = literal.length - literal_count; + + if (digits < literal_digits) + throw new MARSHAL("Fixed Overflow.", 0, + CompletionStatus.COMPLETED_NO); + + int value_pairs = (literal_digits - 1) / 2; // number of digit_digit + // octets + // 1 is substracted from literals represents + //the last digit int digit_signum pair + + int zero_value_pairs = (literal_digits - 1) % 2; // 0_digit octet is 0 + // or 1 + int zero_pairs = (value_length / 2) - zero_value_pairs - value_pairs + - 1; + // 0_0 octets + // 1 is substracted from zero_pairs represents the zero_signum pair + + for (int i = 0; i < zero_pairs; i++) + write_pair(os, 0, 0); + + try { + if (zero_value_pairs != 0) + write_pair(os, 0, + Base16Codec.getValue(literal[literal_count++])); + + for (int i = 0; i < zero_pairs; i++) + write_pair(os, Base16Codec.getValue(literal[literal_count++]), + Base16Codec.getValue(literal[literal_count++])); + + write_pair(os, Base16Codec.getValue(literal[literal_count++]), + (value.signum() < 0) ? 0xD : 0xC); + } + catch (MARSHAL m) { + throw m; + } + catch (Exception e) { + throw new MARSHAL(e.getMessage(), 0, CompletionStatus.COMPLETED_NO); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return m_fixed_type; + } + + static void write_pair(org.omg.CORBA.portable.OutputStream os, int digit1, + int digit2) + { + os.write_octet((byte) ((digit1 << 4) | (digit2))); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/FullUseTableException.java b/source/es/tid/TIDorbj/core/util/FullUseTableException.java new file mode 100644 index 0000000..9a3ab91 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/FullUseTableException.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class FullUseTableException extends Exception +{ + + public FullUseTableException() + { + super(); + } + + public FullUseTableException(String s) + { + super(s); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/HashedLinkedList.java b/source/es/tid/TIDorbj/core/util/HashedLinkedList.java new file mode 100644 index 0000000..40c2f30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/HashedLinkedList.java @@ -0,0 +1,143 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class HashedLinkedList extends LinkedList +{ + + public HashedLinkedList(int maximumSize) + { + super(maximumSize); + m_table = new java.util.Hashtable(); + } + + /** + * @param object + * represents the key & item to be saved in the hashtable + */ + public void append(Object object) + throws Exception + { + append(object, object); + } + + public void append(Object key, Object item) + throws Exception + { + super.append(item); + m_table.put(key, new Integer(getLast())); + } + + public Object get(Object key) + { + Integer index = (Integer) m_table.get(key); + return getObjectAt(index.intValue()); + } + + public boolean object_exist(Object key) + { + return (m_table.get(key) != null); + } + + protected int getIndex(Object key) + { + Integer index = (Integer) m_table.get(key); + + if (index == null) + return -1; + + return index.intValue(); + } + + public Object remove(Object key) + { + + Integer index = (Integer) m_table.get(key); + if (index == null) { + return null; + } + Object removed = internalRemove(index.intValue()); + m_table.remove(key); + return removed; + } + + public Object removeFirst() + { + Object removed = super.removeFirst(); + m_table.remove(removed); + return removed; + } + + public Object removeLast() + { + Object removed = super.removeLast(); + m_table.remove(removed); + return removed; + } + + public java.util.Enumeration getKeys() + { + return m_table.keys(); + } + + /* + * public void dump(java.io.PrintStream os) { super.dump(os); + * os.print("Keys: ["); for (java.util.Enumeration enum = _table.keys(); + * enum.hasMoreElements(); ) { os.print(enum.nextElement()); if + * (enum.hasMoreElements()) os.print(", "); } os.println("]"); } + */ + + protected java.util.Hashtable m_table; + + /* + * public static void main(String[] args) { HashedLinkedList l = new + * HashedLinkedList(10); l.append(new Integer(1)); l.append(new Integer(2)); + * l.append(new Integer(3)); l.append(new Integer(4)); l.append(new + * Integer(5)); l.append(new Integer(6)); l.append(new Integer(7)); + * l.append(new Integer(8)); l.append(new Integer(9)); l.append(new + * Integer(10)); System.out.println("-------"); l.dump(System.out); + * l.remove(new Integer(7)); System.out.println("-------"); + * l.dump(System.out); l.removeFirst(); System.out.println("-------"); + * l.dump(System.out); System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/InitialReference.java b/source/es/tid/TIDorbj/core/util/InitialReference.java new file mode 100644 index 0000000..163baad --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/InitialReference.java @@ -0,0 +1,89 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.BAD_PARAM; + +public class InitialReference +{ + String m_service_name; + + String m_service_url; + + public InitialReference() + { + m_service_name = null; + m_service_url = null; + } + + public InitialReference(String name, String url) + { + m_service_name = name; + m_service_url = url; + } + + public String getName() + { + return m_service_name; + } + + public String getURL() + { + return m_service_url; + } + + public void parse(String value) + { + java.util.StringTokenizer tokenizer = + new java.util.StringTokenizer(value, "="); + + if (tokenizer.countTokens() != 2) + throw new BAD_PARAM( "Invalid -ORBInitRef value: it does not match" + + " = pattern"); + + m_service_name = tokenizer.nextToken(); + m_service_url = tokenizer.nextToken(); + } + +} + diff --git a/source/es/tid/TIDorbj/core/util/LinkedList.java b/source/es/tid/TIDorbj/core/util/LinkedList.java new file mode 100644 index 0000000..6691c64 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/LinkedList.java @@ -0,0 +1,239 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class LinkedList +{ + + protected static int NULL = -1; + + public LinkedList(int maximumSize) + { + m_maximum_size = maximumSize; + m_next = new int[maximumSize]; + m_previous = new int[maximumSize]; + m_free_indexes = new int[maximumSize]; + m_objects = new Object[maximumSize]; + m_last_free = maximumSize - 1; + for (int i = 0; i < maximumSize; i++) { + m_free_indexes[i] = i; + } + m_first = NULL; + m_last = NULL; + } + + public void append(Object object) + throws Exception + { + if (m_last_free < 0) { + throw new Exception("Not enough space in linked list of size " + + m_maximum_size + "!!"); + } + int index = m_free_indexes[m_last_free]; + m_last_free -= 1; + if (m_first >= 0) { + m_next[m_last] = index; + m_objects[index] = object; + m_next[index] = NULL; + m_previous[index] = m_last; + m_last = index; + } else { + m_first = index; + m_last = index; + m_objects[index] = object; + m_next[index] = NULL; + m_previous[index] = NULL; + } + } + + public Object removeFirst() + { + return internalRemove(m_first); + } + + public Object removeLast() + { + return internalRemove(m_last); + } + + public java.util.Enumeration elements() + { + return new LinkedListEnumeration(this); + } + + public int getSize() + { + return m_maximum_size - m_last_free - 1; + } + + public int getMaximumSize() + { + return m_maximum_size; + } + + public void dump(java.io.PrintStream os) + { + int i = m_first; + os.print("["); + while (i > NULL) { + os.print(m_objects[i]); + i = m_next[i]; + if (i > NULL) + os.print(", "); + } + os.println("]"); + } + + /** + * @param pos + * internal index of object to remove (it must be a legal + * position) + */ + protected Object internalRemove(int pos) + { + Object removed = m_objects[pos]; + if (pos != m_first) + m_next[m_previous[pos]] = m_next[pos]; + else + m_first = m_next[pos]; + if (pos != m_last) + m_previous[m_next[pos]] = m_previous[pos]; + else + m_last = m_previous[pos]; + m_last_free += 1; + m_free_indexes[m_last_free] = pos; + return removed; + } + + protected int getLast() + { + return m_last; + } + + protected int getFirst() + { + return m_first; + } + + protected int getNext(int index) + { + return m_next[index]; + } + + protected int getPrevious(int index) + { + return m_previous[index]; + } + + protected Object getObjectAt(int index) + { + return m_objects[index]; + } + + // Maximum size + private int m_maximum_size; + + // Arrays for objects and indexes + private int[] m_next = null; + + private int[] m_previous = null; + + private int[] m_free_indexes = null; + + private Object[] m_objects = null; + + // Indexes + private int m_last_free; + + private int m_first; + + private int m_last; + + /** + * Enumeration support. + */ + protected class LinkedListEnumeration + implements java.util.Enumeration + { + + public LinkedListEnumeration(LinkedList list) + { + _list = list; + _index = _list.m_first; + } + + public boolean hasMoreElements() + { + return (_index != NULL); + } + + public Object nextElement() + { + int i = _index; + _index = _list.m_next[_index]; + return _list.m_objects[i]; + } + + private int _index; + + private LinkedList _list; + } + + // Main - test method + /* + * public static void main(String[] args) { LinkedList l = new + * LinkedList(10); l.append(new Integer(1)); l.append(new Integer(2)); + * l.append(new Integer(3)); l.append(new Integer(4)); l.append(new + * Integer(5)); l.append(new Integer(6)); l.append(new Integer(7)); + * l.append(new Integer(8)); l.append(new Integer(9)); l.append(new + * Integer(10)); System.out.println("-------"); l.dump(System.out); + * l.removeLast(); System.out.println("-------"); l.dump(System.out); + * l.removeFirst(); System.out.println("-------"); l.dump(System.out); + * l.append(new Integer(11)); System.out.println("-------"); + * l.dump(System.out); l.append(new Integer(12)); + * System.out.println("-------"); l.dump(System.out); l.removeFirst(); + * System.out.println("-------"); l.dump(System.out); l.removeLast(); + * System.out.println("-------"); l.dump(System.out); + * System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/Mutex.java b/source/es/tid/TIDorbj/core/util/Mutex.java new file mode 100644 index 0000000..9bf04df --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/Mutex.java @@ -0,0 +1,69 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class Mutex +{ + + boolean m_value; + + public Mutex() + { + m_value = false; + } + + public synchronized void enter() + throws java.lang.InterruptedException + { + while (m_value) { + wait(); + } + m_value = false; + } + + public synchronized void exit() + { + m_value = false; + notify(); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.java b/source/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.java new file mode 100644 index 0000000..0940d84 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/OnlyOneThreadCanWait.java @@ -0,0 +1,56 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * It is thrown if the restriction of a OperationCompletion than only one thread + * can wait, has been violated. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class OnlyOneThreadCanWait extends java.lang.Exception +{ + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/OperationCompletion.java b/source/es/tid/TIDorbj/core/util/OperationCompletion.java new file mode 100644 index 0000000..35efd56 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/OperationCompletion.java @@ -0,0 +1,131 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 35 $ +* Date: $Date: 2006-08-25 13:13:29 +0200 (Fri, 25 Aug 2006) $ +* Last modified by: $Author: ldlfd $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +/** + * Manages the completion status of an operation. + *

+ * Also, makes one thread to wait the completion. + *

+ * The status are: + *

    + *
  • INITIAL: the operation is not completed and there is not + * any Thread waiting for the completion + *
  • WAITING: there is a Thread that is waiting for the completion + *
  • COMPLETED: the operation is completed. + *
+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class OperationCompletion +{ + + public final static int INITIAL = 0; + + public final static int WAITING = 1; + + public final static int COMPLETED = 2; + + /** + * The Completion status. + */ + int m_state; + + public OperationCompletion() + { + m_state = INITIAL; + } + + /** + * @return whether or not the operation is completed + */ + public synchronized boolean isCompleted() + { + return m_state == COMPLETED; + } + + /** + * The operation is completed. + *

+ * If there is a thread waiting for the completion notifies it. + */ + public synchronized void setCompleted() + { + int actual_state = m_state; + + m_state = COMPLETED; + + if (actual_state == WAITING) + notify(); + } + + /** + * Makes a thread wait for the operation completion (with a timeout). + * + * @timeout the timeout + */ + public synchronized void waitForCompletion(long timeout) + throws java.lang.InterruptedException, + es.tid.TIDorbj.core.util.OnlyOneThreadCanWait + { + if (m_state == INITIAL) { + m_state = WAITING; + wait(timeout); + } else if (m_state == WAITING) { + throw new es.tid.TIDorbj.core.util.OnlyOneThreadCanWait(); + } + // else do nothing, is completed + } + + /** + * If there is a thread waiting for the completion notifies it. + * + */ + public synchronized void interruptWaiting() + { + notify(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/RemovableObject.java b/source/es/tid/TIDorbj/core/util/RemovableObject.java new file mode 100644 index 0000000..0104812 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/RemovableObject.java @@ -0,0 +1,50 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public interface RemovableObject +{ + + boolean canBeRemoved(); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/RepositoryId.java b/source/es/tid/TIDorbj/core/util/RepositoryId.java new file mode 100644 index 0000000..837d2b7 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/RepositoryId.java @@ -0,0 +1,207 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +public class RepositoryId +{ + + public String m_value; + + public RepositoryId(String value) + { + m_value = value; + } + + public static String className(String repId) + { + if (repId.equals("IDL:omg.org/CORBA/WStringValue:1.0")) { + return "java.lang.String"; + } else if (repId.startsWith("IDL:")) { + // cut "IDL:" and version + // and swap "org.omg" if necessary + + String id_base = repId.substring(4, repId.lastIndexOf(':')); + if (id_base.startsWith("omg.org")) + return ir2scopes("org.omg", id_base.substring(7)); + else + return ir2scopes("", id_base); + } else if (repId.startsWith("RMI:")) { + return repId.substring(4, repId.indexOf(':', 4)); + } else { + throw new RuntimeException("unrecognized RepositoryID: " + repId); + } + } + + /** + * @return java.lang.String + */ + + private static String ir2scopes(String prefix, String s) + { + if (s.indexOf("/") < 0) + return s; + java.util.StringTokenizer strtok = + new java.util.StringTokenizer(s, "/"); + + int count = strtok.countTokens(); + StringBuffer sb = new StringBuffer(); + sb.append(prefix); + + for (int i = 0; strtok.hasMoreTokens(); i++) { + String sc = strtok.nextToken(); + Class c = null; + if (sb.toString().length() > 0) + c = loadClass(sb.toString() + "." + sc); + else + c = loadClass(sc); + if (c == null) + if (sb.toString().length() > 0) + sb.append("." + sc); + else + sb.append(sc); + else if (i < count - 1) + sb.append("." + sc + "Package"); + else + sb.append("." + sc); + } + + return sb.toString(); + } + + public static String repId(Class c) + { + if (org.omg.CORBA.portable.IDLEntity.class.isAssignableFrom(c)) { + String className = c.getName(); + String head = ""; + String body = ""; + + // add "IDL:" and ":1.0" + // and swap "org.omg" if necessary + + if (className.startsWith("org.omg") + || className.startsWith("org/omg")) { + if (className.length() > 7) + body = className.substring(7); + return "IDL:omg.org/" + scopesToIR(body) + ":1.0"; + } else + return "IDL:" + scopesToIR(className) + ":1.0"; + } else + return javax.rmi.CORBA.Util.createValueHandler() + .getRMIRepositoryID(c); + } + + private static String scopesToIR(String s) + { + if (s.indexOf(".") < 0) + return s; + java.util.StringTokenizer strtok = + new java.util.StringTokenizer(s, "."); + + String scopes[] = new String[strtok.countTokens()]; + + for (int i = 0; strtok.hasMoreTokens(); i++) { + String sc = strtok.nextToken(); + if (sc.endsWith("Package")) + scopes[i] = sc.substring(0, sc.indexOf("Package")); + else + scopes[i] = sc; + } + + StringBuffer sb = new StringBuffer(); + if (scopes.length > 1) { + for (int i = 0; i < scopes.length - 1; i++) + sb.append(scopes[i] + "/"); + } + + sb.append(scopes[scopes.length - 1]); + return sb.toString(); + } + + /** + * convert a class name to a Repository ID
+ * classname - the class name to convert resolveClass - indicates whether + * the method should try to resolve and load the class. If true and the + * class could not be loaded, an IllegalArgumentException will be thrown + */ + + public static String toRepositoryID(String className, boolean resolveClass) + { + if (className.equals("") || className.startsWith("IDL:") + || className.startsWith("RMI:")) + return className; + else { + if (resolveClass) { + + Class c = loadClass(className); + if (c == null) + throw new IllegalArgumentException("cannot find class: " + + className); + else + return repId(c); + } + return "IDL:" + className + ":1.0"; + } + } + + public static String toRepositoryID(String className) + { + return toRepositoryID(className, true); + } + + /** + * Loads class `name' using an appropriate class loader. Returns the + * corresponding class object, or null if the class loader cannot find a + * class by that name. + */ + private static Class loadClass(String name) + { + try { + return Thread.currentThread().getContextClassLoader() + .loadClass(name); + } + catch (ClassNotFoundException e) { + return null; + } + } +} + diff --git a/source/es/tid/TIDorbj/core/util/StringHolder.java b/source/es/tid/TIDorbj/core/util/StringHolder.java new file mode 100644 index 0000000..305325f --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/StringHolder.java @@ -0,0 +1,117 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WString, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class StringHolder + implements org.omg.CORBA.portable.Streamable +{ + + public TypeCode string_type; + + public String value = null; + + public StringHolder() + { + string_type = TypeCodeFactory.tc_string; + } + + public StringHolder(TypeCode type) + { + string_type = type; + } + + public StringHolder(TypeCode type, String initial) + { + string_type = type; + value = initial; + } + + public StringHolder(String initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_string(); + try { + if (string_type.length() != 0) + if (value.length() > string_type.length()) + throw new MARSHAL("String out of bounds."); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + if (string_type.length() != 0) + if (value.length() > string_type.length()) + throw new MARSHAL("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + os.write_string(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return string_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/ULongHolder.java b/source/es/tid/TIDorbj/core/util/ULongHolder.java new file mode 100644 index 0000000..4dfa05d --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/ULongHolder.java @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for ULongLong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ULongHolder + implements org.omg.CORBA.portable.Streamable +{ + + public int value; + + public ULongHolder() + {} + + public ULongHolder(int initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ulong; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/ULongLongHolder.java b/source/es/tid/TIDorbj/core/util/ULongLongHolder.java new file mode 100644 index 0000000..fc4db08 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/ULongLongHolder.java @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for ULongLong, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ULongLongHolder + implements org.omg.CORBA.portable.Streamable +{ + + public long value; + + public ULongLongHolder() + {} + + public ULongLongHolder(long initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ulonglong(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ulonglong(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ulonglong; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/UShortHolder.java b/source/es/tid/TIDorbj/core/util/UShortHolder.java new file mode 100644 index 0000000..2d0ccf2 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/UShortHolder.java @@ -0,0 +1,82 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for UShort, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 0.1 + */ +final public class UShortHolder + implements org.omg.CORBA.portable.Streamable +{ + + public short value; + + public UShortHolder() + {} + + public UShortHolder(short initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_ushort(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_ushort(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_ushort; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/UseTable.java b/source/es/tid/TIDorbj/core/util/UseTable.java new file mode 100644 index 0000000..c8a7f6a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/UseTable.java @@ -0,0 +1,247 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 45 $ +* Date: $Date: 2007-02-12 16:07:48 +0100 (Mon, 12 Feb 2007) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import java.util.Enumeration; +import java.util.Vector; + +public class UseTable extends HashedLinkedList +{ + + public UseTable(int maximumSize) + { + super(maximumSize); + m_use = new int[maximumSize]; + m_round = 0; + m_used_conections = 0; + m_removed_objects = null; + } + + synchronized public void append(Object object) + throws FullUseTableException + { + append(object, object); + } + + synchronized public void append(Object key, Object item) + throws FullUseTableException + { + // Remove elements if needed + m_removed_objects = removeOldObjects(); + + /* + * if (_removedObjects != null) { + * System.out.println("Round: " + _round + + * "Eliminando conexiones: " + _removedObjects.length); } + */ + + if (getSize() == getMaximumSize()) { + throw new + FullUseTableException("Not enough space to append a new object"); + } + + // Append new element + try { + super.append(key, item); + } + catch (Exception e) { + // should never happen!! + } + if (m_round == Integer.MAX_VALUE) { + // Should check if count == maxInteger !! + } + // Initialize round + m_use[getLast()] = m_round - 1; + } + + synchronized public void use(Object key) + { + // Update round + int i = getIndex(key); + + if (i < 0) + return; + + if (m_use[i] != m_round) { + m_used_conections++; + if (m_used_conections > (getMaximumSize() / 2)) { + m_round++; + m_used_conections = 0; + } + } + + // Update linked list of elements + Object removed = remove(key); + try { + append(key, removed); + } + catch (Exception e) { + // should never happen! + } + m_use[getLast()] = m_round; + } + + synchronized public Object[] getRemovedObjects() + { + return m_removed_objects; + } + + protected Object[] removeOldObjects() + { + + Vector removed = new Vector(); + Vector reinsertedKeys = new Vector(); + Vector reinsertedObjects = new Vector(); + + if (getSize() > getMaximumSize() * 0.8) { + do { + int firstRound = m_use[getFirst()]; + int maxRemoved = (int) (getMaximumSize() * 0.5); + for (Enumeration myenum = getKeys(); myenum.hasMoreElements();) { + Object obj = myenum.nextElement(); + int i = getIndex(obj); + if (m_use[i] <= (m_round - 4)) { + removed.addElement(obj); + } + } + + for (int j = 0; j < removed.size(); j++) { + Object key = removed.elementAt(j); + if (key instanceof RemovableObject) { + RemovableObject removableKey = (RemovableObject) key; + if (!removableKey.canBeRemoved()) { + Object obj = get(key); + reinsertedKeys.addElement(key); + reinsertedObjects.addElement(obj); + removed.removeElement(key); + } + } + remove(key); + } + + if ((getSize() + reinsertedKeys.size()) >= getMaximumSize()) { + m_round++; + } + } while ((getSize() > 0) + && (getSize() + reinsertedKeys.size()) + >= getMaximumSize()); + } + + try { + for (int j = 0; j < reinsertedKeys.size(); j++) { + super.append(reinsertedKeys.elementAt(j), + reinsertedObjects.elementAt(j)); + } + } + catch (Exception e) { + // should never happen!! + } + + if (reinsertedKeys.size() == getSize()) { + return null; + } + + if (removed.size() != 0) { + Object[] res = new Object[removed.size()]; + removed.copyInto(res); + return res; + } else + return null; + } + + public void dump(java.io.PrintStream os) + { + super.dump(os); + int i = getFirst(); + os.print("Uses: ["); + while (i > NULL) { + os.print(m_use[i]); + i = getNext(i); + if (i > NULL) + os.print(", "); + } + os.println("]"); + } + + private int[] m_use; + + private int m_round; + + private int m_used_conections; + + private Object[] m_removed_objects; + + /* + * public static void main(String[] args) { try { + * + * UseTable l = new UseTable(10); l.append(new Integer(1), new String("a")); + * l.append(new Integer(2), new String("b")); l.append(new Integer(3), new + * String("c")); l.append(new Integer(4), new String("d")); l.append(new + * Integer(5), new String("e")); l.append(new Integer(6), new String("f")); + * l.append(new Integer(7), new String("g")); l.append(new Integer(8), new + * String("h")); System.out.println("-------"); l.dump(System.out); + * System.out.println("Objeto: " + l.get(new Integer(5))); + * + * l.use(new Integer(4)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(5)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(1)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(7)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(2)); System.out.println("-------"); l.dump(System.out); + * l.use(new Integer(3)); System.out.println("-------"); l.dump(System.out); + * + * l.append(new Integer(9), new String("i")); l.append(new Integer(10), new + * String("j")); System.out.println("-------"); l.dump(System.out); + * l.append(new Integer(11), new String("k")); + * System.out.println("-------"); l.dump(System.out); l.append(new + * Integer(12), new String("p")); System.out.println("-------"); + * l.dump(System.out); l.append(new Integer(13), new String("q")); } catch + * (Throwable t) { t.printStackTrace(); } + * + * + * l.remove(new Integer(5)); System.out.println("-------"); + * l.dump(System.out); l.use(new Integer(6)); System.out.println("-------"); + * l.dump(System.out); l.use(new Integer(11)); + * System.out.println("-------"); l.dump(System.out); + * System.out.println("Tam: " + l.getSize()); } + */ +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/UserExceptionEncoder.java b/source/es/tid/TIDorbj/core/util/UserExceptionEncoder.java new file mode 100644 index 0000000..d2b570e --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/UserExceptionEncoder.java @@ -0,0 +1,92 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.UNKNOWN; +import org.omg.CORBA.UnknownUserException; +import org.omg.CORBA.TypeCodePackage.BadKind; + +/** + * Helper class for inserting/extracting user exceptons in a stream. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +class UserSystemExceptionEncoder +{ + public static void write(org.omg.CORBA.portable.OutputStream out, + org.omg.CORBA.SystemException sys) + { + out.write_string(sys.getClass().getName()); + out.write_ulong(sys.minor); + out.write_ulong(sys.completed.value()); + } + + public static org.omg.CORBA.UnknownUserException + read(org.omg.CORBA.portable.InputStream in, + org.omg.CORBA.TypeCode[] types) + { + String name = in.read_string(); + + try { + if (types != null) + for (int i = 0; i < types.length; i++) { + if (types[i].kind().value() != TCKind._tk_except) + throw new + BAD_PARAM("Bad ExceptionList: not Exception TypeCode"); + + if (name.equals(types[i].name())) { + Any any = in.orb().create_any(); + any.read_value(in, types[i]); + return new UnknownUserException(any); + } + } + } + catch (BadKind bk) {} + throw new UNKNOWN("Unexpected exception: " + name); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/ValueHolder.java b/source/es/tid/TIDorbj/core/util/ValueHolder.java new file mode 100644 index 0000000..7bcf54b --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/ValueHolder.java @@ -0,0 +1,107 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.TypeCode; + +/** + * Particular Holder for ValueTypes, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +final public class ValueHolder + implements org.omg.CORBA.portable.Streamable +{ + + public java.io.Serializable value; + + public TypeCode value_type_typecode; + + public ValueHolder(TypeCode type) + { + value_type_typecode = type; + } + + public ValueHolder(TypeCode type, java.io.Serializable initial) + { + value_type_typecode = type; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + + if (is instanceof org.omg.CORBA_2_3.portable.InputStream) { + + try { + org.omg.CORBA_2_3.portable.InputStream is_2_3 = + (org.omg.CORBA_2_3.portable.InputStream) is; + value = is_2_3.read_value(value_type_typecode.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (os instanceof org.omg.CORBA_2_3.portable.OutputStream) { + try { + org.omg.CORBA_2_3.portable.OutputStream os_2_3 = + (org.omg.CORBA_2_3.portable.OutputStream) os; + os_2_3.write_value(value,value_type_typecode.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } else { + throw new org.omg.CORBA.MARSHAL("InputStream is not CORBA 2.3"); + } + } + + public org.omg.CORBA.TypeCode _type() + { + return value_type_typecode; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/WCharHolder.java b/source/es/tid/TIDorbj/core/util/WCharHolder.java new file mode 100644 index 0000000..e01ad56 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/WCharHolder.java @@ -0,0 +1,83 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WChar, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class WCharHolder + implements org.omg.CORBA.portable.Streamable +{ + + public char value; + + public WCharHolder() + {} + + public WCharHolder(char initial) + { + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_wchar(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + os.write_wchar(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return TypeCodeFactory.tc_wchar; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/WStringHolder.java b/source/es/tid/TIDorbj/core/util/WStringHolder.java new file mode 100644 index 0000000..259d3dc --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/WStringHolder.java @@ -0,0 +1,122 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Particular Holder for WString, Java Mapping does not give one. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +final public class WStringHolder + implements org.omg.CORBA.portable.Streamable +{ + + public TypeCode wstring_type; + + public String value = null; + + public WStringHolder() + { + wstring_type = TypeCodeFactory.tc_wstring; + } + + public WStringHolder(TypeCode type) + { + wstring_type = type; + } + + public WStringHolder(TypeCode type, String initial) + { + wstring_type = type; + value = initial; + } + + public WStringHolder(String initial) + { + wstring_type = TypeCodeFactory.tc_wstring; + value = initial; + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + value = is.read_wstring(); + try { + if (wstring_type.length() != 0) + if (value.length() > (wstring_type.length() / CDR.WCHAR_SIZE)) + throw new MARSHAL("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + if (wstring_type.length() != 0) + if (value.length() > (wstring_type.length() / CDR.WCHAR_SIZE)) + throw new BAD_PARAM("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + + os.write_wstring(value); + } + + public org.omg.CORBA.TypeCode _type() + { + return wstring_type; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/all-wcprops b/source/es/tid/TIDorbj/core/util/exception/.svn/all-wcprops new file mode 100644 index 0000000..85499f0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/all-wcprops @@ -0,0 +1,215 @@ +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception +END +FREE_MEM_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.java +END +INV_IDENT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.java +END +BAD_TYPECODE_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.java +END +TIMEOUT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.java +END +INV_POLICY_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.java +END +NO_MEMORY_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.java +END +NO_RESPONSE_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.java +END +SystemExceptionCreator.java +K 25 +svn:wc:ra_dav:version-url +V 117 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.java +END +INTERNAL_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.java +END +INV_FLAG_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 111 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.java +END +INTF_REPOS_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.java +END +Makefile +K 25 +svn:wc:ra_dav:version-url +V 98 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/Makefile +END +COMM_FAILURE_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.java +END +INVALID_TRANSACTION_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 122 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.java +END +BAD_CONTEXT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.java +END +INITIALIZE_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.java +END +SystemExceptionEncoder.java +K 25 +svn:wc:ra_dav:version-url +V 117 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.java +END +BAD_OPERATION_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.java +END +IMP_LIMIT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.java +END +TRANSACTION_REQUIRED_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 123 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.java +END +MARSHAL_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.java +END +SystemExceptionNames.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.java +END +PERSIST_STORE_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.java +END +BAD_PARAM_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.java +END +NO_PERMISSION_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.java +END +DATA_CONVERSION_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 118 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.java +END +OBJECT_NOT_EXIST_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 119 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.java +END +INV_OBJREF_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 113 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.java +END +TRANSIENT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 112 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.java +END +UNKNOWN_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 110 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.java +END +NO_RESOURCES_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.java +END +OBJ_ADAPTER_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.java +END +BAD_INV_ORDER_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.java +END +NO_IMPLEMENT_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 115 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.java +END +TRANSACTION_ROLLEDBACK_Creator.java +K 25 +svn:wc:ra_dav:version-url +V 125 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.java +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/entries b/source/es/tid/TIDorbj/core/util/exception/.svn/entries new file mode 100644 index 0000000..4af2809 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/entries @@ -0,0 +1,1218 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/util/exception +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2006-07-14T12:08:38.000000Z +21 +iredondo + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +BAD_TYPECODE_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +f901abd2c6d8cfcb7f158556f0a94589 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1898 + +IMP_LIMIT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +e0ff0ff1a97b53353222e2ea5585e5fc +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1892 + +SystemExceptionEncoder.java +file + + + + +2009-05-27T12:24:02.000000Z +5e865d19eab14f4c3e3ac67e8cc23704 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +11121 + +NO_RESPONSE_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +06f63f18f745a1336564962fbc09e1e6 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1895 + +BAD_CONTEXT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +822fcf2067494371628ea92f8acbc5d9 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1896 + +INVALID_TRANSACTION_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +a6ceb6559e634a02bab89df140e06367 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1911 + +UNKNOWN_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +1bc82af63123899e8824d94a0d4a9ee4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1887 + +INITIALIZE_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +839dceba1e8e90deaedd2d9c75a4489d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1894 + +OBJECT_NOT_EXIST_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +bb7a0952474d27fbd5378197e9875180 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1905 + +SystemExceptionCreator.java +file + + + + +2009-05-27T12:24:02.000000Z +79f8b12d70d47b20e13102c675a0afed +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1777 + +NO_MEMORY_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +4ae93100d97da3719b8068556f678b1d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1891 + +PERSIST_STORE_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +5cb5d6d3ec3f1ab46f5be7a08a40a65d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1899 + +NO_RESOURCES_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +e6355d352f7d744b92ef4a7c40a42e8e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1897 + +BAD_OPERATION_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +475e2e46cc13a5e7d8c71f8bfdab6ff7 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1900 + +TRANSIENT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +82c7326f64ade46f38e215cb697afb4e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1891 + +OBJ_ADAPTER_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +2686e6a1b79481a8aabd28633417b28f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1895 + +INV_POLICY_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +a9cb36f7520ddc34a30947d526f99d24 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1893 + +Makefile +file + + + + +2009-05-27T12:24:02.000000Z +106790f2ea8f289fdf9686f0ab8a6794 +2006-07-14T12:08:38.000000Z +21 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +1472 + +DATA_CONVERSION_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +beddc69302b575aaf3dee77c57036fc5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1904 + +INV_IDENT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +eef88f25c1e3ddc1edc4760db7980434 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1892 + +INV_OBJREF_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +923d8bfd12c26fb74a6a5eec9992e958 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1894 + +NO_PERMISSION_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +0132e84b698b45d095136b23b9b710da +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1899 + +INV_FLAG_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +af1b30d13f977761252a9d9d765b2df9 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1890 + +TRANSACTION_REQUIRED_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +d2f08f919f2304c1751107ba3672f3e3 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1913 + +TIMEOUT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +751869e5c5cd309d8d98e5683e3c1e07 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1888 + +NO_IMPLEMENT_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +fe55af3bdb595c4496114dcdf13efb82 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1897 + +MARSHAL_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +df4d746fdf7cf70185ebdd959a8285d8 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1887 + +BAD_INV_ORDER_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +048aafc1c7b40e4c17a3bcfdd4f2a85e +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1900 + +COMM_FAILURE_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +1f4212f1a056821bc7ff503dd89ca066 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1898 + +BAD_PARAM_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +fac5de823200ecb03b423fd1e18c02b0 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1892 + +TRANSACTION_ROLLEDBACK_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +30cf789028c7cfa068c36da8fcb40c88 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1917 + +SystemExceptionNames.java +file + + + + +2009-05-27T12:24:02.000000Z +2858f0cdc8030d2d766bb44a819247e4 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +5717 + +INTF_REPOS_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +7f3db7901dbf9feb96187725a502444d +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1894 + +INTERNAL_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +f0a350ea27e780003aa6589c1b9e7890 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1890 + +FREE_MEM_Creator.java +file + + + + +2009-05-27T12:24:02.000000Z +242790280b1fc8ab5ea68b33dcb34804 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1890 + diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_CONTEXT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_CONTEXT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_CONTEXT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_INV_ORDER_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_INV_ORDER_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_INV_ORDER_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_OPERATION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_OPERATION_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_OPERATION_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_PARAM_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_PARAM_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_PARAM_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_TYPECODE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_TYPECODE_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/BAD_TYPECODE_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/COMM_FAILURE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/COMM_FAILURE_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/COMM_FAILURE_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/DATA_CONVERSION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/DATA_CONVERSION_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/DATA_CONVERSION_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/FREE_MEM_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/FREE_MEM_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/FREE_MEM_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/IMP_LIMIT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/IMP_LIMIT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/IMP_LIMIT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INITIALIZE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INITIALIZE_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INITIALIZE_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTERNAL_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTERNAL_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTERNAL_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTF_REPOS_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTF_REPOS_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INTF_REPOS_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INVALID_TRANSACTION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INVALID_TRANSACTION_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INVALID_TRANSACTION_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_FLAG_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_FLAG_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_FLAG_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_IDENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_IDENT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_IDENT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_OBJREF_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_OBJREF_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_OBJREF_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_POLICY_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_POLICY_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/INV_POLICY_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/MARSHAL_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/MARSHAL_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/MARSHAL_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/Makefile.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/Makefile.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/Makefile.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_IMPLEMENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_IMPLEMENT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_IMPLEMENT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_MEMORY_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_MEMORY_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_MEMORY_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_PERMISSION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_PERMISSION_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_PERMISSION_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESOURCES_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESOURCES_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESOURCES_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESPONSE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESPONSE_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/NO_RESPONSE_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJECT_NOT_EXIST_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJECT_NOT_EXIST_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJECT_NOT_EXIST_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJ_ADAPTER_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJ_ADAPTER_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/OBJ_ADAPTER_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/PERSIST_STORE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/PERSIST_STORE_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/PERSIST_STORE_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionCreator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionCreator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionCreator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionEncoder.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionEncoder.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionEncoder.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionNames.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionNames.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/SystemExceptionNames.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TIMEOUT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TIMEOUT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TIMEOUT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_REQUIRED_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_REQUIRED_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_REQUIRED_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSIENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSIENT_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/TRANSIENT_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/UNKNOWN_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/UNKNOWN_Creator.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/prop-base/UNKNOWN_Creator.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_CONTEXT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_CONTEXT_Creator.java.svn-base new file mode 100644 index 0000000..23a139c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_CONTEXT_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_CONTEXT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_CONTEXT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_INV_ORDER_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_INV_ORDER_Creator.java.svn-base new file mode 100644 index 0000000..71b19e4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_INV_ORDER_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_INV_ORDER_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_INV_ORDER("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_OPERATION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_OPERATION_Creator.java.svn-base new file mode 100644 index 0000000..54bed36 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_OPERATION_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_OPERATION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_OPERATION("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_PARAM_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_PARAM_Creator.java.svn-base new file mode 100644 index 0000000..788026a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_PARAM_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_PARAM_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_PARAM("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_TYPECODE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_TYPECODE_Creator.java.svn-base new file mode 100644 index 0000000..e4f05ef --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/BAD_TYPECODE_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_TYPECODE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_TYPECODE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/COMM_FAILURE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/COMM_FAILURE_Creator.java.svn-base new file mode 100644 index 0000000..40dcab5 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/COMM_FAILURE_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class COMM_FAILURE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.COMM_FAILURE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/DATA_CONVERSION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/DATA_CONVERSION_Creator.java.svn-base new file mode 100644 index 0000000..af3f803 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/DATA_CONVERSION_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class DATA_CONVERSION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.DATA_CONVERSION("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/FREE_MEM_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/FREE_MEM_Creator.java.svn-base new file mode 100644 index 0000000..4c8e62f --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/FREE_MEM_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class FREE_MEM_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.FREE_MEM("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/IMP_LIMIT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/IMP_LIMIT_Creator.java.svn-base new file mode 100644 index 0000000..9eb3dfe --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/IMP_LIMIT_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class IMP_LIMIT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.IMP_LIMIT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INITIALIZE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INITIALIZE_Creator.java.svn-base new file mode 100644 index 0000000..f4abf24 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INITIALIZE_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INITIALIZE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INITIALIZE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTERNAL_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTERNAL_Creator.java.svn-base new file mode 100644 index 0000000..bec2af3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTERNAL_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INTERNAL_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INTERNAL("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTF_REPOS_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTF_REPOS_Creator.java.svn-base new file mode 100644 index 0000000..baff288 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INTF_REPOS_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INTF_REPOS_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INTF_REPOS("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INVALID_TRANSACTION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INVALID_TRANSACTION_Creator.java.svn-base new file mode 100644 index 0000000..24b70dd --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INVALID_TRANSACTION_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INVALID_TRANSACTION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INVALID_TRANSACTION("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_FLAG_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_FLAG_Creator.java.svn-base new file mode 100644 index 0000000..b6ce855 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_FLAG_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_FLAG_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_FLAG("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_IDENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_IDENT_Creator.java.svn-base new file mode 100644 index 0000000..ca1b095 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_IDENT_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_IDENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_IDENT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_OBJREF_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_OBJREF_Creator.java.svn-base new file mode 100644 index 0000000..0843e22 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_OBJREF_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_OBJREF_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_OBJREF("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_POLICY_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_POLICY_Creator.java.svn-base new file mode 100644 index 0000000..73ed463 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/INV_POLICY_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_POLICY_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_POLICY("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/MARSHAL_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/MARSHAL_Creator.java.svn-base new file mode 100644 index 0000000..c20c372 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/MARSHAL_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class MARSHAL_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.MARSHAL("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/Makefile.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/Makefile.svn-base new file mode 100644 index 0000000..f2ee1eb --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/Makefile.svn-base @@ -0,0 +1,52 @@ +# +# Makefile +# (Java & IDL) +# ----------------------------------------------------------------------------------- + +#SUBDIRS= + +#EFC_SERVICES= +#JAVA_TOOLS= + +#IDL_JMODULES= + +SOURCES=BAD_CONTEXT_Creator BAD_INV_ORDER_Creator BAD_OPERATION_Creator \ +BAD_PARAM_Creator BAD_TYPECODE_Creator COMM_FAILURE_Creator \ +DATA_CONVERSION_Creator FREE_MEM_Creator IMP_LIMIT_Creator \ +INITIALIZE_Creator INTERNAL_Creator INTF_REPOS_Creator \ +INVALID_TRANSACTION_Creator INV_FLAG_Creator INV_IDENT_Creator \ +INV_OBJREF_Creator INV_POLICY_Creator MARSHAL_Creator \ +NO_IMPLEMENT_Creator NO_MEMORY_Creator NO_PERMISSION_Creator \ +NO_RESOURCES_Creator NO_RESPONSE_Creator OBJECT_NOT_EXIST_Creator \ +OBJ_ADAPTER_Creator PERSIST_STORE_Creator SystemExceptionCreator \ +SystemExceptionEncoder SystemExceptionNames TRANSACTION_REQUIRED_Creator \ +UNKNOWN_Creator TRANSACTION_ROLLEDBACK_Creator TRANSIENT_Creator + + +USR_CLASSPATH=$(MODULE_PATH)/orb/util/lib/util.jar:$(MODULE_PATH)/orb/idl/orb/lib/CORBA.jar + +#USR_IDLJ_FLAGS= +#USR_JAVAC_FLAGS= +#USR_JAR_FLAGS= + +#USR_CLASSPATH= +#USR_IDL_INCLUDES= + +#SERVICE_JLIB=yes +#SERVICE_JBIN=yes +LOCAL_JLIB=exception +#GLOBAL_JBIN= +#LOCAL_JLIB= +#LOCAL_JBIN= + +#USR_PRE_TARGETS= +#USR_POST_TARGETS= + +#PKG= + +#-------------------------------------------------------- +# PARTE FINAL: er meollo +#-------------------------------------------------------- +include $(CCM_PROJECT_PATH)/java/MakeRules/TIDJMakeRules.mk + +BASIC_CLASSPATH=$(JDK_DIR)/jre/lib/rt.jar diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_IMPLEMENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_IMPLEMENT_Creator.java.svn-base new file mode 100644 index 0000000..036d57d --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_IMPLEMENT_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_IMPLEMENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_IMPLEMENT("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_MEMORY_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_MEMORY_Creator.java.svn-base new file mode 100644 index 0000000..b537754 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_MEMORY_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_MEMORY_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_MEMORY("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_PERMISSION_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_PERMISSION_Creator.java.svn-base new file mode 100644 index 0000000..6469bf8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_PERMISSION_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_PERMISSION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_PERMISSION("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESOURCES_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESOURCES_Creator.java.svn-base new file mode 100644 index 0000000..2a52346 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESOURCES_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_RESOURCES_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_RESOURCES("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESPONSE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESPONSE_Creator.java.svn-base new file mode 100644 index 0000000..6566862 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/NO_RESPONSE_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_RESPONSE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_RESPONSE("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJECT_NOT_EXIST_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJECT_NOT_EXIST_Creator.java.svn-base new file mode 100644 index 0000000..5093e7e --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJECT_NOT_EXIST_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class OBJECT_NOT_EXIST_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.OBJECT_NOT_EXIST("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJ_ADAPTER_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJ_ADAPTER_Creator.java.svn-base new file mode 100644 index 0000000..3a61453 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/OBJ_ADAPTER_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class OBJ_ADAPTER_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.OBJ_ADAPTER("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/PERSIST_STORE_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/PERSIST_STORE_Creator.java.svn-base new file mode 100644 index 0000000..a66c5f4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/PERSIST_STORE_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class PERSIST_STORE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.PERSIST_STORE("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionCreator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionCreator.java.svn-base new file mode 100644 index 0000000..33dfa72 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionCreator.java.svn-base @@ -0,0 +1,53 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public interface SystemExceptionCreator +{ + + SystemException create(int minor, CompletionStatus completion); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionEncoder.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionEncoder.java.svn-base new file mode 100644 index 0000000..84eaa0a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionEncoder.java.svn-base @@ -0,0 +1,235 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; + +/** + * Write/Read SystemExceptions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SystemExceptionEncoder +{ + + private static java.util.Hashtable st_creators_table = null; + + private static java.util.Hashtable st_ids_table = null; + + private synchronized static void initCreators() + { + if (st_creators_table != null) + return; + + st_creators_table = new java.util.Hashtable(); + + st_creators_table.put(SystemExceptionNames.BAD_CONTEXT_id, + new BAD_CONTEXT_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_INV_ORDER_id, + new BAD_INV_ORDER_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_OPERATION_id, + new BAD_OPERATION_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_PARAM_id, + new BAD_PARAM_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_TYPECODE_id, + new BAD_TYPECODE_Creator()); + st_creators_table.put(SystemExceptionNames.COMM_FAILURE_id, + new COMM_FAILURE_Creator()); + st_creators_table.put(SystemExceptionNames.DATA_CONVERSION_id, + new DATA_CONVERSION_Creator()); + st_creators_table.put(SystemExceptionNames.FREE_MEM_id, + new FREE_MEM_Creator()); + st_creators_table.put(SystemExceptionNames.IMP_LIMIT_id, + new IMP_LIMIT_Creator()); + st_creators_table.put(SystemExceptionNames.INITIALIZE_id, + new INITIALIZE_Creator()); + st_creators_table.put(SystemExceptionNames.INTERNAL_id, + new INTERNAL_Creator()); + st_creators_table.put(SystemExceptionNames.INTF_REPOS_id, + new INTF_REPOS_Creator()); + st_creators_table.put(SystemExceptionNames.INV_FLAG_id, + new INV_FLAG_Creator()); + st_creators_table.put(SystemExceptionNames.INV_IDENT_id, + new INV_IDENT_Creator()); + st_creators_table.put(SystemExceptionNames.INV_OBJREF_id, + new INV_OBJREF_Creator()); + st_creators_table.put(SystemExceptionNames.INV_POLICY_id, + new INV_POLICY_Creator()); + st_creators_table.put(SystemExceptionNames.INVALID_TRANSACTION_id, + new INVALID_TRANSACTION_Creator()); + st_creators_table.put(SystemExceptionNames.MARSHAL_id, + new MARSHAL_Creator()); + st_creators_table.put(SystemExceptionNames.NO_IMPLEMENT_id, + new NO_IMPLEMENT_Creator()); + st_creators_table.put(SystemExceptionNames.NO_MEMORY_id, + new NO_MEMORY_Creator()); + st_creators_table.put(SystemExceptionNames.NO_PERMISSION_id, + new NO_PERMISSION_Creator()); + st_creators_table.put(SystemExceptionNames.NO_RESOURCES_id, + new NO_RESOURCES_Creator()); + st_creators_table.put(SystemExceptionNames.NO_RESPONSE_id, + new NO_RESPONSE_Creator()); + st_creators_table.put(SystemExceptionNames.OBJECT_NOT_EXIST_id, + new OBJECT_NOT_EXIST_Creator()); + st_creators_table.put(SystemExceptionNames.OBJ_ADAPTER_id, + new OBJ_ADAPTER_Creator()); + st_creators_table.put(SystemExceptionNames.PERSIST_STORE_id, + new PERSIST_STORE_Creator()); + st_creators_table.put(SystemExceptionNames.TIMEOUT_id, + new TIMEOUT_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSACTION_REQUIRED_id, + new TRANSACTION_REQUIRED_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSACTION_ROLLEDBACK_id, + new TRANSACTION_ROLLEDBACK_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSIENT_id, + new TRANSIENT_Creator()); + st_creators_table.put(SystemExceptionNames.UNKNOWN_id, + new UNKNOWN_Creator()); + } + + private synchronized static void initIds() + { + if (st_ids_table != null) + return; + + st_ids_table = new java.util.Hashtable(); + + st_ids_table.put(SystemExceptionNames.BAD_CONTEXT_name, + SystemExceptionNames.BAD_CONTEXT_id); + st_ids_table.put(SystemExceptionNames.BAD_INV_ORDER_name, + SystemExceptionNames.BAD_INV_ORDER_id); + st_ids_table.put(SystemExceptionNames.BAD_OPERATION_name, + SystemExceptionNames.BAD_OPERATION_id); + st_ids_table.put(SystemExceptionNames.BAD_PARAM_name, + SystemExceptionNames.BAD_PARAM_id); + st_ids_table.put(SystemExceptionNames.BAD_TYPECODE_name, + SystemExceptionNames.BAD_TYPECODE_id); + st_ids_table.put(SystemExceptionNames.COMM_FAILURE_name, + SystemExceptionNames.COMM_FAILURE_id); + st_ids_table.put(SystemExceptionNames.DATA_CONVERSION_name, + SystemExceptionNames.DATA_CONVERSION_id); + st_ids_table.put(SystemExceptionNames.FREE_MEM_name, + SystemExceptionNames.FREE_MEM_id); + st_ids_table.put(SystemExceptionNames.IMP_LIMIT_name, + SystemExceptionNames.IMP_LIMIT_id); + st_ids_table.put(SystemExceptionNames.INITIALIZE_name, + SystemExceptionNames.INITIALIZE_id); + st_ids_table.put(SystemExceptionNames.INTERNAL_name, + SystemExceptionNames.INTERNAL_id); + st_ids_table.put(SystemExceptionNames.INTF_REPOS_name, + SystemExceptionNames.INTF_REPOS_id); + st_ids_table.put(SystemExceptionNames.INV_FLAG_name, + SystemExceptionNames.INV_FLAG_id); + st_ids_table.put(SystemExceptionNames.INV_IDENT_name, + SystemExceptionNames.INV_IDENT_id); + st_ids_table.put(SystemExceptionNames.INV_OBJREF_name, + SystemExceptionNames.INV_OBJREF_id); + st_ids_table.put(SystemExceptionNames.INV_POLICY_name, + SystemExceptionNames.INV_POLICY_id); + st_ids_table.put(SystemExceptionNames.INVALID_TRANSACTION_name, + SystemExceptionNames.INVALID_TRANSACTION_id); + st_ids_table.put(SystemExceptionNames.MARSHAL_name, + SystemExceptionNames.MARSHAL_id); + st_ids_table.put(SystemExceptionNames.NO_IMPLEMENT_name, + SystemExceptionNames.NO_IMPLEMENT_id); + st_ids_table.put(SystemExceptionNames.NO_MEMORY_name, + SystemExceptionNames.NO_MEMORY_id); + st_ids_table.put(SystemExceptionNames.NO_PERMISSION_name, + SystemExceptionNames.NO_PERMISSION_id); + st_ids_table.put(SystemExceptionNames.NO_RESOURCES_name, + SystemExceptionNames.NO_RESOURCES_id); + st_ids_table.put(SystemExceptionNames.NO_RESPONSE_name, + SystemExceptionNames.NO_RESPONSE_id); + st_ids_table.put(SystemExceptionNames.OBJECT_NOT_EXIST_name, + SystemExceptionNames.OBJECT_NOT_EXIST_id); + st_ids_table.put(SystemExceptionNames.OBJ_ADAPTER_name, + SystemExceptionNames.OBJ_ADAPTER_id); + st_ids_table.put(SystemExceptionNames.PERSIST_STORE_name, + SystemExceptionNames.PERSIST_STORE_id); + st_ids_table.put(SystemExceptionNames.TIMEOUT_name, + SystemExceptionNames.TIMEOUT_id); + st_ids_table.put(SystemExceptionNames.TRANSACTION_REQUIRED_name, + SystemExceptionNames.TRANSACTION_REQUIRED_id); + st_ids_table.put(SystemExceptionNames.TRANSACTION_ROLLEDBACK_name, + SystemExceptionNames.TRANSACTION_ROLLEDBACK_id); + st_ids_table.put(SystemExceptionNames.TRANSIENT_name, + SystemExceptionNames.TRANSIENT_id); + st_ids_table.put(SystemExceptionNames.UNKNOWN_name, + SystemExceptionNames.UNKNOWN_id); + } + + public static void write(org.omg.CORBA.portable.OutputStream out, + org.omg.CORBA.SystemException sys) + { + if (st_ids_table == null) + initIds(); + + out.write_string((String) st_ids_table.get(sys.getClass().getName())); + out.write_ulong(sys.minor); + out.write_ulong(sys.completed.value()); + } + + public static org.omg.CORBA.SystemException + read(org.omg.CORBA.portable.InputStream in) + { + String name = in.read_string(); + int minor = in.read_ulong(); + int completed = in.read_ulong(); + + CompletionStatus completion = CompletionStatus.from_int(completed); + + if (st_creators_table == null) + initCreators(); + + SystemExceptionCreator creator = (SystemExceptionCreator) + st_creators_table.get(name); + + if (creator == null) + throw new org.omg.CORBA.MARSHAL("Invalid System Exception Name"); + + return creator.create(minor, completion); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionNames.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionNames.java.svn-base new file mode 100644 index 0000000..7eaf648 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/SystemExceptionNames.java.svn-base @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +/** + * SystemException names and Repository Ids. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public interface SystemExceptionNames +{ + + String BAD_CONTEXT_id = "IDL:omg.org/CORBA/BAD_CONTEXT:1.0"; + + String BAD_CONTEXT_name = "org.omg.CORBA.BAD_CONTEXT"; + + String BAD_INV_ORDER_id = "IDL:omg.org/CORBA/BAD_INV_ORDER:1.0"; + + String BAD_INV_ORDER_name = "org.omg.CORBA.BAD_INV_ORDER"; + + String BAD_OPERATION_id = "IDL:omg.org/CORBA/BAD_OPERATION:1.0"; + + String BAD_OPERATION_name = "org.omg.CORBA.BAD_OPERATION"; + + String BAD_PARAM_id = "IDL:omg.org/CORBA/BAD_PARAM:1.0"; + + String BAD_PARAM_name = "org.omg.CORBA.BAD_PARAM"; + + String BAD_TYPECODE_id = "IDL:omg.org/CORBA/BAD_TYPECODE:1.0"; + + String BAD_TYPECODE_name = "org.omg.CORBA.BAD_TYPECODE"; + + String COMM_FAILURE_id = "IDL:omg.org/CORBA/COMM_FAILURE:1.0"; + + String COMM_FAILURE_name = "org.omg.CORBA.COMM_FAILURE"; + + String DATA_CONVERSION_id = "IDL:omg.org/CORBA/DATA_CONVERSION:1.0"; + + String DATA_CONVERSION_name = "org.omg.CORBA.DATA_CONVERSION"; + + String FREE_MEM_id = "IDL:omg.org/CORBA/FREE_MEM:1.0"; + + String FREE_MEM_name = "org.omg.CORBA.FREE_MEM"; + + String IMP_LIMIT_id = "IDL:omg.org/CORBA/IMP_LIMIT:1.0"; + + String IMP_LIMIT_name = "org.omg.CORBA.IMP_LIMIT"; + + String INITIALIZE_id = "IDL:omg.org/CORBA/INITIALIZE:1.0"; + + String INITIALIZE_name = "org.omg.CORBA.INITIALIZE"; + + String INTERNAL_id = "IDL:omg.org/CORBA/INTERNAL:1.0"; + + String INTERNAL_name = "org.omg.CORBA.INTERNAL"; + + String INTF_REPOS_id = "IDL:omg.org/CORBA/INTF_REPOS:1.0"; + + String INTF_REPOS_name = "org.omg.CORBA.INTF_REPOS"; + + String INV_FLAG_id = "IDL:omg.org/CORBA/INV_FLAG:1.0"; + + String INV_FLAG_name = "org.omg.CORBA.INV_FLAG"; + + String INV_IDENT_id = "IDL:omg.org/CORBA/INV_IDENT:1.0"; + + String INV_IDENT_name = "org.omg.CORBA.INV_IDENT"; + + String INV_OBJREF_id = "IDL:omg.org/CORBA/INV_OBJREF:1.0"; + + String INV_OBJREF_name = "org.omg.CORBA.INV_OBJREF"; + + String INV_POLICY_id = "IDL:omg.org/CORBA/INV_POLICY:1.0"; + + String INV_POLICY_name = "org.omg.CORBA.INV_POLICY"; + + String INVALID_TRANSACTION_id = "IDL:omg.org/CORBA/INVALID_TRANSACTION:1.0"; + + String INVALID_TRANSACTION_name = "org.omg.CORBA.INVALID_TRANSACTION"; + + String MARSHAL_id = "IDL:omg.org/CORBA/MARSHAL:1.0"; + + String MARSHAL_name = "org.omg.CORBA.MARSHAL"; + + String NO_IMPLEMENT_id = "IDL:omg.org/CORBA/NO_IMPLEMENT:1.0"; + + String NO_IMPLEMENT_name = "org.omg.CORBA.NO_IMPLEMENT"; + + String NO_MEMORY_id = "IDL:omg.org/CORBA/NO_MEMORY:1.0"; + + String NO_MEMORY_name = "org.omg.CORBA.NO_MEMORY"; + + String NO_PERMISSION_id = "IDL:omg.org/CORBA/NO_PERMISSION:1.0"; + + String NO_PERMISSION_name = "org.omg.CORBA.NO_PERMISSION"; + + String NO_RESOURCES_id = "IDL:omg.org/CORBA/NO_RESOURCES:1.0"; + + String NO_RESOURCES_name = "org.omg.CORBA.NO_RESOURCES"; + + String NO_RESPONSE_id = "IDL:omg.org/CORBA/NO_RESPONSE:1.0"; + + String NO_RESPONSE_name = "org.omg.CORBA.NO_RESPONSE"; + + String OBJECT_NOT_EXIST_id = "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0"; + + String OBJECT_NOT_EXIST_name = "org.omg.CORBA.OBJECT_NOT_EXIST"; + + String OBJ_ADAPTER_id = "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0"; + + String OBJ_ADAPTER_name = "org.omg.CORBA.OBJ_ADAPTER"; + + String PERSIST_STORE_id = "IDL:omg.org/CORBA/PERSIST_STORE:1.0"; + + String PERSIST_STORE_name = "org.omg.CORBA.PERSIST_STORE"; + + String TIMEOUT_id = "IDL:omg.org/CORBA/TIMEOUT:1.0"; + + String TIMEOUT_name = "org.omg.CORBA.TIMEOUT"; + + String TRANSACTION_REQUIRED_id = "IDL:omg.org/CORBA/TRANSACTION_REQUIRED:1.0"; + + String TRANSACTION_REQUIRED_name = "org.omg.CORBA.TRANSACTION_REQUIRED"; + + String TRANSACTION_ROLLEDBACK_id = "IDL:omg.org/CORBA/TRANSACTION_ROLLEDBACK:1.0"; + + String TRANSACTION_ROLLEDBACK_name = "org.omg.CORBA.TRANSACTION_ROLLEDBACK"; + + String TRANSIENT_id = "IDL:omg.org/CORBA/TRANSIENT:1.0"; + + String TRANSIENT_name = "org.omg.CORBA.TRANSIENT"; + + String UNKNOWN_id = "IDL:omg.org/CORBA/UNKNOWN:1.0"; + + String UNKNOWN_name = "org.omg.CORBA.UNKNOWN"; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TIMEOUT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TIMEOUT_Creator.java.svn-base new file mode 100644 index 0000000..32bb00a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TIMEOUT_Creator.java.svn-base @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TIMEOUT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TIMEOUT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_REQUIRED_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_REQUIRED_Creator.java.svn-base new file mode 100644 index 0000000..f1b4fb3 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_REQUIRED_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSACTION_REQUIRED_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSACTION_REQUIRED("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base new file mode 100644 index 0000000..9f182e0 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSACTION_ROLLEDBACK_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSACTION_ROLLEDBACK_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSACTION_ROLLEDBACK("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSIENT_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSIENT_Creator.java.svn-base new file mode 100644 index 0000000..7904543 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/TRANSIENT_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSIENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSIENT("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/UNKNOWN_Creator.java.svn-base b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/UNKNOWN_Creator.java.svn-base new file mode 100644 index 0000000..e98ebb8 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/.svn/text-base/UNKNOWN_Creator.java.svn-base @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class UNKNOWN_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.UNKNOWN("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.java new file mode 100644 index 0000000..48d8029 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/BAD_CONTEXT_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_CONTEXT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_CONTEXT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.java b/source/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.java new file mode 100644 index 0000000..003e40c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/BAD_INV_ORDER_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_INV_ORDER_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_INV_ORDER("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.java b/source/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.java new file mode 100644 index 0000000..f531efa --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/BAD_OPERATION_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_OPERATION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_OPERATION("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.java b/source/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.java new file mode 100644 index 0000000..7e5a62b --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/BAD_PARAM_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_PARAM_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_PARAM("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.java b/source/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.java new file mode 100644 index 0000000..6569a43 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/BAD_TYPECODE_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class BAD_TYPECODE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.BAD_TYPECODE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.java b/source/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.java new file mode 100644 index 0000000..07af911 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/COMM_FAILURE_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class COMM_FAILURE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.COMM_FAILURE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.java b/source/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.java new file mode 100644 index 0000000..3c6c107 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/DATA_CONVERSION_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class DATA_CONVERSION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.DATA_CONVERSION("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.java b/source/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.java new file mode 100644 index 0000000..31307d4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/FREE_MEM_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class FREE_MEM_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.FREE_MEM("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.java new file mode 100644 index 0000000..d6a3a08 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/IMP_LIMIT_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class IMP_LIMIT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.IMP_LIMIT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.java new file mode 100644 index 0000000..cc7d251 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INITIALIZE_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INITIALIZE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INITIALIZE("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.java new file mode 100644 index 0000000..3aea3ec --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INTERNAL_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INTERNAL_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INTERNAL("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.java new file mode 100644 index 0000000..299e6ed --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INTF_REPOS_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INTF_REPOS_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INTF_REPOS("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.java new file mode 100644 index 0000000..21398d4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INVALID_TRANSACTION_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INVALID_TRANSACTION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INVALID_TRANSACTION("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.java new file mode 100644 index 0000000..f6434bd --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INV_FLAG_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_FLAG_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_FLAG("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.java new file mode 100644 index 0000000..18651d6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INV_IDENT_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_IDENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_IDENT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.java new file mode 100644 index 0000000..f1030c6 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INV_OBJREF_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_OBJREF_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_OBJREF("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.java b/source/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.java new file mode 100644 index 0000000..4a39e1c --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/INV_POLICY_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class INV_POLICY_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.INV_POLICY("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.java b/source/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.java new file mode 100644 index 0000000..4fde971 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/MARSHAL_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class MARSHAL_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.MARSHAL("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/Makefile b/source/es/tid/TIDorbj/core/util/exception/Makefile new file mode 100644 index 0000000..f2ee1eb --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/Makefile @@ -0,0 +1,52 @@ +# +# Makefile +# (Java & IDL) +# ----------------------------------------------------------------------------------- + +#SUBDIRS= + +#EFC_SERVICES= +#JAVA_TOOLS= + +#IDL_JMODULES= + +SOURCES=BAD_CONTEXT_Creator BAD_INV_ORDER_Creator BAD_OPERATION_Creator \ +BAD_PARAM_Creator BAD_TYPECODE_Creator COMM_FAILURE_Creator \ +DATA_CONVERSION_Creator FREE_MEM_Creator IMP_LIMIT_Creator \ +INITIALIZE_Creator INTERNAL_Creator INTF_REPOS_Creator \ +INVALID_TRANSACTION_Creator INV_FLAG_Creator INV_IDENT_Creator \ +INV_OBJREF_Creator INV_POLICY_Creator MARSHAL_Creator \ +NO_IMPLEMENT_Creator NO_MEMORY_Creator NO_PERMISSION_Creator \ +NO_RESOURCES_Creator NO_RESPONSE_Creator OBJECT_NOT_EXIST_Creator \ +OBJ_ADAPTER_Creator PERSIST_STORE_Creator SystemExceptionCreator \ +SystemExceptionEncoder SystemExceptionNames TRANSACTION_REQUIRED_Creator \ +UNKNOWN_Creator TRANSACTION_ROLLEDBACK_Creator TRANSIENT_Creator + + +USR_CLASSPATH=$(MODULE_PATH)/orb/util/lib/util.jar:$(MODULE_PATH)/orb/idl/orb/lib/CORBA.jar + +#USR_IDLJ_FLAGS= +#USR_JAVAC_FLAGS= +#USR_JAR_FLAGS= + +#USR_CLASSPATH= +#USR_IDL_INCLUDES= + +#SERVICE_JLIB=yes +#SERVICE_JBIN=yes +LOCAL_JLIB=exception +#GLOBAL_JBIN= +#LOCAL_JLIB= +#LOCAL_JBIN= + +#USR_PRE_TARGETS= +#USR_POST_TARGETS= + +#PKG= + +#-------------------------------------------------------- +# PARTE FINAL: er meollo +#-------------------------------------------------------- +include $(CCM_PROJECT_PATH)/java/MakeRules/TIDJMakeRules.mk + +BASIC_CLASSPATH=$(JDK_DIR)/jre/lib/rt.jar diff --git a/source/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.java new file mode 100644 index 0000000..a377fdc --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/NO_IMPLEMENT_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_IMPLEMENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_IMPLEMENT("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.java b/source/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.java new file mode 100644 index 0000000..8358f71 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/NO_MEMORY_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_MEMORY_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_MEMORY("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.java b/source/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.java new file mode 100644 index 0000000..535c1bb --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/NO_PERMISSION_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_PERMISSION_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_PERMISSION("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.java b/source/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.java new file mode 100644 index 0000000..2ed1270 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/NO_RESOURCES_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_RESOURCES_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_RESOURCES("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.java b/source/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.java new file mode 100644 index 0000000..e1cd92a --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/NO_RESPONSE_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class NO_RESPONSE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.NO_RESPONSE("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.java b/source/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.java new file mode 100644 index 0000000..6175810 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/OBJECT_NOT_EXIST_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class OBJECT_NOT_EXIST_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.OBJECT_NOT_EXIST("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.java b/source/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.java new file mode 100644 index 0000000..726cf3e --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/OBJ_ADAPTER_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class OBJ_ADAPTER_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.OBJ_ADAPTER("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.java b/source/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.java new file mode 100644 index 0000000..864e971 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/PERSIST_STORE_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class PERSIST_STORE_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.PERSIST_STORE("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.java b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.java new file mode 100644 index 0000000..a151052 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionCreator.java @@ -0,0 +1,53 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public interface SystemExceptionCreator +{ + + SystemException create(int minor, CompletionStatus completion); + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.java b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.java new file mode 100644 index 0000000..ccc32a9 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionEncoder.java @@ -0,0 +1,235 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; + +/** + * Write/Read SystemExceptions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class SystemExceptionEncoder +{ + + private static java.util.Hashtable st_creators_table = null; + + private static java.util.Hashtable st_ids_table = null; + + private synchronized static void initCreators() + { + if (st_creators_table != null) + return; + + st_creators_table = new java.util.Hashtable(); + + st_creators_table.put(SystemExceptionNames.BAD_CONTEXT_id, + new BAD_CONTEXT_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_INV_ORDER_id, + new BAD_INV_ORDER_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_OPERATION_id, + new BAD_OPERATION_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_PARAM_id, + new BAD_PARAM_Creator()); + st_creators_table.put(SystemExceptionNames.BAD_TYPECODE_id, + new BAD_TYPECODE_Creator()); + st_creators_table.put(SystemExceptionNames.COMM_FAILURE_id, + new COMM_FAILURE_Creator()); + st_creators_table.put(SystemExceptionNames.DATA_CONVERSION_id, + new DATA_CONVERSION_Creator()); + st_creators_table.put(SystemExceptionNames.FREE_MEM_id, + new FREE_MEM_Creator()); + st_creators_table.put(SystemExceptionNames.IMP_LIMIT_id, + new IMP_LIMIT_Creator()); + st_creators_table.put(SystemExceptionNames.INITIALIZE_id, + new INITIALIZE_Creator()); + st_creators_table.put(SystemExceptionNames.INTERNAL_id, + new INTERNAL_Creator()); + st_creators_table.put(SystemExceptionNames.INTF_REPOS_id, + new INTF_REPOS_Creator()); + st_creators_table.put(SystemExceptionNames.INV_FLAG_id, + new INV_FLAG_Creator()); + st_creators_table.put(SystemExceptionNames.INV_IDENT_id, + new INV_IDENT_Creator()); + st_creators_table.put(SystemExceptionNames.INV_OBJREF_id, + new INV_OBJREF_Creator()); + st_creators_table.put(SystemExceptionNames.INV_POLICY_id, + new INV_POLICY_Creator()); + st_creators_table.put(SystemExceptionNames.INVALID_TRANSACTION_id, + new INVALID_TRANSACTION_Creator()); + st_creators_table.put(SystemExceptionNames.MARSHAL_id, + new MARSHAL_Creator()); + st_creators_table.put(SystemExceptionNames.NO_IMPLEMENT_id, + new NO_IMPLEMENT_Creator()); + st_creators_table.put(SystemExceptionNames.NO_MEMORY_id, + new NO_MEMORY_Creator()); + st_creators_table.put(SystemExceptionNames.NO_PERMISSION_id, + new NO_PERMISSION_Creator()); + st_creators_table.put(SystemExceptionNames.NO_RESOURCES_id, + new NO_RESOURCES_Creator()); + st_creators_table.put(SystemExceptionNames.NO_RESPONSE_id, + new NO_RESPONSE_Creator()); + st_creators_table.put(SystemExceptionNames.OBJECT_NOT_EXIST_id, + new OBJECT_NOT_EXIST_Creator()); + st_creators_table.put(SystemExceptionNames.OBJ_ADAPTER_id, + new OBJ_ADAPTER_Creator()); + st_creators_table.put(SystemExceptionNames.PERSIST_STORE_id, + new PERSIST_STORE_Creator()); + st_creators_table.put(SystemExceptionNames.TIMEOUT_id, + new TIMEOUT_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSACTION_REQUIRED_id, + new TRANSACTION_REQUIRED_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSACTION_ROLLEDBACK_id, + new TRANSACTION_ROLLEDBACK_Creator()); + st_creators_table.put(SystemExceptionNames.TRANSIENT_id, + new TRANSIENT_Creator()); + st_creators_table.put(SystemExceptionNames.UNKNOWN_id, + new UNKNOWN_Creator()); + } + + private synchronized static void initIds() + { + if (st_ids_table != null) + return; + + st_ids_table = new java.util.Hashtable(); + + st_ids_table.put(SystemExceptionNames.BAD_CONTEXT_name, + SystemExceptionNames.BAD_CONTEXT_id); + st_ids_table.put(SystemExceptionNames.BAD_INV_ORDER_name, + SystemExceptionNames.BAD_INV_ORDER_id); + st_ids_table.put(SystemExceptionNames.BAD_OPERATION_name, + SystemExceptionNames.BAD_OPERATION_id); + st_ids_table.put(SystemExceptionNames.BAD_PARAM_name, + SystemExceptionNames.BAD_PARAM_id); + st_ids_table.put(SystemExceptionNames.BAD_TYPECODE_name, + SystemExceptionNames.BAD_TYPECODE_id); + st_ids_table.put(SystemExceptionNames.COMM_FAILURE_name, + SystemExceptionNames.COMM_FAILURE_id); + st_ids_table.put(SystemExceptionNames.DATA_CONVERSION_name, + SystemExceptionNames.DATA_CONVERSION_id); + st_ids_table.put(SystemExceptionNames.FREE_MEM_name, + SystemExceptionNames.FREE_MEM_id); + st_ids_table.put(SystemExceptionNames.IMP_LIMIT_name, + SystemExceptionNames.IMP_LIMIT_id); + st_ids_table.put(SystemExceptionNames.INITIALIZE_name, + SystemExceptionNames.INITIALIZE_id); + st_ids_table.put(SystemExceptionNames.INTERNAL_name, + SystemExceptionNames.INTERNAL_id); + st_ids_table.put(SystemExceptionNames.INTF_REPOS_name, + SystemExceptionNames.INTF_REPOS_id); + st_ids_table.put(SystemExceptionNames.INV_FLAG_name, + SystemExceptionNames.INV_FLAG_id); + st_ids_table.put(SystemExceptionNames.INV_IDENT_name, + SystemExceptionNames.INV_IDENT_id); + st_ids_table.put(SystemExceptionNames.INV_OBJREF_name, + SystemExceptionNames.INV_OBJREF_id); + st_ids_table.put(SystemExceptionNames.INV_POLICY_name, + SystemExceptionNames.INV_POLICY_id); + st_ids_table.put(SystemExceptionNames.INVALID_TRANSACTION_name, + SystemExceptionNames.INVALID_TRANSACTION_id); + st_ids_table.put(SystemExceptionNames.MARSHAL_name, + SystemExceptionNames.MARSHAL_id); + st_ids_table.put(SystemExceptionNames.NO_IMPLEMENT_name, + SystemExceptionNames.NO_IMPLEMENT_id); + st_ids_table.put(SystemExceptionNames.NO_MEMORY_name, + SystemExceptionNames.NO_MEMORY_id); + st_ids_table.put(SystemExceptionNames.NO_PERMISSION_name, + SystemExceptionNames.NO_PERMISSION_id); + st_ids_table.put(SystemExceptionNames.NO_RESOURCES_name, + SystemExceptionNames.NO_RESOURCES_id); + st_ids_table.put(SystemExceptionNames.NO_RESPONSE_name, + SystemExceptionNames.NO_RESPONSE_id); + st_ids_table.put(SystemExceptionNames.OBJECT_NOT_EXIST_name, + SystemExceptionNames.OBJECT_NOT_EXIST_id); + st_ids_table.put(SystemExceptionNames.OBJ_ADAPTER_name, + SystemExceptionNames.OBJ_ADAPTER_id); + st_ids_table.put(SystemExceptionNames.PERSIST_STORE_name, + SystemExceptionNames.PERSIST_STORE_id); + st_ids_table.put(SystemExceptionNames.TIMEOUT_name, + SystemExceptionNames.TIMEOUT_id); + st_ids_table.put(SystemExceptionNames.TRANSACTION_REQUIRED_name, + SystemExceptionNames.TRANSACTION_REQUIRED_id); + st_ids_table.put(SystemExceptionNames.TRANSACTION_ROLLEDBACK_name, + SystemExceptionNames.TRANSACTION_ROLLEDBACK_id); + st_ids_table.put(SystemExceptionNames.TRANSIENT_name, + SystemExceptionNames.TRANSIENT_id); + st_ids_table.put(SystemExceptionNames.UNKNOWN_name, + SystemExceptionNames.UNKNOWN_id); + } + + public static void write(org.omg.CORBA.portable.OutputStream out, + org.omg.CORBA.SystemException sys) + { + if (st_ids_table == null) + initIds(); + + out.write_string((String) st_ids_table.get(sys.getClass().getName())); + out.write_ulong(sys.minor); + out.write_ulong(sys.completed.value()); + } + + public static org.omg.CORBA.SystemException + read(org.omg.CORBA.portable.InputStream in) + { + String name = in.read_string(); + int minor = in.read_ulong(); + int completed = in.read_ulong(); + + CompletionStatus completion = CompletionStatus.from_int(completed); + + if (st_creators_table == null) + initCreators(); + + SystemExceptionCreator creator = (SystemExceptionCreator) + st_creators_table.get(name); + + if (creator == null) + throw new org.omg.CORBA.MARSHAL("Invalid System Exception Name"); + + return creator.create(minor, completion); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.java b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.java new file mode 100644 index 0000000..1a40878 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/SystemExceptionNames.java @@ -0,0 +1,178 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +/** + * SystemException names and Repository Ids. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public interface SystemExceptionNames +{ + + String BAD_CONTEXT_id = "IDL:omg.org/CORBA/BAD_CONTEXT:1.0"; + + String BAD_CONTEXT_name = "org.omg.CORBA.BAD_CONTEXT"; + + String BAD_INV_ORDER_id = "IDL:omg.org/CORBA/BAD_INV_ORDER:1.0"; + + String BAD_INV_ORDER_name = "org.omg.CORBA.BAD_INV_ORDER"; + + String BAD_OPERATION_id = "IDL:omg.org/CORBA/BAD_OPERATION:1.0"; + + String BAD_OPERATION_name = "org.omg.CORBA.BAD_OPERATION"; + + String BAD_PARAM_id = "IDL:omg.org/CORBA/BAD_PARAM:1.0"; + + String BAD_PARAM_name = "org.omg.CORBA.BAD_PARAM"; + + String BAD_TYPECODE_id = "IDL:omg.org/CORBA/BAD_TYPECODE:1.0"; + + String BAD_TYPECODE_name = "org.omg.CORBA.BAD_TYPECODE"; + + String COMM_FAILURE_id = "IDL:omg.org/CORBA/COMM_FAILURE:1.0"; + + String COMM_FAILURE_name = "org.omg.CORBA.COMM_FAILURE"; + + String DATA_CONVERSION_id = "IDL:omg.org/CORBA/DATA_CONVERSION:1.0"; + + String DATA_CONVERSION_name = "org.omg.CORBA.DATA_CONVERSION"; + + String FREE_MEM_id = "IDL:omg.org/CORBA/FREE_MEM:1.0"; + + String FREE_MEM_name = "org.omg.CORBA.FREE_MEM"; + + String IMP_LIMIT_id = "IDL:omg.org/CORBA/IMP_LIMIT:1.0"; + + String IMP_LIMIT_name = "org.omg.CORBA.IMP_LIMIT"; + + String INITIALIZE_id = "IDL:omg.org/CORBA/INITIALIZE:1.0"; + + String INITIALIZE_name = "org.omg.CORBA.INITIALIZE"; + + String INTERNAL_id = "IDL:omg.org/CORBA/INTERNAL:1.0"; + + String INTERNAL_name = "org.omg.CORBA.INTERNAL"; + + String INTF_REPOS_id = "IDL:omg.org/CORBA/INTF_REPOS:1.0"; + + String INTF_REPOS_name = "org.omg.CORBA.INTF_REPOS"; + + String INV_FLAG_id = "IDL:omg.org/CORBA/INV_FLAG:1.0"; + + String INV_FLAG_name = "org.omg.CORBA.INV_FLAG"; + + String INV_IDENT_id = "IDL:omg.org/CORBA/INV_IDENT:1.0"; + + String INV_IDENT_name = "org.omg.CORBA.INV_IDENT"; + + String INV_OBJREF_id = "IDL:omg.org/CORBA/INV_OBJREF:1.0"; + + String INV_OBJREF_name = "org.omg.CORBA.INV_OBJREF"; + + String INV_POLICY_id = "IDL:omg.org/CORBA/INV_POLICY:1.0"; + + String INV_POLICY_name = "org.omg.CORBA.INV_POLICY"; + + String INVALID_TRANSACTION_id = "IDL:omg.org/CORBA/INVALID_TRANSACTION:1.0"; + + String INVALID_TRANSACTION_name = "org.omg.CORBA.INVALID_TRANSACTION"; + + String MARSHAL_id = "IDL:omg.org/CORBA/MARSHAL:1.0"; + + String MARSHAL_name = "org.omg.CORBA.MARSHAL"; + + String NO_IMPLEMENT_id = "IDL:omg.org/CORBA/NO_IMPLEMENT:1.0"; + + String NO_IMPLEMENT_name = "org.omg.CORBA.NO_IMPLEMENT"; + + String NO_MEMORY_id = "IDL:omg.org/CORBA/NO_MEMORY:1.0"; + + String NO_MEMORY_name = "org.omg.CORBA.NO_MEMORY"; + + String NO_PERMISSION_id = "IDL:omg.org/CORBA/NO_PERMISSION:1.0"; + + String NO_PERMISSION_name = "org.omg.CORBA.NO_PERMISSION"; + + String NO_RESOURCES_id = "IDL:omg.org/CORBA/NO_RESOURCES:1.0"; + + String NO_RESOURCES_name = "org.omg.CORBA.NO_RESOURCES"; + + String NO_RESPONSE_id = "IDL:omg.org/CORBA/NO_RESPONSE:1.0"; + + String NO_RESPONSE_name = "org.omg.CORBA.NO_RESPONSE"; + + String OBJECT_NOT_EXIST_id = "IDL:omg.org/CORBA/OBJECT_NOT_EXIST:1.0"; + + String OBJECT_NOT_EXIST_name = "org.omg.CORBA.OBJECT_NOT_EXIST"; + + String OBJ_ADAPTER_id = "IDL:omg.org/CORBA/OBJ_ADAPTER:1.0"; + + String OBJ_ADAPTER_name = "org.omg.CORBA.OBJ_ADAPTER"; + + String PERSIST_STORE_id = "IDL:omg.org/CORBA/PERSIST_STORE:1.0"; + + String PERSIST_STORE_name = "org.omg.CORBA.PERSIST_STORE"; + + String TIMEOUT_id = "IDL:omg.org/CORBA/TIMEOUT:1.0"; + + String TIMEOUT_name = "org.omg.CORBA.TIMEOUT"; + + String TRANSACTION_REQUIRED_id = "IDL:omg.org/CORBA/TRANSACTION_REQUIRED:1.0"; + + String TRANSACTION_REQUIRED_name = "org.omg.CORBA.TRANSACTION_REQUIRED"; + + String TRANSACTION_ROLLEDBACK_id = "IDL:omg.org/CORBA/TRANSACTION_ROLLEDBACK:1.0"; + + String TRANSACTION_ROLLEDBACK_name = "org.omg.CORBA.TRANSACTION_ROLLEDBACK"; + + String TRANSIENT_id = "IDL:omg.org/CORBA/TRANSIENT:1.0"; + + String TRANSIENT_name = "org.omg.CORBA.TRANSIENT"; + + String UNKNOWN_id = "IDL:omg.org/CORBA/UNKNOWN:1.0"; + + String UNKNOWN_name = "org.omg.CORBA.UNKNOWN"; +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.java new file mode 100644 index 0000000..6509a52 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/TIMEOUT_Creator.java @@ -0,0 +1,58 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TIMEOUT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TIMEOUT("", minor, completion); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.java b/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.java new file mode 100644 index 0000000..e26fc75 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_REQUIRED_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSACTION_REQUIRED_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSACTION_REQUIRED("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.java b/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.java new file mode 100644 index 0000000..6ad2971 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/TRANSACTION_ROLLEDBACK_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSACTION_ROLLEDBACK_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSACTION_ROLLEDBACK("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.java b/source/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.java new file mode 100644 index 0000000..a468e07 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/TRANSIENT_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class TRANSIENT_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.TRANSIENT("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.java b/source/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.java new file mode 100644 index 0000000..9232723 --- /dev/null +++ b/source/es/tid/TIDorbj/core/util/exception/UNKNOWN_Creator.java @@ -0,0 +1,57 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.util.exception; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.SystemException; + +public class UNKNOWN_Creator + implements SystemExceptionCreator +{ + + public SystemException create(int minor, CompletionStatus completion) + { + return new org.omg.CORBA.UNKNOWN("", minor, completion); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/all-wcprops b/source/es/tid/TIDorbj/core/ziop/.svn/all-wcprops new file mode 100644 index 0000000..36c2d19 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 79 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop +END +ZIOP.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop/ZIOP.java +END +CompressionEnablingPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.java +END +CompressionLowValuePolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.java +END +CompressorIdLevelListPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 116 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.java +END +CompressionMinRatioPolicyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 114 +/svn/tidorbj/!svn/ver/395/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.java +END diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/entries b/source/es/tid/TIDorbj/core/ziop/.svn/entries new file mode 100644 index 0000000..c42adb4 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/entries @@ -0,0 +1,205 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/core/ziop +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + + + + + + +0 + +CompressorIdLevelListPolicyImpl.java +file + + + + +2009-05-27T12:26:06.000000Z +928f344e36fca76619138eaf8d2fe7b7 +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +4806 + +ZIOP.java +file + + + + +2009-05-27T12:26:06.000000Z +f39551077efadd6747f1f1cceef97869 +2009-05-27T14:10:32.637285Z +395 +avega +has-props + + + + + + + + + + + + + + + + + + + + +9065 + +CompressionLowValuePolicyImpl.java +file + + + + +2009-05-27T12:26:06.000000Z +d0cbe9f9b5ab6866c0a4d8f344556c62 +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +4308 + +CompressionEnablingPolicyImpl.java +file + + + + +2009-05-27T12:26:06.000000Z +768eab0d515f39b5050f31a2af2e2685 +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +4856 + +CompressionMinRatioPolicyImpl.java +file + + + + +2009-05-27T12:26:06.000000Z +b5a0c44f85f74817249f3dababb9c4eb +2009-05-27T14:10:32.637285Z +395 +avega + + + + + + + + + + + + + + + + + + + + + +4268 + diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/prop-base/ZIOP.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/prop-base/ZIOP.java.svn-base new file mode 100644 index 0000000..3160658 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/prop-base/ZIOP.java.svn-base @@ -0,0 +1,5 @@ +K 13 +svn:mergeinfo +V 0 + +END diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionEnablingPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionEnablingPolicyImpl.java.svn-base new file mode 100644 index 0000000..7026f0e --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionEnablingPolicyImpl.java.svn-base @@ -0,0 +1,167 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionEnablingPolicyImpl implementation of + * CompressionEnabling Policy. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionEnablingPolicyImpl + extends org.omg.ZIOP.CompressionEnablingPolicyLocalBase +{ + + boolean m_value; + + /** + * Creates a new CompressionEnablingPolicyImpl instance. + * + * @param val a boolean value + */ + public CompressionEnablingPolicyImpl(boolean val) + { + m_value = val; + } + + /** + * compression_enabled returns if compression is enabled. + * + * @return a boolean value + */ + public boolean compression_enabled() + { + return m_value; + } + + /** + * Returns policy_type + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_ENABLING_POLICY_ID.value; + } + + /** + * copy . + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionEnablingPolicyImpl(m_value); + } + + /** + * destroy . + * + */ + public void destroy() + { + // do nothing! + } + + /** + * Describe createPolicy method here. + * + * @param val an Any value + * @return a CompressionEnablingPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionEnablingPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + boolean policy_value = + CompressionEnablingPolicyValueHelper.extract(val); + + return new CompressionEnablingPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * read CompressionEnablingPolicy from a encapsulation. + * + * @param input a CDRInputStream value + * @return a CompressionEnablingPolicyImpl value + */ + public static CompressionEnablingPolicyImpl read(CDRInputStream input) + { + boolean policy_value = CompressionEnablingPolicyValueHelper.read(input); + + return new CompressionEnablingPolicyImpl(policy_value); + } + + /** + * write CompressionEnablingPolicy into a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionEnablingPolicy value + */ + public static void write(CDROutputStream output, + CompressionEnablingPolicy policy) + { + CompressionEnablingPolicyValueHelper.write(output, + policy.compression_enabled()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionLowValuePolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionLowValuePolicyImpl.java.svn-base new file mode 100644 index 0000000..0bb7a3c --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionLowValuePolicyImpl.java.svn-base @@ -0,0 +1,154 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionLowValuePolicyImpl policy implementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionLowValuePolicyImpl + extends CompressionLowValuePolicyLocalBase +{ + + int m_value; + + /** + * Creates a new CompressionLowValuePolicyImpl instance. + * + * @param val an int value + */ + public CompressionLowValuePolicyImpl(int val) + { + m_value = val; + } + + /** + * Returns low_value . + * + * @return an int value + */ + public int low_value() + { + return m_value; + } + + /** + * Retruns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_LOW_VALUE_POLICY_ID.value; + } + + /** + * copy current policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionLowValuePolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy create a new CompressionLowValuePolicyImpl. + * + * @param val an Any value + * @return a CompressionLowValuePolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionLowValuePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + int policy_value = + CompressionLowValuePolicyValueHelper.extract(val); + + return new CompressionLowValuePolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * write policy into a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionLowValuePolicy value + */ + public static void write(CDROutputStream output, + CompressionLowValuePolicy policy) + { + + CompressionLowValuePolicyValueHelper.write(output, + policy.low_value()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionMinRatioPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionMinRatioPolicyImpl.java.svn-base new file mode 100644 index 0000000..402af44 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressionMinRatioPolicyImpl.java.svn-base @@ -0,0 +1,154 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionMinRatioPolicyImpl policy implmementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionMinRatioPolicyImpl + extends CompressionMinRatioPolicyLocalBase +{ + + float m_value; + + /** + * Creates a new CompressionMinRatioPolicyImpl instance. + * + * @param val an int value + */ + public CompressionMinRatioPolicyImpl(float val) + { + m_value = val; + } + + /** + * Returns ratio . + * + * @return an int value + */ + public float ratio() + { + return m_value; + } + + /** + * Returns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_MIN_RATIO_POLICY_ID.value; + } + + /** + * copy current policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionMinRatioPolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy . + * + * @param val an Any value + * @return a CompressionMinRatioPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionMinRatioPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + float policy_value = + CompressionMinRatioPolicyValueHelper.extract(val); + + return new CompressionMinRatioPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * write policy in to a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionMinRatioPolicy value + */ + public static void write(CDROutputStream output, + CompressionMinRatioPolicy policy) + { + + CompressionMinRatioPolicyValueHelper.write(output, + policy.ratio()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressorIdLevelListPolicyImpl.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressorIdLevelListPolicyImpl.java.svn-base new file mode 100644 index 0000000..c8157da --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/CompressorIdLevelListPolicyImpl.java.svn-base @@ -0,0 +1,165 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressorIdLevelListPolicyImpl policy implementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressorIdLevelListPolicyImpl + extends CompressorIdLevelListPolicyLocalBase +{ + + CompressorIdLevel[] m_value; + + /** + * Creates a new CompressorIdLevelListPolicyImpl instance. + * + * @param val a CompressorIdLevel value + */ + public CompressorIdLevelListPolicyImpl(CompressorIdLevel[] val) + { + m_value = val; + } + + /** + * Returns compressor_ids . + * + * @return a CompressorIdLevel[] value + */ + public CompressorIdLevel[] compressor_ids() + { + return m_value; + } + + /** + * Returns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value; + } + + /** + * copy policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressorIdLevelListPolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy . + * + * @param val an Any value + * @return a CompressorIdLevelListPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressorIdLevelListPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + CompressorIdLevel[] policy_value = + CompressorIdLevelListHelper.extract(val); + + return new CompressorIdLevelListPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * read policy from an encapsulation. + * + * @param input a CDRInputStream value + * @return a CompressorIdLevelListPolicyImpl value + */ + public static CompressorIdLevelListPolicyImpl read(CDRInputStream input) + { + CompressorIdLevel[] policy_value = CompressorIdLevelListHelper.read(input); + return new CompressorIdLevelListPolicyImpl(policy_value); + } + + /** + * write policy into an encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressorIdLevelListPolicy value + */ + public static void write(CDROutputStream output, + CompressorIdLevelListPolicy policy) + { + CompressorIdLevelListHelper.write(output, + policy.compressor_ids()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/.svn/text-base/ZIOP.java.svn-base b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/ZIOP.java.svn-base new file mode 100644 index 0000000..22658a1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/.svn/text-base/ZIOP.java.svn-base @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.ziop; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +import org.omg.Compression.*; +import org.omg.ZIOP.*; + + +/** + * ZIOP common facilities to dealing with ZIOP policies + * CompressionEnabling Policy. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class ZIOP +{ + + + /** + * checkCompressionEnabled cheks if the context contains a + * CompressionEnablingPolicy enabled + * + * @param context a PolicyContext value + * @return a boolean value + */ + public static boolean checkCompressionEnabled(PolicyContext context) + { + if (context != null) { + + CompressionEnablingPolicy compressionEnablingPolicy = + context.getCompressionEnablingPolicy(); + + if (compressionEnablingPolicy != null) { + return compressionEnablingPolicy.compression_enabled(); + } + } + return false; + } + + /** + * checkCompressionEnabled checks if both context provided + * contains CompressionEnablingPolicy enabled. + * + * @param context a PolicyContext value + * @param ior_context a PolicyContext value + * @return a boolean value + */ + public static boolean checkCompressionEnabled(PolicyContext context, + PolicyContext ior_context) + { + if ( (context != null) && (ior_context != null) ) { + + CompressionEnablingPolicy compressionEnablingPolicy = + context.getCompressionEnablingPolicy(); + + CompressionEnablingPolicy compressionEnablingPolicy_ior = + ior_context.getCompressionEnablingPolicy(); + + if ( (compressionEnablingPolicy != null) && + (compressionEnablingPolicy_ior != null) ){ + return ( compressionEnablingPolicy.compression_enabled() && + compressionEnablingPolicy_ior.compression_enabled() ); + } + } + return false; + } + + /** + * Retuns getClientCompressor a CompressorIdLevel that could + * be used in client side, taken in accont client context and IOR (server + * context). + * + * @param context a PolicyContext value + * @param ior_context a PolicyContext value + * @return a CompressorIdLevel value + */ + public static CompressorIdLevel getClientCompressor(PolicyContext context, + PolicyContext ior_context, + boolean assume_ziop_server) + { + + CompressorIdLevel result = new CompressorIdLevel((short)0, (short)0); + + if (context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy = + context.getCompressorIdLevelListPolicy(); + + if (ior_context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy_ior = + ior_context.getCompressorIdLevelListPolicy(); + + + if ( (compressionIdLevelListPolicy != null) && + (compressionIdLevelListPolicy_ior != null) ){ + + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + CompressorIdLevel[] compressors_ior = + compressionIdLevelListPolicy_ior.compressor_ids(); + + // Compare both lists + for (int i = 0; i < compressors_ctx.length; i++) { + + for (int j = 0; j < compressors_ior.length; j++) { + + if ( compressors_ctx[i].compressor_id == + compressors_ior[j].compressor_id ){ + result.compressor_id = + compressors_ctx[i].compressor_id; + result.compression_level = + compressors_ctx[i].compression_level; + return result; + } + } + } + } + + } else { + + if (assume_ziop_server) { + + if (compressionIdLevelListPolicy != null) { + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + if (compressors_ctx.length > 0) { + result.compressor_id = + compressors_ctx[0].compressor_id; + result.compression_level = + compressors_ctx[0].compression_level; + } + } + } + + } + } + return result; + } + + + /** + * Retuns getLevelCompressor a CompressorLevel that could + * be used in client side, taken in accont client context and IOR (server + * context). + * + * @param compressor_id a short value + * @param context a PolicyContext value + * @return a short value + */ + public static short getLevelCompressor(short compressor_id, + PolicyContext context) + { + if (context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy = + context.getCompressorIdLevelListPolicy(); + + if (compressionIdLevelListPolicy != null) { + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + + // Compare both lists + for (int i = 0; i < compressors_ctx.length; i++) { + if (compressors_ctx[i].compressor_id == compressor_id) { + return compressors_ctx[i].compression_level; + } + } + } + } + return 0; + } + + + + /** + * getLowValue from a context. + * + * @param context a PolicyContext value + * @return an int value + */ + public static int getLowValue(PolicyContext context) + { + CompressionLowValuePolicy compressionLowValuePolicy = + context.getCompressionLowValuePolicy(); + + if (compressionLowValuePolicy != null) { + return compressionLowValuePolicy.low_value(); + } + else + return 0; + } + + /** + * getMinRatio value from a context. + * + * @param context a PolicyContext value + * @return an int value + */ + public static float getMinRatio(PolicyContext context) + { + CompressionMinRatioPolicy compressionMinRatioPolicy = + context.getCompressionMinRatioPolicy(); + + if (compressionMinRatioPolicy != null) { + return compressionMinRatioPolicy.ratio(); + } + else + return 0; + } + +} diff --git a/source/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.java b/source/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.java new file mode 100644 index 0000000..7026f0e --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/CompressionEnablingPolicyImpl.java @@ -0,0 +1,167 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionEnablingPolicyImpl implementation of + * CompressionEnabling Policy. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionEnablingPolicyImpl + extends org.omg.ZIOP.CompressionEnablingPolicyLocalBase +{ + + boolean m_value; + + /** + * Creates a new CompressionEnablingPolicyImpl instance. + * + * @param val a boolean value + */ + public CompressionEnablingPolicyImpl(boolean val) + { + m_value = val; + } + + /** + * compression_enabled returns if compression is enabled. + * + * @return a boolean value + */ + public boolean compression_enabled() + { + return m_value; + } + + /** + * Returns policy_type + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_ENABLING_POLICY_ID.value; + } + + /** + * copy . + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionEnablingPolicyImpl(m_value); + } + + /** + * destroy . + * + */ + public void destroy() + { + // do nothing! + } + + /** + * Describe createPolicy method here. + * + * @param val an Any value + * @return a CompressionEnablingPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionEnablingPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + boolean policy_value = + CompressionEnablingPolicyValueHelper.extract(val); + + return new CompressionEnablingPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * read CompressionEnablingPolicy from a encapsulation. + * + * @param input a CDRInputStream value + * @return a CompressionEnablingPolicyImpl value + */ + public static CompressionEnablingPolicyImpl read(CDRInputStream input) + { + boolean policy_value = CompressionEnablingPolicyValueHelper.read(input); + + return new CompressionEnablingPolicyImpl(policy_value); + } + + /** + * write CompressionEnablingPolicy into a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionEnablingPolicy value + */ + public static void write(CDROutputStream output, + CompressionEnablingPolicy policy) + { + CompressionEnablingPolicyValueHelper.write(output, + policy.compression_enabled()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.java b/source/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.java new file mode 100644 index 0000000..0bb7a3c --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/CompressionLowValuePolicyImpl.java @@ -0,0 +1,154 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionLowValuePolicyImpl policy implementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionLowValuePolicyImpl + extends CompressionLowValuePolicyLocalBase +{ + + int m_value; + + /** + * Creates a new CompressionLowValuePolicyImpl instance. + * + * @param val an int value + */ + public CompressionLowValuePolicyImpl(int val) + { + m_value = val; + } + + /** + * Returns low_value . + * + * @return an int value + */ + public int low_value() + { + return m_value; + } + + /** + * Retruns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_LOW_VALUE_POLICY_ID.value; + } + + /** + * copy current policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionLowValuePolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy create a new CompressionLowValuePolicyImpl. + * + * @param val an Any value + * @return a CompressionLowValuePolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionLowValuePolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + int policy_value = + CompressionLowValuePolicyValueHelper.extract(val); + + return new CompressionLowValuePolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * write policy into a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionLowValuePolicy value + */ + public static void write(CDROutputStream output, + CompressionLowValuePolicy policy) + { + + CompressionLowValuePolicyValueHelper.write(output, + policy.low_value()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.java b/source/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.java new file mode 100644 index 0000000..402af44 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/CompressionMinRatioPolicyImpl.java @@ -0,0 +1,154 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressionMinRatioPolicyImpl policy implmementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressionMinRatioPolicyImpl + extends CompressionMinRatioPolicyLocalBase +{ + + float m_value; + + /** + * Creates a new CompressionMinRatioPolicyImpl instance. + * + * @param val an int value + */ + public CompressionMinRatioPolicyImpl(float val) + { + m_value = val; + } + + /** + * Returns ratio . + * + * @return an int value + */ + public float ratio() + { + return m_value; + } + + /** + * Returns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSION_MIN_RATIO_POLICY_ID.value; + } + + /** + * copy current policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressionMinRatioPolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy . + * + * @param val an Any value + * @return a CompressionMinRatioPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressionMinRatioPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + float policy_value = + CompressionMinRatioPolicyValueHelper.extract(val); + + return new CompressionMinRatioPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * write policy in to a encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressionMinRatioPolicy value + */ + public static void write(CDROutputStream output, + CompressionMinRatioPolicy policy) + { + + CompressionMinRatioPolicyValueHelper.write(output, + policy.ratio()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.java b/source/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.java new file mode 100644 index 0000000..c8157da --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/CompressorIdLevelListPolicyImpl.java @@ -0,0 +1,165 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.core.ziop; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_POLICY_VALUE; +import org.omg.CORBA.PolicyError; +import org.omg.Compression.*; +import org.omg.ZIOP.*; + +import es.tid.TIDorbj.core.cdr.CDROutputStream; +import es.tid.TIDorbj.core.cdr.CDRInputStream; + +/** + * CompressorIdLevelListPolicyImpl policy implementation. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class CompressorIdLevelListPolicyImpl + extends CompressorIdLevelListPolicyLocalBase +{ + + CompressorIdLevel[] m_value; + + /** + * Creates a new CompressorIdLevelListPolicyImpl instance. + * + * @param val a CompressorIdLevel value + */ + public CompressorIdLevelListPolicyImpl(CompressorIdLevel[] val) + { + m_value = val; + } + + /** + * Returns compressor_ids . + * + * @return a CompressorIdLevel[] value + */ + public CompressorIdLevel[] compressor_ids() + { + return m_value; + } + + /** + * Returns policy_type . + * + * @return an int value + */ + public int policy_type() + { + return COMPRESSOR_ID_LEVEL_LIST_POLICY_ID.value; + } + + /** + * copy policy. + * + * @return an org.omg.CORBA.Policy value + */ + public org.omg.CORBA.Policy copy() + { + return new CompressorIdLevelListPolicyImpl(m_value); + } + + /** + * destroy current policy. + * + */ + public void destroy() + { + // do nothing! + } + + /** + * createPolicy . + * + * @param val an Any value + * @return a CompressorIdLevelListPolicyImpl value + * @exception org.omg.CORBA.PolicyError if an error occurs + */ + public static CompressorIdLevelListPolicyImpl createPolicy(Any val) + throws org.omg.CORBA.PolicyError + { + try { + CompressorIdLevel[] policy_value = + CompressorIdLevelListHelper.extract(val); + + return new CompressorIdLevelListPolicyImpl(policy_value); + + } + catch (BAD_PARAM bp) { + throw new PolicyError(BAD_POLICY_VALUE.value); + } + } + + /** + * read policy from an encapsulation. + * + * @param input a CDRInputStream value + * @return a CompressorIdLevelListPolicyImpl value + */ + public static CompressorIdLevelListPolicyImpl read(CDRInputStream input) + { + CompressorIdLevel[] policy_value = CompressorIdLevelListHelper.read(input); + return new CompressorIdLevelListPolicyImpl(policy_value); + } + + /** + * write policy into an encapsulation. + * + * @param output a CDROutputStream value + * @param policy a CompressorIdLevelListPolicy value + */ + public static void write(CDROutputStream output, + CompressorIdLevelListPolicy policy) + { + CompressorIdLevelListHelper.write(output, + policy.compressor_ids()); + } + + + +} diff --git a/source/es/tid/TIDorbj/core/ziop/ZIOP.java b/source/es/tid/TIDorbj/core/ziop/ZIOP.java new file mode 100644 index 0000000..22658a1 --- /dev/null +++ b/source/es/tid/TIDorbj/core/ziop/ZIOP.java @@ -0,0 +1,258 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 1 $ +* Date: $Date: 2008-12-01 08:58:21 +0100 (Mon, 01 Dec 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.core.ziop; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.policy.PolicyContext; +import es.tid.TIDorbj.util.Trace; + +import org.omg.Compression.*; +import org.omg.ZIOP.*; + + +/** + * ZIOP common facilities to dealing with ZIOP policies + * CompressionEnabling Policy. + * + * @author Alvaro Vega Garcia + * @version 1.0 + */ +public class ZIOP +{ + + + /** + * checkCompressionEnabled cheks if the context contains a + * CompressionEnablingPolicy enabled + * + * @param context a PolicyContext value + * @return a boolean value + */ + public static boolean checkCompressionEnabled(PolicyContext context) + { + if (context != null) { + + CompressionEnablingPolicy compressionEnablingPolicy = + context.getCompressionEnablingPolicy(); + + if (compressionEnablingPolicy != null) { + return compressionEnablingPolicy.compression_enabled(); + } + } + return false; + } + + /** + * checkCompressionEnabled checks if both context provided + * contains CompressionEnablingPolicy enabled. + * + * @param context a PolicyContext value + * @param ior_context a PolicyContext value + * @return a boolean value + */ + public static boolean checkCompressionEnabled(PolicyContext context, + PolicyContext ior_context) + { + if ( (context != null) && (ior_context != null) ) { + + CompressionEnablingPolicy compressionEnablingPolicy = + context.getCompressionEnablingPolicy(); + + CompressionEnablingPolicy compressionEnablingPolicy_ior = + ior_context.getCompressionEnablingPolicy(); + + if ( (compressionEnablingPolicy != null) && + (compressionEnablingPolicy_ior != null) ){ + return ( compressionEnablingPolicy.compression_enabled() && + compressionEnablingPolicy_ior.compression_enabled() ); + } + } + return false; + } + + /** + * Retuns getClientCompressor a CompressorIdLevel that could + * be used in client side, taken in accont client context and IOR (server + * context). + * + * @param context a PolicyContext value + * @param ior_context a PolicyContext value + * @return a CompressorIdLevel value + */ + public static CompressorIdLevel getClientCompressor(PolicyContext context, + PolicyContext ior_context, + boolean assume_ziop_server) + { + + CompressorIdLevel result = new CompressorIdLevel((short)0, (short)0); + + if (context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy = + context.getCompressorIdLevelListPolicy(); + + if (ior_context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy_ior = + ior_context.getCompressorIdLevelListPolicy(); + + + if ( (compressionIdLevelListPolicy != null) && + (compressionIdLevelListPolicy_ior != null) ){ + + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + CompressorIdLevel[] compressors_ior = + compressionIdLevelListPolicy_ior.compressor_ids(); + + // Compare both lists + for (int i = 0; i < compressors_ctx.length; i++) { + + for (int j = 0; j < compressors_ior.length; j++) { + + if ( compressors_ctx[i].compressor_id == + compressors_ior[j].compressor_id ){ + result.compressor_id = + compressors_ctx[i].compressor_id; + result.compression_level = + compressors_ctx[i].compression_level; + return result; + } + } + } + } + + } else { + + if (assume_ziop_server) { + + if (compressionIdLevelListPolicy != null) { + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + if (compressors_ctx.length > 0) { + result.compressor_id = + compressors_ctx[0].compressor_id; + result.compression_level = + compressors_ctx[0].compression_level; + } + } + } + + } + } + return result; + } + + + /** + * Retuns getLevelCompressor a CompressorLevel that could + * be used in client side, taken in accont client context and IOR (server + * context). + * + * @param compressor_id a short value + * @param context a PolicyContext value + * @return a short value + */ + public static short getLevelCompressor(short compressor_id, + PolicyContext context) + { + if (context != null) { + + CompressorIdLevelListPolicy compressionIdLevelListPolicy = + context.getCompressorIdLevelListPolicy(); + + if (compressionIdLevelListPolicy != null) { + CompressorIdLevel[] compressors_ctx = + compressionIdLevelListPolicy.compressor_ids(); + + // Compare both lists + for (int i = 0; i < compressors_ctx.length; i++) { + if (compressors_ctx[i].compressor_id == compressor_id) { + return compressors_ctx[i].compression_level; + } + } + } + } + return 0; + } + + + + /** + * getLowValue from a context. + * + * @param context a PolicyContext value + * @return an int value + */ + public static int getLowValue(PolicyContext context) + { + CompressionLowValuePolicy compressionLowValuePolicy = + context.getCompressionLowValuePolicy(); + + if (compressionLowValuePolicy != null) { + return compressionLowValuePolicy.low_value(); + } + else + return 0; + } + + /** + * getMinRatio value from a context. + * + * @param context a PolicyContext value + * @return an int value + */ + public static float getMinRatio(PolicyContext context) + { + CompressionMinRatioPolicy compressionMinRatioPolicy = + context.getCompressionMinRatioPolicy(); + + if (compressionMinRatioPolicy != null) { + return compressionMinRatioPolicy.ratio(); + } + else + return 0; + } + +} diff --git a/source/es/tid/TIDorbj/dynAny/.svn/all-wcprops b/source/es/tid/TIDorbj/dynAny/.svn/all-wcprops new file mode 100644 index 0000000..d5a4c5e --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/all-wcprops @@ -0,0 +1,95 @@ +K 25 +svn:wc:ra_dav:version-url +V 76 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny +END +DynEnumImpl.java +K 25 +svn:wc:ra_dav:version-url +V 93 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynEnumImpl.java +END +DynSequenceImpl.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynSequenceImpl.java +END +DynAnyWithAny.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynAnyWithAny.java +END +DynValueImpl.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynValueImpl.java +END +DynArrayImpl.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynArrayImpl.java +END +DynAnyFactoryImpl.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.java +END +DynSingleton.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynSingleton.java +END +DynComposite.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynComposite.java +END +DynStructImpl.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynStructImpl.java +END +DynAnyImpl.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynAnyImpl.java +END +DynExceptImpl.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynExceptImpl.java +END +DynUnionImpl.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynUnionImpl.java +END +DynStructBase.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynStructBase.java +END +DynFixedImpl.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynFixedImpl.java +END +DynAnyBase.java +K 25 +svn:wc:ra_dav:version-url +V 92 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny/DynAnyBase.java +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/entries b/source/es/tid/TIDorbj/dynAny/.svn/entries new file mode 100644 index 0000000..55dfa64 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/entries @@ -0,0 +1,538 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/source/es/tid/TIDorbj/dynAny +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +DynEnumImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +7b7ea4df58d0c9f8488965417c475857 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9545 + +DynSequenceImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +f6d71fa5e25b8040419fc3cbe3177eab +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +20361 + +DynAnyWithAny.java +file + + + + +2009-05-27T12:24:00.000000Z +956dd6d06461904a7f39bb884e00e940 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9141 + +DynValueImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +f14f7941a79f8509052c9479a240c70c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4604 + +DynArrayImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +79a9e5dd5cb9a8375e92630c7cc1388b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +16572 + +DynAnyFactoryImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +58dfe72573d8defdc5567da3db81926a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +14339 + +DynSingleton.java +file + + + + +2009-05-27T12:24:00.000000Z +c6607b5c91a1978516c6278c3b22de8a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +11729 + +DynComposite.java +file + + + + +2010-04-28T10:47:58.000000Z +bebaa4b9b1d690d71f4f02236b849fa0 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +64471 + +DynStructImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +d3e7e0c0a3dde8cff77666b3aae3e965 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4330 + +DynAnyImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +3919240f6b791247daff3fc2ba08d9eb +2006-05-26T08:56:46.000000Z +18 +scheca +has-props + + + + + + + + + + + + + + + + + + + + +38114 + +DynUnionImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +1dd1b2a5b45166fd97ebd269ac30f335 +2006-06-28T08:17:01.000000Z +19 +iredondo +has-props + + + + + + + + + + + + + + + + + + + + +48890 + +DynExceptImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +657582b30eed57d94467fcfea2d3eef1 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +4512 + +DynStructBase.java +file + + + + +2009-05-27T12:24:00.000000Z +80ff05eae034c4d54fa46ca4412b3bb5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +9956 + +DynFixedImpl.java +file + + + + +2009-05-27T12:24:00.000000Z +bbf3046a963f772493be3684c6139e47 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +8762 + +DynAnyBase.java +file + + + + +2009-05-27T12:24:00.000000Z +8e91da678b570bc9d2d6ca779389be66 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +11578 + diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyBase.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyBase.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyBase.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyFactoryImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyFactoryImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyFactoryImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyWithAny.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyWithAny.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynAnyWithAny.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynArrayImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynArrayImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynArrayImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynComposite.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynComposite.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynComposite.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynEnumImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynEnumImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynEnumImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynExceptImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynExceptImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynExceptImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynFixedImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynFixedImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynFixedImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSequenceImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSequenceImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSequenceImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSingleton.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSingleton.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynSingleton.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructBase.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructBase.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructBase.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynStructImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynUnionImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynUnionImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynUnionImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynValueImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynValueImpl.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/prop-base/DynValueImpl.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyBase.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyBase.java.svn-base new file mode 100644 index 0000000..2030fad --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyBase.java.svn-base @@ -0,0 +1,433 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * Base clase for all DynAny implementation classes. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +abstract class DynAnyBase extends es.tid.TIDorbj.core.PseudoObject + implements org.omg.DynamicAny.DynAny, org.omg.CORBA.portable.Streamable +{ + + /** + * The active ORB. + */ + + TIDORB m_orb; + + /** + * The active DynAny factory. + */ + DynAnyFactoryImpl m_factory; + + /** + * The DynAny typecode. It maybe different from the base_type + * typecode, if it is a alias typecode. + */ + + TypeCode m_dyn_type; + + /** + * The "real" DynAny typecode base type. + */ + + TypeCode m_base_type; + + /** + * If true the DynAny can be destroyed by the user. + * Otherwise, it only will be destroyed by the container DynAny that created + * it. + *

+ * Default value: true (user can destroy it). + */ + + boolean m_user_destroy; + + protected DynAnyBase(DynAnyFactoryImpl factory, TIDORB orb) + { + m_factory = factory; + m_orb = orb; + m_destroyed = false; + m_user_destroy = true; + m_dyn_type = null; + m_base_type = null; + } + + protected DynAnyBase(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + this.m_factory = factory; + this.m_orb = orb; + m_destroyed = false; + m_user_destroy = true; + m_dyn_type = type; + m_base_type = real_type; + } + + public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_user_destroy) { + destroyNow(); + } + } + + protected void destroyNow() + { + m_destroyed = true; + m_dyn_type = null; + m_base_type = null; + m_factory = null; + m_orb = null; + } + + protected void setUserDestroy(boolean value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + m_user_destroy = value; + } + + // DynAny operations + + public org.omg.CORBA.TypeCode type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + return m_dyn_type; + } + + // DynAny without components methods + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return 0; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + // no components + + return false; + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + typeMismatch(); + return null; + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + // Streamable operations + + public org.omg.CORBA.TypeCode _type() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return type(); + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynAny:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + // Implementation + + protected void typeMismatch() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyFactoryImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyFactoryImpl.java.svn-base new file mode 100644 index 0000000..3bbc226 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyFactoryImpl.java.svn-base @@ -0,0 +1,410 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.DynamicAny.DynAnyFactoryLocalBase; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynAnyFactory implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyFactoryImpl extends DynAnyFactoryLocalBase +{ + + private boolean m_destroyed; + + private TIDORB m_orb; + + public DynAnyFactoryImpl() + { + m_destroyed = false; + } + + public void set_orb(org.omg.CORBA.ORB orb) + { + m_orb = (TIDORB) orb; + } + + public synchronized void destroy() + { + m_orb = null; + m_destroyed = true; + } + + public synchronized org.omg.DynamicAny.DynAny + create_dyn_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (value == null) + throw new BAD_PARAM("Null any reference"); + + switch (value.type().kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, value, value.type()); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, value, value.type()); + case TCKind._tk_alias: + return createAliasDynAny(value); + + // complex typecodes + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, value, value.type()); + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, value, value.type()); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, value, value.type()); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, value, value.type()); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, value, value.type()); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, value, value.type()); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, value, value.type()); + + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, value, value.type()); + + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + protected org.omg.DynamicAny.DynAny + createAliasDynAny(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (value == null) + throw new BAD_PARAM("Null any reference"); + + TypeCode base_type = null; + + try { + base_type = value.type().content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + switch (base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, value, base_type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, value, base_type); + // complex typecodes + + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, value, base_type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, value, base_type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, value, base_type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, value, base_type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, value, base_type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, value, base_type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, value, base_type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, value, base_type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public synchronized org.omg.DynamicAny.DynAny + create_dyn_any_from_type_code(org.omg.CORBA.TypeCode type) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + switch (type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, type, type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, type, type); + case TCKind._tk_alias: + return createAliasDynAnyFromTypeCode(type); + // complex typecodes + + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, type, type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, type, type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, type, type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, type, type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, type, type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, type, type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, type, type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, type, type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public org.omg.DynamicAny.DynAny + createAliasDynAnyFromTypeCode(org.omg.CORBA.TypeCode type) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (type == null) + throw new BAD_TYPECODE("Null TypeCode reference"); + + TypeCode base_type = null; + + try { + base_type = type.content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + switch (base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, type, base_type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, type, base_type); + // complex typecodes + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, type, base_type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, type, base_type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, type, base_type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, type, base_type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, type, base_type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, type, base_type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, type, base_type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, type, base_type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public static boolean isBasic(org.omg.CORBA.TypeCode type) + { + if (type == null) + throw new BAD_PARAM("Null type reference"); + + switch (type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_any: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return true; + case TCKind._tk_alias: + return aliasWithBasicTC(type); + default: + return false; + } + } + + protected static boolean aliasWithBasicTC(org.omg.CORBA.TypeCode type) + { + if (type == null) + throw new BAD_PARAM("Null any reference"); + + TypeCode base_type = null; + + try { + base_type = type.content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + return isBasic(base_type); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyImpl.java.svn-base new file mode 100644 index 0000000..7da57c8 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyImpl.java.svn-base @@ -0,0 +1,1180 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.util.StringHolder; +import es.tid.TIDorbj.core.util.WStringHolder; + +/** + * DynAny implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyImpl extends DynAnyBase +{ + /** + * Primitive type value. + */ + + AnyImpl m_dyn_value; + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_dyn_value = null; + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value, assumes that the TypeCode is Basic. + */ + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + initValue(any); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + super(factory, orb, type, real_type); + + initValue(); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + m_dyn_value.read_value(in, m_base_type); + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + m_dyn_value.write_value(out); + } + + // DynAny operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + try { + switch (m_base_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + m_dyn_value.type(m_base_type); + return; + case TCKind._tk_objref: + m_dyn_value.insert_Object(dyn_any.get_reference()); + return; + case TCKind._tk_TypeCode: + m_dyn_value.insert_TypeCode(dyn_any.get_typecode()); + return; + case TCKind._tk_short: + m_dyn_value.insert_short(dyn_any.get_short()); + return; + case TCKind._tk_long: + m_dyn_value.insert_long(dyn_any.get_long()); + return; + case TCKind._tk_ushort: + m_dyn_value.insert_ushort(dyn_any.get_ushort()); + return; + case TCKind._tk_ulong: + m_dyn_value.insert_ulong(dyn_any.get_ulong()); + return; + case TCKind._tk_float: + m_dyn_value.insert_float(dyn_any.get_float()); + return; + case TCKind._tk_double: + m_dyn_value.insert_double(dyn_any.get_double()); + return; + case TCKind._tk_boolean: + m_dyn_value.insert_boolean(dyn_any.get_boolean()); + return; + case TCKind._tk_char: + m_dyn_value.insert_char(dyn_any.get_char()); + return; + case TCKind._tk_octet: + m_dyn_value.insert_octet(dyn_any.get_octet()); + return; + case TCKind._tk_longlong: + m_dyn_value.insert_longlong(dyn_any.get_longlong()); + return; + case TCKind._tk_ulonglong: + m_dyn_value.insert_ulonglong(dyn_any.get_ulonglong()); + return; + case TCKind._tk_wchar: + m_dyn_value.insert_wchar(dyn_any.get_wchar()); + return; + case TCKind._tk_string: + m_dyn_value.insert_string(dyn_any.get_string()); + return; + case TCKind._tk_wstring: + m_dyn_value.insert_string(dyn_any.get_string()); + return; + + } + } + catch (InvalidValue iv) { + throw new BAD_PARAM(iv.toString()); + } + + // set the any type to the "dyn_type" + m_dyn_value.setEquivalentType(m_base_type); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_dyn_type.equivalent(value.type())) + throw new TypeMismatch(); + + initValue(value); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + + AnyImpl.assign(m_dyn_value, new_value); + + new_value.setEquivalentType(m_dyn_type); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + try { + switch (m_base_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + return true; + case TCKind._tk_objref: + return m_dyn_value.extract_Object() + ._is_equivalent(dyn_any.get_reference()); + case TCKind._tk_TypeCode: + return m_dyn_value.extract_TypeCode() + .equal(dyn_any.get_typecode()); + case TCKind._tk_short: + return m_dyn_value.extract_short() == dyn_any.get_short(); + case TCKind._tk_long: + return m_dyn_value.extract_long() == dyn_any.get_long(); + case TCKind._tk_ushort: + return m_dyn_value.extract_ushort() == dyn_any.get_ushort(); + case TCKind._tk_ulong: + return m_dyn_value.extract_ulong() == dyn_any.get_ulong(); + case TCKind._tk_float: + return m_dyn_value.extract_float() == dyn_any.get_float(); + case TCKind._tk_double: + return m_dyn_value.extract_double() == dyn_any.get_double(); + case TCKind._tk_boolean: + return m_dyn_value.extract_boolean() + == dyn_any.get_boolean(); + case TCKind._tk_char: + return m_dyn_value.extract_char() == dyn_any.get_char(); + case TCKind._tk_octet: + return m_dyn_value.extract_octet() == dyn_any.get_octet(); + case TCKind._tk_longlong: + return m_dyn_value.extract_longlong() + == dyn_any.get_longlong(); + case TCKind._tk_ulonglong: + return m_dyn_value.extract_ulonglong() + == dyn_any.get_ulonglong(); + case TCKind._tk_wchar: + return m_dyn_value.extract_wchar() == dyn_any.get_wchar(); + case TCKind._tk_string: + return m_dyn_value.extract_string() == dyn_any.get_string(); + case TCKind._tk_wstring: + return m_dyn_value.extract_string() == dyn_any.get_string(); + } + } + catch (InvalidValue iv) { + throw new BAD_PARAM(iv.toString()); + } + catch (TypeMismatch tm) { + throw new INTERNAL(tm.toString()); + } + throw new INTERNAL("DynAnyImpl with no basic TypeCode"); + + } + + protected void destroyNow() + { + super.destroyNow(); + m_dyn_value = null; + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynAnyImpl new_dyn = new DynAnyImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + try { + new_dyn.assign(this); + } + catch (TypeMismatch tm) {} + + return new_dyn; + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_dyn_value.type().kind().value() != TCKind._tk_boolean) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_boolean(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_octet) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_octet(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_char) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_char(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_short) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_short(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ushort) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ushort(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_long) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_long(value); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ulong(value); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_float) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_float(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_double) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_double(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_string) + throw new TypeMismatch("Unexpected type"); + + try { + if (m_base_type.length() == 0) { // unboundled string + m_dyn_value.insert_string(value); + return; + } + if (value.length() > m_base_type.length()) + throw new BAD_PARAM("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + m_dyn_value.insert_Streamable(new StringHolder(m_base_type, value)); + + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(); + } + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_wstring) + throw new TypeMismatch("Unexpected type"); + + try { + if (m_base_type.length() == 0) { // unboundled string + m_dyn_value.insert_wstring(value); + return; + } + if (value.length() > (m_base_type.length() / CDR.WCHAR_SIZE)) + throw new BAD_PARAM("WString out of bounds.", 0, + CompletionStatus.COMPLETED_NO); + m_dyn_value.insert_Streamable( + new WStringHolder(m_base_type, value)); + + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_objref) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_Object(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_TypeCode) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_TypeCode(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_longlong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_longlong(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulonglong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ulonglong(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_wchar) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_wchar(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_value) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_Value(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_boolean) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_boolean(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_octet) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_octet(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_char) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_char(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_short) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_short(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ushort) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ushort(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_long) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_long(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ulong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_float) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_float(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_double) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_double(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_string) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_string(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_objref) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_Object(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_TypeCode) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_TypeCode(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_longlong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_longlong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulonglong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ulonglong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_wchar) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_wchar(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_wstring) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_wstring(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_value) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_Value(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + } + + /** + * Initialize the content value with the any value. + * + * @param any + * the value + */ + + protected void initValue(Any any) + { + if (m_dyn_value == null) + m_dyn_value = (AnyImpl) m_orb.create_any(); + + if (m_dyn_type.kind().value() == TCKind._tk_alias) { + + m_dyn_value.read_value(any.create_input_stream(), m_base_type); + + } else { + AnyImpl.assign(any, m_dyn_value); + m_dyn_value.setEquivalentType(m_base_type); + } + } + + /** + * Initialize the content value with the default value of the type. + */ + + protected void initValue() + { + if (m_dyn_value == null) + m_dyn_value = (AnyImpl) m_orb.create_any(); + + switch (m_base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_short: + m_dyn_value.insert_short((short) 0); + return; + case TCKind._tk_long: + m_dyn_value.insert_long(0); + return; + case TCKind._tk_ushort: + m_dyn_value.insert_ushort((short) 0); + return; + case TCKind._tk_ulong: + m_dyn_value.insert_ulong(0); + return; + case TCKind._tk_float: + m_dyn_value.insert_float(0.0F); + return; + case TCKind._tk_double: + m_dyn_value.insert_double(0.0D); + return; + case TCKind._tk_boolean: + m_dyn_value.insert_boolean(false); + return; + case TCKind._tk_char: + m_dyn_value.insert_char((char) 0); + return; + case TCKind._tk_octet: + m_dyn_value.insert_octet((byte) 0); + return; + case TCKind._tk_longlong: + m_dyn_value.insert_longlong(0L); + return; + case TCKind._tk_ulonglong: + m_dyn_value.insert_ulonglong(0L); + return; + case TCKind._tk_wchar: + m_dyn_value.insert_wchar((char) 0); + return; + case TCKind._tk_string: + m_dyn_value.insert_string(""); + return; + case TCKind._tk_wstring: + m_dyn_value.insert_wstring(""); + return; + case TCKind._tk_objref: + m_dyn_value.insert_Object(null); + return; + case TCKind._tk_TypeCode: + m_dyn_value.insert_TypeCode( + m_orb.get_primitive_tc(TCKind.tk_null)); + return; + default: + throw new INTERNAL("TypeCode not expected"); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyWithAny.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyWithAny.java.svn-base new file mode 100644 index 0000000..15641c4 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynAnyWithAny.java.svn-base @@ -0,0 +1,305 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynAny implementation that contains an any with an inner any. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyWithAny extends DynSingleton +{ + + // contained any as a DynAny + + DynAnyBase m_any_value; + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + initValue(); + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value, assumes that the TypeCode is Basic. + */ + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + initValue(any.extract_any()); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + initValue(); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + initValue(in.read_any()); + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_TypeCode(m_any_value.type()); + m_any_value._write(out); + } + + // DynAny operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + try { + initValue(dyn_any.get_any()); + } + catch (InvalidValue invalidValue) {} + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_dyn_type.equivalent(value.type())) + throw new TypeMismatch(); + + initValue(value.extract_any()); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + + new_value.insert_any(m_any_value.to_any()); + + new_value.setEquivalentType(m_dyn_type); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + try { + return m_any_value.equal(dyn_any.get_dyn_any()); + } + catch (TypeMismatch typeMismatch) {} + catch (InvalidValue invalidValue) {} + + return false; + } + + protected void destroyNow() + { + super.destroyNow(); + if (m_any_value != null) { + m_any_value.destroyNow(); + m_any_value = null; + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynAnyWithAny new_dyn = new DynAnyWithAny(m_factory, m_orb, m_dyn_type, + m_base_type); + + try { + new_dyn.assign(this); + } + catch (TypeMismatch tm) {} + + return new_dyn; + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + initValue(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + initValue(value.to_any()); + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return m_any_value.to_any(); + } + + public synchronized org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_any) + throw new TypeMismatch("Unexpected type"); + + return m_any_value; + } + + /** + * Initialize the content value with the default value of the type. + */ + + protected void initValue() + { + AnyImpl val = (AnyImpl) m_orb.create_any(); + initValue(val); + } + + protected void initValue(Any any) + { + if (m_any_value != null) { + m_any_value.destroyNow(); + } + + try { + + m_any_value = (DynAnyBase) m_factory.create_dyn_any(any); + m_any_value.setUserDestroy(false); + + } + catch (InconsistentTypeCode inconsistentTypeCode) {} + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynArrayImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynArrayImpl.java.svn-base new file mode 100644 index 0000000..9f12553 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynArrayImpl.java.svn-base @@ -0,0 +1,565 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * DynArray implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynArrayImpl extends DynComposite + implements org.omg.DynamicAny.DynArray +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an array TypeCode. + * + * @param any + * the any value. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + try { + m_component_count = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_array. + * + * @param any + * the any value. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynArrayImpl new_dyn = new DynArrayImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + protected TypeCode getComponentType(int position) + { + + try { + return m_base_type.content_type(); + } + catch (BadKind bk) { + /* unreachable */ + throw new org.omg.CORBA.INTERNAL(); + } + + } + + // CORBA 2.5 + + // DynArray Operations + + public org.omg.CORBA.Any[] get_elements() + { + return super.get_elements(); + } + + public void set_elements(org.omg.CORBA.Any[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.set_elements(value); + } + + public org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + return super.get_elements_as_dyn_any(); + } + + public void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.set_elements_as_dyn_any(value); + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + insert_boolean_members(value); + + } else { + super.insert_boolean_seq(value); + } + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + insert_octet_members(value); + + } else { + super.insert_octet_seq(value); + } + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + insert_char_members(value); + + } else { + super.insert_char_seq(value); + } + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + insert_short_members(value); + + } else { + super.insert_short_seq(value); + } + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + insert_ushort_members(value); + + } else { + super.insert_ushort_seq(value); + } + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + insert_long_members(value); + + } else { + super.insert_long_seq(value); + } + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + insert_ulong_members(value); + + } else { + super.insert_ulong_seq(value); + } + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + insert_float_members(value); + + } else { + super.insert_float_seq(value); + } + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + insert_double_members(value); + + } else { + super.insert_double_seq(value); + } + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + insert_longlong_members(value); + + } else { + super.insert_longlong_seq(value); + } + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulonglong)) { + insert_ulonglong_members(value); + + } else { + super.insert_ulonglong_seq(value); + } + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + insert_wchar_members(value); + + } else { + super.insert_wchar_seq(value); + } + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + return super.get_boolean_members(); + } else { + return super.get_boolean_seq(); + } + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + return super.get_octet_members(); + } else { + return super.get_octet_seq(); + } + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + return super.get_char_members(); + } else { + return super.get_char_seq(); + } + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + return super.get_short_members(); + } else { + return super.get_short_seq(); + } + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + return super.get_ushort_members(); + } else { + return super.get_ushort_seq(); + } + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + return super.get_long_members(); + } else { + return super.get_long_seq(); + } + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + return super.get_ulong_members(); + } else { + return super.get_ulong_seq(); + } + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + return super.get_float_members(); + } else { + return super.get_float_seq(); + } + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + return super.get_double_members(); + } else { + return super.get_double_seq(); + } + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + return super.get_longlong_members(); + } else { + return super.get_longlong_seq(); + } + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + return super.get_wchar_members(); + } else { + return super.get_wchar_seq(); + } + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynArray:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynComposite.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynComposite.java.svn-base new file mode 100644 index 0000000..2bbedb7 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynComposite.java.svn-base @@ -0,0 +1,2233 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.OutputStream; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Base class for composite Dynamic Anys. It implements the Streamable interface + * for alowing the generated anys (with to_any) write its value in an output + * stream. The generated anys are contructed with: + *

+ * + * Any to_any() + *

{ + *

Any a= new Any(); + *

a.insert_Streamable(this); + *

return a; + *

} Due to this construction unneccesary remarshalings are avoided. + *

+ * The DynComposite has two operation modes: + *

    + *
  • Inserting Mode : a TypeCode is given and the + * any is constructec from other Dynamic Anys. + *
  • Extraction Mode : a Any is given and the + * DynAny structures are obtained from the any and its input stream. + *
+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class DynComposite extends DynAnyBase +{ + /** + * The marshaled value of the Dynamic Any for extracting. + */ + + CDRInputStream m_complete_value; + + /** + * The next component marshaled value of the Dynamic Any for extracting. + */ + + CDRInputStream m_next_value; + + /** + * Current component of the array. + */ + + int m_current_index; + + /** + * Number of Components of the Dynany. This value must be initialized by the + * child classes. + */ + + int m_component_count; + + /** + * Array of components. + */ + + Vector m_components; + + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_components = new Vector(); + m_component_count = 0; + m_current_index = -1; + m_complete_value = null; + m_next_value = null; + } + + /** + * Constructor for insertions. + */ + + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + this(factory, orb); + + m_dyn_type = type; + m_base_type = real_type; + } + + /** + * Constructor for extraction. + */ + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + this(factory, orb); + + m_dyn_type = any.type(); + m_base_type = real_type; + + getStreams(any); + } + + // DynComposite methods + + /** + * Clears the value of the dynAny and try to destroy the components. It is + * done when going to insert a new value. + */ + + protected void reset() + { + if (m_component_count == 0) + m_current_index = -1; + else + m_current_index = 0; + + int size = m_components.size(); + + for (int i = 0; i < size; i++) { + ((DynAny) m_components.elementAt(i)).destroy(); + } + + m_components.removeAllElements(); + + m_complete_value = null; + m_next_value = null; + } + + /** + * @param position + * the component position + * @return the TypeCode of the component at the given + * position + */ + protected abstract TypeCode getComponentType(int position); + + /** + * Internal operation to notify that the last component has been + * dissasembled and the DynAny can be wroten writing its components. + * + */ + protected void lastComponent() + { + m_complete_value = null; + m_next_value = null; + } + + /** + * Streamable _read operation + */ + public void _read(org.omg.CORBA.portable.InputStream is) + { + reset(); + + Any any = m_orb.create_any(); + + any.read_value(is, m_base_type); + + getStreams(any); + + } + + /** + * Streamable _write operation + */ + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (os == null) + throw new BAD_PARAM("Null OutputStream reference", 0, + CompletionStatus.COMPLETED_NO); + + DynAny dyn = null; + try { + for (int i = 0; i < m_component_count; i++) { + dyn = getComponent(i); + if (dyn instanceof DynAnyBase) + ((DynAnyBase) dyn)._write(os); + else + dyn.to_any().write_value(os); + } + } + catch (TypeMismatch tm) { + throw new INTERNAL(); + } + } + + /** + * DynAny destructor. Invoked by container DynAnys. + */ + protected void destroyNow() + { + super.destroyNow(); + + reset(); + + m_components = null; + } + + /** + * Obtains the marshaled value from the any. + * + * @param any + * the new value + */ + protected void getStreams(org.omg.CORBA.Any any) + { + if (any == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + try { + m_complete_value = (CDRInputStream) + any.create_input_stream(); + } + catch (ClassCastException cce) { + OutputStream out = m_orb.create_output_stream(); + any.write_value(out); + m_complete_value = (CDRInputStream) out.create_input_stream(); + } + + m_next_value = m_complete_value.copy(); + } + + /** + * Validates and prepares the dyn_any assignment. + * + * @param dyn_any + * the new value + * @throws TypeMismatch + * if the new value TypeCode is not equivalent + */ + protected void preAssign(org.omg.DynamicAny.DynAny dyn_any) + throws TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) { + throw new TypeMismatch(); + } + + // both are the same type. + + reset(); + + // component_count = dyn_any.component_count(); + } + + /** + * Copy the content of the DynComposite instance to other. + * + * @param dyn_any + * the destination DynComposite + */ + protected void copyTo(DynComposite dyn_any) + { + + dyn_any.m_component_count = m_component_count; + + if (m_component_count == 0) { + dyn_any.m_current_index = -1; + return; + } + + if (m_complete_value != null) { + dyn_any.m_complete_value = m_complete_value.copy(); + dyn_any.m_next_value = m_complete_value.copy(); + return; + } + + try { + for (int i = 0; i < m_component_count; i++) + dyn_any.m_components.addElement(getComponent(i).copy()); + + } + catch (TypeMismatch tm) { + throw new INTERNAL("Error with current_component"); + } + } + + /** + * Creates the DynAny at the position, read its value if exists, and insert + * it in the component vector. + */ + protected DynAny getComponent(int position) + throws TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynArray destroyed."); + + if (position == -1) + return null; + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // initialize the component, + + // when the DynAny has been introduced in a any (with to_any() + // operation), + // prevents multihreaded writes (os.write_any() -> dyn_any._write() + // -> + // dyn_any.get_element(i)._write() + + synchronized (this) { + if (position == m_components.size()) { + DynAnyBase dyn_component = null; + + try { + dyn_component = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + getComponentType(position)); + + } + catch (InconsistentTypeCode itc) { + throw new + TypeMismatch("Inconsistent TypeCode of member: " + + position + + " . " + + itc.toString() + + " was thrown"); + } + + dyn_component.setUserDestroy(false); // component + // destruction + + m_components.addElement(dyn_component); + + if (m_next_value != null) { // demarshal the component + dyn_component._read(m_next_value); + } + + if (position == (m_component_count - 1)) { + m_next_value = null; + m_complete_value = null; + } + } + } + + } + + return (DynAny) m_components.elementAt(position); + } + + /** + * Set or creates a new component at position with the given + * value. + */ + protected void setComponent(int position, Any value) + throws TypeMismatch, + InvalidValue + { + try { + if (!getComponentType(position).equivalent(value.type())) + throw new TypeMismatch("Unexpected value type in component " + + position); + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // create the component + DynAny dyn_component = m_factory.create_dyn_any(value); + + m_components.addElement(dyn_component); + } else { + DynAny curr_dyn = (DynAny) + m_components.elementAt(m_current_index); + curr_dyn.from_any(value); + } + + } + catch (InconsistentTypeCode itc) { + throw new TypeMismatch("Inconsistent TypeCode of member: " + + m_current_index + " . " + itc.toString() + + " was thrown"); + } + } + + /** + * Set or creates a new component at position with the given + * value. + */ + protected void setComponent(int position, DynAny value) + throws TypeMismatch + { + + if (!getComponentType(position).equivalent(value.type())) + throw new TypeMismatch("Unexpedted value type in component " + + position); + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // create the component + m_components.addElement(value); + } else { + ((DynAny) m_components.elementAt(position)).destroy(); + m_components.insertElementAt(value, m_current_index); + } + } + + // DynAny operations + + public void from_any(org.omg.CORBA.Any value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + reset(); + + getStreams(value); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + Any new_any = m_orb.create_any(); + + new_any.type(type()); + + org.omg.CORBA.portable.OutputStream output = + new_any.create_output_stream(); + + _write(output); + + return new_any; + } + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws TypeMismatch + { + preAssign(dyn_any); + + if (m_component_count == 0) + return; + + int other_aux_current = m_component_count - 1; + + while (dyn_any.next()) + other_aux_current--; + + dyn_any.rewind(); + + try { + for (int i = 0; i < m_component_count; i++) + setComponent(i, dyn_any.current_component().copy()); + + } + catch (TypeMismatch tm) { + reset(); + dyn_any.seek(other_aux_current); + throw tm; + } + + m_current_index = 0; + + dyn_any.seek(other_aux_current); + + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference"); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (m_component_count != dyn_any.component_count()) + return false; + + if (m_component_count == 0) + return true; + + int aux_current = m_current_index; + + int other_aux_current = m_component_count - 1; + + try { + while (dyn_any.next()) + other_aux_current--; + + dyn_any.rewind(); + + for (int i = 0; i < m_component_count; i++) { + if (!getComponent(i).equal(dyn_any.current_component())) { + dyn_any.seek(other_aux_current); + return false; + } + + dyn_any.next(); + } + } + catch (TypeMismatch tm) { + throw new INTERNAL(tm.toString()); + } + finally { + dyn_any.seek(other_aux_current); + } + + return true; + } + + public org.omg.CORBA.Any[] get_elements() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + Any[] any_array = new Any[m_component_count]; + + if (m_component_count > 0) { + try { + for (int i = 0; i < m_component_count; i++) { + any_array[i] = getComponent(i).to_any(); + } + } + catch (TypeMismatch tm) { + /* unreachable */ + throw new INTERNAL(tm.toString()); + } + + } + + return any_array; + + } + + protected void set_elements(org.omg.CORBA.Any[] value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + reset(); + + if (value.length == 0) + return; + + if (m_component_count != value.length) + throw new + InvalidValue("Value length differs from component number"); + + for (int i = 0; i < m_component_count; i++) { + if (value[i] == null) + throw new BAD_PARAM("null Any array element"); + + setComponent(i, value[i]); + } + } + + protected org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + DynAny[] any_array = new DynAny[m_component_count]; + + if (m_component_count > 0) { + try { + for (int i = 0; i < m_component_count; i++) { + any_array[i] = getComponent(i); + } + } + catch (TypeMismatch tm) { + /* unreachable */ + throw new INTERNAL(tm.toString()); + } + } + + return any_array; + } + + protected void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("Null DynAny[] reference"); + + reset(); + + if (value.length == 0) + return; + + if (m_component_count != value.length) + throw new InvalidValue("Value length differs from members number"); + + for (int i = 0; i < m_component_count; i++) { + if (value[i] == null) + throw new BAD_PARAM("null Any array element"); + + setComponent(i, value[i]); + } + } + + public org.omg.DynamicAny.DynAny current_component() + throws TypeMismatch + { + return getComponent(m_current_index); + } + + public int component_count() + { + return m_component_count; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (index < 0) { + m_current_index = -1; + return false; + } + + if (m_component_count == 0) + return false; + + if (m_component_count <= index) + return false; + + m_current_index = 0; + + for (int i = 0; i < index; i++) { + next(); + } + + return true; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count > 0) + seek(0); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count <= (m_current_index + 1)) + return false; + + // if the current object has not been initialized, do it + + if (m_current_index == m_components.size()) + try { + current_component(); + } + catch (TypeMismatch tm) { + return false; + } + + // leaves the current component ready + m_current_index++; + return true; + } + + public void insert_boolean(boolean value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + current_component().insert_boolean(value); + } + + public void insert_char(char value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + current_component().insert_char(value); + } + + public void insert_wchar(char value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + current_component().insert_wchar(value); + } + + public void insert_octet(byte value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + current_component().insert_octet(value); + } + + public void insert_short(short value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + current_component().insert_short(value); + } + + public void insert_ushort(short value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + current_component().insert_ushort(value); + } + + public void insert_long(int value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + current_component().insert_long(value); + } + + public void insert_ulong(int value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + current_component().insert_ulong(value); + } + + public void insert_longlong(long value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + current_component().insert_longlong(value); + } + + public void insert_ulonglong(long value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + current_component().insert_ulonglong(value); + } + + public void insert_float(float value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + current_component().insert_float(value); + } + + public void insert_double(double value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + current_component().insert_double(value); + } + + public void insert_string(String value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + current_component().insert_string(value); + } + + public void insert_wstring(String value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + current_component().insert_wstring(value); + } + + public void insert_any(org.omg.CORBA.Any value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + current_component().insert_any(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + current_component().insert_dyn_any(value); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + current_component().insert_typecode(value); + } + + public void insert_val(java.io.Serializable value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + current_component().insert_val(value); + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_abstract(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_abstract(value); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + current_component().insert_reference(value); + } + + public boolean get_boolean() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + return current_component().get_boolean(); + } + + public char get_char() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + return current_component().get_char(); + } + + public char get_wchar() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + return current_component().get_wchar(); + } + + public byte get_octet() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + return current_component().get_octet(); + } + + public short get_short() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + return current_component().get_short(); + } + + public short get_ushort() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + return current_component().get_ushort(); + } + + public int get_long() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + return current_component().get_long(); + } + + public int get_ulong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + return current_component().get_ulong(); + } + + public long get_longlong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public long get_ulonglong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public float get_float() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + return current_component().get_float(); + } + + public double get_double() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + return current_component().get_double(); + } + + public String get_string() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + return current_component().get_string(); + } + + public String get_wstring() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + return current_component().get_wstring(); + } + + public org.omg.CORBA.Any get_any() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_any(); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_dyn_any(); + } + + public org.omg.CORBA.TypeCode get_typecode() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + return current_component().get_typecode(); + } + + public java.io.Serializable get_val() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public org.omg.CORBA.Object get_reference() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + return current_component().get_reference(); + } + + // CORBA 2.5 + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_boolean_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_boolean_seq(value); + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_octet_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_octet_seq(value); + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_char_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_char_seq(value); + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_short_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_short_seq(value); + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ushort_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ushort_seq(value); + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_long_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_long_seq(value); + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ulong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ulong_seq(value); + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_float_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_float_seq(value); + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_double_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_double_seq(value); + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_longlong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_longlong_seq(value); + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ulonglong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ulonglong_seq(value); + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_wchar_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_wchar_seq(value); + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_boolean_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_boolean_seq(); + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_octet_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_octet_seq(); + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_char_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_char_seq(); + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_short_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_short_seq(); + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ushort_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ushort_seq(); + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_long_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_long_seq(); + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ulong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ulong_seq(); + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_float_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_float_seq(); + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_double_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_double_seq(); + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_longlong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_longlong_seq(); + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ulonglong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ulonglong_seq(); + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_wchar_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_wchar_seq(); + } + + protected void insert_boolean_members(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_boolean(value[i]); + next(); + } + + rewind(); + } + + protected void insert_octet_members(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_octet(value[i]); + next(); + } + + rewind(); + } + + protected void insert_char_members(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_char(value[i]); + next(); + } + + rewind(); + } + + protected void insert_short_members(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_short(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ushort_members(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ushort(value[i]); + next(); + } + + rewind(); + } + + protected void insert_long_members(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_long(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ulong_members(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ulong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_float_members(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_float(value[i]); + next(); + } + + rewind(); + } + + protected void insert_double_members(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_double(value[i]); + next(); + } + + rewind(); + } + + protected void insert_longlong_members(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_longlong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ulonglong_members(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ulonglong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_wchar_members(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_wchar(value[i]); + next(); + } + + rewind(); + } + + protected boolean[] get_boolean_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + boolean[] value = new boolean[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_boolean(); + } + } + + return value; + } + + protected byte[] get_octet_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + byte[] value = new byte[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_octet(); + } + } + + return value; + } + + protected char[] get_char_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + char[] value = new char[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_char(); + } + } + + return value; + } + + protected short[] get_short_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + short[] value = new short[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_short(); + } + } + + return value; + } + + protected short[] get_ushort_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + short[] value = new short[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ushort(); + } + } + + return value; + } + + protected int[] get_long_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + int[] value = new int[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_long(); + } + } + + return value; + } + + protected int[] get_ulong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + int[] value = new int[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ulong(); + } + } + + return value; + } + + protected float[] get_float_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + float[] value = new float[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_float(); + } + } + + return value; + } + + protected double[] get_double_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + double[] value = new double[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_double(); + } + } + + return value; + } + + protected long[] get_longlong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + long[] value = new long[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_longlong(); + } + } + + return value; + } + + protected long[] get_ulonglong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + long[] value = new long[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ulonglong(); + } + } + + return value; + } + + protected char[] get_wchar_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + char[] value = new char[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_wchar(); + } + } + + return value; + } +} diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynEnumImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynEnumImpl.java.svn-base new file mode 100644 index 0000000..48a9c72 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynEnumImpl.java.svn-base @@ -0,0 +1,320 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * DynEnum implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynEnumImpl extends DynSingleton + implements org.omg.DynamicAny.DynEnum +{ + + int m_enum_value; + + private DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_enum_value = 0; + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value. + * @throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + */ + + protected DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb); + + m_dyn_type = any.type(); + + m_base_type = real_type; + + CDROutputStream out = new CDROutputStream(orb, CDR.ULONG_SIZE); + any.write_value(out); + CDRInputStream in = (CDRInputStream) out.create_input_stream(); + m_enum_value = in.read_ulong(); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + super(factory, orb); + m_dyn_type = type; + m_base_type = real_type; + m_enum_value = 0; + } + + public String get_as_string() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + return m_base_type.member_name(m_enum_value); + } + catch (Bounds bd) { + return null; + } + catch (BadKind bk) { + return null; + } + } + + public void set_as_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + int num_values = m_base_type.member_count(); + + for (int i = 0; i < num_values; i++) { + if (value.equals(type().member_name(i))) { + m_enum_value = i; + return; + } + } + throw new InvalidValue("No member named " + value + "."); + + } + catch (Bounds bd) { /* unreachable */ + } + catch (BadKind bk) { /* unreachable */ + } + } + + public int get_as_ulong() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return m_enum_value; + } + + public void set_as_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + int count = m_base_type.member_count(); + + if ((value < 0) || (value >= count)) + throw new InvalidValue(type().id() + " : value " + value + + " out of range."); + } + catch (BadKind bk) { /* unreachable */ + } + + m_enum_value = value; + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + try { + set_as_ulong(in.read_ulong()); + } + catch (InvalidValue iv) { + throw new MARSHAL(iv.toString()); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_ulong(m_enum_value); + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + if (dyn_any instanceof org.omg.DynamicAny.DynEnum) + m_enum_value = + ((org.omg.DynamicAny.DynEnum) dyn_any).get_as_ulong(); + else + // invalid error + throw new TypeMismatch(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + _write(output); + + // new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof org.omg.DynamicAny.DynEnum) + return (m_enum_value + == ((org.omg.DynamicAny.DynEnum) dyn_any).get_as_ulong()); + else + // invalid error + throw new BAD_PARAM("DynAny does not implements DynEnum when" + + " its type is enum"); + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynEnumImpl new_dyn = new DynEnumImpl(m_factory, m_orb); + new_dyn.m_enum_value = m_enum_value; + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + + return new_dyn; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynEnum:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynExceptImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynExceptImpl.java.svn-base new file mode 100644 index 0000000..6e5d942 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynExceptImpl.java.svn-base @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStruct implementation for exceptions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynExceptImpl extends DynStructImpl +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + protected boolean validateName() + { + try { + return m_next_value.read_string().equals(m_base_type.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + throw new org.omg.CORBA.BAD_TYPECODE(); + } + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_value (for DynValueImpl that + * extends DynStructImpl) + * + * @param type + * the TypeCode value. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.from_any(value); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + super._read(is); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + os.write_string(m_base_type.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + throw new org.omg.CORBA.BAD_TYPECODE(); + } + + super._write(os); + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynExceptImpl new_dyn = new DynExceptImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + if (new_dyn.m_next_value != null) + new_dyn.m_next_value.skipString(); + + return new_dyn; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynFixedImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynFixedImpl.java.svn-base new file mode 100644 index 0000000..301e1c6 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynFixedImpl.java.svn-base @@ -0,0 +1,298 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import java.math.BigDecimal; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.DynamicAny.DynFixed; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.util.FixedHolder; + +/** + * DynFixed implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynFixedImpl extends DynSingleton + implements org.omg.DynamicAny.DynFixed, org.omg.CORBA.portable.Streamable +{ + + BigDecimal fixed_value; + + private DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + fixed_value = new BigDecimal(0.0D); + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value. + */ + + protected DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + InputStream in = any.create_input_stream(); + FixedHolder holder = new FixedHolder(m_base_type); + holder._read(in); + + fixed_value = holder.value; + } + + protected DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + + try { + + fixed_value = BigDecimal.valueOf(0, m_base_type.fixed_scale()); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + } + + // DynFixed operations + + public String get_value() + { + + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return fixed_value.toString(); + } + + public boolean set_value(java.lang.String val) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + if (val == null) + throw new BAD_PARAM("null string value"); + + BigDecimal value = new BigDecimal(val); + try { + if (value.scale() != m_base_type.fixed_scale()) + throw new InvalidValue("Bad fixed scale"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + fixed_value = value; + + return true; + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + FixedHolder holder = new FixedHolder(m_base_type); + holder._read(in); + + fixed_value = holder.value; + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_fixed(fixed_value); + } + + public org.omg.CORBA.TypeCode type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + return m_dyn_type; + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); + + try { + set_value(((DynFixed) dyn_any).get_value()); + } + catch (InvalidValue iv) { + throw new BAD_PARAM("Invalid value"); + } + catch (ClassCastException cce) { + throw new BAD_PARAM("Not a DynFixed value"); + } + + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + _write(output); + //new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof DynFixed) { + return fixed_value.equals( + new BigDecimal(new String(((DynFixed) dyn_any).get_value()))); + } else { // invalid error + throw new BAD_PARAM("dyn_any value does not instantiate DynFixed!" + + " but its type is fixed;"); + } + } + + protected void destroyNow() + { + super.destroyNow(); + fixed_value = null; + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynFixedImpl new_dyn = new DynFixedImpl(m_factory, m_orb); + new_dyn.fixed_value = fixed_value; + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + + return new_dyn; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynFixed:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSequenceImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSequenceImpl.java.svn-base new file mode 100644 index 0000000..5b51255 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSequenceImpl.java.svn-base @@ -0,0 +1,682 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * DynSequence implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynSequenceImpl extends DynComposite + implements org.omg.DynamicAny.DynSequence +{ + + boolean m_bounded; + + int m_bound; + + /** + * Empty Constructor for generate copies. + */ + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets a TypeCode to create a new value. Warning: It assumes + * that the TypeCode is tk_sequence. + * + * @param any + * the any value. + */ + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_bound = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + m_bounded = (m_bound != 0); + m_component_count = 0; + } + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + try { + m_bound = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + m_bounded = (m_bound != 0); + + extract_length(); + } + + protected void extract_length() + { + m_component_count = m_next_value.read_ulong(); + + if(m_component_count > 0) { + m_current_index = 0; + } + + m_next_value.fixStarting(); + if ((m_bound != 0) && (m_component_count > m_bound)) + throw new MARSHAL("Invalid bounded sequence length"); + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynSequenceImpl new_dyn = new DynSequenceImpl(m_factory, m_orb, + m_dyn_type, m_base_type); + + copyTo(new_dyn); + + new_dyn.m_bound = m_bound; + + new_dyn.m_bounded = m_bounded; + + return new_dyn; + } + + // DynSequence Operations + + public int get_length() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return component_count(); + } + + public void set_length(int len) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (len < 0) + throw new InvalidValue("Invalid Sequence length: " + len); + + if (len == m_component_count) + return; + + if (len == 0) { + reset(); + } + + if (m_bounded && (len > m_bound)) { + throw new InvalidValue("Invalid Sequence length (" + len + + "), bound is (" + m_bound + ")"); + } + + m_component_count = len; + + int actual_components = m_components.size(); + + if (len < actual_components) { //destroy excedent + m_complete_value = null; + m_next_value = null; + for (int i = actual_components - 1; i >= len; i--) { + ((DynAny) (m_components.elementAt(i))).destroy(); + m_components.removeElementAt(i); + } + } + } + + public org.omg.CORBA.Any[] get_elements() + { + return super.get_elements(); + } + + public void set_elements(org.omg.CORBA.Any[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + set_length(value.length); + + super.set_elements(value); + } + + public void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + set_length(value.length); + + super.set_elements_as_dyn_any(value); + } + + public org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + return super.get_elements_as_dyn_any(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.from_any(value); + + extract_length(); + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + super._read(is); + + extract_length(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (os == null) + throw new BAD_PARAM("Null OutputStream reference"); + + if (m_complete_value != null) {// value marshaled + CDRInputStream value_copy = m_complete_value.copy(); + value_copy.rewind(); + TypeCodeMarshaler.remarshalValue(m_base_type, value_copy, os); + } else { // value in the dynAny structure + + os.write_long(m_component_count); + + super._write(os); + } + } + + protected TypeCode getComponentType(int position) + { + + try { + return m_base_type.content_type(); + } + catch (BadKind bk) { + /* unreachable */ + throw new org.omg.CORBA.BAD_TYPECODE(); + } + + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + set_length(value.length); + insert_boolean_members(value); + + } else { + set_length(value.length); + super.insert_boolean_seq(value); + } + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + set_length(value.length); + insert_octet_members(value); + } else { + set_length(value.length); + super.insert_octet_seq(value); + } + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + set_length(value.length); + insert_char_members(value); + } else { + set_length(value.length); + super.insert_char_seq(value); + } + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + set_length(value.length); + insert_short_members(value); + } else { + set_length(value.length); + super.insert_short_seq(value); + } + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + set_length(value.length); + insert_ushort_members(value); + } else { + set_length(value.length); + super.insert_ushort_seq(value); + } + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + set_length(value.length); + insert_long_members(value); + } else { + set_length(value.length); + super.insert_long_seq(value); + } + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + set_length(value.length); + insert_ulong_members(value); + } else { + set_length(value.length); + super.insert_ulong_seq(value); + } + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + set_length(value.length); + insert_float_members(value); + } else { + set_length(value.length); + super.insert_float_seq(value); + } + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + set_length(value.length); + insert_double_members(value); + } else { + set_length(value.length); + super.insert_double_seq(value); + } + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + set_length(value.length); + insert_longlong_members(value); + } else { + set_length(value.length); + super.insert_longlong_seq(value); + } + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulonglong)) { + set_length(value.length); + insert_ulonglong_members(value); + } else { + set_length(value.length); + super.insert_ulonglong_seq(value); + } + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + set_length(value.length); + insert_wchar_members(value); + } else { + set_length(value.length); + super.insert_wchar_seq(value); + } + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + return super.get_boolean_members(); + } else { + return super.get_boolean_seq(); + } + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + return super.get_octet_members(); + } else { + return super.get_octet_seq(); + } + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + return super.get_char_members(); + } else { + return super.get_char_seq(); + } + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + return super.get_short_members(); + } else { + return super.get_short_seq(); + } + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + return super.get_ushort_members(); + } else { + return super.get_ushort_seq(); + } + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + return super.get_long_members(); + } else { + return super.get_long_seq(); + } + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + return super.get_ulong_members(); + } else { + return super.get_ulong_seq(); + } + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + return super.get_float_members(); + } else { + return super.get_float_seq(); + } + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + return super.get_double_members(); + } else { + return super.get_double_seq(); + } + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + return super.get_longlong_members(); + } else { + return super.get_longlong_seq(); + } + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + return super.get_wchar_members(); + } else { + return super.get_wchar_seq(); + } + } + + // Object methods + + protected final static String[] __ids = + { "IDL:omg.org/DynamicAny/DynAny:1.0", }; + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier + .equals("IDL:omg.org/DynamicAny/DynSequence:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSingleton.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSingleton.java.svn-base new file mode 100644 index 0000000..3df2794 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynSingleton.java.svn-base @@ -0,0 +1,418 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * Abstract clase that only throws TypeMismatch in insert/get operations. It is + * the base clase for DynEnum or DynFixed + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +abstract class DynSingleton extends DynAnyBase +{ + + protected DynSingleton(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + protected DynSingleton(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return false; + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (byte) 0; + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (char) 0; + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (short) 0; + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (short) 0; + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0; + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0; + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0.0F; + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0.0D; + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return ""; + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0L; + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0L; + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return '0'; + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return ""; + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return -1; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return true; + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("DynAny without components"); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructBase.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructBase.java.svn-base new file mode 100644 index 0000000..6154303 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructBase.java.svn-base @@ -0,0 +1,335 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.NameDynAnyPair; +import org.omg.DynamicAny.NameValuePair; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStructBase implementation. Base for Struct, Exception and ValueType. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class DynStructBase extends DynComposite +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_value (for DynValueImpl that + * extends DynStructBase) + * + * @param type + * the TypeCode value. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public String current_member_name() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("No member (current = -1)"); + + // at this point alwais curremt_member is valid + try { + return m_base_type.member_name(m_current_index); + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + } + + public org.omg.CORBA.TCKind current_member_kind() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("No member (current = -1)"); + + try { + return m_base_type.member_type(m_current_index).kind(); + } + catch (BadKind bk) { + /* unreachable */ + throw new TypeMismatch(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new TypeMismatch(bd.toString()); + } + + } + + public org.omg.DynamicAny.NameValuePair[] get_members() + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + + Any[] any_members = super.get_elements(); + + NameValuePair[] members = new NameValuePair[m_component_count]; + + for (int i = 0; i < m_component_count; i++) { + + members[i] = new NameValuePair(m_base_type.member_name(i), + any_members[i]); + } + + return members; + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } + + public void set_members(org.omg.DynamicAny.NameValuePair[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + try { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + reset(); + + if (value.length != m_component_count) + throw new TypeMismatch("Invalid number of members: " + + m_component_count + " expected, not " + + value.length); + + Any[] members_values = new Any[m_component_count]; + + for (int i = 0; i < m_component_count; i++) { + members_values[i] = value[i].value; + if (!m_base_type.member_name(i).equals(value[i].id)) + throw new InvalidValue("Invalid member name, " + + m_base_type.member_name(i) + + "expected, not " + value[i].id); + } + + set_elements(members_values); + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } + + public org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + + DynAny[] dyns = super.get_elements_as_dyn_any(); + + NameDynAnyPair[] members = new NameDynAnyPair[m_component_count]; + + for (int i = 0; i < m_component_count; i++) + members[i] = new NameDynAnyPair(m_base_type.member_name(i), + dyns[i]); + + return members; + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + } + + public void + set_members_as_dyn_any(org.omg.DynamicAny.NameDynAnyPair[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value.length != m_component_count) + throw new TypeMismatch("Invalid number of members: " + + m_component_count + " expected, not " + + value.length); + + DynAny[] members_values = new DynAny[m_component_count]; + + try { + for (int i = 0; i < m_component_count; i++) { + members_values[i] = value[i].value; + if (!m_base_type.member_name(i).equals(value[i].id)) + throw new InvalidValue("Invalid member name, " + + m_base_type.member_name(i) + + "expected, not " + value[i].id); + } + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + set_elements_as_dyn_any(members_values); + } + + protected TypeCode getComponentType(int position) + { + try { + return m_base_type.member_type(position); + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructImpl.java.svn-base new file mode 100644 index 0000000..3f1435c --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynStructImpl.java.svn-base @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStruct implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynStructImpl extends DynStructBase + implements org.omg.DynamicAny.DynStruct +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_exception + * + * @param type + * the TypeCode value. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynStructImpl new_dyn = new DynStructImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynStruct:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynUnionImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynUnionImpl.java.svn-base new file mode 100644 index 0000000..d13da08 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynUnionImpl.java.svn-base @@ -0,0 +1,1566 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.Streamable; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynUnion; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.util.EnumHolder; + +/** + * The DynUnion interface represents a DynAny + * object that is associated with an IDL union. Union values can be traversed + * using the operations defined in DynAny. The first component + * in the union corresponds to the discriminator; the second corresponds to the + * actual value of the union. Calling the method next() twice + * allows you to access both components. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynUnionImpl extends DynAnyBase + implements org.omg.DynamicAny.DynUnion +{ + /** + * Active member. + */ + DynAnyBase m_active_member; + + /** + * Active discriminator. + */ + DynAnyBase m_dyn_discriminator; + + /** + * Member index in the union TypeCode. + */ + int m_active_member_index; + + /** + * Current Component. + */ + int m_current_index; + + /** + * Component Count. + */ + int m_component_count; + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_current_index = -1; + m_component_count = 1; + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + m_component_count = 2; + + InputStream in = any.create_input_stream(); + + _read(in); + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. + * + * @param type + * the UnionTypeCode value. + */ + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + + try { + m_active_member_index = m_base_type.default_index(); + if (m_active_member_index > -1) + m_component_count = 2; + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + DynUnionImpl new_dyn = new DynUnionImpl(m_factory, m_orb); + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + new_dyn.m_active_member_index = m_active_member_index; + new_dyn.m_component_count = m_component_count; + + if (m_component_count == 2) { + if (m_active_member != null) { + new_dyn.m_active_member = (DynAnyBase) m_active_member.copy(); + } + if (m_dyn_discriminator != null) { + new_dyn.m_dyn_discriminator = + (DynAnyBase) m_dyn_discriminator.copy(); + } + } + + return new_dyn; + } + + // DynUnion operations + public org.omg.DynamicAny.DynAny get_discriminator() + // CORBA 2.6: throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + // throw new InvalidValue("No active member."); + throw new BAD_OPERATION("No active member."); + + if (m_dyn_discriminator == null) { // default discriminator search + + Any discriminator = m_orb.create_any(); + int i = 0; + do { // search a value that will be not at the case labels + setDiscriminatorValue(discriminator, ++i); + } while (UnionTypeCode.searchMemberIndex(m_base_type, discriminator) + != m_active_member_index); + + try { + m_dyn_discriminator = (DynAnyBase) + m_factory.create_dyn_any(discriminator); + } + catch (InconsistentTypeCode itc) {/* unreachable */ + return null; + } + + } + + return m_dyn_discriminator; + } + + public void set_discriminator(org.omg.DynamicAny.DynAny d) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + int index = UnionTypeCode.searchMemberIndex(m_base_type, d.to_any()); + + if (index < 0) + throw new TypeMismatch("DynUnion: Invalid label value " + index); + + setIndex(index, d); + } + + protected void setIndex(int index, DynAny discriminator) + { + if (m_active_member_index == index) { + if ((m_dyn_discriminator == null) && (discriminator != null)) + m_dyn_discriminator = (DynAnyBase) discriminator.copy(); + return; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + + if (discriminator != null) + m_dyn_discriminator = (DynAnyBase) discriminator.copy(); + + m_current_index = 0; + m_component_count = 2; + m_active_member_index = index; + + try { + if ((m_active_member != null) + && (!m_active_member.type() + .equivalent(m_base_type.member_type(m_active_member_index)))) { + m_active_member.destroy(); + m_active_member = null; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + } + + public void set_to_default_member() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + // set member idex to defalut index + + int index = m_base_type.default_index(); + if (index < 0) + throw new TypeMismatch("Union without default case or all " + + " posible discriminator values used."); + + setIndex(index, null); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + } + + public void set_to_no_active_member() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + if (m_base_type.default_index() > -1) + throw new TypeMismatch("Union has default case"); + + // are all the discriminator values uses + + if (allCasesUsed()) + throw new + TypeMismatch("All posible discriminator cases used in union."); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + if (m_active_member != null) { + m_active_member.destroy(); + m_active_member = null; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + + m_active_member_index = -1; + m_component_count = 1; + } + + public boolean has_no_active_member() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return m_component_count < 2; + } + + public org.omg.CORBA.TCKind discriminator_kind() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + return m_base_type.discriminator_type().kind(); + } + catch (BadKind bk) {/* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + + } + + public org.omg.DynamicAny.DynAny member() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + if (m_active_member == null) { + try { + m_active_member = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + m_base_type.member_type(m_active_member_index)); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode bk) { /* unreachable */} + } + + return m_active_member; + } + + public String member_name() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + try { + return m_base_type.member_name(m_active_member_index); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + } + + public void member_name(String arg) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + try { + + int member_count = m_base_type.member_count(); + + for (int i = 0; i < member_count; i++) { + if (arg.equals(m_base_type.member_name(i))) { + DynAnyBase dyn_disc = (DynAnyBase) + m_factory.create_dyn_any(m_base_type.member_label(i)); + setIndex(i, dyn_disc); + + return; + } + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode itc) {/* unreachable */ + return; + } + + throw new InvalidValue("Union has not any member named: " + arg); + } + + public org.omg.CORBA.TCKind member_kind() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_active_member_index < 1) + throw new InvalidValue("No member selected."); + + try { + return m_base_type.member_type(m_active_member_index).kind(); + } + catch (BadKind bk) { /* unreachable */ + return null; + } + catch (Bounds bd) { /* unreachable */ + return null; + } + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + return null; + + try { + switch (m_current_index) + { + case 0: + return get_discriminator(); + case 1: + return member(); + } + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + + throw new INTERNAL("Current out of range"); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + Any discriminator_any = m_orb.create_any(); + + try { + discriminator_any.read_value(in, m_base_type.discriminator_type()); + + m_active_member_index = + UnionTypeCode.searchMemberIndex(m_base_type, discriminator_any); + + if (m_active_member_index < 0) + throw new BAD_PARAM("Invalid Union label: " + + m_active_member_index); + + m_dyn_discriminator = (DynAnyBase) + m_factory.create_dyn_any(discriminator_any); + + m_dyn_discriminator.setUserDestroy(false); + + m_active_member = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + m_base_type.member_type(m_active_member_index)); + + m_active_member.setUserDestroy(false); + + ((Streamable) m_active_member)._read(in); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode bk) { /* unreachable */ + } + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_component_count == 1) + throw new BAD_OPERATION("Uncompleted union."); + + try { + ((Streamable) get_discriminator())._write(out); + ((Streamable) member())._write(out); + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + if (dyn_any instanceof DynUnion) { + try { + DynUnion dyn_union = (DynUnion) dyn_any; + if (dyn_union.has_no_active_member()) { + set_to_no_active_member(); + } else { + set_discriminator(dyn_union.get_discriminator()); + member().assign(dyn_union.member()); + } + } + catch (InvalidValue iv) {} + } else + // invalid error + throw new TypeMismatch(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + + _write(output); + + //new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof DynUnion) { + try { + DynUnion dyn_union = (DynUnion) dyn_any; + + if (!get_discriminator().equal(dyn_union.get_discriminator())) + return false; + + return member().equal(dyn_union.member()); + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + + } else + // invalid error + throw new BAD_PARAM("dyn_any value does not instantiate DynUnion" + + " but its type is union"); + } + + protected void destroyNow() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_active_member != null) { + m_active_member.destroy(); + m_active_member = null; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + } + + protected boolean allCasesUsed() + throws TypeMismatch + { + TypeCode disc_type = null; + int member_count; + try { + disc_type = m_base_type.discriminator_type(); + + while (disc_type.kind().value() == TCKind._tk_alias) + disc_type = disc_type.content_type(); + + member_count = m_base_type.member_count(); + + switch (disc_type.kind().value()) + { + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_longlong: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_char: + return false; + case TCKind._tk_boolean: + return member_count <= 2; + case TCKind._tk_enum: + return disc_type.member_count() <= member_count; + } + } + catch (BadKind bk) { + throw new INTERNAL(bk.toString()); + } + + throw new TypeMismatch("Invalid discriminator Value"); + } + + protected void setDiscriminatorValue(org.omg.CORBA.Any discriminator, + int value) + { + switch (discriminator.type().kind().value()) + { + case TCKind._tk_short: + discriminator.insert_short((short) value); + break; + case TCKind._tk_long: + discriminator.insert_long(value); + break; + case TCKind._tk_longlong: + discriminator.insert_longlong(value); + break; + case TCKind._tk_ushort: + discriminator.insert_ushort((short) value); + break; + case TCKind._tk_ulong: + discriminator.insert_ulong(value); + break; + case TCKind._tk_ulonglong: + discriminator.insert_ulonglong(value); + break; + case TCKind._tk_boolean: + discriminator.insert_boolean((value == 0) ? false : true); + break; + case TCKind._tk_char: + discriminator.insert_char((char) value); + break; + case TCKind._tk_wchar: + discriminator.insert_wchar((char) value); + break; + case TCKind._tk_enum: + try { + discriminator.insert_Streamable( + new EnumHolder((EnumTypeCode) + m_base_type.discriminator_type(), + value)); + } + catch (BadKind bk) {} + break; + + } + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynUnion:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_boolean(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_boolean(value); + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_char(value); + + set_discriminator(new_disc); + + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_char(value); + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_char(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_wchar(value); + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + else + current_component().insert_octet(value); + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_short(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_short(value); + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_ushort(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ushort(value); + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_long(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_long(value); + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component() .type()); + + new_disc.insert_ulong(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ulong(value); + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_longlong(value); + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_longlong(value); + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type() + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_ulonglong(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ulonglong(value); + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + if (m_current_index == 0) + throw new TypeMismatch(); + else + current_component().insert_float(value); + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + else + current_component().insert_double(value); + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + if (m_current_index == 0) + throw new TypeMismatch(); + if (!current_component().type().equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + else + current_component().insert_string(value); + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + else + current_component().insert_wstring(value); + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + else + current_component().insert_any(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + else + current_component().insert_dyn_any(value); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + else + current_component().insert_typecode(value); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + current_component().insert_val(value); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + else + current_component().insert_reference(value); + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + return current_component().get_boolean(); + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + return current_component().get_char(); + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + return current_component().get_wchar(); + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + return current_component().get_octet(); + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + return current_component().get_short(); + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + return current_component().get_ushort(); + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + return current_component().get_long(); + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + return current_component().get_ulong(); + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type() + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + return current_component().get_float(); + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + return current_component().get_double(); + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + return current_component().get_string(); + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + return current_component().get_wstring(); + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_any(); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_dyn_any(); + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + return current_component().get_typecode(); + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + return current_component().get_reference(); + } + + // DynAny without components methods + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + +// return 0; + return m_component_count; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index == -1) + return false; + + if (index < component_count()) { + m_current_index = index; + return true; + } else + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index != -1) + m_current_index = 0; + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index == -1) + return false; + + if (m_current_index < component_count() - 1) { + m_current_index++; + return true; + } else + return false; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynValueImpl.java.svn-base b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynValueImpl.java.svn-base new file mode 100644 index 0000000..2407cac --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/.svn/text-base/DynValueImpl.java.svn-base @@ -0,0 +1,175 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynValue implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynValueImpl extends DynStructBase + implements org.omg.DynamicAny.DynValue +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an value TypeCode. + * + * @param any + * the any value. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_value + * + * @param type + * the TypeCode value. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynValueImpl new_dyn = new DynValueImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynValue:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + // DynValueCommon methods + + public boolean is_null() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_to_null() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_to_value() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynAnyBase.java b/source/es/tid/TIDorbj/dynAny/DynAnyBase.java new file mode 100644 index 0000000..5653999 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynAnyBase.java @@ -0,0 +1,433 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * Base clase for all DynAny implementation classes. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ +abstract class DynAnyBase extends es.tid.TIDorbj.core.PseudoObject + implements org.omg.DynamicAny.DynAny, org.omg.CORBA.portable.Streamable +{ + + /** + * The active ORB. + */ + + TIDORB m_orb; + + /** + * The active DynAny factory. + */ + DynAnyFactoryImpl m_factory; + + /** + * The DynAny typecode. It maybe different from the base_type + * typecode, if it is a alias typecode. + */ + + TypeCode m_dyn_type; + + /** + * The "real" DynAny typecode base type. + */ + + TypeCode m_base_type; + + /** + * If true the DynAny can be destroyed by the user. + * Otherwise, it only will be destroyed by the container DynAny that created + * it. + *

+ * Default value: true (user can destroy it). + */ + + boolean m_user_destroy; + + protected DynAnyBase(DynAnyFactoryImpl factory, TIDORB orb) + { + m_factory = factory; + m_orb = orb; + m_destroyed = false; + m_user_destroy = true; + m_dyn_type = null; + m_base_type = null; + } + + protected DynAnyBase(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + this.m_factory = factory; + this.m_orb = orb; + m_destroyed = false; + m_user_destroy = true; + m_dyn_type = type; + m_base_type = real_type; + } + + public void destroy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_user_destroy) { + destroyNow(); + } + } + + protected void destroyNow() + { + m_destroyed = true; + m_dyn_type = null; + m_base_type = null; + m_factory = null; + m_orb = null; + } + + protected void setUserDestroy(boolean value) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + m_user_destroy = value; + } + + // DynAny operations + + public org.omg.CORBA.TypeCode type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + return m_dyn_type; + } + + // DynAny without components methods + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return 0; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + // no components + + return false; + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + typeMismatch(); + return null; + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + // Streamable operations + + public org.omg.CORBA.TypeCode _type() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return type(); + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynAny:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + // Implementation + + protected void typeMismatch() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.java b/source/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.java new file mode 100644 index 0000000..7e09ff2 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynAnyFactoryImpl.java @@ -0,0 +1,410 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.DynamicAny.DynAnyFactoryLocalBase; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynAnyFactory implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyFactoryImpl extends DynAnyFactoryLocalBase +{ + + private boolean m_destroyed; + + private TIDORB m_orb; + + public DynAnyFactoryImpl() + { + m_destroyed = false; + } + + public void set_orb(org.omg.CORBA.ORB orb) + { + m_orb = (TIDORB) orb; + } + + public synchronized void destroy() + { + m_orb = null; + m_destroyed = true; + } + + public synchronized org.omg.DynamicAny.DynAny + create_dyn_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (value == null) + throw new BAD_PARAM("Null any reference"); + + switch (value.type().kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, value, value.type()); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, value, value.type()); + case TCKind._tk_alias: + return createAliasDynAny(value); + + // complex typecodes + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, value, value.type()); + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, value, value.type()); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, value, value.type()); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, value, value.type()); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, value, value.type()); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, value, value.type()); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, value, value.type()); + + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, value, value.type()); + + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + protected org.omg.DynamicAny.DynAny + createAliasDynAny(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (value == null) + throw new BAD_PARAM("Null any reference"); + + TypeCode base_type = null; + + try { + base_type = value.type().content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + switch (base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, value, base_type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, value, base_type); + // complex typecodes + + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, value, base_type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, value, base_type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, value, base_type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, value, base_type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, value, base_type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, value, base_type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, value, base_type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, value, base_type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public synchronized org.omg.DynamicAny.DynAny + create_dyn_any_from_type_code(org.omg.CORBA.TypeCode type) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (type == null) + throw new BAD_PARAM("Null TypeCode reference"); + + switch (type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, type, type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, type, type); + case TCKind._tk_alias: + return createAliasDynAnyFromTypeCode(type); + // complex typecodes + + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, type, type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, type, type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, type, type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, type, type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, type, type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, type, type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, type, type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, type, type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public org.omg.DynamicAny.DynAny + createAliasDynAnyFromTypeCode(org.omg.CORBA.TypeCode type) + throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + { + if (type == null) + throw new BAD_TYPECODE("Null TypeCode reference"); + + TypeCode base_type = null; + + try { + base_type = type.content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + switch (base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return new DynAnyImpl(this, m_orb, type, base_type); + case TCKind._tk_any: + return new DynAnyWithAny(this, m_orb, type, base_type); + // complex typecodes + case TCKind._tk_struct: + return new DynStructImpl(this, m_orb, type, base_type); + case TCKind._tk_sequence: + return new DynSequenceImpl(this, m_orb, type, base_type); + case TCKind._tk_enum: + return new DynEnumImpl(this, m_orb, type, base_type); + case TCKind._tk_except: + return new DynExceptImpl(this, m_orb, type, base_type); + case TCKind._tk_array: + return new DynArrayImpl(this, m_orb, type, base_type); + case TCKind._tk_union: + return new DynUnionImpl(this, m_orb, type, base_type); + case TCKind._tk_fixed: + return new DynFixedImpl(this, m_orb, type, base_type); + case TCKind._tk_value: + return new DynValueImpl(this, m_orb, type, base_type); + case TCKind._tk_longdouble: + throw new org.omg.CORBA.NO_IMPLEMENT(); + default: + throw new InconsistentTypeCode("Bad TypeCode"); + } + } + + public static boolean isBasic(org.omg.CORBA.TypeCode type) + { + if (type == null) + throw new BAD_PARAM("Null type reference"); + + switch (type.kind().value()) + { + // basic typecodes + case TCKind._tk_null: + case TCKind._tk_any: + case TCKind._tk_objref: + case TCKind._tk_TypeCode: + case TCKind._tk_void: + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_float: + case TCKind._tk_double: + case TCKind._tk_boolean: + case TCKind._tk_char: + case TCKind._tk_octet: + case TCKind._tk_longlong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_string: + case TCKind._tk_wstring: + return true; + case TCKind._tk_alias: + return aliasWithBasicTC(type); + default: + return false; + } + } + + protected static boolean aliasWithBasicTC(org.omg.CORBA.TypeCode type) + { + if (type == null) + throw new BAD_PARAM("Null any reference"); + + TypeCode base_type = null; + + try { + base_type = type.content_type(); + + while (base_type.kind().value() == TCKind._tk_alias) { + base_type = base_type.content_type(); + } + } + catch (BadKind bk) { + throw new + BAD_TYPECODE("Alias typecode fault in content_type() method:" + + bk.toString()); + } + + return isBasic(base_type); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynAnyImpl.java b/source/es/tid/TIDorbj/dynAny/DynAnyImpl.java new file mode 100644 index 0000000..470808f --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynAnyImpl.java @@ -0,0 +1,1180 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 18 $ +* Date: $Date: 2006-05-26 10:56:46 +0200 (Fri, 26 May 2006) $ +* Last modified by: $Author: scheca $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.util.StringHolder; +import es.tid.TIDorbj.core.util.WStringHolder; + +/** + * DynAny implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyImpl extends DynAnyBase +{ + /** + * Primitive type value. + */ + + AnyImpl m_dyn_value; + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_dyn_value = null; + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value, assumes that the TypeCode is Basic. + */ + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + initValue(any); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynAnyImpl(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + super(factory, orb, type, real_type); + + initValue(); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + m_dyn_value.read_value(in, m_base_type); + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + m_dyn_value.write_value(out); + } + + // DynAny operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + try { + switch (m_base_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + m_dyn_value.type(m_base_type); + return; + case TCKind._tk_objref: + m_dyn_value.insert_Object(dyn_any.get_reference()); + return; + case TCKind._tk_TypeCode: + m_dyn_value.insert_TypeCode(dyn_any.get_typecode()); + return; + case TCKind._tk_short: + m_dyn_value.insert_short(dyn_any.get_short()); + return; + case TCKind._tk_long: + m_dyn_value.insert_long(dyn_any.get_long()); + return; + case TCKind._tk_ushort: + m_dyn_value.insert_ushort(dyn_any.get_ushort()); + return; + case TCKind._tk_ulong: + m_dyn_value.insert_ulong(dyn_any.get_ulong()); + return; + case TCKind._tk_float: + m_dyn_value.insert_float(dyn_any.get_float()); + return; + case TCKind._tk_double: + m_dyn_value.insert_double(dyn_any.get_double()); + return; + case TCKind._tk_boolean: + m_dyn_value.insert_boolean(dyn_any.get_boolean()); + return; + case TCKind._tk_char: + m_dyn_value.insert_char(dyn_any.get_char()); + return; + case TCKind._tk_octet: + m_dyn_value.insert_octet(dyn_any.get_octet()); + return; + case TCKind._tk_longlong: + m_dyn_value.insert_longlong(dyn_any.get_longlong()); + return; + case TCKind._tk_ulonglong: + m_dyn_value.insert_ulonglong(dyn_any.get_ulonglong()); + return; + case TCKind._tk_wchar: + m_dyn_value.insert_wchar(dyn_any.get_wchar()); + return; + case TCKind._tk_string: + m_dyn_value.insert_string(dyn_any.get_string()); + return; + case TCKind._tk_wstring: + m_dyn_value.insert_string(dyn_any.get_string()); + return; + + } + } + catch (InvalidValue iv) { + throw new BAD_PARAM(iv.toString()); + } + + // set the any type to the "dyn_type" + m_dyn_value.setEquivalentType(m_base_type); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_dyn_type.equivalent(value.type())) + throw new TypeMismatch(); + + initValue(value); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + + AnyImpl.assign(m_dyn_value, new_value); + + new_value.setEquivalentType(m_dyn_type); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + try { + switch (m_base_type.kind().value()) + { + case TCKind._tk_null: + case TCKind._tk_void: + return true; + case TCKind._tk_objref: + return m_dyn_value.extract_Object() + ._is_equivalent(dyn_any.get_reference()); + case TCKind._tk_TypeCode: + return m_dyn_value.extract_TypeCode() + .equal(dyn_any.get_typecode()); + case TCKind._tk_short: + return m_dyn_value.extract_short() == dyn_any.get_short(); + case TCKind._tk_long: + return m_dyn_value.extract_long() == dyn_any.get_long(); + case TCKind._tk_ushort: + return m_dyn_value.extract_ushort() == dyn_any.get_ushort(); + case TCKind._tk_ulong: + return m_dyn_value.extract_ulong() == dyn_any.get_ulong(); + case TCKind._tk_float: + return m_dyn_value.extract_float() == dyn_any.get_float(); + case TCKind._tk_double: + return m_dyn_value.extract_double() == dyn_any.get_double(); + case TCKind._tk_boolean: + return m_dyn_value.extract_boolean() + == dyn_any.get_boolean(); + case TCKind._tk_char: + return m_dyn_value.extract_char() == dyn_any.get_char(); + case TCKind._tk_octet: + return m_dyn_value.extract_octet() == dyn_any.get_octet(); + case TCKind._tk_longlong: + return m_dyn_value.extract_longlong() + == dyn_any.get_longlong(); + case TCKind._tk_ulonglong: + return m_dyn_value.extract_ulonglong() + == dyn_any.get_ulonglong(); + case TCKind._tk_wchar: + return m_dyn_value.extract_wchar() == dyn_any.get_wchar(); + case TCKind._tk_string: + return m_dyn_value.extract_string() == dyn_any.get_string(); + case TCKind._tk_wstring: + return m_dyn_value.extract_string() == dyn_any.get_string(); + } + } + catch (InvalidValue iv) { + throw new BAD_PARAM(iv.toString()); + } + catch (TypeMismatch tm) { + throw new INTERNAL(tm.toString()); + } + throw new INTERNAL("DynAnyImpl with no basic TypeCode"); + + } + + protected void destroyNow() + { + super.destroyNow(); + m_dyn_value = null; + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynAnyImpl new_dyn = new DynAnyImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + try { + new_dyn.assign(this); + } + catch (TypeMismatch tm) {} + + return new_dyn; + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_dyn_value.type().kind().value() != TCKind._tk_boolean) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_boolean(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_octet) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_octet(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_char) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_char(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_short) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_short(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ushort) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ushort(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_long) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_long(value); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ulong(value); + } + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_float) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_float(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_double) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_double(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_string) + throw new TypeMismatch("Unexpected type"); + + try { + if (m_base_type.length() == 0) { // unboundled string + m_dyn_value.insert_string(value); + return; + } + if (value.length() > m_base_type.length()) + throw new BAD_PARAM("String out of bounds.", + 0, + CompletionStatus.COMPLETED_NO); + m_dyn_value.insert_Streamable(new StringHolder(m_base_type, value)); + + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + catch (org.omg.CORBA.BAD_OPERATION bo) { + throw new InvalidValue(); + } + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null string reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_wstring) + throw new TypeMismatch("Unexpected type"); + + try { + if (m_base_type.length() == 0) { // unboundled string + m_dyn_value.insert_wstring(value); + return; + } + if (value.length() > (m_base_type.length() / CDR.WCHAR_SIZE)) + throw new BAD_PARAM("WString out of bounds.", 0, + CompletionStatus.COMPLETED_NO); + m_dyn_value.insert_Streamable( + new WStringHolder(m_base_type, value)); + + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) {} + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_objref) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_Object(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null TypeCode reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_TypeCode) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_TypeCode(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_longlong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_longlong(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulonglong) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_ulonglong(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_wchar) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_wchar(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_value) + throw new TypeMismatch("Unexpected type"); + + try { + m_dyn_value.insert_Value(value); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_boolean) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_boolean(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_octet) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_octet(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_char) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_char(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_short) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_short(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ushort) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ushort(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_long) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_long(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ulong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_float) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_float(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_double) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_double(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_string) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_string(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_objref) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_Object(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_TypeCode) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_TypeCode(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_longlong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_longlong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_ulonglong) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_ulonglong(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_wchar) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_wchar(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_base_type.kind().value() != TCKind._tk_wstring) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_wstring(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(); + } + + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("Unexpected type"); + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_value) + throw new TypeMismatch("Unexpected type"); + + try { + return m_dyn_value.extract_Value(); + } + catch (BAD_OPERATION bo) { + throw new InvalidValue(bo.toString()); + } + } + + /** + * Initialize the content value with the any value. + * + * @param any + * the value + */ + + protected void initValue(Any any) + { + if (m_dyn_value == null) + m_dyn_value = (AnyImpl) m_orb.create_any(); + + if (m_dyn_type.kind().value() == TCKind._tk_alias) { + + m_dyn_value.read_value(any.create_input_stream(), m_base_type); + + } else { + AnyImpl.assign(any, m_dyn_value); + m_dyn_value.setEquivalentType(m_base_type); + } + } + + /** + * Initialize the content value with the default value of the type. + */ + + protected void initValue() + { + if (m_dyn_value == null) + m_dyn_value = (AnyImpl) m_orb.create_any(); + + switch (m_base_type.kind().value()) + { + // basic typecodes + case TCKind._tk_short: + m_dyn_value.insert_short((short) 0); + return; + case TCKind._tk_long: + m_dyn_value.insert_long(0); + return; + case TCKind._tk_ushort: + m_dyn_value.insert_ushort((short) 0); + return; + case TCKind._tk_ulong: + m_dyn_value.insert_ulong(0); + return; + case TCKind._tk_float: + m_dyn_value.insert_float(0.0F); + return; + case TCKind._tk_double: + m_dyn_value.insert_double(0.0D); + return; + case TCKind._tk_boolean: + m_dyn_value.insert_boolean(false); + return; + case TCKind._tk_char: + m_dyn_value.insert_char((char) 0); + return; + case TCKind._tk_octet: + m_dyn_value.insert_octet((byte) 0); + return; + case TCKind._tk_longlong: + m_dyn_value.insert_longlong(0L); + return; + case TCKind._tk_ulonglong: + m_dyn_value.insert_ulonglong(0L); + return; + case TCKind._tk_wchar: + m_dyn_value.insert_wchar((char) 0); + return; + case TCKind._tk_string: + m_dyn_value.insert_string(""); + return; + case TCKind._tk_wstring: + m_dyn_value.insert_wstring(""); + return; + case TCKind._tk_objref: + m_dyn_value.insert_Object(null); + return; + case TCKind._tk_TypeCode: + m_dyn_value.insert_TypeCode( + m_orb.get_primitive_tc(TCKind.tk_null)); + return; + default: + throw new INTERNAL("TypeCode not expected"); + } + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynAnyWithAny.java b/source/es/tid/TIDorbj/dynAny/DynAnyWithAny.java new file mode 100644 index 0000000..f3ee423 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynAnyWithAny.java @@ -0,0 +1,305 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynAny implementation that contains an any with an inner any. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynAnyWithAny extends DynSingleton +{ + + // contained any as a DynAny + + DynAnyBase m_any_value; + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + initValue(); + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value, assumes that the TypeCode is Basic. + */ + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + initValue(any.extract_any()); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynAnyWithAny(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + initValue(); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + initValue(in.read_any()); + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_TypeCode(m_any_value.type()); + m_any_value._write(out); + } + + // DynAny operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + try { + initValue(dyn_any.get_any()); + } + catch (InvalidValue invalidValue) {} + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_dyn_type.equivalent(value.type())) + throw new TypeMismatch(); + + initValue(value.extract_any()); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + + new_value.insert_any(m_any_value.to_any()); + + new_value.setEquivalentType(m_dyn_type); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + try { + return m_any_value.equal(dyn_any.get_dyn_any()); + } + catch (TypeMismatch typeMismatch) {} + catch (InvalidValue invalidValue) {} + + return false; + } + + protected void destroyNow() + { + super.destroyNow(); + if (m_any_value != null) { + m_any_value.destroyNow(); + m_any_value = null; + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynAnyWithAny new_dyn = new DynAnyWithAny(m_factory, m_orb, m_dyn_type, + m_base_type); + + try { + new_dyn.assign(this); + } + catch (TypeMismatch tm) {} + + return new_dyn; + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + initValue(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + initValue(value.to_any()); + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return m_any_value.to_any(); + } + + public synchronized org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_base_type.kind().value() != TCKind._tk_any) + throw new TypeMismatch("Unexpected type"); + + return m_any_value; + } + + /** + * Initialize the content value with the default value of the type. + */ + + protected void initValue() + { + AnyImpl val = (AnyImpl) m_orb.create_any(); + initValue(val); + } + + protected void initValue(Any any) + { + if (m_any_value != null) { + m_any_value.destroyNow(); + } + + try { + + m_any_value = (DynAnyBase) m_factory.create_dyn_any(any); + m_any_value.setUserDestroy(false); + + } + catch (InconsistentTypeCode inconsistentTypeCode) {} + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynArrayImpl.java b/source/es/tid/TIDorbj/dynAny/DynArrayImpl.java new file mode 100644 index 0000000..951f67c --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynArrayImpl.java @@ -0,0 +1,565 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * DynArray implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynArrayImpl extends DynComposite + implements org.omg.DynamicAny.DynArray +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an array TypeCode. + * + * @param any + * the any value. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + try { + m_component_count = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_array. + * + * @param any + * the any value. + */ + + protected DynArrayImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynArrayImpl new_dyn = new DynArrayImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + protected TypeCode getComponentType(int position) + { + + try { + return m_base_type.content_type(); + } + catch (BadKind bk) { + /* unreachable */ + throw new org.omg.CORBA.INTERNAL(); + } + + } + + // CORBA 2.5 + + // DynArray Operations + + public org.omg.CORBA.Any[] get_elements() + { + return super.get_elements(); + } + + public void set_elements(org.omg.CORBA.Any[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.set_elements(value); + } + + public org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + return super.get_elements_as_dyn_any(); + } + + public void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.set_elements_as_dyn_any(value); + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + insert_boolean_members(value); + + } else { + super.insert_boolean_seq(value); + } + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + insert_octet_members(value); + + } else { + super.insert_octet_seq(value); + } + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + insert_char_members(value); + + } else { + super.insert_char_seq(value); + } + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + insert_short_members(value); + + } else { + super.insert_short_seq(value); + } + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + insert_ushort_members(value); + + } else { + super.insert_ushort_seq(value); + } + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + insert_long_members(value); + + } else { + super.insert_long_seq(value); + } + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + insert_ulong_members(value); + + } else { + super.insert_ulong_seq(value); + } + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + insert_float_members(value); + + } else { + super.insert_float_seq(value); + } + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + insert_double_members(value); + + } else { + super.insert_double_seq(value); + } + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + insert_longlong_members(value); + + } else { + super.insert_longlong_seq(value); + } + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulonglong)) { + insert_ulonglong_members(value); + + } else { + super.insert_ulonglong_seq(value); + } + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + insert_wchar_members(value); + + } else { + super.insert_wchar_seq(value); + } + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + return super.get_boolean_members(); + } else { + return super.get_boolean_seq(); + } + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + return super.get_octet_members(); + } else { + return super.get_octet_seq(); + } + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + return super.get_char_members(); + } else { + return super.get_char_seq(); + } + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + return super.get_short_members(); + } else { + return super.get_short_seq(); + } + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + return super.get_ushort_members(); + } else { + return super.get_ushort_seq(); + } + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + return super.get_long_members(); + } else { + return super.get_long_seq(); + } + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + return super.get_ulong_members(); + } else { + return super.get_ulong_seq(); + } + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + return super.get_float_members(); + } else { + return super.get_float_seq(); + } + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + return super.get_double_members(); + } else { + return super.get_double_seq(); + } + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + return super.get_longlong_members(); + } else { + return super.get_longlong_seq(); + } + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + return super.get_wchar_members(); + } else { + return super.get_wchar_seq(); + } + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynArray:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynComposite.java b/source/es/tid/TIDorbj/dynAny/DynComposite.java new file mode 100644 index 0000000..3cd9af3 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynComposite.java @@ -0,0 +1,2233 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import java.util.Vector; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.portable.OutputStream; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; + +/** + * Base class for composite Dynamic Anys. It implements the Streamable interface + * for alowing the generated anys (with to_any) write its value in an output + * stream. The generated anys are contructed with: + *

+ * + * Any to_any() + *

{ + *

Any a= new Any(); + *

a.insert_Streamable(this); + *

return a; + *

} Due to this construction unneccesary remarshalings are avoided. + *

+ * The DynComposite has two operation modes: + *

    + *
  • Inserting Mode : a TypeCode is given and the + * any is constructec from other Dynamic Anys. + *
  • Extraction Mode : a Any is given and the + * DynAny structures are obtained from the any and its input stream. + *
+ * + * @autor Juan A. Cáceres + * @version 1.0 + */ +public abstract class DynComposite extends DynAnyBase +{ + /** + * The marshaled value of the Dynamic Any for extracting. + */ + + CDRInputStream m_complete_value; + + /** + * The next component marshaled value of the Dynamic Any for extracting. + */ + + CDRInputStream m_next_value; + + /** + * Current component of the array. + */ + + int m_current_index; + + /** + * Number of Components of the Dynany. This value must be initialized by the + * child classes. + */ + + int m_component_count; + + /** + * Array of components. + */ + + Vector m_components; + + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_components = new Vector(); + m_component_count = 0; + m_current_index = -1; + m_complete_value = null; + m_next_value = null; + } + + /** + * Constructor for insertions. + */ + + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + this(factory, orb); + + m_dyn_type = type; + m_base_type = real_type; + } + + /** + * Constructor for extraction. + */ + protected DynComposite(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + this(factory, orb); + + m_dyn_type = any.type(); + m_base_type = real_type; + + getStreams(any); + } + + // DynComposite methods + + /** + * Clears the value of the dynAny and try to destroy the components. It is + * done when going to insert a new value. + */ + + protected void reset() + { + if (m_component_count == 0) + m_current_index = -1; + else + m_current_index = 0; + + int size = m_components.size(); + + for (int i = 0; i < size; i++) { + ((DynAny) m_components.elementAt(i)).destroy(); + } + + m_components.removeAllElements(); + + m_complete_value = null; + m_next_value = null; + } + + /** + * @param position + * the component position + * @return the TypeCode of the component at the given + * position + */ + protected abstract TypeCode getComponentType(int position); + + /** + * Internal operation to notify that the last component has been + * dissasembled and the DynAny can be wroten writing its components. + * + */ + protected void lastComponent() + { + m_complete_value = null; + m_next_value = null; + } + + /** + * Streamable _read operation + */ + public void _read(org.omg.CORBA.portable.InputStream is) + { + reset(); + + Any any = m_orb.create_any(); + + any.read_value(is, m_base_type); + + getStreams(any); + + } + + /** + * Streamable _write operation + */ + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (os == null) + throw new BAD_PARAM("Null OutputStream reference", 0, + CompletionStatus.COMPLETED_NO); + + DynAny dyn = null; + try { + for (int i = 0; i < m_component_count; i++) { + dyn = getComponent(i); + if (dyn instanceof DynAnyBase) + ((DynAnyBase) dyn)._write(os); + else + dyn.to_any().write_value(os); + } + } + catch (TypeMismatch tm) { + throw new INTERNAL(); + } + } + + /** + * DynAny destructor. Invoked by container DynAnys. + */ + protected void destroyNow() + { + super.destroyNow(); + + reset(); + + m_components = null; + } + + /** + * Obtains the marshaled value from the any. + * + * @param any + * the new value + */ + protected void getStreams(org.omg.CORBA.Any any) + { + if (any == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + try { + m_complete_value = (CDRInputStream) + any.create_input_stream(); + } + catch (ClassCastException cce) { + OutputStream out = m_orb.create_output_stream(); + any.write_value(out); + m_complete_value = (CDRInputStream) out.create_input_stream(); + } + + m_next_value = m_complete_value.copy(); + } + + /** + * Validates and prepares the dyn_any assignment. + * + * @param dyn_any + * the new value + * @throws TypeMismatch + * if the new value TypeCode is not equivalent + */ + protected void preAssign(org.omg.DynamicAny.DynAny dyn_any) + throws TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) { + throw new TypeMismatch(); + } + + // both are the same type. + + reset(); + + // component_count = dyn_any.component_count(); + } + + /** + * Copy the content of the DynComposite instance to other. + * + * @param dyn_any + * the destination DynComposite + */ + protected void copyTo(DynComposite dyn_any) + { + + dyn_any.m_component_count = m_component_count; + + if (m_component_count == 0) { + dyn_any.m_current_index = -1; + return; + } + + if (m_complete_value != null) { + dyn_any.m_complete_value = m_complete_value.copy(); + dyn_any.m_next_value = m_complete_value.copy(); + return; + } + + try { + for (int i = 0; i < m_component_count; i++) + dyn_any.m_components.addElement(getComponent(i).copy()); + + } + catch (TypeMismatch tm) { + throw new INTERNAL("Error with current_component"); + } + } + + /** + * Creates the DynAny at the position, read its value if exists, and insert + * it in the component vector. + */ + protected DynAny getComponent(int position) + throws TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynArray destroyed."); + + if (position == -1) + return null; + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // initialize the component, + + // when the DynAny has been introduced in a any (with to_any() + // operation), + // prevents multihreaded writes (os.write_any() -> dyn_any._write() + // -> + // dyn_any.get_element(i)._write() + + synchronized (this) { + if (position == m_components.size()) { + DynAnyBase dyn_component = null; + + try { + dyn_component = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + getComponentType(position)); + + } + catch (InconsistentTypeCode itc) { + throw new + TypeMismatch("Inconsistent TypeCode of member: " + + position + + " . " + + itc.toString() + + " was thrown"); + } + + dyn_component.setUserDestroy(false); // component + // destruction + + m_components.addElement(dyn_component); + + if (m_next_value != null) { // demarshal the component + dyn_component._read(m_next_value); + } + + if (position == (m_component_count - 1)) { + m_next_value = null; + m_complete_value = null; + } + } + } + + } + + return (DynAny) m_components.elementAt(position); + } + + /** + * Set or creates a new component at position with the given + * value. + */ + protected void setComponent(int position, Any value) + throws TypeMismatch, + InvalidValue + { + try { + if (!getComponentType(position).equivalent(value.type())) + throw new TypeMismatch("Unexpected value type in component " + + position); + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // create the component + DynAny dyn_component = m_factory.create_dyn_any(value); + + m_components.addElement(dyn_component); + } else { + DynAny curr_dyn = (DynAny) + m_components.elementAt(m_current_index); + curr_dyn.from_any(value); + } + + } + catch (InconsistentTypeCode itc) { + throw new TypeMismatch("Inconsistent TypeCode of member: " + + m_current_index + " . " + itc.toString() + + " was thrown"); + } + } + + /** + * Set or creates a new component at position with the given + * value. + */ + protected void setComponent(int position, DynAny value) + throws TypeMismatch + { + + if (!getComponentType(position).equivalent(value.type())) + throw new TypeMismatch("Unexpedted value type in component " + + position); + + int next_component_index = m_components.size(); + + if (position > next_component_index) + throw new INTERNAL("Component position out of sequence"); + + if (position == next_component_index) { // create the component + m_components.addElement(value); + } else { + ((DynAny) m_components.elementAt(position)).destroy(); + m_components.insertElementAt(value, m_current_index); + } + } + + // DynAny operations + + public void from_any(org.omg.CORBA.Any value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + reset(); + + getStreams(value); + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(0, CompletionStatus.COMPLETED_NO); + + Any new_any = m_orb.create_any(); + + new_any.type(type()); + + org.omg.CORBA.portable.OutputStream output = + new_any.create_output_stream(); + + _write(output); + + return new_any; + } + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws TypeMismatch + { + preAssign(dyn_any); + + if (m_component_count == 0) + return; + + int other_aux_current = m_component_count - 1; + + while (dyn_any.next()) + other_aux_current--; + + dyn_any.rewind(); + + try { + for (int i = 0; i < m_component_count; i++) + setComponent(i, dyn_any.current_component().copy()); + + } + catch (TypeMismatch tm) { + reset(); + dyn_any.seek(other_aux_current); + throw tm; + } + + m_current_index = 0; + + dyn_any.seek(other_aux_current); + + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference"); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (m_component_count != dyn_any.component_count()) + return false; + + if (m_component_count == 0) + return true; + + int aux_current = m_current_index; + + int other_aux_current = m_component_count - 1; + + try { + while (dyn_any.next()) + other_aux_current--; + + dyn_any.rewind(); + + for (int i = 0; i < m_component_count; i++) { + if (!getComponent(i).equal(dyn_any.current_component())) { + dyn_any.seek(other_aux_current); + return false; + } + + dyn_any.next(); + } + } + catch (TypeMismatch tm) { + throw new INTERNAL(tm.toString()); + } + finally { + dyn_any.seek(other_aux_current); + } + + return true; + } + + public org.omg.CORBA.Any[] get_elements() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + Any[] any_array = new Any[m_component_count]; + + if (m_component_count > 0) { + try { + for (int i = 0; i < m_component_count; i++) { + any_array[i] = getComponent(i).to_any(); + } + } + catch (TypeMismatch tm) { + /* unreachable */ + throw new INTERNAL(tm.toString()); + } + + } + + return any_array; + + } + + protected void set_elements(org.omg.CORBA.Any[] value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + reset(); + + if (value.length == 0) + return; + + if (m_component_count != value.length) + throw new + InvalidValue("Value length differs from component number"); + + for (int i = 0; i < m_component_count; i++) { + if (value[i] == null) + throw new BAD_PARAM("null Any array element"); + + setComponent(i, value[i]); + } + } + + protected org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + DynAny[] any_array = new DynAny[m_component_count]; + + if (m_component_count > 0) { + try { + for (int i = 0; i < m_component_count; i++) { + any_array[i] = getComponent(i); + } + } + catch (TypeMismatch tm) { + /* unreachable */ + throw new INTERNAL(tm.toString()); + } + } + + return any_array; + } + + protected void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("Null DynAny[] reference"); + + reset(); + + if (value.length == 0) + return; + + if (m_component_count != value.length) + throw new InvalidValue("Value length differs from members number"); + + for (int i = 0; i < m_component_count; i++) { + if (value[i] == null) + throw new BAD_PARAM("null Any array element"); + + setComponent(i, value[i]); + } + } + + public org.omg.DynamicAny.DynAny current_component() + throws TypeMismatch + { + return getComponent(m_current_index); + } + + public int component_count() + { + return m_component_count; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (index < 0) { + m_current_index = -1; + return false; + } + + if (m_component_count == 0) + return false; + + if (m_component_count <= index) + return false; + + m_current_index = 0; + + for (int i = 0; i < index; i++) { + next(); + } + + return true; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count > 0) + seek(0); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count <= (m_current_index + 1)) + return false; + + // if the current object has not been initialized, do it + + if (m_current_index == m_components.size()) + try { + current_component(); + } + catch (TypeMismatch tm) { + return false; + } + + // leaves the current component ready + m_current_index++; + return true; + } + + public void insert_boolean(boolean value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + current_component().insert_boolean(value); + } + + public void insert_char(char value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + current_component().insert_char(value); + } + + public void insert_wchar(char value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + current_component().insert_wchar(value); + } + + public void insert_octet(byte value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + current_component().insert_octet(value); + } + + public void insert_short(short value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + current_component().insert_short(value); + } + + public void insert_ushort(short value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + current_component().insert_ushort(value); + } + + public void insert_long(int value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + current_component().insert_long(value); + } + + public void insert_ulong(int value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + current_component().insert_ulong(value); + } + + public void insert_longlong(long value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + current_component().insert_longlong(value); + } + + public void insert_ulonglong(long value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + current_component().insert_ulonglong(value); + } + + public void insert_float(float value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + current_component().insert_float(value); + } + + public void insert_double(double value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + current_component().insert_double(value); + } + + public void insert_string(String value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + current_component().insert_string(value); + } + + public void insert_wstring(String value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + current_component().insert_wstring(value); + } + + public void insert_any(org.omg.CORBA.Any value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + current_component().insert_any(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + current_component().insert_dyn_any(value); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + current_component().insert_typecode(value); + } + + public void insert_val(java.io.Serializable value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + current_component().insert_val(value); + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_abstract(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_abstract(value); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + current_component().insert_reference(value); + } + + public boolean get_boolean() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + return current_component().get_boolean(); + } + + public char get_char() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + return current_component().get_char(); + } + + public char get_wchar() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + return current_component().get_wchar(); + } + + public byte get_octet() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + return current_component().get_octet(); + } + + public short get_short() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + return current_component().get_short(); + } + + public short get_ushort() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + return current_component().get_ushort(); + } + + public int get_long() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + return current_component().get_long(); + } + + public int get_ulong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + return current_component().get_ulong(); + } + + public long get_longlong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public long get_ulonglong() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public float get_float() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + return current_component().get_float(); + } + + public double get_double() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + return current_component().get_double(); + } + + public String get_string() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + return current_component().get_string(); + } + + public String get_wstring() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + return current_component().get_wstring(); + } + + public org.omg.CORBA.Any get_any() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_any(); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_dyn_any(); + } + + public org.omg.CORBA.TypeCode get_typecode() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + return current_component().get_typecode(); + } + + public java.io.Serializable get_val() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public org.omg.CORBA.Object get_reference() + throws TypeMismatch, + InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!getComponentType(m_current_index) + .equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + return current_component().get_reference(); + } + + // CORBA 2.5 + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_boolean_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_boolean_seq(value); + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_octet_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_octet_seq(value); + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_char_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_char_seq(value); + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_short_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_short_seq(value); + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ushort_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ushort_seq(value); + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_long_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_long_seq(value); + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ulong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ulong_seq(value); + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_float_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_float_seq(value); + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_double_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_double_seq(value); + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_longlong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_longlong_seq(value); + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_ulonglong_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_ulonglong_seq(value); + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // current_component().insert_wchar_seq(value); + ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .insert_wchar_seq(value); + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_boolean_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_boolean_seq(); + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_octet_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_octet_seq(); + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_char_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_char_seq(); + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_short_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_short_seq(); + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ushort_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ushort_seq(); + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_long_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_long_seq(); + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ulong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ulong_seq(); + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_float_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_float_seq(); + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_double_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_double_seq(); + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_longlong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_longlong_seq(); + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_ulonglong_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_ulonglong_seq(); + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + // DynAny de J2SDK 1.4.1 no cumple CORBA 2.6 + // return current_component().get_wchar_seq(); + return ((es.tid.TIDorbj.dynAny.DynAnyBase) current_component()) + .get_wchar_seq(); + } + + protected void insert_boolean_members(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_boolean(value[i]); + next(); + } + + rewind(); + } + + protected void insert_octet_members(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_octet(value[i]); + next(); + } + + rewind(); + } + + protected void insert_char_members(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_char(value[i]); + next(); + } + + rewind(); + } + + protected void insert_short_members(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_short(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ushort_members(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ushort(value[i]); + next(); + } + + rewind(); + } + + protected void insert_long_members(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_long(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ulong_members(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ulong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_float_members(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_float(value[i]); + next(); + } + + rewind(); + } + + protected void insert_double_members(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_double(value[i]); + next(); + } + + rewind(); + } + + protected void insert_longlong_members(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_longlong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_ulonglong_members(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_ulonglong(value[i]); + next(); + } + + rewind(); + } + + protected void insert_wchar_members(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value.length != m_component_count) { + throw new InvalidValue("Invalid length"); + } + + reset(); + + for (int i = 0; i < value.length; i++) { + current_component().insert_wchar(value[i]); + next(); + } + + rewind(); + } + + protected boolean[] get_boolean_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + boolean[] value = new boolean[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_boolean(); + } + } + + return value; + } + + protected byte[] get_octet_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + byte[] value = new byte[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_octet(); + } + } + + return value; + } + + protected char[] get_char_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + char[] value = new char[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_char(); + } + } + + return value; + } + + protected short[] get_short_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + short[] value = new short[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_short(); + } + } + + return value; + } + + protected short[] get_ushort_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + short[] value = new short[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ushort(); + } + } + + return value; + } + + protected int[] get_long_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + int[] value = new int[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_long(); + } + } + + return value; + } + + protected int[] get_ulong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + int[] value = new int[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ulong(); + } + } + + return value; + } + + protected float[] get_float_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + float[] value = new float[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_float(); + } + } + + return value; + } + + protected double[] get_double_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + double[] value = new double[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_double(); + } + } + + return value; + } + + protected long[] get_longlong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + long[] value = new long[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_longlong(); + } + } + + return value; + } + + protected long[] get_ulonglong_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + long[] value = new long[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_ulonglong(); + } + } + + return value; + } + + protected char[] get_wchar_members() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + char[] value = new char[m_component_count]; + + if (m_component_count > 0) { + for (int i = 0; i < m_component_count; i++) { + value[i] = getComponent(i).get_wchar(); + } + } + + return value; + } +} diff --git a/source/es/tid/TIDorbj/dynAny/DynEnumImpl.java b/source/es/tid/TIDorbj/dynAny/DynEnumImpl.java new file mode 100644 index 0000000..5a5cb28 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynEnumImpl.java @@ -0,0 +1,320 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDR; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.cdr.CDROutputStream; + +/** + * DynEnum implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynEnumImpl extends DynSingleton + implements org.omg.DynamicAny.DynEnum +{ + + int m_enum_value; + + private DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_enum_value = 0; + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value. + * @throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + */ + + protected DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb); + + m_dyn_type = any.type(); + + m_base_type = real_type; + + CDROutputStream out = new CDROutputStream(orb, CDR.ULONG_SIZE); + any.write_value(out); + CDRInputStream in = (CDRInputStream) out.create_input_stream(); + m_enum_value = in.read_ulong(); + } + + /** + * Constructor. Gets a simple TypeCode to create a new value; It assumes + * that the TypeCode contains is simple (octect, short ...). + * + * @param type + * the new TypeCode value. + * @exception org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode + * if the TypeCode is not basic. + */ + + protected DynEnumImpl(DynAnyFactoryImpl factory, TIDORB orb, TypeCode type, + TypeCode real_type) + { + super(factory, orb); + m_dyn_type = type; + m_base_type = real_type; + m_enum_value = 0; + } + + public String get_as_string() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + return m_base_type.member_name(m_enum_value); + } + catch (Bounds bd) { + return null; + } + catch (BadKind bk) { + return null; + } + } + + public void set_as_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + int num_values = m_base_type.member_count(); + + for (int i = 0; i < num_values; i++) { + if (value.equals(type().member_name(i))) { + m_enum_value = i; + return; + } + } + throw new InvalidValue("No member named " + value + "."); + + } + catch (Bounds bd) { /* unreachable */ + } + catch (BadKind bk) { /* unreachable */ + } + } + + public int get_as_ulong() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return m_enum_value; + } + + public void set_as_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + int count = m_base_type.member_count(); + + if ((value < 0) || (value >= count)) + throw new InvalidValue(type().id() + " : value " + value + + " out of range."); + } + catch (BadKind bk) { /* unreachable */ + } + + m_enum_value = value; + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + try { + set_as_ulong(in.read_ulong()); + } + catch (InvalidValue iv) { + throw new MARSHAL(iv.toString()); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_ulong(m_enum_value); + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + if (dyn_any instanceof org.omg.DynamicAny.DynEnum) + m_enum_value = + ((org.omg.DynamicAny.DynEnum) dyn_any).get_as_ulong(); + else + // invalid error + throw new TypeMismatch(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + _write(output); + + // new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof org.omg.DynamicAny.DynEnum) + return (m_enum_value + == ((org.omg.DynamicAny.DynEnum) dyn_any).get_as_ulong()); + else + // invalid error + throw new BAD_PARAM("DynAny does not implements DynEnum when" + + " its type is enum"); + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynEnumImpl new_dyn = new DynEnumImpl(m_factory, m_orb); + new_dyn.m_enum_value = m_enum_value; + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + + return new_dyn; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynEnum:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynExceptImpl.java b/source/es/tid/TIDorbj/dynAny/DynExceptImpl.java new file mode 100644 index 0000000..e0d0fb4 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynExceptImpl.java @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.TypeCode; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStruct implementation for exceptions. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynExceptImpl extends DynStructImpl +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + protected boolean validateName() + { + try { + return m_next_value.read_string().equals(m_base_type.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + throw new org.omg.CORBA.BAD_TYPECODE(); + } + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_value (for DynValueImpl that + * extends DynStructImpl) + * + * @param type + * the TypeCode value. + */ + + protected DynExceptImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.from_any(value); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + super._read(is); + if (!validateName()) { + throw new org.omg.CORBA.MARSHAL("Unexpected exception id in any"); + } + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + try { + os.write_string(m_base_type.id()); + } + catch (org.omg.CORBA.TypeCodePackage.BadKind bk) { + throw new org.omg.CORBA.BAD_TYPECODE(); + } + + super._write(os); + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynExceptImpl new_dyn = new DynExceptImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + if (new_dyn.m_next_value != null) + new_dyn.m_next_value.skipString(); + + return new_dyn; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynFixedImpl.java b/source/es/tid/TIDorbj/dynAny/DynFixedImpl.java new file mode 100644 index 0000000..707f86b --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynFixedImpl.java @@ -0,0 +1,298 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import java.math.BigDecimal; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.portable.InputStream; +import org.omg.DynamicAny.DynFixed; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.util.FixedHolder; + +/** + * DynFixed implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynFixedImpl extends DynSingleton + implements org.omg.DynamicAny.DynFixed, org.omg.CORBA.portable.Streamable +{ + + BigDecimal fixed_value; + + private DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + fixed_value = new BigDecimal(0.0D); + } + + /** + * Constructor. Gets an any object for reading its value. + * + * @param any + * the any value. + */ + + protected DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + InputStream in = any.create_input_stream(); + FixedHolder holder = new FixedHolder(m_base_type); + holder._read(in); + + fixed_value = holder.value; + } + + protected DynFixedImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + + try { + + fixed_value = BigDecimal.valueOf(0, m_base_type.fixed_scale()); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + } + + // DynFixed operations + + public String get_value() + { + + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return fixed_value.toString(); + } + + public boolean set_value(java.lang.String val) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + if (val == null) + throw new BAD_PARAM("null string value"); + + BigDecimal value = new BigDecimal(val); + try { + if (value.scale() != m_base_type.fixed_scale()) + throw new InvalidValue("Bad fixed scale"); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + fixed_value = value; + + return true; + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + FixedHolder holder = new FixedHolder(m_base_type); + holder._read(in); + + fixed_value = holder.value; + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + out.write_fixed(fixed_value); + } + + public org.omg.CORBA.TypeCode type() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + return m_dyn_type; + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); + + try { + set_value(((DynFixed) dyn_any).get_value()); + } + catch (InvalidValue iv) { + throw new BAD_PARAM("Invalid value"); + } + catch (ClassCastException cce) { + throw new BAD_PARAM("Not a DynFixed value"); + } + + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + _write(output); + //new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof DynFixed) { + return fixed_value.equals( + new BigDecimal(new String(((DynFixed) dyn_any).get_value()))); + } else { // invalid error + throw new BAD_PARAM("dyn_any value does not instantiate DynFixed!" + + " but its type is fixed;"); + } + } + + protected void destroyNow() + { + super.destroyNow(); + fixed_value = null; + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + DynFixedImpl new_dyn = new DynFixedImpl(m_factory, m_orb); + new_dyn.fixed_value = fixed_value; + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + + return new_dyn; + } + + // OBJECT methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynFixed:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynSequenceImpl.java b/source/es/tid/TIDorbj/dynAny/DynSequenceImpl.java new file mode 100644 index 0000000..d767c20 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynSequenceImpl.java @@ -0,0 +1,682 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; + +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.cdr.CDRInputStream; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.TypeCodeMarshaler; + +/** + * DynSequence implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynSequenceImpl extends DynComposite + implements org.omg.DynamicAny.DynSequence +{ + + boolean m_bounded; + + int m_bound; + + /** + * Empty Constructor for generate copies. + */ + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets a TypeCode to create a new value. Warning: It assumes + * that the TypeCode is tk_sequence. + * + * @param any + * the any value. + */ + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_bound = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + m_bounded = (m_bound != 0); + m_component_count = 0; + } + + protected DynSequenceImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + try { + m_bound = real_type.length(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + m_bounded = (m_bound != 0); + + extract_length(); + } + + protected void extract_length() + { + m_component_count = m_next_value.read_ulong(); + + if(m_component_count > 0) { + m_current_index = 0; + } + + m_next_value.fixStarting(); + if ((m_bound != 0) && (m_component_count > m_bound)) + throw new MARSHAL("Invalid bounded sequence length"); + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynSequenceImpl new_dyn = new DynSequenceImpl(m_factory, m_orb, + m_dyn_type, m_base_type); + + copyTo(new_dyn); + + new_dyn.m_bound = m_bound; + + new_dyn.m_bounded = m_bounded; + + return new_dyn; + } + + // DynSequence Operations + + public int get_length() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return component_count(); + } + + public void set_length(int len) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (len < 0) + throw new InvalidValue("Invalid Sequence length: " + len); + + if (len == m_component_count) + return; + + if (len == 0) { + reset(); + } + + if (m_bounded && (len > m_bound)) { + throw new InvalidValue("Invalid Sequence length (" + len + + "), bound is (" + m_bound + ")"); + } + + m_component_count = len; + + int actual_components = m_components.size(); + + if (len < actual_components) { //destroy excedent + m_complete_value = null; + m_next_value = null; + for (int i = actual_components - 1; i >= len; i--) { + ((DynAny) (m_components.elementAt(i))).destroy(); + m_components.removeElementAt(i); + } + } + } + + public org.omg.CORBA.Any[] get_elements() + { + return super.get_elements(); + } + + public void set_elements(org.omg.CORBA.Any[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + set_length(value.length); + + super.set_elements(value); + } + + public void set_elements_as_dyn_any(org.omg.DynamicAny.DynAny[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + set_length(value.length); + + super.set_elements_as_dyn_any(value); + } + + public org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() + { + return super.get_elements_as_dyn_any(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + super.from_any(value); + + extract_length(); + } + + public void _read(org.omg.CORBA.portable.InputStream is) + { + super._read(is); + + extract_length(); + } + + public void _write(org.omg.CORBA.portable.OutputStream os) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST(); + + if (os == null) + throw new BAD_PARAM("Null OutputStream reference"); + + if (m_complete_value != null) {// value marshaled + CDRInputStream value_copy = m_complete_value.copy(); + value_copy.rewind(); + TypeCodeMarshaler.remarshalValue(m_base_type, value_copy, os); + } else { // value in the dynAny structure + + os.write_long(m_component_count); + + super._write(os); + } + } + + protected TypeCode getComponentType(int position) + { + + try { + return m_base_type.content_type(); + } + catch (BadKind bk) { + /* unreachable */ + throw new org.omg.CORBA.BAD_TYPECODE(); + } + + } + + public void insert_boolean_seq(boolean[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + set_length(value.length); + insert_boolean_members(value); + + } else { + set_length(value.length); + super.insert_boolean_seq(value); + } + } + + public void insert_octet_seq(byte[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + set_length(value.length); + insert_octet_members(value); + } else { + set_length(value.length); + super.insert_octet_seq(value); + } + } + + public void insert_char_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + set_length(value.length); + insert_char_members(value); + } else { + set_length(value.length); + super.insert_char_seq(value); + } + } + + public void insert_short_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + set_length(value.length); + insert_short_members(value); + } else { + set_length(value.length); + super.insert_short_seq(value); + } + } + + public void insert_ushort_seq(short[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + set_length(value.length); + insert_ushort_members(value); + } else { + set_length(value.length); + super.insert_ushort_seq(value); + } + } + + public void insert_long_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + set_length(value.length); + insert_long_members(value); + } else { + set_length(value.length); + super.insert_long_seq(value); + } + } + + public void insert_ulong_seq(int[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + set_length(value.length); + insert_ulong_members(value); + } else { + set_length(value.length); + super.insert_ulong_seq(value); + } + } + + public void insert_float_seq(float[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + set_length(value.length); + insert_float_members(value); + } else { + set_length(value.length); + super.insert_float_seq(value); + } + } + + public void insert_double_seq(double[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + set_length(value.length); + insert_double_members(value); + } else { + set_length(value.length); + super.insert_double_seq(value); + } + } + + public void insert_longlong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + set_length(value.length); + insert_longlong_members(value); + } else { + set_length(value.length); + super.insert_longlong_seq(value); + } + } + + public void insert_ulonglong_seq(long[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulonglong)) { + set_length(value.length); + insert_ulonglong_members(value); + } else { + set_length(value.length); + super.insert_ulonglong_seq(value); + } + } + + public void insert_wchar_seq(char[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value == null) + throw new BAD_PARAM("null array reference"); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + set_length(value.length); + insert_wchar_members(value); + } else { + set_length(value.length); + super.insert_wchar_seq(value); + } + } + + public boolean[] get_boolean_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_boolean)) { + return super.get_boolean_members(); + } else { + return super.get_boolean_seq(); + } + } + + public byte[] get_octet_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_octet)) { + return super.get_octet_members(); + } else { + return super.get_octet_seq(); + } + } + + public char[] get_char_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_char)) { + return super.get_char_members(); + } else { + return super.get_char_seq(); + } + } + + public short[] get_short_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_short)) { + return super.get_short_members(); + } else { + return super.get_short_seq(); + } + } + + public short[] get_ushort_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ushort)) { + return super.get_ushort_members(); + } else { + return super.get_ushort_seq(); + } + } + + public int[] get_long_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_long)) { + return super.get_long_members(); + } else { + return super.get_long_seq(); + } + } + + public int[] get_ulong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_ulong)) { + return super.get_ulong_members(); + } else { + return super.get_ulong_seq(); + } + } + + public float[] get_float_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_float)) { + return super.get_float_members(); + } else { + return super.get_float_seq(); + } + } + + public double[] get_double_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_double)) { + return super.get_double_members(); + } else { + return super.get_double_seq(); + } + } + + public long[] get_longlong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_longlong)) { + return super.get_longlong_members(); + } else { + return super.get_longlong_seq(); + } + } + + public long[] get_ulonglong_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public char[] get_wchar_seq() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (getComponentType(0).equivalent(TypeCodeFactory.tc_wchar)) { + return super.get_wchar_members(); + } else { + return super.get_wchar_seq(); + } + } + + // Object methods + + protected final static String[] __ids = + { "IDL:omg.org/DynamicAny/DynAny:1.0", }; + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier + .equals("IDL:omg.org/DynamicAny/DynSequence:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynSingleton.java b/source/es/tid/TIDorbj/dynAny/DynSingleton.java new file mode 100644 index 0000000..755d88a --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynSingleton.java @@ -0,0 +1,418 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * Abstract clase that only throws TypeMismatch in insert/get operations. It is + * the base clase for DynEnum or DynFixed + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +abstract class DynSingleton extends DynAnyBase +{ + + protected DynSingleton(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + protected DynSingleton(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public void insert_abstract(java.lang.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return false; + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (byte) 0; + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (char) 0; + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (short) 0; + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return (short) 0; + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0; + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0; + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0.0F; + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0.0D; + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return ""; + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0L; + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return 0L; + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return '0'; + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return ""; + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public java.lang.Object get_abstract() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + typeMismatch(); + return null; + } + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return -1; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + return true; + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + throw new TypeMismatch("DynAny without components"); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynStructBase.java b/source/es/tid/TIDorbj/dynAny/DynStructBase.java new file mode 100644 index 0000000..fdd569e --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynStructBase.java @@ -0,0 +1,335 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.NameDynAnyPair; +import org.omg.DynamicAny.NameValuePair; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStructBase implementation. Base for Struct, Exception and ValueType. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public abstract class DynStructBase extends DynComposite +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_value (for DynValueImpl that + * extends DynStructBase) + * + * @param type + * the TypeCode value. + */ + + protected DynStructBase(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public String current_member_name() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("No member (current = -1)"); + + // at this point alwais curremt_member is valid + try { + return m_base_type.member_name(m_current_index); + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + } + + public org.omg.CORBA.TCKind current_member_kind() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("No member (current = -1)"); + + try { + return m_base_type.member_type(m_current_index).kind(); + } + catch (BadKind bk) { + /* unreachable */ + throw new TypeMismatch(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new TypeMismatch(bd.toString()); + } + + } + + public org.omg.DynamicAny.NameValuePair[] get_members() + { + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + + Any[] any_members = super.get_elements(); + + NameValuePair[] members = new NameValuePair[m_component_count]; + + for (int i = 0; i < m_component_count; i++) { + + members[i] = new NameValuePair(m_base_type.member_name(i), + any_members[i]); + } + + return members; + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } + + public void set_members(org.omg.DynamicAny.NameValuePair[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + try { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + reset(); + + if (value.length != m_component_count) + throw new TypeMismatch("Invalid number of members: " + + m_component_count + " expected, not " + + value.length); + + Any[] members_values = new Any[m_component_count]; + + for (int i = 0; i < m_component_count; i++) { + members_values[i] = value[i].value; + if (!m_base_type.member_name(i).equals(value[i].id)) + throw new InvalidValue("Invalid member name, " + + m_base_type.member_name(i) + + "expected, not " + value[i].id); + } + + set_elements(members_values); + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } + + public org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + + DynAny[] dyns = super.get_elements_as_dyn_any(); + + NameDynAnyPair[] members = new NameDynAnyPair[m_component_count]; + + for (int i = 0; i < m_component_count; i++) + members[i] = new NameDynAnyPair(m_base_type.member_name(i), + dyns[i]); + + return members; + + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + } + + public void + set_members_as_dyn_any(org.omg.DynamicAny.NameDynAnyPair[] value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (value.length != m_component_count) + throw new TypeMismatch("Invalid number of members: " + + m_component_count + " expected, not " + + value.length); + + DynAny[] members_values = new DynAny[m_component_count]; + + try { + for (int i = 0; i < m_component_count; i++) { + members_values[i] = value[i].value; + if (!m_base_type.member_name(i).equals(value[i].id)) + throw new InvalidValue("Invalid member name, " + + m_base_type.member_name(i) + + "expected, not " + value[i].id); + } + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + set_elements_as_dyn_any(members_values); + } + + protected TypeCode getComponentType(int position) + { + try { + return m_base_type.member_type(position); + } + catch (BadKind bk) { + /* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + /* unreachable */ + throw new INTERNAL(bd.toString()); + } + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynStructImpl.java b/source/es/tid/TIDorbj/dynAny/DynStructImpl.java new file mode 100644 index 0000000..0c32aa5 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynStructImpl.java @@ -0,0 +1,157 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynStruct implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynStructImpl extends DynStructBase + implements org.omg.DynamicAny.DynStruct +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_struct or tk_exception + * + * @param type + * the TypeCode value. + */ + + protected DynStructImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynStructImpl new_dyn = new DynStructImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynStruct:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynUnionImpl.java b/source/es/tid/TIDorbj/dynAny/DynUnionImpl.java new file mode 100644 index 0000000..9c5b176 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynUnionImpl.java @@ -0,0 +1,1566 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 19 $ +* Date: $Date: 2006-06-28 10:17:01 +0200 (Wed, 28 Jun 2006) $ +* Last modified by: $Author: iredondo $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_OPERATION; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.CompletionStatus; +import org.omg.CORBA.INTERNAL; +import org.omg.CORBA.MARSHAL; +import org.omg.CORBA.OBJECT_NOT_EXIST; +import org.omg.CORBA.TCKind; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; +import org.omg.CORBA.TypeCodePackage.Bounds; +import org.omg.CORBA.portable.InputStream; +import org.omg.CORBA.portable.Streamable; +import org.omg.DynamicAny.DynAny; +import org.omg.DynamicAny.DynUnion; +import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode; +import org.omg.DynamicAny.DynAnyPackage.InvalidValue; +import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; + +import es.tid.TIDorbj.core.AnyImpl; +import es.tid.TIDorbj.core.TIDORB; +import es.tid.TIDorbj.core.typecode.EnumTypeCode; +import es.tid.TIDorbj.core.typecode.TypeCodeFactory; +import es.tid.TIDorbj.core.typecode.UnionTypeCode; +import es.tid.TIDorbj.core.util.EnumHolder; + +/** + * The DynUnion interface represents a DynAny + * object that is associated with an IDL union. Union values can be traversed + * using the operations defined in DynAny. The first component + * in the union corresponds to the discriminator; the second corresponds to the + * actual value of the union. Calling the method next() twice + * allows you to access both components. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynUnionImpl extends DynAnyBase + implements org.omg.DynamicAny.DynUnion +{ + /** + * Active member. + */ + DynAnyBase m_active_member; + + /** + * Active discriminator. + */ + DynAnyBase m_dyn_discriminator; + + /** + * Member index in the union TypeCode. + */ + int m_active_member_index; + + /** + * Current Component. + */ + int m_current_index; + + /** + * Component Count. + */ + int m_component_count; + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + m_current_index = -1; + m_component_count = 1; + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an struct TypeCode. + * + * @param any + * the any value. + */ + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any.type(), real_type); + + m_component_count = 2; + + InputStream in = any.create_input_stream(); + + _read(in); + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. + * + * @param type + * the UnionTypeCode value. + */ + + protected DynUnionImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + + try { + m_active_member_index = m_base_type.default_index(); + if (m_active_member_index > -1) + m_component_count = 2; + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + DynUnionImpl new_dyn = new DynUnionImpl(m_factory, m_orb); + new_dyn.m_dyn_type = m_dyn_type; + new_dyn.m_base_type = m_base_type; + new_dyn.m_active_member_index = m_active_member_index; + new_dyn.m_component_count = m_component_count; + + if (m_component_count == 2) { + if (m_active_member != null) { + new_dyn.m_active_member = (DynAnyBase) m_active_member.copy(); + } + if (m_dyn_discriminator != null) { + new_dyn.m_dyn_discriminator = + (DynAnyBase) m_dyn_discriminator.copy(); + } + } + + return new_dyn; + } + + // DynUnion operations + public org.omg.DynamicAny.DynAny get_discriminator() + // CORBA 2.6: throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + // throw new InvalidValue("No active member."); + throw new BAD_OPERATION("No active member."); + + if (m_dyn_discriminator == null) { // default discriminator search + + Any discriminator = m_orb.create_any(); + int i = 0; + do { // search a value that will be not at the case labels + setDiscriminatorValue(discriminator, ++i); + } while (UnionTypeCode.searchMemberIndex(m_base_type, discriminator) + != m_active_member_index); + + try { + m_dyn_discriminator = (DynAnyBase) + m_factory.create_dyn_any(discriminator); + } + catch (InconsistentTypeCode itc) {/* unreachable */ + return null; + } + + } + + return m_dyn_discriminator; + } + + public void set_discriminator(org.omg.DynamicAny.DynAny d) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + int index = UnionTypeCode.searchMemberIndex(m_base_type, d.to_any()); + + if (index < 0) + throw new TypeMismatch("DynUnion: Invalid label value " + index); + + setIndex(index, d); + } + + protected void setIndex(int index, DynAny discriminator) + { + if (m_active_member_index == index) { + if ((m_dyn_discriminator == null) && (discriminator != null)) + m_dyn_discriminator = (DynAnyBase) discriminator.copy(); + return; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + + if (discriminator != null) + m_dyn_discriminator = (DynAnyBase) discriminator.copy(); + + m_current_index = 0; + m_component_count = 2; + m_active_member_index = index; + + try { + if ((m_active_member != null) + && (!m_active_member.type() + .equivalent(m_base_type.member_type(m_active_member_index)))) { + m_active_member.destroy(); + m_active_member = null; + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + } + + public void set_to_default_member() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + // set member idex to defalut index + + int index = m_base_type.default_index(); + if (index < 0) + throw new TypeMismatch("Union without default case or all " + + " posible discriminator values used."); + + setIndex(index, null); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + } + + public void set_to_no_active_member() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + if (m_base_type.default_index() > -1) + throw new TypeMismatch("Union has default case"); + + // are all the discriminator values uses + + if (allCasesUsed()) + throw new + TypeMismatch("All posible discriminator cases used in union."); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + + if (m_active_member != null) { + m_active_member.destroy(); + m_active_member = null; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + + m_active_member_index = -1; + m_component_count = 1; + } + + public boolean has_no_active_member() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + return m_component_count < 2; + } + + public org.omg.CORBA.TCKind discriminator_kind() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + try { + return m_base_type.discriminator_type().kind(); + } + catch (BadKind bk) {/* unreachable */ + throw new BAD_TYPECODE(bk.toString()); + } + + } + + public org.omg.DynamicAny.DynAny member() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + if (m_active_member == null) { + try { + m_active_member = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + m_base_type.member_type(m_active_member_index)); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode bk) { /* unreachable */} + } + + return m_active_member; + } + + public String member_name() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + try { + return m_base_type.member_name(m_active_member_index); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + } + + public void member_name(String arg) + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_component_count == 1) + throw new InvalidValue("No active member"); + + try { + + int member_count = m_base_type.member_count(); + + for (int i = 0; i < member_count; i++) { + if (arg.equals(m_base_type.member_name(i))) { + DynAnyBase dyn_disc = (DynAnyBase) + m_factory.create_dyn_any(m_base_type.member_label(i)); + setIndex(i, dyn_disc); + + return; + } + } + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode itc) {/* unreachable */ + return; + } + + throw new InvalidValue("Union has not any member named: " + arg); + } + + public org.omg.CORBA.TCKind member_kind() + throws org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_active_member_index < 1) + throw new InvalidValue("No member selected."); + + try { + return m_base_type.member_type(m_active_member_index).kind(); + } + catch (BadKind bk) { /* unreachable */ + return null; + } + catch (Bounds bd) { /* unreachable */ + return null; + } + } + + public org.omg.DynamicAny.DynAny current_component() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + return null; + + try { + switch (m_current_index) + { + case 0: + return get_discriminator(); + case 1: + return member(); + } + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + + throw new INTERNAL("Current out of range"); + } + + // Streamable operations + + public void _read(org.omg.CORBA.portable.InputStream in) + { + Any discriminator_any = m_orb.create_any(); + + try { + discriminator_any.read_value(in, m_base_type.discriminator_type()); + + m_active_member_index = + UnionTypeCode.searchMemberIndex(m_base_type, discriminator_any); + + if (m_active_member_index < 0) + throw new BAD_PARAM("Invalid Union label: " + + m_active_member_index); + + m_dyn_discriminator = (DynAnyBase) + m_factory.create_dyn_any(discriminator_any); + + m_dyn_discriminator.setUserDestroy(false); + + m_active_member = (DynAnyBase) + m_factory.create_dyn_any_from_type_code( + m_base_type.member_type(m_active_member_index)); + + m_active_member.setUserDestroy(false); + + ((Streamable) m_active_member)._read(in); + + } + catch (BadKind bk) { + throw new BAD_TYPECODE(bk.toString()); + } + catch (Bounds bd) { + throw new INTERNAL(bd.toString()); + } + catch (InconsistentTypeCode bk) { /* unreachable */ + } + } + + public void _write(org.omg.CORBA.portable.OutputStream out) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_component_count == 1) + throw new BAD_OPERATION("Uncompleted union."); + + try { + ((Streamable) get_discriminator())._write(out); + ((Streamable) member())._write(out); + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + } + + // DynAny Operations + + public void assign(org.omg.DynamicAny.DynAny dyn_any) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + throw new TypeMismatch(); + + if (dyn_any instanceof DynUnion) { + try { + DynUnion dyn_union = (DynUnion) dyn_any; + if (dyn_union.has_no_active_member()) { + set_to_no_active_member(); + } else { + set_discriminator(dyn_union.get_discriminator()); + member().assign(dyn_union.member()); + } + } + catch (InvalidValue iv) {} + } else + // invalid error + throw new TypeMismatch(); + } + + public void from_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (value == null) + throw new BAD_PARAM("Null Any reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(value.type())) + throw new TypeMismatch(); + + try { + _read(value.create_input_stream()); + } + catch (MARSHAL m) { + throw new InvalidValue(); + } + } + + public org.omg.CORBA.Any to_any() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + AnyImpl new_value = (AnyImpl) m_orb.create_any(); + new_value.type(type()); + org.omg.CORBA.portable.OutputStream output; + output = new_value.create_output_stream(); + + _write(output); + + //new_value.insert_Streamable(this); + + return new_value; + } + + public boolean equal(org.omg.DynamicAny.DynAny dyn_any) + { + if (dyn_any == null) + throw new BAD_PARAM("Null DynAny reference", 0, + CompletionStatus.COMPLETED_NO); + + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (!m_base_type.equivalent(dyn_any.type())) + return false; + + if (dyn_any instanceof DynUnion) { + try { + DynUnion dyn_union = (DynUnion) dyn_any; + + if (!get_discriminator().equal(dyn_union.get_discriminator())) + return false; + + return member().equal(dyn_union.member()); + } + catch (InvalidValue iv) { + throw new INTERNAL(iv.toString()); + } + + } else + // invalid error + throw new BAD_PARAM("dyn_any value does not instantiate DynUnion" + + " but its type is union"); + } + + protected void destroyNow() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed", 0, + CompletionStatus.COMPLETED_NO); + + if (m_active_member != null) { + m_active_member.destroy(); + m_active_member = null; + } + + if (m_dyn_discriminator != null) { + m_dyn_discriminator.destroy(); + m_dyn_discriminator = null; + } + } + + protected boolean allCasesUsed() + throws TypeMismatch + { + TypeCode disc_type = null; + int member_count; + try { + disc_type = m_base_type.discriminator_type(); + + while (disc_type.kind().value() == TCKind._tk_alias) + disc_type = disc_type.content_type(); + + member_count = m_base_type.member_count(); + + switch (disc_type.kind().value()) + { + case TCKind._tk_short: + case TCKind._tk_long: + case TCKind._tk_longlong: + case TCKind._tk_ushort: + case TCKind._tk_ulong: + case TCKind._tk_ulonglong: + case TCKind._tk_wchar: + case TCKind._tk_char: + return false; + case TCKind._tk_boolean: + return member_count <= 2; + case TCKind._tk_enum: + return disc_type.member_count() <= member_count; + } + } + catch (BadKind bk) { + throw new INTERNAL(bk.toString()); + } + + throw new TypeMismatch("Invalid discriminator Value"); + } + + protected void setDiscriminatorValue(org.omg.CORBA.Any discriminator, + int value) + { + switch (discriminator.type().kind().value()) + { + case TCKind._tk_short: + discriminator.insert_short((short) value); + break; + case TCKind._tk_long: + discriminator.insert_long(value); + break; + case TCKind._tk_longlong: + discriminator.insert_longlong(value); + break; + case TCKind._tk_ushort: + discriminator.insert_ushort((short) value); + break; + case TCKind._tk_ulong: + discriminator.insert_ulong(value); + break; + case TCKind._tk_ulonglong: + discriminator.insert_ulonglong(value); + break; + case TCKind._tk_boolean: + discriminator.insert_boolean((value == 0) ? false : true); + break; + case TCKind._tk_char: + discriminator.insert_char((char) value); + break; + case TCKind._tk_wchar: + discriminator.insert_wchar((char) value); + break; + case TCKind._tk_enum: + try { + discriminator.insert_Streamable( + new EnumHolder((EnumTypeCode) + m_base_type.discriminator_type(), + value)); + } + catch (BadKind bk) {} + break; + + } + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynUnion:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + public void insert_boolean(boolean value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_boolean(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_boolean(value); + } + + public void insert_char(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_char(value); + + set_discriminator(new_disc); + + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_char(value); + } + + public void insert_wchar(char value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_char(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_wchar(value); + } + + public void insert_octet(byte value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + else + current_component().insert_octet(value); + } + + public void insert_short(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_short(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_short(value); + } + + public void insert_ushort(short value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_ushort(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ushort(value); + } + + public void insert_long(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_long(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_long(value); + } + + public void insert_ulong(int value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component() .type()); + + new_disc.insert_ulong(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ulong(value); + } + + public void insert_longlong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_longlong(value); + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_longlong(value); + } + + public void insert_ulonglong(long value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type() + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + if (m_current_index == 0) { + try { + DynAny new_disc = + m_factory.create_dyn_any_from_type_code( + current_component().type()); + + new_disc.insert_ulonglong(value); + + set_discriminator(new_disc); + } + catch (InconsistentTypeCode itc) { + throw new INTERNAL(itc.toString()); + } + } else + current_component().insert_ulonglong(value); + } + + public void insert_float(float value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + if (m_current_index == 0) + throw new TypeMismatch(); + else + current_component().insert_float(value); + } + + public void insert_double(double value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + else + current_component().insert_double(value); + } + + public void insert_string(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + if (m_current_index == 0) + throw new TypeMismatch(); + if (!current_component().type().equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + else + current_component().insert_string(value); + } + + public void insert_wstring(String value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + else + current_component().insert_wstring(value); + } + + public void insert_any(org.omg.CORBA.Any value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + else + current_component().insert_any(value); + } + + public void insert_dyn_any(org.omg.DynamicAny.DynAny value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + else + current_component().insert_dyn_any(value); + } + + public void insert_typecode(org.omg.CORBA.TypeCode value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + else + current_component().insert_typecode(value); + } + + public void insert_val(java.io.Serializable value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + current_component().insert_val(value); + } + + public void insert_reference(org.omg.CORBA.Object value) + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (m_current_index == 0) + throw new TypeMismatch(); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + else + current_component().insert_reference(value); + } + + public boolean get_boolean() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_boolean)) + throw new TypeMismatch(); + + return current_component().get_boolean(); + } + + public char get_char() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_char)) + throw new TypeMismatch(); + + return current_component().get_char(); + } + + public char get_wchar() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wchar)) + throw new TypeMismatch(); + + return current_component().get_wchar(); + } + + public byte get_octet() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_octet)) + throw new TypeMismatch(); + + return current_component().get_octet(); + } + + public short get_short() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_short)) + throw new TypeMismatch(); + + return current_component().get_short(); + } + + public short get_ushort() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ushort)) + throw new TypeMismatch(); + + return current_component().get_ushort(); + } + + public int get_long() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_long)) + throw new TypeMismatch(); + + return current_component().get_long(); + } + + public int get_ulong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_ulong)) + throw new TypeMismatch(); + + return current_component().get_ulong(); + } + + public long get_longlong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_longlong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public long get_ulonglong() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type() + .equivalent(TypeCodeFactory.tc_ulonglong)) + throw new TypeMismatch(); + + return current_component().get_ulonglong(); + } + + public float get_float() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_float)) + throw new TypeMismatch(); + + return current_component().get_float(); + } + + public double get_double() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_double)) + throw new TypeMismatch(); + + return current_component().get_double(); + } + + public String get_string() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_string)) + throw new TypeMismatch(); + + return current_component().get_string(); + } + + public String get_wstring() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_wstring)) + throw new TypeMismatch(); + + return current_component().get_wstring(); + } + + public org.omg.CORBA.Any get_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_any(); + } + + public org.omg.DynamicAny.DynAny get_dyn_any() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_any)) + throw new TypeMismatch(); + + return current_component().get_dyn_any(); + } + + public org.omg.CORBA.TypeCode get_typecode() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_TypeCode)) + throw new TypeMismatch(); + + return current_component().get_typecode(); + } + + public java.io.Serializable get_val() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + return current_component().get_val(); + } + + public org.omg.CORBA.Object get_reference() + throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, + org.omg.DynamicAny.DynAnyPackage.InvalidValue + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed."); + + if (m_current_index == -1) + throw new InvalidValue("Current position is -1"); + + if (!current_component().type().equivalent(TypeCodeFactory.tc_objref)) + throw new TypeMismatch(); + + return current_component().get_reference(); + } + + // DynAny without components methods + + public int component_count() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + +// return 0; + return m_component_count; + } + + public boolean seek(int index) + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index == -1) + return false; + + if (index < component_count()) { + m_current_index = index; + return true; + } else + return false; + } + + public void rewind() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index != -1) + m_current_index = 0; + } + + public boolean next() + { + if (m_destroyed) + throw new OBJECT_NOT_EXIST("DynAny destroyed.", 0, + CompletionStatus.COMPLETED_NO); + + if (m_current_index == -1) + return false; + + if (m_current_index < component_count() - 1) { + m_current_index++; + return true; + } else + return false; + } + +} \ No newline at end of file diff --git a/source/es/tid/TIDorbj/dynAny/DynValueImpl.java b/source/es/tid/TIDorbj/dynAny/DynValueImpl.java new file mode 100644 index 0000000..897f240 --- /dev/null +++ b/source/es/tid/TIDorbj/dynAny/DynValueImpl.java @@ -0,0 +1,175 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.dynAny; + +import org.omg.CORBA.Any; +import org.omg.CORBA.BAD_PARAM; +import org.omg.CORBA.BAD_TYPECODE; +import org.omg.CORBA.TypeCode; +import org.omg.CORBA.TypeCodePackage.BadKind; + +import es.tid.TIDorbj.core.TIDORB; + +/** + * DynValue implementation. + * + * @autor Juan A. Cáceres + * @version 1.0 + */ + +public class DynValueImpl extends DynStructBase + implements org.omg.DynamicAny.DynValue +{ + + /** + * Empty Constructor for generate copies. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb) + { + super(factory, orb); + } + + /** + * Constructor. Gets an any object for reading its value. It assumes that + * the any contains an value TypeCode. + * + * @param any + * the any value. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb, Any any, + TypeCode real_type) + { + super(factory, orb, any, real_type); + + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + /** + * Constructor. Gets a simple TypeCode to create a new value. Warning: It + * assumes that the TypeCode is tk_value + * + * @param type + * the TypeCode value. + */ + + protected DynValueImpl(DynAnyFactoryImpl factory, TIDORB orb, + TypeCode type, TypeCode real_type) + { + super(factory, orb, type, real_type); + try { + m_component_count = real_type.member_count(); + } + catch (BadKind bk) { + throw new BAD_TYPECODE(); + } + + if (m_component_count == 0) { + m_current_index = -1; + } else { + m_current_index = 0; + } + + } + + public org.omg.DynamicAny.DynAny copy() + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + DynValueImpl new_dyn = new DynValueImpl(m_factory, m_orb, m_dyn_type, + m_base_type); + + copyTo(new_dyn); + + return new_dyn; + } + + // Object methods + + public boolean _is_a(java.lang.String repositoryIdentifier) + { + if (m_destroyed) + throw new org.omg.CORBA.OBJECT_NOT_EXIST("DynAny destroyed."); + + if (repositoryIdentifier == null) + throw new BAD_PARAM("Null string reference"); + + if (repositoryIdentifier.equals("IDL:omg.org/DynamicAny/DynValue:1.0")) + return true; + + return super._is_a(repositoryIdentifier); + + } + + // DynValueCommon methods + + public boolean is_null() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_to_null() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + + public void set_to_value() + { + throw new org.omg.CORBA.NO_IMPLEMENT(); + } + +} \ No newline at end of file diff --git a/source/properties.xml b/source/properties.xml new file mode 100644 index 0000000..4b90010 --- /dev/null +++ b/source/properties.xml @@ -0,0 +1,51 @@ + + + + + + + + + + \ No newline at end of file diff --git a/tools/.class/es/tid/TIDorbj/tools/PrintIOR.class b/tools/.class/es/tid/TIDorbj/tools/PrintIOR.class new file mode 100644 index 0000000..b5435ea Binary files /dev/null and b/tools/.class/es/tid/TIDorbj/tools/PrintIOR.class differ diff --git a/tools/.cvsignore b/tools/.cvsignore new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/tools/.cvsignore @@ -0,0 +1 @@ +.class diff --git a/tools/.svn/all-wcprops b/tools/.svn/all-wcprops new file mode 100644 index 0000000..95fa1b3 --- /dev/null +++ b/tools/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools +END +properties.xml +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/tools/properties.xml +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 64 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/tools/.cvsignore +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/tools/build.xml +END diff --git a/tools/.svn/dir-prop-base b/tools/.svn/dir-prop-base new file mode 100644 index 0000000..b15a857 --- /dev/null +++ b/tools/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 6 +.class +END diff --git a/tools/.svn/entries b/tools/.svn/entries new file mode 100644 index 0000000..62dac9a --- /dev/null +++ b/tools/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/tools +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +es +dir + +properties.xml +file + + + + +2009-02-16T09:48:50.000000Z +0191474c64122736504cffa1f78466f1 +2007-11-08T13:09:57.221704Z +100 +avega +has-props + + + + + + + + + + + + + + + + + + + + +1679 + +.cvsignore +file + + + + +2009-02-16T09:48:50.000000Z +9139eabf1b8942aaa41f16fe329f2507 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7 + +build.xml +file + + + + +2009-02-16T09:48:50.000000Z +58d3513f585f1154765cb6ba85c9c1e3 +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2306 + diff --git a/tools/.svn/prop-base/.cvsignore.svn-base b/tools/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/tools/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/tools/.svn/prop-base/build.xml.svn-base b/tools/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/tools/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/tools/.svn/prop-base/properties.xml.svn-base b/tools/.svn/prop-base/properties.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/tools/.svn/prop-base/properties.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/tools/.svn/text-base/.cvsignore.svn-base b/tools/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/tools/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1 @@ +.class diff --git a/tools/.svn/text-base/build.xml.svn-base b/tools/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..070982d --- /dev/null +++ b/tools/.svn/text-base/build.xml.svn-base @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/.svn/text-base/properties.xml.svn-base b/tools/.svn/text-base/properties.xml.svn-base new file mode 100644 index 0000000..0896dc9 --- /dev/null +++ b/tools/.svn/text-base/properties.xml.svn-base @@ -0,0 +1,50 @@ + + + + + + + + + diff --git a/tools/build.xml b/tools/build.xml new file mode 100644 index 0000000..f667d53 --- /dev/null +++ b/tools/build.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/es/.svn/all-wcprops b/tools/es/.svn/all-wcprops new file mode 100644 index 0000000..a6335c5 --- /dev/null +++ b/tools/es/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 56 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools/es +END diff --git a/tools/es/.svn/entries b/tools/es/.svn/entries new file mode 100644 index 0000000..d620600 --- /dev/null +++ b/tools/es/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/tools/es +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +tid +dir + diff --git a/tools/es/tid/.svn/all-wcprops b/tools/es/tid/.svn/all-wcprops new file mode 100644 index 0000000..80676c0 --- /dev/null +++ b/tools/es/tid/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 60 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools/es/tid +END diff --git a/tools/es/tid/.svn/entries b/tools/es/tid/.svn/entries new file mode 100644 index 0000000..3dd9905 --- /dev/null +++ b/tools/es/tid/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/tools/es/tid +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TIDorbj +dir + diff --git a/tools/es/tid/TIDorbj/.svn/all-wcprops b/tools/es/tid/TIDorbj/.svn/all-wcprops new file mode 100644 index 0000000..eeee056 --- /dev/null +++ b/tools/es/tid/TIDorbj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 68 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools/es/tid/TIDorbj +END diff --git a/tools/es/tid/TIDorbj/.svn/entries b/tools/es/tid/TIDorbj/.svn/entries new file mode 100644 index 0000000..79f8161 --- /dev/null +++ b/tools/es/tid/TIDorbj/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/tools/es/tid/TIDorbj +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +tools +dir + diff --git a/tools/es/tid/TIDorbj/tools/.svn/all-wcprops b/tools/es/tid/TIDorbj/tools/.svn/all-wcprops new file mode 100644 index 0000000..d293448 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/all-wcprops @@ -0,0 +1,11 @@ +K 25 +svn:wc:ra_dav:version-url +V 74 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools/es/tid/TIDorbj/tools +END +PrintIOR.java +K 25 +svn:wc:ra_dav:version-url +V 88 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/tools/es/tid/TIDorbj/tools/PrintIOR.java +END diff --git a/tools/es/tid/TIDorbj/tools/.svn/entries b/tools/es/tid/TIDorbj/tools/.svn/entries new file mode 100644 index 0000000..f2db3e2 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/tools/es/tid/TIDorbj/tools +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +PrintIOR.java +file + + + + +2010-04-28T10:47:59.000000Z +2e7e2abdbf9154cc257c4a351e1853dd +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +7982 + diff --git a/tools/es/tid/TIDorbj/tools/.svn/prop-base/PrintIOR.java.svn-base b/tools/es/tid/TIDorbj/tools/.svn/prop-base/PrintIOR.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/prop-base/PrintIOR.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/tools/es/tid/TIDorbj/tools/.svn/prop-base/startClient.sh.svn-base b/tools/es/tid/TIDorbj/tools/.svn/prop-base/startClient.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/prop-base/startClient.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/tools/es/tid/TIDorbj/tools/.svn/prop-base/startServer.sh.svn-base b/tools/es/tid/TIDorbj/tools/.svn/prop-base/startServer.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/prop-base/startServer.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/Echo.idl.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/Echo.idl.svn-base new file mode 100644 index 0000000..c36c25c --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/Echo.idl.svn-base @@ -0,0 +1,7 @@ +module Echo{ + + interface Test{ + string echo (in string s); + oneway void shutdown(); + }; +}; diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoClient.java.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoClient.java.svn-base new file mode 100644 index 0000000..3c31387 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoClient.java.svn-base @@ -0,0 +1,41 @@ +import java.util.Properties; +import java.io.*; + +import Echo.TestHelper; +import Echo.Test; + + + +public class EchoClient { + public static void main(String args[]) + { + try { + // Create and initialize orb + org.omg.CORBA.ORB orb = + org.omg.CORBA.ORB.init(args, System.getProperties()); + + // Get object reference + org.omg.CORBA.Object obj = + // orb.string_to_object("corbaloc:iiop:1.2@dacha.hi.inet:1968/Test"); + // orb.string_to_object("corbaloc:iiop:1.2@fe80::221:70ff:fea2:63b4:1968/Test"); + orb.string_to_object("corbaloc:iiop:1.2@[::1]:1968/Test"); + //orb.string_to_object("corbaloc:iiop:1.2@127.0.0.1:1968/Test"); + //orb.string_to_object("corbaloc:iiop:1.2@10.95.28.47:1968/Test"); + Test refTest = TestHelper.narrow(obj); + + + String message = "Hola mundo"; + for (int i=0; i < 10; i++) { + String response = refTest.echo(message); + System.out.println("[client] response = " + response); + } + + System.exit(0); + } + catch (Exception e) { + System.err.println("Main: Unexpected exception " + e.getMessage()); + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoServer.java.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoServer.java.svn-base new file mode 100644 index 0000000..52e6a96 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/EchoServer.java.svn-base @@ -0,0 +1,107 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJTest + * Programming Language: Java + * + * File: $Source: EchoServer.java $ + * Version: $Revision: 1.0 $ + * Date: $Date: 10-ago-2006 $ + * Last modified by: $Author: irenka.redondo $ + * + * (C) Copyright 2004 Telefónica Investigación y Desarrollo + * S.A.Unipersonal (Telefónica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.util.Properties; + +import org.omg.CORBA.ORB; +import org.omg.PortableServer.POA; +import org.omg.PortableServer.POAHelper; + +public class EchoServer { + public static void main(String[] args) { + try { + // Create and initialize orb + org.omg.CORBA_2_5.ORB orb = + (org.omg.CORBA_2_5.ORB) ORB.init(args, System.getProperties()); + + // Get rootPOA reference and activate POAManager + POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); + rootPOA.the_POAManager().activate(); + + // Create servant + MyEchoTestImpl servant = new MyEchoTestImpl(orb); + + // Activate servant + byte[] servantId = rootPOA.activate_object(servant); + + // Get servant reference and write it to file + org.omg.CORBA.Object obj = rootPOA.id_to_reference(servantId); + String reference = orb.object_to_string(obj); + + String dbior = "Test.ior"; + File ior_fl = new File(dbior); + try { + BufferedWriter bw = new BufferedWriter(new FileWriter(ior_fl)); + bw.write(reference, 0, reference.length()); + bw.flush(); + bw.close(); + } catch (java.io.IOException e) { + System.err.println("Error writing file " + dbior); + System.exit(0); + } + + + orb.register_initial_reference("Test", obj); + + // Start serving requests + System.out.println("[Server] Running..."); + + orb.run(); + //Thread.sleep(35000); // sleep 30 seconds + + //Destroy orb + System.out.println("[Server] Destroying ORB..."); + orb.destroy(); + + System.exit(0); + + } catch (Exception e) { + System.err.println("Main: Unexpected exception " + e.getMessage()); + e.printStackTrace(); + System.exit(1); + } + } +} diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/MyEchoTestImpl.java.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/MyEchoTestImpl.java.svn-base new file mode 100644 index 0000000..f135b02 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/MyEchoTestImpl.java.svn-base @@ -0,0 +1,64 @@ +/* + * MORFEO Project + * http://www.morfeo-project.org + * + * Component: TIDorbJTest + * Programming Language: Java + * + * File: $Source: MyEchoTestImpl.java $ + * Version: $Revision: 1.0 $ + * Date: $Date: 10-ago-2006 $ + * Last modified by: $Author: irenka.redondo $ + * + * (C) Copyright 2004 Telefónica Investigación y Desarrollo + * S.A.Unipersonal (Telefónica I+D) + * + * Info about members and contributors of the MORFEO project + * is available at: + * + * http://www.morfeo-project.org/TIDorbJ/CREDITS + * + * 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. + * + * If you want to use this software an plan to distribute a + * proprietary application in any way, and you are not licensing and + * distributing your source code under GPL, you probably need to + * purchase a commercial license of the product. More info about + * licensing options is available at: + * + * http://www.morfeo-project.org/TIDorbJ/Licensing + */ + +import Echo.*; + +public class MyEchoTestImpl extends TestPOA { + + private org.omg.CORBA.ORB m_orb; + + public MyEchoTestImpl(org.omg.CORBA.ORB orb) { + this.m_orb = orb; + } + + public String echo(String s) { + return s; + } + + public void shutdown() { + System.err.println("[MyEchoTestImpl shutdown] called"); + m_orb.shutdown(true); + } + + +} diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/PrintIOR.java.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/PrintIOR.java.svn-base new file mode 100644 index 0000000..6235bcc --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/PrintIOR.java.svn-base @@ -0,0 +1,272 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.tools; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +import org.omg.IOP.TAG_INTERNET_IOP; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; + +public class PrintIOR +{ + + public static String get_repository_id(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + print_buffer.println(ior.getTypeId()); + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String get_giop_version(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getVersion().toString()); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String get_host(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getListenPoint().m_host); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + + public static String get_port(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getListenPoint().m_port); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + + public static String get_object_key(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getObjectKey().toString()); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String print(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + + if (size == 0) { + print_buffer.println("IOR: nil"); + } else { + print_buffer.println("IOR:"); + + print_buffer.println("Repository Id: " + ior.getTypeId()); + + print_buffer.println("(" + size + " Profiles)"); + + for (int i = 0; i < size; i++) + print_buffer.println(ior.getProfile(i).toString()); + } + + //System.out.flush(); + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static void main(String[] argv) + { + System.out.println("TIDorbJ printIOR version " + + es.tid.TIDorbj.core.TIDORB.st_version); + + if ((argv == null) || (argv.length != 1)) { + + System.out.println("Usage: printIOR [ior|file]"); + return; + } + + String ior_str = null; + + try { // try to read in a file + FileReader file = new FileReader(argv[0]); + BufferedReader reader = new BufferedReader(file); + + ior_str = reader.readLine(); + file.close(); + } + catch (java.io.FileNotFoundException ioe) { + // Argument is the IOR, not a file + } + catch (IOException ioe) { + ioe.printStackTrace(); + return; + } + + try { + String ior_text = null; + if (ior_str == null) + ior_text = es.tid.TIDorbj.tools.PrintIOR.print(argv[0]); + else + ior_text = es.tid.TIDorbj.tools.PrintIOR.print(ior_str); + + System.out.print(ior_text); + System.out.flush(); + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + } +} diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/build.xml.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..d9795a1 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/build.xml.svn-base @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/startClient.sh.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/startClient.sh.svn-base new file mode 100644 index 0000000..e2fb19a --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/startClient.sh.svn-base @@ -0,0 +1,63 @@ +#!/bin/sh +# +# MORFEO Project +# http://www.morfeo-project.org +# +# Component: TIDorbJ +# Programming Language: Java +# +# File: $Source: /cvsroot/tidorbj/TIDorbJTest/basic/echo/startClient.sh,v $ +# Version: $Revision: 1.0 $ +# Date: $Date: 2006/10/13 10:16:41 $ +# Last modified by: $Author: iredondo $ +# +# (C) Copyright 2004 Telefónica Investigación y Desarrollo +# S.A.Unipersonal (Telefónica I+D) +# +# Info about members and contributors of the MORFEO project +# is available at: +# +# http://www.morfeo-project.org/TIDIdlc/CREDITS +# +# 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. +# +# If you want to use this software an plan to distribute a +# proprietary application in any way, and you are not licensing and +# distributing your source code under GPL, you probably need to +# purchase a commercial license of the product. More info about +# licensing options is available at: +# +# http://www.morfeo-project.org/TIDIdlc/Licensing +# + +set +u + +if [ -z "$JAVA_HOME" ]; then + echo "Environment variable JAVA_HOME must be set" + exit 1 +fi + +if [ -z "$TIDORBJ_HOME" ]; then + echo "Environment variable TIDORBJ_HOME must be set" + exit 1 +fi + +$TIDORBJ_HOME/bin/tidorbj.sh \ + -Dorg.omg.CORBA.ORBClass=es.tid.TIDorbj.core.TIDORB \ + -Dorg.omg.CORBA.ORBSingletonClass=es.tid.TIDorbj.core.SingletonORB \ + EchoClient \ + es.tid.TIDorbj.trace.file client.log \ + es.tid.TIDorbj.trace.level 5 \ + es.tid.TIDorbj.iiop.ipv6 false diff --git a/tools/es/tid/TIDorbj/tools/.svn/text-base/startServer.sh.svn-base b/tools/es/tid/TIDorbj/tools/.svn/text-base/startServer.sh.svn-base new file mode 100644 index 0000000..c22c241 --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/.svn/text-base/startServer.sh.svn-base @@ -0,0 +1,70 @@ +#!/bin/sh +# +# MORFEO Project +# http://www.morfeo-project.org +# +# Component: TIDorbJ +# Programming Language: Java +# +# File: $Source: /cvsroot/tidorbj/TIDorbJTest/basic/echo/startServer.sh,v $ +# Version: $Revision: 1.0 $ +# Date: $Date: 2006/10/13 10:12:48 $ +# Last modified by: $Author: iredondo $ +# +# (C) Copyright 2004 Telefónica Investigación y Desarrollo +# S.A.Unipersonal (Telefónica I+D) +# +# Info about members and contributors of the MORFEO project +# is available at: +# +# http://www.morfeo-project.org/TIDIdlc/CREDITS +# +# 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. +# +# If you want to use this software an plan to distribute a +# proprietary application in any way, and you are not licensing and +# distributing your source code under GPL, you probably need to +# purchase a commercial license of the product. More info about +# licensing options is available at: +# +# http://www.morfeo-project.org/TIDIdlc/Licensing +# + +set +u + +if [ -z "$JAVA_HOME" ]; then + echo "Environment variable JAVA_HOME must be set" + exit 1 +fi + +if [ -z "$TIDORBJ_HOME" ]; then + echo "Environment variable TIDORBJ_HOME must be set" + exit 1 +fi + +#export JVM=$JAVA_HOME/bin/java +#$JVM -classpath .;$TIDORBJ_HOME/lib/tidorbj.jar EchoServer + +#export JVM= + +$TIDORBJ_HOME/bin/tidorbj.sh \ + -Dorg.omg.CORBA.ORBClass=es.tid.TIDorbj.core.TIDORB \ + -Dorg.omg.CORBA.ORBSingletonClass=es.tid.TIDorbj.core.SingletonORB \ + EchoServer \ + es.tid.TIDorbj.trace.file server.log \ + es.tid.TIDorbj.trace.level 5 \ + es.tid.TIDorbj.iiop.orb_port 1968 \ + es.tid.TIDorbj.iiop.ipv6 true +# es.tid.TIDorbj.iiop.address fe80::221:70ff:fea2:63b4 diff --git a/tools/es/tid/TIDorbj/tools/PrintIOR.java b/tools/es/tid/TIDorbj/tools/PrintIOR.java new file mode 100644 index 0000000..9708b1c --- /dev/null +++ b/tools/es/tid/TIDorbj/tools/PrintIOR.java @@ -0,0 +1,272 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telef�nica Investigaci�n y Desarrollo +* S.A.Unipersonal (Telef�nica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.tools; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; + +import java.io.StringWriter; +import java.io.PrintWriter; + +import es.tid.TIDorbj.core.iop.DefaultIOR; +import es.tid.TIDorbj.core.iop.IOR; + +import org.omg.IOP.TAG_INTERNET_IOP; +import es.tid.TIDorbj.core.iop.TaggedProfile; +import es.tid.TIDorbj.core.comm.iiop.IIOPProfile; + +public class PrintIOR +{ + + public static String get_repository_id(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + print_buffer.println(ior.getTypeId()); + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String get_giop_version(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getVersion().toString()); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String get_host(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getListenPoint().m_host); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + + public static String get_port(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getListenPoint().m_port); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + + public static String get_object_key(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + for (int i = 0; i < size; i++) { + TaggedProfile profile = ior.getProfile(i); + if (profile.tag == TAG_INTERNET_IOP.value) { + IIOPProfile iiop_profile = (IIOPProfile) profile; + print_buffer.println(iiop_profile.getObjectKey().toString()); + break; + } + } + + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static String print(String ior_str) + { + StringWriter buffer = new StringWriter(); + PrintWriter print_buffer = new PrintWriter(buffer); + + try { + IOR ior = null; + + ior = DefaultIOR.fromString(null, ior_str); + + int size = ior.memberCount(); + + if (size == 0) { + print_buffer.println("IOR: nil"); + } else { + print_buffer.println("IOR:"); + + print_buffer.println("Repository Id: " + ior.getTypeId()); + + print_buffer.println("(" + size + " Profiles)"); + + for (int i = 0; i < size; i++) + print_buffer.println(ior.getProfile(i).toString()); + } + + //System.out.flush(); + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + + return buffer.toString(); + } + + public static void main(String[] argv) + { + System.out.println("TIDorbJ printIOR version " + + es.tid.TIDorbj.core.TIDORB.st_version); + + if ((argv == null) || (argv.length != 1)) { + + System.out.println("Usage: printIOR [ior|file]"); + return; + } + + String ior_str = null; + + try { // try to read in a file + FileReader file = new FileReader(argv[0]); + BufferedReader reader = new BufferedReader(file); + + ior_str = reader.readLine(); + file.close(); + } + catch (java.io.FileNotFoundException ioe) { + // Argument is the IOR, not a file + } + catch (IOException ioe) { + ioe.printStackTrace(); + return; + } + + try { + String ior_text = null; + if (ior_str == null) + ior_text = es.tid.TIDorbj.tools.PrintIOR.print(argv[0]); + else + ior_text = es.tid.TIDorbj.tools.PrintIOR.print(ior_str); + + System.out.print(ior_text); + System.out.flush(); + } + catch (Throwable th) { + System.out.println("Invalid IOR"); + } + } +} diff --git a/tools/properties.xml b/tools/properties.xml new file mode 100644 index 0000000..7bee96f --- /dev/null +++ b/tools/properties.xml @@ -0,0 +1,50 @@ + + + + + + + + + diff --git a/util/.class/es/tid/TIDorbj/util/AlreadyActivatedException.class b/util/.class/es/tid/TIDorbj/util/AlreadyActivatedException.class new file mode 100644 index 0000000..f17732a Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/AlreadyActivatedException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/AlreadyDeactivatedException.class b/util/.class/es/tid/TIDorbj/util/AlreadyDeactivatedException.class new file mode 100644 index 0000000..00574c0 Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/AlreadyDeactivatedException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/Base16Codec.class b/util/.class/es/tid/TIDorbj/util/Base16Codec.class new file mode 100644 index 0000000..6868e8b Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/Base16Codec.class differ diff --git a/util/.class/es/tid/TIDorbj/util/Base64Codec.class b/util/.class/es/tid/TIDorbj/util/Base64Codec.class new file mode 100644 index 0000000..c5caf10 Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/Base64Codec.class differ diff --git a/util/.class/es/tid/TIDorbj/util/CannotProceedException.class b/util/.class/es/tid/TIDorbj/util/CannotProceedException.class new file mode 100644 index 0000000..00aa92e Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/CannotProceedException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/CircularTraceFile.class b/util/.class/es/tid/TIDorbj/util/CircularTraceFile.class new file mode 100644 index 0000000..d4bed8b Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/CircularTraceFile.class differ diff --git a/util/.class/es/tid/TIDorbj/util/InvalidTraceLevelException.class b/util/.class/es/tid/TIDorbj/util/InvalidTraceLevelException.class new file mode 100644 index 0000000..433a170 Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/InvalidTraceLevelException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/NoFileEspecifiedException.class b/util/.class/es/tid/TIDorbj/util/NoFileEspecifiedException.class new file mode 100644 index 0000000..23dd21c Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/NoFileEspecifiedException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/NotActivatedException.class b/util/.class/es/tid/TIDorbj/util/NotActivatedException.class new file mode 100644 index 0000000..80ac91f Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/NotActivatedException.class differ diff --git a/util/.class/es/tid/TIDorbj/util/OutputStreamWrapper.class b/util/.class/es/tid/TIDorbj/util/OutputStreamWrapper.class new file mode 100644 index 0000000..f6c9e48 Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/OutputStreamWrapper.class differ diff --git a/util/.class/es/tid/TIDorbj/util/SystemProperties.class b/util/.class/es/tid/TIDorbj/util/SystemProperties.class new file mode 100644 index 0000000..5483dcd Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/SystemProperties.class differ diff --git a/util/.class/es/tid/TIDorbj/util/Trace.class b/util/.class/es/tid/TIDorbj/util/Trace.class new file mode 100644 index 0000000..54f68ff Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/Trace.class differ diff --git a/util/.class/es/tid/TIDorbj/util/TranslateURLEscapes.class b/util/.class/es/tid/TIDorbj/util/TranslateURLEscapes.class new file mode 100644 index 0000000..0e7691a Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/TranslateURLEscapes.class differ diff --git a/util/.class/es/tid/TIDorbj/util/UTC.class b/util/.class/es/tid/TIDorbj/util/UTC.class new file mode 100644 index 0000000..6eb7402 Binary files /dev/null and b/util/.class/es/tid/TIDorbj/util/UTC.class differ diff --git a/util/.cvsignore b/util/.cvsignore new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/util/.cvsignore @@ -0,0 +1 @@ +.class diff --git a/util/.svn/all-wcprops b/util/.svn/all-wcprops new file mode 100644 index 0000000..ce75b5d --- /dev/null +++ b/util/.svn/all-wcprops @@ -0,0 +1,23 @@ +K 25 +svn:wc:ra_dav:version-url +V 52 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util +END +properties.xml +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/properties.xml +END +.cvsignore +K 25 +svn:wc:ra_dav:version-url +V 63 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/.cvsignore +END +build.xml +K 25 +svn:wc:ra_dav:version-url +V 62 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/build.xml +END diff --git a/util/.svn/dir-prop-base b/util/.svn/dir-prop-base new file mode 100644 index 0000000..b15a857 --- /dev/null +++ b/util/.svn/dir-prop-base @@ -0,0 +1,5 @@ +K 10 +svn:ignore +V 6 +.class +END diff --git a/util/.svn/entries b/util/.svn/entries new file mode 100644 index 0000000..6068932 --- /dev/null +++ b/util/.svn/entries @@ -0,0 +1,133 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/util +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +es +dir + +properties.xml +file + + + + +2009-02-16T09:48:56.000000Z +6f9fbc038554da4852f44644208e6b4b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1675 + +.cvsignore +file + + + + +2009-02-16T09:48:56.000000Z +9139eabf1b8942aaa41f16fe329f2507 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7 + +build.xml +file + + + + +2009-02-16T09:48:56.000000Z +206fe905e1664a5dafc5ac2ec7c73326 +2008-02-25T10:57:48.454081Z +212 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2216 + diff --git a/util/.svn/prop-base/.cvsignore.svn-base b/util/.svn/prop-base/.cvsignore.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/.svn/prop-base/.cvsignore.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/.svn/prop-base/build.xml.svn-base b/util/.svn/prop-base/build.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/.svn/prop-base/build.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/.svn/prop-base/properties.xml.svn-base b/util/.svn/prop-base/properties.xml.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/.svn/prop-base/properties.xml.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/.svn/text-base/.cvsignore.svn-base b/util/.svn/text-base/.cvsignore.svn-base new file mode 100644 index 0000000..9af7884 --- /dev/null +++ b/util/.svn/text-base/.cvsignore.svn-base @@ -0,0 +1 @@ +.class diff --git a/util/.svn/text-base/build.xml.svn-base b/util/.svn/text-base/build.xml.svn-base new file mode 100644 index 0000000..5d192f9 --- /dev/null +++ b/util/.svn/text-base/build.xml.svn-base @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/util/.svn/text-base/properties.xml.svn-base b/util/.svn/text-base/properties.xml.svn-base new file mode 100644 index 0000000..a6647aa --- /dev/null +++ b/util/.svn/text-base/properties.xml.svn-base @@ -0,0 +1,50 @@ + + + + + + + + + \ No newline at end of file diff --git a/util/build.xml b/util/build.xml new file mode 100644 index 0000000..52a1663 --- /dev/null +++ b/util/build.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/util/es/.svn/all-wcprops b/util/es/.svn/all-wcprops new file mode 100644 index 0000000..385d846 --- /dev/null +++ b/util/es/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 55 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util/es +END diff --git a/util/es/.svn/entries b/util/es/.svn/entries new file mode 100644 index 0000000..07b01ad --- /dev/null +++ b/util/es/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/util/es +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +tid +dir + diff --git a/util/es/tid/.svn/all-wcprops b/util/es/tid/.svn/all-wcprops new file mode 100644 index 0000000..327653c --- /dev/null +++ b/util/es/tid/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 59 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util/es/tid +END diff --git a/util/es/tid/.svn/entries b/util/es/tid/.svn/entries new file mode 100644 index 0000000..4437c86 --- /dev/null +++ b/util/es/tid/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/util/es/tid +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +TIDorbj +dir + diff --git a/util/es/tid/TIDorbj/.svn/all-wcprops b/util/es/tid/TIDorbj/.svn/all-wcprops new file mode 100644 index 0000000..a38a09d --- /dev/null +++ b/util/es/tid/TIDorbj/.svn/all-wcprops @@ -0,0 +1,5 @@ +K 25 +svn:wc:ra_dav:version-url +V 67 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj +END diff --git a/util/es/tid/TIDorbj/.svn/entries b/util/es/tid/TIDorbj/.svn/entries new file mode 100644 index 0000000..7780c1c --- /dev/null +++ b/util/es/tid/TIDorbj/.svn/entries @@ -0,0 +1,31 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +util +dir + diff --git a/util/es/tid/TIDorbj/util/.svn/all-wcprops b/util/es/tid/TIDorbj/util/.svn/all-wcprops new file mode 100644 index 0000000..9fea694 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/all-wcprops @@ -0,0 +1,89 @@ +K 25 +svn:wc:ra_dav:version-url +V 72 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util +END +Base16Codec.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/Base16Codec.java +END +SystemProperties.java +K 25 +svn:wc:ra_dav:version-url +V 94 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/SystemProperties.java +END +Base64Codec.java +K 25 +svn:wc:ra_dav:version-url +V 89 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/Base64Codec.java +END +CannotProceedException.java +K 25 +svn:wc:ra_dav:version-url +V 100 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/CannotProceedException.java +END +CircularTraceFile.java +K 25 +svn:wc:ra_dav:version-url +V 95 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/CircularTraceFile.java +END +NotActivatedException.java +K 25 +svn:wc:ra_dav:version-url +V 99 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/NotActivatedException.java +END +TranslateURLEscapes.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/TranslateURLEscapes.java +END +AlreadyActivatedException.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/AlreadyActivatedException.java +END +UTC.java +K 25 +svn:wc:ra_dav:version-url +V 81 +/svn/tidorbj/!svn/ver/453/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/UTC.java +END +InvalidTraceLevelException.java +K 25 +svn:wc:ra_dav:version-url +V 104 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/InvalidTraceLevelException.java +END +NoFileEspecifiedException.java +K 25 +svn:wc:ra_dav:version-url +V 103 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/NoFileEspecifiedException.java +END +OutputStreamWrapper.java +K 25 +svn:wc:ra_dav:version-url +V 97 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/OutputStreamWrapper.java +END +AlreadyDeactivatedException.java +K 25 +svn:wc:ra_dav:version-url +V 105 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/AlreadyDeactivatedException.java +END +Trace.java +K 25 +svn:wc:ra_dav:version-url +V 83 +/svn/tidorbj/!svn/ver/358/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util/Trace.java +END diff --git a/util/es/tid/TIDorbj/util/.svn/entries b/util/es/tid/TIDorbj/util/.svn/entries new file mode 100644 index 0000000..e49cc6c --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/entries @@ -0,0 +1,504 @@ +10 + +dir +454 +https://svn.forge.morfeo-project.org/svn/tidorbj/branches/IPV6/TIDorbJ/util/es/tid/TIDorbj/util +https://svn.forge.morfeo-project.org/svn/tidorbj + + + +2010-04-27T14:52:41.930615Z +453 +avega + + + + + + + + + + + + + + +55a92839-c318-0410-96fd-f7e6f5eacc0e + +Base16Codec.java +file + + + + +2009-02-16T09:48:56.000000Z +2309d544151c21b70b5d440b24963cbe +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +3688 + +SystemProperties.java +file + + + + +2009-02-16T09:48:56.000000Z +abd4addd47afd01f0aa66a5e46f561ff +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2695 + +Base64Codec.java +file + + + + +2009-02-16T09:48:56.000000Z +61bd1663d4ba7fb9f8a2dffc631771e5 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +7646 + +CannotProceedException.java +file + + + + +2009-02-16T09:48:56.000000Z +821ecfd6fe3bb68178df6f6ec82d178a +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1718 + +CircularTraceFile.java +file + + + + +2009-02-16T09:48:56.000000Z +a2287c06d9645a2633b714e3f527311c +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6197 + +NotActivatedException.java +file + + + + +2009-02-16T09:48:56.000000Z +1c4560b2509289aaa34824cc09812f2f +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1626 + +TranslateURLEscapes.java +file + + + + +2009-02-16T09:48:56.000000Z +3285f0a6ee2a532a95a716f990bf8a57 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +6125 + +AlreadyActivatedException.java +file + + + + +2009-02-16T09:48:56.000000Z +c5e5cf599e4438584486765f4eb19e34 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1630 + +UTC.java +file + + + + +2010-04-28T10:48:01.000000Z +b23e2ad8a6eac20580c29b39894a6c48 +2010-04-27T14:52:41.930615Z +453 +avega +has-props + + + + + + + + + + + + + + + + + + + + +2831 + +InvalidTraceLevelException.java +file + + + + +2009-02-16T09:48:56.000000Z +2527325dc8c894df478237e45256eb41 +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1631 + +NoFileEspecifiedException.java +file + + + + +2009-02-16T09:48:56.000000Z +778ef8cef8fbb038dcfcdf0ef64416aa +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1630 + +OutputStreamWrapper.java +file + + + + +2009-02-16T09:48:56.000000Z +258c74aacb9b49eee27c9ad06aa8a98b +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +2775 + +AlreadyDeactivatedException.java +file + + + + +2009-02-16T09:48:56.000000Z +fd59a1e5a0076e4fcec5377eb34d44de +2005-12-19T07:58:21.000000Z +2 +caceres +has-props + + + + + + + + + + + + + + + + + + + + +1632 + +Trace.java +file + + + + +2009-02-16T09:48:56.000000Z +112d419b7788b5b4aad002512d0314fc +2008-02-22T06:46:45.933246Z +211 +avega +has-props + + + + + + + + + + + + + + + + + + + + +20289 + diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyActivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyActivatedException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyActivatedException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyDeactivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyDeactivatedException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/AlreadyDeactivatedException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/Base16Codec.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/Base16Codec.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/Base16Codec.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/Base64Codec.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/Base64Codec.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/Base64Codec.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/CannotProceedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/CannotProceedException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/CannotProceedException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/CircularTraceFile.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/CircularTraceFile.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/CircularTraceFile.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/InvalidTraceLevelException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/InvalidTraceLevelException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/InvalidTraceLevelException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/NoFileEspecifiedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/NoFileEspecifiedException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/NoFileEspecifiedException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/NotActivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/NotActivatedException.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/NotActivatedException.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/OutputStreamWrapper.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/OutputStreamWrapper.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/OutputStreamWrapper.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/SystemProperties.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/SystemProperties.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/SystemProperties.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/Trace.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/Trace.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/Trace.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/TranslateURLEscapes.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/TranslateURLEscapes.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/TranslateURLEscapes.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/prop-base/UTC.java.svn-base b/util/es/tid/TIDorbj/util/.svn/prop-base/UTC.java.svn-base new file mode 100644 index 0000000..7b57b30 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/prop-base/UTC.java.svn-base @@ -0,0 +1,9 @@ +K 13 +svn:eol-style +V 6 +native +K 12 +svn:keywords +V 23 +Author Date Id Revision +END diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyActivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyActivatedException.java.svn-base new file mode 100644 index 0000000..b21c5f6 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyActivatedException.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class AlreadyActivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyDeactivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyDeactivatedException.java.svn-base new file mode 100644 index 0000000..37acbcd --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/AlreadyDeactivatedException.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class AlreadyDeactivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/Base16Codec.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/Base16Codec.java.svn-base new file mode 100644 index 0000000..4b12dfa --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/Base16Codec.java.svn-base @@ -0,0 +1,128 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public abstract class Base16Codec +{ + + public static byte[] decode(String str) + throws Exception + { + int str_length = str.length(); + + if ((str_length % 2) != 0) + throw new Exception("Invalid String length"); + + byte[] data = new byte[str_length / 2]; + + decode(str, data, 0); + + return data; + } + + public static void decode(String str, byte[] data, int data_offset) + throws Exception + { + char[] str_chars = str.toCharArray(); + + int final_position = data_offset + (str.length() / 2); + + int j = 0; + + for (int i = data_offset; i < final_position; i++) + data[i] = (byte) (16 * (getValue(str_chars[j++])) + + getValue(str_chars[j++])); + + str_chars = null; + } + + public static String encode(byte[] data) + { + return encode(data, 0, data.length); + } + + public static String encode(byte[] data, int offset, int length) + { + + char[] digits = new char[2 * length]; + int octet = 0; + int j = 0; + + int final_position = offset + length; + + for (int i = offset; i < final_position; i++) { + octet = 0xff & data[i]; + digits[j++] = toBase16[octet >> 4]; + digits[j++] = toBase16[octet & 0xf]; + } + + return new String(digits); + } + + public static final char[] toBase16 = + { '0', '1', '2', '3', '4', '5', '6', + '7', '8', '9', 'a', 'b', 'c', 'd', + 'e', 'f' }; + + public static char getDigit(int hex_value) + throws Exception + { + if (hex_value > toBase16.length) + throw new Exception("Invalid hexadecimal value"); + + return toBase16[hex_value]; + } + + public static int getValue(char digit) + throws Exception + { + if ((digit >= '0') && (digit <= '9')) + return digit - '0'; + if ((digit >= 'A') && (digit <= 'F')) + return digit - 'A' + 0xA; + if ((digit >= 'a') && (digit <= 'f')) + return digit - 'a' + 0xA; + //error + throw new Exception("No hexadecimal digit."); + } +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/Base64Codec.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/Base64Codec.java.svn-base new file mode 100644 index 0000000..ab5256c --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/Base64Codec.java.svn-base @@ -0,0 +1,223 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +/** + * BASE64 encoding encodes 3 bytes into 4 characters. + * |11111122|22223333|33444444| Each set of 6 bits is encoded according to the + * toBase64 map. If the number of input bytes is not a multiple of 3, then the + * last group of 4 characters is padded with one or two = signs. Each output + * line is at most 76 characters. + */ + +public class Base64Codec +{ + + private final static int BYTE_GROUP = 3; + + private final static int CHAR_GROUP = 4; + + public static String encode(byte[] data) + { + int char_buff_length = (data.length / BYTE_GROUP) * CHAR_GROUP; + + if ((data.length % BYTE_GROUP) != 0) + char_buff_length += CHAR_GROUP; + + char[] char_buff = new char[char_buff_length]; + + int i = 0; + int remain = data.length; + for (int j = 0; j < data.length; j += BYTE_GROUP) { + + if (remain >= 3) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[((data[j] & 0x03) << 4) + | ((data[j + 1] & 0xF0) >> 4)]; + char_buff[i++] = toBase64[((data[j + 1] & 0x0F) << 2) + | ((data[j + 2] & 0xC0) >> 6)]; + char_buff[i++] = toBase64[data[j + 2] & 0x3F]; + } else if (remain == 1) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[(data[j] & 0x03) << 4]; + char_buff[i++] = '='; + char_buff[i++] = '='; + } else if (remain == 2) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[((data[j] & 0x03) << 4) + | ((data[j + 1] & 0xF0) >> 4)]; + char_buff[i++] = toBase64[(data[j + 1] & 0x0F) << 2]; + char_buff[i++] = '='; + } + remain -= BYTE_GROUP; + } + + return new String(char_buff); + } + + public final static byte[] decode(String str) + throws Exception + { + if ((str.length() % CHAR_GROUP) != 0) + throw new + Exception("Invalid string length, it must be multiple of 4"); + + char[] char_buff = str.toCharArray(); + + int data_chars = char_buff.length; + + while (char_buff[data_chars - 1] == '=') + data_chars--; + + int whites = char_buff.length - data_chars; + + int data_bytes = (data_chars / CHAR_GROUP) * BYTE_GROUP; + + if (whites == 1) + data_bytes += 2; + else if (whites == 2) + data_bytes += 1; + + byte[] data = new byte[data_bytes]; + + int[] group_value = new int[CHAR_GROUP]; + + int i = 0; + + int remain = data_bytes; + + for (int j = 0; j < char_buff.length; j += CHAR_GROUP) { + if (remain >= 3) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + group_value[2] = position(char_buff[j + 2]); + group_value[3] = position(char_buff[j + 3]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + data[i++] = (byte) ((group_value[1] << 4) + | (group_value[2] >> 2)); + data[i++] = (byte) ((group_value[2] << 6) + | group_value[3]); + } else if (remain == 2) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + group_value[2] = position(char_buff[j + 2]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + data[i++] = (byte) ((group_value[1] << 4) + | (group_value[2] >> 2)); + } else if (remain == 1) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + } + + remain -= BYTE_GROUP; + } + + return data; + } + + private final static int position(char value) + throws Exception + { + if ((value >= 'A') && (value <= 'Z')) { + return value - 'A'; + } else if ((value >= 'a') && (value <= 'z')) { + return value - 'a' + 26; + } else if ((value >= '0') && (value <= '9')) { + return value - '0' + 52; + } else if (value == '+') { + return 62; + } else if (value == '/') { + return 63; + } else if (value == '=') { + return -1; + } else + throw new Exception("Invalid character in string"); + } + + private final static char[] toBase64 = + { 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', + 'c', 'd', 'e', 'f', 'g', 'h', 'i', + 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', + '/' }; + + /* + * public static void main(String[] args) { for(int i = 0; i < + * toBase64.length; i++) { System.out.println("Value ("+i +") of " + + * toBase64[i] + " is " + ((int)toBase64[i])); } + * + * try { String str = "Hola cara-cola in the morning"; + * + * System.out.println("Initial " + str); + * + * byte[] data = str.getBytes(); + * + * String encoded = encode(data); + * + * System.out.println("Encoded " + encoded); + * + * byte[] decoded = decode(encoded); + * + * java.io.ByteArrayOutputStream buffer = new + * java.io.ByteArrayOutputStream(); + * + * buffer.write(decoded,0, decoded.length); + * + * String str_2 = buffer.toString(); + * + * System.out.println("Processed " + str_2); } catch (Throwable e) { + * e.printStackTrace(); } } + */ +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/CannotProceedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/CannotProceedException.java.svn-base new file mode 100644 index 0000000..2cc5e4a --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/CannotProceedException.java.svn-base @@ -0,0 +1,54 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class CannotProceedException extends Exception +{ + + public CannotProceedException(String message) + { + super(message); + } + +} + diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/CircularTraceFile.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/CircularTraceFile.java.svn-base new file mode 100644 index 0000000..bf19c2c --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/CircularTraceFile.java.svn-base @@ -0,0 +1,205 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.File; +import java.io.FileWriter; +import java.io.Writer; + +public class CircularTraceFile extends Writer +{ + + /** + * Base name for trace files + */ + private String m_name; + + /** + * Current trace file index + */ + private int m_current = 0; + + /** + * Current file descriptor + */ + private File m_current_file = null; + + /** + * Maximun size, in bytes, for a circular trace file, by default 100 K + */ + private long m_size = 102400; + + /** + * Circular file list size, by default 5 + */ + private int m_list_length = 5; + + /** + * File descriptors for trace + */ + private File[] m_files_list = null; + + /** + * Output writer for trace + */ + private FileWriter m_fw = null; + + public CircularTraceFile(int length, long size, String name) + throws java.io.IOException + { + if (length != 0) //si vale cero -> valor por defecto + m_list_length = length; + if (size != 0) //si vale cero -> valor por defecto + m_size = size; + m_name = name; + m_files_list = new File[m_list_length]; + try { + getInitFile(); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //constructor + + /* implementación de los metodos abstractos del writer */ + public void close() + { + for (int i = 0; i < m_list_length; i++) + m_files_list[i] = null; + } //close + + public void flush() + throws java.io.IOException + { + try { + m_fw.flush(); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //flush + + public void write(char[] cbuf, int off, int len) + { + try { + m_fw.write(cbuf, off, len); + m_fw.flush(); + if (m_current_file.length() >= m_size) + nextFile(); + } + catch (java.io.IOException ioex) {} + } //write + + /* fin implementacion de los metodos abstractos del writer */ + + // devuelve el siguiente fichero de la lista, es decir, sobre el + // que se deben seguir escribiendo las trazas + private void nextFile() + throws java.io.IOException + { + try { + m_fw.close(); + m_current = (m_current + 1) % m_list_length; + + if (m_files_list[m_current] == null) + //primera vez que se usa un fichero de la lista + m_files_list[m_current] = new File(m_name + m_current); + else + //el fichero se reutiliza --> debo vaciarlo (lo borro y lo creo de + // nuevo) + { + ((File) m_files_list[m_current]).delete(); + m_files_list[m_current] = new File(m_name + m_current); + (m_files_list[m_current]).createNewFile(); + } + m_current_file = (File) m_files_list[m_current]; + m_fw = new FileWriter(m_current_file.getPath(), true); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //nextFile + + //elige como fichero a utilizar inicialmente el más antiguo + private void getInitFile() + throws java.io.IOException + { + int i = 0; + File aux; + File selected = new File(m_name + 0); + int use = 0; //indice del vector de ficheros + + try { + while (i < m_list_length) { + aux = new File(m_name + i); + if (aux.exists()) { + m_files_list[i] = aux; + if (aux.lastModified() < selected.lastModified()) { + //selected es mas actual + selected = aux; + use = i; + } + } + i++; + } + m_current = use; + // En _files_list tenemos los nombres de los ficheros que existen + // Si el que vamos a usar no esta en la lista, es porque no existe + if (m_files_list[use] == null) // Lo apuntamos + m_files_list[use] = selected; + else + // El fichero a usar ya existe, lo limpiamos. + { + ((File) m_files_list[m_current]).delete(); + m_files_list[m_current] = new File(m_name + m_current); + (m_files_list[m_current]).createNewFile(); + } + m_current_file = (File) m_files_list[use]; + m_fw = new FileWriter(m_current_file.getPath(), true); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //getInitFile + +} //class CircularTraceFile diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/InvalidTraceLevelException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/InvalidTraceLevelException.java.svn-base new file mode 100644 index 0000000..ff3f487 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/InvalidTraceLevelException.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class InvalidTraceLevelException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/NoFileEspecifiedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/NoFileEspecifiedException.java.svn-base new file mode 100644 index 0000000..81b0bd1 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/NoFileEspecifiedException.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class NoFileEspecifiedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/NotActivatedException.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/NotActivatedException.java.svn-base new file mode 100644 index 0000000..5b35929 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/NotActivatedException.java.svn-base @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class NotActivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/OutputStreamWrapper.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/OutputStreamWrapper.java.svn-base new file mode 100644 index 0000000..12e35e5 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/OutputStreamWrapper.java.svn-base @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +/** + * A OutputStreamWrapper wraps a OutputStream like Sistem.out, + * and does not close the wrapped stream when close() is invoked. This is useful + * when trace streams does not have to close it. + * + * @version 1.0 + * @author Juan A. Caceres + * @since TIDorbJ 1.0.11 + */ + +public class OutputStreamWrapper extends java.io.OutputStream +{ + + private java.io.OutputStream m_stream; + + public OutputStreamWrapper(java.io.OutputStream stream) + { + m_stream = stream; + } + + public void flush() + throws java.io.IOException + { + if (m_stream != null) + m_stream.flush(); + } + + public void close() + throws java.io.IOException + { + // do_nothing + m_stream = null; + } + + public void write(int b) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(b); + } + + public void write(byte buf[]) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(buf); + } + + public void write(byte buf[], int off, int len) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(buf, off, len); + } + +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/SystemProperties.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/SystemProperties.java.svn-base new file mode 100644 index 0000000..f21c134 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/SystemProperties.java.svn-base @@ -0,0 +1,84 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +public class SystemProperties +{ + + public static String findProperty(String prop_key) + { + try { + String str_class = System.getProperty(prop_key); + + if (str_class != null) + return str_class; + + // search in system file properties + + String java_home = System.getProperty("java.home"); + + if (java_home != null) { + + String str_file = java_home + File.separator + "lib" + + File.separator + "orb.properties"; + + FileInputStream file_in = new FileInputStream(str_file); + Properties file_prop = new Properties(); + file_prop.load(file_in); + file_in.close(); + return file_prop.getProperty(prop_key); + } + } + catch (java.io.IOException ioe) {} + catch (SecurityException se) {} + catch (Throwable th) { + throw new org.omg.CORBA.INTERNAL("Unexpected Excepition"); + } + + return null; + } +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/Trace.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/Trace.java.svn-base new file mode 100644 index 0000000..9dabc48 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/Trace.java.svn-base @@ -0,0 +1,699 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Date; + +public class Trace +{ + + public final static int NONE = 0; + + public final static int ERROR = 1; + + public final static int USER = 2; + + public final static int DEBUG = 3; + + public final static int DEEP_DEBUG = 4; + + public final static int DUMP = 5; + + private final static String[] st_levels = { "NONE ", "ERROR ", "USER ", + "DEBUG ", "DEEP_DEBUG ", "DUMP " }; + + /** + * Trace Log Stream. + */ + private PrintWriter m_log; + + /** + * Aplication Name printed in log messages. + */ + protected String m_application_name; + + /** + * Current trace level. + */ + protected int m_level = NONE; + + /** + * Include the date in log messages. + */ + protected boolean m_include_date = true; + + /** + * Invokes the stream flush each x times. It improves the file output + * performance. + */ + protected int m_do_flush_at = 1; + + /** + * Printed messages counter + */ + protected int m_message_count = 0; + + /** + * Global static Trace instance. + */ + public static Trace global = null; + + /** ****************************************************** */ + private boolean m_activated_trace = true; + + private String m_circular_trace_file_name = ""; + + private CircularTraceFile m_circular_trace_file = null; + + /** ****************************************************** */ + + /** + * Private Constructor. + */ + private Trace(PrintWriter log, String applicationName, int level) + { + m_log = log; + m_level = level; + m_application_name = applicationName; + m_activated_trace = true; + } + + /** + * Creates the trace using the standard error output. + * + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(String applicationName, int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter( + new OutputStreamWrapper(System.err)))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given output stream. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(OutputStream log, String applicationName, + int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter(log))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given writer stream. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(Writer log, String applicationName, + int level) + throws IOException + { + PrintWriter writer = new PrintWriter(new BufferedWriter(log)); + + return new Trace(writer, applicationName, level); + } + + /** + * Creates the trace that will write messages in the given file. + * + * @param fileName + * messages file name. + * @param applicationName + * application name. It may be null. + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(String fileName, String applicationName, + int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new FileWriter(fileName))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given circular trace file. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(CircularTraceFile log, + String applicationName, int level) + throws IOException + { + PrintWriter writer = new PrintWriter(new BufferedWriter(log)); + + return new Trace(writer, applicationName, level); + + } + + /** + * Sets the trace level. If level is 0 traces will be deactivated. + * + * @param level + * new trace level + */ + public void setLevel(int level) + { + m_level = level; + } + public int getLevel() + { + return m_level; + } + + /** + * Activates/deactivates the date inclussion in trace messages. + * + * @param value + * if true include it, otherwise do not. + */ + public void setIncludeDate(boolean value) + { + m_include_date = value; + } + + /** + * Sets each times the stream flush operation is invoked. It improves the + * file output performance. + * + * @param value + * buffer flush round. + */ + public void setDoFlushAt(int value) + { + if (value > 0) + m_do_flush_at = value; + } + + /** + * @return the buffer flush round value. + */ + public int getDoFlushAt() + { + return m_do_flush_at; + } + + /** + * @return the log stream used by the trace instance. + */ + public PrintWriter getLog() + { + return m_log; + } + + /** + * Forces the buffered stream flushing. + */ + public void flush() + { + if (m_log != null) { + m_log.flush(); + } + } + + /** + * Closes the trace log stream. + */ + public synchronized void close() + { + if (m_log != null) { + m_log.println("LOG CLOSED"); + m_log.close(); + m_log = null; + } + } + + /** + * Prints the message if the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + */ + public void print(int level, String message) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + m_log.print(st_levels[level]); + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + m_log.println(message); + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + } + catch (Throwable th) {} + } + } + } + + /** + * Compounds and Prints the message chunks if the trace level is less or + * equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + public void print(int level, String[] message) + { + + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + + for (int i = 0; i < message.length; i++) + m_log.print(message[i]); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + + } + catch (Throwable th) {} + } + } + } + + /** + * Prints the Exception "e" and its backtrace to the _log print writer if + * the trace level is less or equal than current. + * + * @param level + * message trace level + * @param e + * the Exception object with the backtrace to be written. + */ + public void printStackTrace(int level, String msg, Throwable e) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) + if (m_application_name.length() > 0) { + m_log.print(m_application_name); + m_log.print(" "); + } + + m_log.print(msg); + m_log.println(); + + e.printStackTrace(m_log); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + } + catch (Throwable th) {} + } + } + } + + /** + * Compounds and Prints the message chunks if the trace level is less or + * equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + public void printStackTrace(int level, String[] message, Throwable ex) + { + if (m_log == null) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + + for (int i = 0; i < message.length; i++) + m_log.print(message[i]); + + m_log.println(); + + ex.printStackTrace(m_log); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + + } + catch (Throwable th) {} + } + } + } + + public static void printStackTrace_st(int level, String[] msg, Throwable e) + { + if (global != null) + global.printStackTrace(level, msg, e); + } + + public static void printStackTrace_st(int level, String msg, Throwable e) + { + if (global != null) + global.printStackTrace(level, msg, e); + } + + /** + * Prints the messages in the global trace instance if the trace level is + * less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + */ + + public static void print_st(int level, String message) + { + if (global != null) + global.print(level, message); + } + + /** + * Compounds and Prints the message chunks in the global trace instance if + * the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + + public static void print_st(int level, String[] message) + { + if (global != null) + global.print(level, message); + } + + /** ********************************************************************* */ + /** **************** METODOS PARA GESTION REMOTA *********************** */ + /** ********************************************************************* */ + + public void setTraceFile(String name) + throws CannotProceedException + { + if (!m_circular_trace_file_name.equals("")) + throw new CannotProceedException( + "The Circular Trace File nas already been stablished"); + else { + m_circular_trace_file_name = name; + try { + m_circular_trace_file = new CircularTraceFile(0, 0, name); + //init circular trace files with default values (0,0) + } + catch (java.io.IOException ioex) { + throw new + CannotProceedException("Cannot crate circular trace file"); + } + PrintWriter writer = + new PrintWriter( + new BufferedWriter(m_circular_trace_file)); + m_log = writer; + } + } //set_trace_file + + public String getTraceFile() + throws NoFileEspecifiedException + { + if (m_circular_trace_file_name.equals("")) + throw new NoFileEspecifiedException(); + else + return m_circular_trace_file_name; + } + + public void activateTrace() + throws AlreadyActivatedException + { + if (m_activated_trace) + throw new AlreadyActivatedException(); + else + m_activated_trace = true; + } //activate_trace + + public void deactivateTrace() + throws AlreadyDeactivatedException + { + if (!m_activated_trace) + throw new AlreadyDeactivatedException(); + else + m_activated_trace = false; + return; + }//deactivate_trace + + public void setTraceLevel(int tr_l) + throws NotActivatedException, + InvalidTraceLevelException + { + if ((tr_l < NONE) || (tr_l > DEEP_DEBUG)) + throw new InvalidTraceLevelException(); + + if (!m_activated_trace) + throw new NotActivatedException(); + + m_level = tr_l; + return; + } //set_trace_level + + /** ********************************************************************* */ + /** ************** FIN METODOS GESTION REMOTA *************************** */ + /** ********************************************************************* */ + + /** + * Prints dump of a GIOP message if the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + * @param length + * the trace length message to be written. + */ + public void dump(int level, byte[] message, int length) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + + char line[] = new char[17]; + int position = 0; + + for(int i = 0; i < length; i++) { + + if ( ((i % 8) == 0) && (i > 0) ) + m_log.print(" "); + + if ( ((i % 16) == 0) && (i > 0) ){ + line[16] = '\0'; + m_log.print(" "); + for (int j = 0; j < 16; j++) + m_log.print(line[j]); + m_log.print('\n'); + position = 0; + } + + // Fix bug [#399] Compilation error with JDK 1.4 + //m_log.print(String.format("%02X", message[i]) + " "); + String hex = Integer.toHexString(message[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + m_log.print("0" + hex); + break; + case 2: + m_log.print(hex); + break; + default: + m_log.print(hex.substring(hlength-2, hlength)); + } + m_log.print(" "); + + if ( (message[i] >= 32) && (message[i] <= 126) ) // Is in ascii char set? + line[position] = (char)message[i]; + else + line[position] = '.'; + + position++; + } + + line[position] = '\0'; + + int blank_fill_length = 49 - (position*3) + (position > 8 ? 2 : 3); + for (int k = 1; k < blank_fill_length; k++) + m_log.print(" "); + for (int j = 0; j < position; j++) + m_log.print(line[j]); + + m_log.print('\n'); + + } + catch (Throwable th) {} + } + } + } + + + +} //Trace diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/TranslateURLEscapes.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/TranslateURLEscapes.java.svn-base new file mode 100644 index 0000000..130ae64 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/TranslateURLEscapes.java.svn-base @@ -0,0 +1,164 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class TranslateURLEscapes +{ + public static String putEscapes(String name) + { + int position; + String cnescapes = translateEscapes(name); + position = cnescapes.indexOf("%5c%5c"); + while (position != -1) // Change \ + { + cnescapes = cnescapes.substring(0, position) + "\\\\" + + cnescapes.substring(position + 6); + position = cnescapes.indexOf("%5c%5c", position); + } + position = cnescapes.indexOf("%5c/"); + while (position != -1) // Change / + { + cnescapes = cnescapes.substring(0, position) + "\\<" + + cnescapes.substring(position + 4); + position = cnescapes.indexOf("%5c/", position); + } + position = cnescapes.indexOf("%5c."); + while (position != -1) // Change . + { + cnescapes = cnescapes.substring(0, position) + "\\>" + + cnescapes.substring(position + 4); + position = cnescapes.indexOf("%5c.", position); + } + return cnescapes; + } + + public static String translateEscapes(String str) + { + String strescapes = ""; + String no_escapes = ";/:?@&=+$,-_.!~*'()"; + char c; + for (int i = 0; i < str.length(); i++) { + c = str.charAt(i); + if (no_escapes.indexOf(c) == -1 && !Character.isLetterOrDigit(c)) + strescapes = strescapes + "%" + Integer.toHexString((int) c); + else + strescapes = strescapes + c; + } + return strescapes; + } + + public static String resolveEscapes(String str) + { + int position; + String strescapes = str; + position = strescapes.indexOf("\\\\"); // Resolve \ + while (position != -1) { + strescapes = strescapes.substring(0, position) + "%5c" + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\\\", position); + } + position = strescapes.indexOf("\\<"); // Resolve / + while (position != -1) { + strescapes = strescapes.substring(0, position) + "/" + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\<", position); + } + position = strescapes.indexOf("\\>"); // Resolve . + while (position != -1) { + strescapes = strescapes.substring(0, position) + "." + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\>", position); + } + return strescapes; + } + + public static String stringfy(String str) + { + int position; + String stringfied = str; + String hex; + int nunicode; + position = stringfied.indexOf("\\"); // Reading \ + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\\\" + + stringfied.substring(position + 1); + position = stringfied.indexOf("\\", position + 2); + } + position = stringfied.indexOf("."); // Reading . + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\." + + stringfied.substring(position + 1); + position = stringfied.indexOf(".", position + 2); + } + position = stringfied.indexOf("/"); // Reading / + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\/" + + stringfied.substring(position + 1); + position = stringfied.indexOf("/", position + 2); + } + position = stringfied.indexOf("%5c"); // Reading \ hex + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\\\" + + stringfied.substring(position + 3); + position = stringfied.indexOf("%5c", position); + } + return translateUnicode(stringfied); + } + + public static String translateUnicode(String str) + { + String hex; + int nunicode; + String unicode = str; + int position = unicode.indexOf("%"); // Reading %hexhex + while (position != -1) { + hex = unicode.substring(position + 1, position + 3); + nunicode = Integer.parseInt(hex, 16); + unicode = unicode.substring(0, position) + (char) nunicode + + unicode.substring(position + 3); + position = unicode.indexOf("%", position); + } + return unicode; + } + +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/.svn/text-base/UTC.java.svn-base b/util/es/tid/TIDorbj/util/.svn/text-base/UTC.java.svn-base new file mode 100644 index 0000000..bc8d6b7 --- /dev/null +++ b/util/es/tid/TIDorbj/util/.svn/text-base/UTC.java.svn-base @@ -0,0 +1,96 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision$ +* Date: $Date$ +* Last modified by: $Author$ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.util; + +import java.util.TimeZone; + +/** + * Utility class to convert time to UTC using Gregorian Calendar. + * Gregorian calendar base time is 15th October 1582 00:00. + * Java System time takes as base time 1th January 1970. + * This class also has operations to convert types of the TimeBase module . + * + * @author caceres + * + */ + +public class UTC +{ + /** + * 1/1/1970 00:00 time in Gregorian Calendar + */ + public final static long GREGORIAN_CUTOVER = 12219292800000L; + + + /** + * Gets the current time in millisecons from 15th October 1582 00:00 + * @return the value in millisecons + */ + public static long currentUtcTimeMillis() + { + return System.currentTimeMillis() + + GREGORIAN_CUTOVER; // current time is form 1th Jan 1973 0:0 + } + + /** + * Converts milliseconds to TimeBase::TimeT units (1 = 100 ns.) + * @param timeInMillis + * @return + */ + public static long toTimeT(long timeInMilliseconds) + { + return timeInMilliseconds * 10000; + } + + /** + * Converts TimeBase::TimeT units (1 = 100 ns.) to milliseconds + * @param timeInMillis + * @return + */ + public static long toTimeInMillis(long timeT) + { + return timeT / 10000; + } + +} diff --git a/util/es/tid/TIDorbj/util/AlreadyActivatedException.java b/util/es/tid/TIDorbj/util/AlreadyActivatedException.java new file mode 100644 index 0000000..f7d65d5 --- /dev/null +++ b/util/es/tid/TIDorbj/util/AlreadyActivatedException.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class AlreadyActivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/AlreadyDeactivatedException.java b/util/es/tid/TIDorbj/util/AlreadyDeactivatedException.java new file mode 100644 index 0000000..acd10b4 --- /dev/null +++ b/util/es/tid/TIDorbj/util/AlreadyDeactivatedException.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class AlreadyDeactivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/Base16Codec.java b/util/es/tid/TIDorbj/util/Base16Codec.java new file mode 100644 index 0000000..10afa1b --- /dev/null +++ b/util/es/tid/TIDorbj/util/Base16Codec.java @@ -0,0 +1,128 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public abstract class Base16Codec +{ + + public static byte[] decode(String str) + throws Exception + { + int str_length = str.length(); + + if ((str_length % 2) != 0) + throw new Exception("Invalid String length"); + + byte[] data = new byte[str_length / 2]; + + decode(str, data, 0); + + return data; + } + + public static void decode(String str, byte[] data, int data_offset) + throws Exception + { + char[] str_chars = str.toCharArray(); + + int final_position = data_offset + (str.length() / 2); + + int j = 0; + + for (int i = data_offset; i < final_position; i++) + data[i] = (byte) (16 * (getValue(str_chars[j++])) + + getValue(str_chars[j++])); + + str_chars = null; + } + + public static String encode(byte[] data) + { + return encode(data, 0, data.length); + } + + public static String encode(byte[] data, int offset, int length) + { + + char[] digits = new char[2 * length]; + int octet = 0; + int j = 0; + + int final_position = offset + length; + + for (int i = offset; i < final_position; i++) { + octet = 0xff & data[i]; + digits[j++] = toBase16[octet >> 4]; + digits[j++] = toBase16[octet & 0xf]; + } + + return new String(digits); + } + + public static final char[] toBase16 = + { '0', '1', '2', '3', '4', '5', '6', + '7', '8', '9', 'a', 'b', 'c', 'd', + 'e', 'f' }; + + public static char getDigit(int hex_value) + throws Exception + { + if (hex_value > toBase16.length) + throw new Exception("Invalid hexadecimal value"); + + return toBase16[hex_value]; + } + + public static int getValue(char digit) + throws Exception + { + if ((digit >= '0') && (digit <= '9')) + return digit - '0'; + if ((digit >= 'A') && (digit <= 'F')) + return digit - 'A' + 0xA; + if ((digit >= 'a') && (digit <= 'f')) + return digit - 'a' + 0xA; + //error + throw new Exception("No hexadecimal digit."); + } +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/Base64Codec.java b/util/es/tid/TIDorbj/util/Base64Codec.java new file mode 100644 index 0000000..4059c9f --- /dev/null +++ b/util/es/tid/TIDorbj/util/Base64Codec.java @@ -0,0 +1,223 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +/** + * BASE64 encoding encodes 3 bytes into 4 characters. + * |11111122|22223333|33444444| Each set of 6 bits is encoded according to the + * toBase64 map. If the number of input bytes is not a multiple of 3, then the + * last group of 4 characters is padded with one or two = signs. Each output + * line is at most 76 characters. + */ + +public class Base64Codec +{ + + private final static int BYTE_GROUP = 3; + + private final static int CHAR_GROUP = 4; + + public static String encode(byte[] data) + { + int char_buff_length = (data.length / BYTE_GROUP) * CHAR_GROUP; + + if ((data.length % BYTE_GROUP) != 0) + char_buff_length += CHAR_GROUP; + + char[] char_buff = new char[char_buff_length]; + + int i = 0; + int remain = data.length; + for (int j = 0; j < data.length; j += BYTE_GROUP) { + + if (remain >= 3) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[((data[j] & 0x03) << 4) + | ((data[j + 1] & 0xF0) >> 4)]; + char_buff[i++] = toBase64[((data[j + 1] & 0x0F) << 2) + | ((data[j + 2] & 0xC0) >> 6)]; + char_buff[i++] = toBase64[data[j + 2] & 0x3F]; + } else if (remain == 1) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[(data[j] & 0x03) << 4]; + char_buff[i++] = '='; + char_buff[i++] = '='; + } else if (remain == 2) { + char_buff[i++] = toBase64[(data[j] & 0xFC) >> 2]; + char_buff[i++] = toBase64[((data[j] & 0x03) << 4) + | ((data[j + 1] & 0xF0) >> 4)]; + char_buff[i++] = toBase64[(data[j + 1] & 0x0F) << 2]; + char_buff[i++] = '='; + } + remain -= BYTE_GROUP; + } + + return new String(char_buff); + } + + public final static byte[] decode(String str) + throws Exception + { + if ((str.length() % CHAR_GROUP) != 0) + throw new + Exception("Invalid string length, it must be multiple of 4"); + + char[] char_buff = str.toCharArray(); + + int data_chars = char_buff.length; + + while (char_buff[data_chars - 1] == '=') + data_chars--; + + int whites = char_buff.length - data_chars; + + int data_bytes = (data_chars / CHAR_GROUP) * BYTE_GROUP; + + if (whites == 1) + data_bytes += 2; + else if (whites == 2) + data_bytes += 1; + + byte[] data = new byte[data_bytes]; + + int[] group_value = new int[CHAR_GROUP]; + + int i = 0; + + int remain = data_bytes; + + for (int j = 0; j < char_buff.length; j += CHAR_GROUP) { + if (remain >= 3) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + group_value[2] = position(char_buff[j + 2]); + group_value[3] = position(char_buff[j + 3]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + data[i++] = (byte) ((group_value[1] << 4) + | (group_value[2] >> 2)); + data[i++] = (byte) ((group_value[2] << 6) + | group_value[3]); + } else if (remain == 2) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + group_value[2] = position(char_buff[j + 2]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + data[i++] = (byte) ((group_value[1] << 4) + | (group_value[2] >> 2)); + } else if (remain == 1) { + group_value[0] = position(char_buff[j]); + group_value[1] = position(char_buff[j + 1]); + + data[i++] = (byte) ((group_value[0] << 2) + | (group_value[1] >> 4)); + } + + remain -= BYTE_GROUP; + } + + return data; + } + + private final static int position(char value) + throws Exception + { + if ((value >= 'A') && (value <= 'Z')) { + return value - 'A'; + } else if ((value >= 'a') && (value <= 'z')) { + return value - 'a' + 26; + } else if ((value >= '0') && (value <= '9')) { + return value - '0' + 52; + } else if (value == '+') { + return 62; + } else if (value == '/') { + return 63; + } else if (value == '=') { + return -1; + } else + throw new Exception("Invalid character in string"); + } + + private final static char[] toBase64 = + { 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', + 'c', 'd', 'e', 'f', 'g', 'h', 'i', + 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', + '/' }; + + /* + * public static void main(String[] args) { for(int i = 0; i < + * toBase64.length; i++) { System.out.println("Value ("+i +") of " + + * toBase64[i] + " is " + ((int)toBase64[i])); } + * + * try { String str = "Hola cara-cola in the morning"; + * + * System.out.println("Initial " + str); + * + * byte[] data = str.getBytes(); + * + * String encoded = encode(data); + * + * System.out.println("Encoded " + encoded); + * + * byte[] decoded = decode(encoded); + * + * java.io.ByteArrayOutputStream buffer = new + * java.io.ByteArrayOutputStream(); + * + * buffer.write(decoded,0, decoded.length); + * + * String str_2 = buffer.toString(); + * + * System.out.println("Processed " + str_2); } catch (Throwable e) { + * e.printStackTrace(); } } + */ +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/CannotProceedException.java b/util/es/tid/TIDorbj/util/CannotProceedException.java new file mode 100644 index 0000000..10b5118 --- /dev/null +++ b/util/es/tid/TIDorbj/util/CannotProceedException.java @@ -0,0 +1,54 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class CannotProceedException extends Exception +{ + + public CannotProceedException(String message) + { + super(message); + } + +} + diff --git a/util/es/tid/TIDorbj/util/CircularTraceFile.java b/util/es/tid/TIDorbj/util/CircularTraceFile.java new file mode 100644 index 0000000..305316e --- /dev/null +++ b/util/es/tid/TIDorbj/util/CircularTraceFile.java @@ -0,0 +1,205 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.File; +import java.io.FileWriter; +import java.io.Writer; + +public class CircularTraceFile extends Writer +{ + + /** + * Base name for trace files + */ + private String m_name; + + /** + * Current trace file index + */ + private int m_current = 0; + + /** + * Current file descriptor + */ + private File m_current_file = null; + + /** + * Maximun size, in bytes, for a circular trace file, by default 100 K + */ + private long m_size = 102400; + + /** + * Circular file list size, by default 5 + */ + private int m_list_length = 5; + + /** + * File descriptors for trace + */ + private File[] m_files_list = null; + + /** + * Output writer for trace + */ + private FileWriter m_fw = null; + + public CircularTraceFile(int length, long size, String name) + throws java.io.IOException + { + if (length != 0) //si vale cero -> valor por defecto + m_list_length = length; + if (size != 0) //si vale cero -> valor por defecto + m_size = size; + m_name = name; + m_files_list = new File[m_list_length]; + try { + getInitFile(); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //constructor + + /* implementación de los metodos abstractos del writer */ + public void close() + { + for (int i = 0; i < m_list_length; i++) + m_files_list[i] = null; + } //close + + public void flush() + throws java.io.IOException + { + try { + m_fw.flush(); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //flush + + public void write(char[] cbuf, int off, int len) + { + try { + m_fw.write(cbuf, off, len); + m_fw.flush(); + if (m_current_file.length() >= m_size) + nextFile(); + } + catch (java.io.IOException ioex) {} + } //write + + /* fin implementacion de los metodos abstractos del writer */ + + // devuelve el siguiente fichero de la lista, es decir, sobre el + // que se deben seguir escribiendo las trazas + private void nextFile() + throws java.io.IOException + { + try { + m_fw.close(); + m_current = (m_current + 1) % m_list_length; + + if (m_files_list[m_current] == null) + //primera vez que se usa un fichero de la lista + m_files_list[m_current] = new File(m_name + m_current); + else + //el fichero se reutiliza --> debo vaciarlo (lo borro y lo creo de + // nuevo) + { + ((File) m_files_list[m_current]).delete(); + m_files_list[m_current] = new File(m_name + m_current); + (m_files_list[m_current]).createNewFile(); + } + m_current_file = (File) m_files_list[m_current]; + m_fw = new FileWriter(m_current_file.getPath(), true); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //nextFile + + //elige como fichero a utilizar inicialmente el más antiguo + private void getInitFile() + throws java.io.IOException + { + int i = 0; + File aux; + File selected = new File(m_name + 0); + int use = 0; //indice del vector de ficheros + + try { + while (i < m_list_length) { + aux = new File(m_name + i); + if (aux.exists()) { + m_files_list[i] = aux; + if (aux.lastModified() < selected.lastModified()) { + //selected es mas actual + selected = aux; + use = i; + } + } + i++; + } + m_current = use; + // En _files_list tenemos los nombres de los ficheros que existen + // Si el que vamos a usar no esta en la lista, es porque no existe + if (m_files_list[use] == null) // Lo apuntamos + m_files_list[use] = selected; + else + // El fichero a usar ya existe, lo limpiamos. + { + ((File) m_files_list[m_current]).delete(); + m_files_list[m_current] = new File(m_name + m_current); + (m_files_list[m_current]).createNewFile(); + } + m_current_file = (File) m_files_list[use]; + m_fw = new FileWriter(m_current_file.getPath(), true); + } + catch (java.io.IOException ioex) { + throw ioex; + } + } //getInitFile + +} //class CircularTraceFile diff --git a/util/es/tid/TIDorbj/util/InvalidTraceLevelException.java b/util/es/tid/TIDorbj/util/InvalidTraceLevelException.java new file mode 100644 index 0000000..ffd986a --- /dev/null +++ b/util/es/tid/TIDorbj/util/InvalidTraceLevelException.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class InvalidTraceLevelException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/NoFileEspecifiedException.java b/util/es/tid/TIDorbj/util/NoFileEspecifiedException.java new file mode 100644 index 0000000..5067406 --- /dev/null +++ b/util/es/tid/TIDorbj/util/NoFileEspecifiedException.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class NoFileEspecifiedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/NotActivatedException.java b/util/es/tid/TIDorbj/util/NotActivatedException.java new file mode 100644 index 0000000..f6df514 --- /dev/null +++ b/util/es/tid/TIDorbj/util/NotActivatedException.java @@ -0,0 +1,46 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class NotActivatedException extends Exception +{} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/OutputStreamWrapper.java b/util/es/tid/TIDorbj/util/OutputStreamWrapper.java new file mode 100644 index 0000000..8c23346 --- /dev/null +++ b/util/es/tid/TIDorbj/util/OutputStreamWrapper.java @@ -0,0 +1,100 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +/** + * A OutputStreamWrapper wraps a OutputStream like Sistem.out, + * and does not close the wrapped stream when close() is invoked. This is useful + * when trace streams does not have to close it. + * + * @version 1.0 + * @author Juan A. Caceres + * @since TIDorbJ 1.0.11 + */ + +public class OutputStreamWrapper extends java.io.OutputStream +{ + + private java.io.OutputStream m_stream; + + public OutputStreamWrapper(java.io.OutputStream stream) + { + m_stream = stream; + } + + public void flush() + throws java.io.IOException + { + if (m_stream != null) + m_stream.flush(); + } + + public void close() + throws java.io.IOException + { + // do_nothing + m_stream = null; + } + + public void write(int b) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(b); + } + + public void write(byte buf[]) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(buf); + } + + public void write(byte buf[], int off, int len) + throws java.io.IOException + { + if (m_stream != null) + m_stream.write(buf, off, len); + } + +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/SystemProperties.java b/util/es/tid/TIDorbj/util/SystemProperties.java new file mode 100644 index 0000000..a4038f7 --- /dev/null +++ b/util/es/tid/TIDorbj/util/SystemProperties.java @@ -0,0 +1,84 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.File; +import java.io.FileInputStream; +import java.util.Properties; + +public class SystemProperties +{ + + public static String findProperty(String prop_key) + { + try { + String str_class = System.getProperty(prop_key); + + if (str_class != null) + return str_class; + + // search in system file properties + + String java_home = System.getProperty("java.home"); + + if (java_home != null) { + + String str_file = java_home + File.separator + "lib" + + File.separator + "orb.properties"; + + FileInputStream file_in = new FileInputStream(str_file); + Properties file_prop = new Properties(); + file_prop.load(file_in); + file_in.close(); + return file_prop.getProperty(prop_key); + } + } + catch (java.io.IOException ioe) {} + catch (SecurityException se) {} + catch (Throwable th) { + throw new org.omg.CORBA.INTERNAL("Unexpected Excepition"); + } + + return null; + } +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/Trace.java b/util/es/tid/TIDorbj/util/Trace.java new file mode 100644 index 0000000..8a6b37a --- /dev/null +++ b/util/es/tid/TIDorbj/util/Trace.java @@ -0,0 +1,699 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 211 $ +* Date: $Date: 2008-02-22 07:46:45 +0100 (Fri, 22 Feb 2008) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.Writer; +import java.util.Date; + +public class Trace +{ + + public final static int NONE = 0; + + public final static int ERROR = 1; + + public final static int USER = 2; + + public final static int DEBUG = 3; + + public final static int DEEP_DEBUG = 4; + + public final static int DUMP = 5; + + private final static String[] st_levels = { "NONE ", "ERROR ", "USER ", + "DEBUG ", "DEEP_DEBUG ", "DUMP " }; + + /** + * Trace Log Stream. + */ + private PrintWriter m_log; + + /** + * Aplication Name printed in log messages. + */ + protected String m_application_name; + + /** + * Current trace level. + */ + protected int m_level = NONE; + + /** + * Include the date in log messages. + */ + protected boolean m_include_date = true; + + /** + * Invokes the stream flush each x times. It improves the file output + * performance. + */ + protected int m_do_flush_at = 1; + + /** + * Printed messages counter + */ + protected int m_message_count = 0; + + /** + * Global static Trace instance. + */ + public static Trace global = null; + + /** ****************************************************** */ + private boolean m_activated_trace = true; + + private String m_circular_trace_file_name = ""; + + private CircularTraceFile m_circular_trace_file = null; + + /** ****************************************************** */ + + /** + * Private Constructor. + */ + private Trace(PrintWriter log, String applicationName, int level) + { + m_log = log; + m_level = level; + m_application_name = applicationName; + m_activated_trace = true; + } + + /** + * Creates the trace using the standard error output. + * + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(String applicationName, int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter( + new OutputStreamWrapper(System.err)))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given output stream. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(OutputStream log, String applicationName, + int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter(log))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given writer stream. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(Writer log, String applicationName, + int level) + throws IOException + { + PrintWriter writer = new PrintWriter(new BufferedWriter(log)); + + return new Trace(writer, applicationName, level); + } + + /** + * Creates the trace that will write messages in the given file. + * + * @param fileName + * messages file name. + * @param applicationName + * application name. It may be null. + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(String fileName, String applicationName, + int level) + throws IOException + { + PrintWriter writer = + new PrintWriter( + new BufferedWriter( + new FileWriter(fileName))); + + return new Trace(writer, applicationName, level); + + } + + /** + * Creates the trace using the given circular trace file. + * + * @param log + * the output stream where the messages will be written. + * @param applicationName + * may be null + * @param level + * trace level addopted + * @return a new Trace instance + */ + public static Trace createTrace(CircularTraceFile log, + String applicationName, int level) + throws IOException + { + PrintWriter writer = new PrintWriter(new BufferedWriter(log)); + + return new Trace(writer, applicationName, level); + + } + + /** + * Sets the trace level. If level is 0 traces will be deactivated. + * + * @param level + * new trace level + */ + public void setLevel(int level) + { + m_level = level; + } + public int getLevel() + { + return m_level; + } + + /** + * Activates/deactivates the date inclussion in trace messages. + * + * @param value + * if true include it, otherwise do not. + */ + public void setIncludeDate(boolean value) + { + m_include_date = value; + } + + /** + * Sets each times the stream flush operation is invoked. It improves the + * file output performance. + * + * @param value + * buffer flush round. + */ + public void setDoFlushAt(int value) + { + if (value > 0) + m_do_flush_at = value; + } + + /** + * @return the buffer flush round value. + */ + public int getDoFlushAt() + { + return m_do_flush_at; + } + + /** + * @return the log stream used by the trace instance. + */ + public PrintWriter getLog() + { + return m_log; + } + + /** + * Forces the buffered stream flushing. + */ + public void flush() + { + if (m_log != null) { + m_log.flush(); + } + } + + /** + * Closes the trace log stream. + */ + public synchronized void close() + { + if (m_log != null) { + m_log.println("LOG CLOSED"); + m_log.close(); + m_log = null; + } + } + + /** + * Prints the message if the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + */ + public void print(int level, String message) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + m_log.print(st_levels[level]); + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + m_log.println(message); + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + } + catch (Throwable th) {} + } + } + } + + /** + * Compounds and Prints the message chunks if the trace level is less or + * equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + public void print(int level, String[] message) + { + + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + + for (int i = 0; i < message.length; i++) + m_log.print(message[i]); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + + } + catch (Throwable th) {} + } + } + } + + /** + * Prints the Exception "e" and its backtrace to the _log print writer if + * the trace level is less or equal than current. + * + * @param level + * message trace level + * @param e + * the Exception object with the backtrace to be written. + */ + public void printStackTrace(int level, String msg, Throwable e) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) + if (m_application_name.length() > 0) { + m_log.print(m_application_name); + m_log.print(" "); + } + + m_log.print(msg); + m_log.println(); + + e.printStackTrace(m_log); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + } + catch (Throwable th) {} + } + } + } + + /** + * Compounds and Prints the message chunks if the trace level is less or + * equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + public void printStackTrace(int level, String[] message, Throwable ex) + { + if (m_log == null) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + + m_log.print('['); + m_log.print(m_message_count++); + m_log.print("] "); + + m_log.print(st_levels[level]); + + if (m_include_date) { + m_log.print((new Date()).toString()); + m_log.print(" "); + } + + if (m_application_name != null) { + m_log.print(m_application_name); + m_log.print(" "); + } + + for (int i = 0; i < message.length; i++) + m_log.print(message[i]); + + m_log.println(); + + ex.printStackTrace(m_log); + + m_log.println(); + + if ((m_message_count % m_do_flush_at) == 0) + m_log.flush(); + + } + catch (Throwable th) {} + } + } + } + + public static void printStackTrace_st(int level, String[] msg, Throwable e) + { + if (global != null) + global.printStackTrace(level, msg, e); + } + + public static void printStackTrace_st(int level, String msg, Throwable e) + { + if (global != null) + global.printStackTrace(level, msg, e); + } + + /** + * Prints the messages in the global trace instance if the trace level is + * less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + */ + + public static void print_st(int level, String message) + { + if (global != null) + global.print(level, message); + } + + /** + * Compounds and Prints the message chunks in the global trace instance if + * the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message chunks to be written. + */ + + public static void print_st(int level, String[] message) + { + if (global != null) + global.print(level, message); + } + + /** ********************************************************************* */ + /** **************** METODOS PARA GESTION REMOTA *********************** */ + /** ********************************************************************* */ + + public void setTraceFile(String name) + throws CannotProceedException + { + if (!m_circular_trace_file_name.equals("")) + throw new CannotProceedException( + "The Circular Trace File nas already been stablished"); + else { + m_circular_trace_file_name = name; + try { + m_circular_trace_file = new CircularTraceFile(0, 0, name); + //init circular trace files with default values (0,0) + } + catch (java.io.IOException ioex) { + throw new + CannotProceedException("Cannot crate circular trace file"); + } + PrintWriter writer = + new PrintWriter( + new BufferedWriter(m_circular_trace_file)); + m_log = writer; + } + } //set_trace_file + + public String getTraceFile() + throws NoFileEspecifiedException + { + if (m_circular_trace_file_name.equals("")) + throw new NoFileEspecifiedException(); + else + return m_circular_trace_file_name; + } + + public void activateTrace() + throws AlreadyActivatedException + { + if (m_activated_trace) + throw new AlreadyActivatedException(); + else + m_activated_trace = true; + } //activate_trace + + public void deactivateTrace() + throws AlreadyDeactivatedException + { + if (!m_activated_trace) + throw new AlreadyDeactivatedException(); + else + m_activated_trace = false; + return; + }//deactivate_trace + + public void setTraceLevel(int tr_l) + throws NotActivatedException, + InvalidTraceLevelException + { + if ((tr_l < NONE) || (tr_l > DEEP_DEBUG)) + throw new InvalidTraceLevelException(); + + if (!m_activated_trace) + throw new NotActivatedException(); + + m_level = tr_l; + return; + } //set_trace_level + + /** ********************************************************************* */ + /** ************** FIN METODOS GESTION REMOTA *************************** */ + /** ********************************************************************* */ + + /** + * Prints dump of a GIOP message if the trace level is less or equal than current. + * + * @param level + * message trace level + * @param message + * the trace message to be written. + * @param length + * the trace length message to be written. + */ + public void dump(int level, byte[] message, int length) + { + if ((m_log == null) || (!m_activated_trace)) + return; + + if (level <= m_level) { + synchronized (m_log) { + try { + + char line[] = new char[17]; + int position = 0; + + for(int i = 0; i < length; i++) { + + if ( ((i % 8) == 0) && (i > 0) ) + m_log.print(" "); + + if ( ((i % 16) == 0) && (i > 0) ){ + line[16] = '\0'; + m_log.print(" "); + for (int j = 0; j < 16; j++) + m_log.print(line[j]); + m_log.print('\n'); + position = 0; + } + + // Fix bug [#399] Compilation error with JDK 1.4 + //m_log.print(String.format("%02X", message[i]) + " "); + String hex = Integer.toHexString(message[i]); + int hlength = hex.length(); + switch (hlength) { + case 0: + break; + case 1: + m_log.print("0" + hex); + break; + case 2: + m_log.print(hex); + break; + default: + m_log.print(hex.substring(hlength-2, hlength)); + } + m_log.print(" "); + + if ( (message[i] >= 32) && (message[i] <= 126) ) // Is in ascii char set? + line[position] = (char)message[i]; + else + line[position] = '.'; + + position++; + } + + line[position] = '\0'; + + int blank_fill_length = 49 - (position*3) + (position > 8 ? 2 : 3); + for (int k = 1; k < blank_fill_length; k++) + m_log.print(" "); + for (int j = 0; j < position; j++) + m_log.print(line[j]); + + m_log.print('\n'); + + } + catch (Throwable th) {} + } + } + } + + + +} //Trace diff --git a/util/es/tid/TIDorbj/util/TranslateURLEscapes.java b/util/es/tid/TIDorbj/util/TranslateURLEscapes.java new file mode 100644 index 0000000..7d8f021 --- /dev/null +++ b/util/es/tid/TIDorbj/util/TranslateURLEscapes.java @@ -0,0 +1,164 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 2 $ +* Date: $Date: 2005-12-19 08:58:21 +0100 (Mon, 19 Dec 2005) $ +* Last modified by: $Author: caceres $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ +package es.tid.TIDorbj.util; + +public class TranslateURLEscapes +{ + public static String putEscapes(String name) + { + int position; + String cnescapes = translateEscapes(name); + position = cnescapes.indexOf("%5c%5c"); + while (position != -1) // Change \ + { + cnescapes = cnescapes.substring(0, position) + "\\\\" + + cnescapes.substring(position + 6); + position = cnescapes.indexOf("%5c%5c", position); + } + position = cnescapes.indexOf("%5c/"); + while (position != -1) // Change / + { + cnescapes = cnescapes.substring(0, position) + "\\<" + + cnescapes.substring(position + 4); + position = cnescapes.indexOf("%5c/", position); + } + position = cnescapes.indexOf("%5c."); + while (position != -1) // Change . + { + cnescapes = cnescapes.substring(0, position) + "\\>" + + cnescapes.substring(position + 4); + position = cnescapes.indexOf("%5c.", position); + } + return cnescapes; + } + + public static String translateEscapes(String str) + { + String strescapes = ""; + String no_escapes = ";/:?@&=+$,-_.!~*'()"; + char c; + for (int i = 0; i < str.length(); i++) { + c = str.charAt(i); + if (no_escapes.indexOf(c) == -1 && !Character.isLetterOrDigit(c)) + strescapes = strescapes + "%" + Integer.toHexString((int) c); + else + strescapes = strescapes + c; + } + return strescapes; + } + + public static String resolveEscapes(String str) + { + int position; + String strescapes = str; + position = strescapes.indexOf("\\\\"); // Resolve \ + while (position != -1) { + strescapes = strescapes.substring(0, position) + "%5c" + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\\\", position); + } + position = strescapes.indexOf("\\<"); // Resolve / + while (position != -1) { + strescapes = strescapes.substring(0, position) + "/" + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\<", position); + } + position = strescapes.indexOf("\\>"); // Resolve . + while (position != -1) { + strescapes = strescapes.substring(0, position) + "." + + strescapes.substring(position + 2); + position = strescapes.indexOf("\\>", position); + } + return strescapes; + } + + public static String stringfy(String str) + { + int position; + String stringfied = str; + String hex; + int nunicode; + position = stringfied.indexOf("\\"); // Reading \ + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\\\" + + stringfied.substring(position + 1); + position = stringfied.indexOf("\\", position + 2); + } + position = stringfied.indexOf("."); // Reading . + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\." + + stringfied.substring(position + 1); + position = stringfied.indexOf(".", position + 2); + } + position = stringfied.indexOf("/"); // Reading / + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\/" + + stringfied.substring(position + 1); + position = stringfied.indexOf("/", position + 2); + } + position = stringfied.indexOf("%5c"); // Reading \ hex + while (position != -1) { + stringfied = stringfied.substring(0, position) + "\\\\" + + stringfied.substring(position + 3); + position = stringfied.indexOf("%5c", position); + } + return translateUnicode(stringfied); + } + + public static String translateUnicode(String str) + { + String hex; + int nunicode; + String unicode = str; + int position = unicode.indexOf("%"); // Reading %hexhex + while (position != -1) { + hex = unicode.substring(position + 1, position + 3); + nunicode = Integer.parseInt(hex, 16); + unicode = unicode.substring(0, position) + (char) nunicode + + unicode.substring(position + 3); + position = unicode.indexOf("%", position); + } + return unicode; + } + +} \ No newline at end of file diff --git a/util/es/tid/TIDorbj/util/UTC.java b/util/es/tid/TIDorbj/util/UTC.java new file mode 100644 index 0000000..fa4e5a5 --- /dev/null +++ b/util/es/tid/TIDorbj/util/UTC.java @@ -0,0 +1,96 @@ +/* +* MORFEO Project +* http://www.morfeo-project.org +* +* Component: TIDorbJ +* Programming Language: Java +* +* File: $Source$ +* Version: $Revision: 453 $ +* Date: $Date: 2010-04-27 16:52:41 +0200 (Tue, 27 Apr 2010) $ +* Last modified by: $Author: avega $ +* +* (C) Copyright 2004 Telefónica Investigación y Desarrollo +* S.A.Unipersonal (Telefónica I+D) +* +* Info about members and contributors of the MORFEO project +* is available at: +* +* http://www.morfeo-project.org/TIDorbJ/CREDITS +* +* 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. +* +* If you want to use this software an plan to distribute a +* proprietary application in any way, and you are not licensing and +* distributing your source code under GPL, you probably need to +* purchase a commercial license of the product. More info about +* licensing options is available at: +* +* http://www.morfeo-project.org/TIDorbJ/Licensing +*/ + +package es.tid.TIDorbj.util; + +import java.util.TimeZone; + +/** + * Utility class to convert time to UTC using Gregorian Calendar. + * Gregorian calendar base time is 15th October 1582 00:00. + * Java System time takes as base time 1th January 1970. + * This class also has operations to convert types of the TimeBase module . + * + * @author caceres + * + */ + +public class UTC +{ + /** + * 1/1/1970 00:00 time in Gregorian Calendar + */ + public final static long GREGORIAN_CUTOVER = 12219292800000L; + + + /** + * Gets the current time in millisecons from 15th October 1582 00:00 + * @return the value in millisecons + */ + public static long currentUtcTimeMillis() + { + return System.currentTimeMillis() + + GREGORIAN_CUTOVER; // current time is form 1th Jan 1973 0:0 + } + + /** + * Converts milliseconds to TimeBase::TimeT units (1 = 100 ns.) + * @param timeInMillis + * @return + */ + public static long toTimeT(long timeInMilliseconds) + { + return timeInMilliseconds * 10000; + } + + /** + * Converts TimeBase::TimeT units (1 = 100 ns.) to milliseconds + * @param timeInMillis + * @return + */ + public static long toTimeInMillis(long timeT) + { + return timeT / 10000; + } + +} diff --git a/util/properties.xml b/util/properties.xml new file mode 100644 index 0000000..2d5dbcb --- /dev/null +++ b/util/properties.xml @@ -0,0 +1,50 @@ + + + + + + + + + \ No newline at end of file