Dead
[official-gcc.git] / gomp-20050608-branch / libjava / classpath / org / omg / DynamicAny / package.html
blob997006d2c0c6fc4c675661b606df3e96cf629fb1
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <!-- package.html -
3 Copyright (C) 2005 Free Software Foundation, Inc.
5 This file is part of GNU Classpath.
7 GNU Classpath is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU Classpath is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Classpath; see the file COPYING. If not, write to the
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301 USA.
22 Linking this library statically or dynamically with other modules is
23 making a combined work based on this library. Thus, the terms and
24 conditions of the GNU General Public License cover the whole
25 combination.
27 As a special exception, the copyright holders of this library give you
28 permission to link this library with independent modules to produce an
29 executable, regardless of the license terms of these independent
30 modules, and to copy and distribute the resulting executable under
31 terms of your choice, provided that you also meet, for each linked
32 independent module, the terms and conditions of the license of that
33 module. An independent module is a module which is not derived from
34 or based on this library. If you modify this library, you may extend
35 this exception to your version of the library, but you are not
36 obligated to do so. If you do not wish to do so, delete this
37 exception statement from your version. -->
39 <html>
40 <head><title>GNU Classpath - org.omg.DynamicAny</title></head>
42 <body>
43 <p>DynAny's allow to work with data structures, exact content of those is not
44 known at the time of compilation. In this way, the conception of DynAny
45 remebers the java reflection mechanism. DynAny usually obtain the value from
46 the {@link org.omg.CORBA.Any} that, if needed, can carry highly nested data
47 structures (like array of sequences of unions). DynAny's allow to see/modify
48 all parts of such structures. This is especially helpful for writing generic
49 servers (bridges, event channels supporting, filtering and so on). Similarly,
50 DynAny's can create an Any at runtime, without having static knowledge of its
51 type. This is helpful for writing generic clients like browsers, debuggers or
52 user interface tools.
53 </p><p>
54 The API clearly states that DynAny and DynAnyFactory objects are local and
55 cannot be transferred to remote server or client. While such methods are
56 formally defined in the corresponding helpers, they simply always throw MARSHAL.
57 </p><p>
58 DynAny's are created by {@link DynAnyFactory}. The factory is obtaines by
59 {@link org.omg.CORBA.ORB#resolve_initial_references):
60 <code>
61 ORB orb = ORB.init(new String[0], null);
62 DynAnyFactory f = DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory"));
63 </code>
64 DynAny's are also returned by some methods, invoked on another DynAny.
65 </p><p>
66 The primitive types like string or char are wrapped into an ordinary DynAny. It
67 has multiple methods for setting/getting the content like
68 {@link DynAnyOperations#get_string()} or
69 {@link DynAnyOperations#insert_string(String)}. The more complex types like
70 sequences or structures are wrapped into specialised DynAny's, providing means
71 to access the enclosed members. In this case, the DynAny has the
72 "internal cursor", normally pointing at one of the members in the data
73 structure. The "internal cursor" can be set to the needed position
74 {@link DynAnyOperations#seek(int)} or advanced forward
75 ({@link DynAnyOperations#next()}. The member under cursor is returned by
76 {@link DynAnyOperations#current_component()}. For composite DynAnys the
77 methods like {@link DynAnyOperations#get_string()} or
78 {@link DynAnyOperations#insert_string(String)} apply to the selected member,
79 not to the complex DynAny in general.
80 </p><p>
81 DynAnys are created and optimized for traversing values extracted from anys
82 or constructing values of anys at runtime. OMG does not recommend to use them
83 for other purposes.
84 </p><p>
85 @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
86 </body>
87 </html>