KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > orb > EncapsInfo


1 package org.jacorb.orb;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2004 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import java.util.*;
24
25 /**
26  * information the has to be saved for each encapsulation and
27  * restored later
28  * @author Gerald Brose
29  * @version $Id: EncapsInfo.java,v 1.13 2004/08/14 15:48:22 andre.spiegel Exp $
30  */

31
32 public class EncapsInfo
33 {
34     public boolean littleEndian;
35     public int index;
36     public int start;
37     public int size;
38     public Map valueMap;
39     public Map repIdMap;
40     public Map codebaseMap;
41
42     /** constructor used by CDRInputStream */
43
44     public EncapsInfo(boolean le, int index, int start, int size)
45     {
46     littleEndian = le;
47     this.index = index;
48     this.start = start;
49     this.size = size;
50     }
51
52     /**
53      * constructor used by CDROutputStream:
54      * record the index a new encapsulation starts with
55      * and the start position in the buffer. CORBA specifies that "indirections
56      * may not cross encapsulation boundaries", so the new encapsulation must
57      * set up its own indirection maps for values, repository ids and codebase
58      * strings. The maps currently in use are also recorded, to be restored at
59      * the end of the encapsulation.
60      */

61
62     public EncapsInfo(int index, int start,
63                       Map valueMap, Map repIdMap, Map codebaseMap)
64     {
65     this.index = index;
66     this.start = start;
67         this.valueMap = valueMap;
68         this.repIdMap = repIdMap;
69         this.codebaseMap = codebaseMap;
70
71         if (valueMap == null)
72         {
73             valueMap = new HashMap ();
74         }
75         if (repIdMap == null)
76         {
77             repIdMap = new HashMap ();
78         }
79         if (codebaseMap == null)
80         {
81             codebaseMap = new HashMap ();
82         }
83     }
84 }
85
Popular Tags