KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gcc > rmi > iiop > GiopMessage


1 /*
2  * Copyright 2004 The Apache Software Foundation or its licensors, as
3  * applicable.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19 package gcc.rmi.iiop;
20
21 import gcc.org.omg.GIOP.*;
22
23 public class GiopMessage
24 {
25     public int size;
26     public int type;
27     public int giopVersion;
28     public RequestHeader_1_2 request;
29     public LocateRequestHeader_1_2 locateRequest;
30     public ReplyHeader_1_2 reply;
31
32     public String toString()
33     {
34         StringBuffer sb = new StringBuffer("GiopMessage(");
35         /* TODO
36         if (header != null)
37         {
38             if (header.GIOP_version != null)
39             {
40                 sb.append("version = ");
41                 sb.append(header.GIOP_version.major);
42                 sb.append('.');
43                 sb.append(header.GIOP_version.minor);
44             }
45             if ((header.flags & 1) != 0)
46             {
47                 sb.append(", little endian");
48             }
49             else
50             {
51                 sb.append(", big endian");
52             }
53             if ((header.flags & 2) != 0)
54             {
55                 sb.append(", fragmented");
56             }
57             sb.append(", message type = ");
58             switch (header.message_type)
59             {
60               case MsgType_1_1._Request:
61                 sb.append("Request");
62                 break;
63               case MsgType_1_1._Reply:
64                 sb.append("Reply");
65                 break;
66               default:
67                 sb.append(header.message_type);
68             }
69             sb.append(", message size = ");
70             sb.append(header.message_size);
71         }
72         */

73         sb.append(")");
74         return sb.toString();
75     }
76 }
77
Popular Tags