KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > interop > rmi > iiop > GiopMessage


1 /**
2  *
3  * Copyright 2004-2005 The Apache Software Foundation
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 implied.
14  *
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.interop.rmi.iiop;
19
20 import org.omg.GIOP.RequestHeader_1_2;
21 import org.omg.GIOP.LocateRequestHeader_1_2;
22 import org.omg.GIOP.ReplyHeader_1_2;
23
24 public class GiopMessage
25 {
26     public int size;
27     public int type;
28     public int giopVersion;
29     public RequestHeader_1_2 request;
30     public LocateRequestHeader_1_2 locateRequest;
31     public ReplyHeader_1_2 reply;
32     public boolean httpTunneling;
33     public int hiopVersion; //http tunneling version - 1 or 2
34

35     public String JavaDoc toString()
36     {
37         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("GiopMessage(");
38         /* TODO
39         if (header != null)
40         {
41             if (header.GIOP_version != null)
42             {
43                 sb.append("version = ");
44                 sb.append(header.GIOP_version.major);
45                 sb.append('.');
46                 sb.append(header.GIOP_version.minor);
47             }
48             if ((header.flags & 1) != 0)
49             {
50                 sb.append(", little endian");
51             }
52             else
53             {
54                 sb.append(", big endian");
55             }
56             if ((header.flags & 2) != 0)
57             {
58                 sb.append(", fragmented");
59             }
60             sb.append(", message type = ");
61             switch (header.message_type)
62             {
63               case MsgType_1_1._Request:
64                 sb.append("Request");
65                 break;
66               case MsgType_1_1._Reply:
67                 sb.append("Reply");
68                 break;
69               default:
70                 sb.append(header.message_type);
71             }
72             sb.append(", message size = ");
73             sb.append(header.message_size);
74         }
75         */

76         sb.append(")");
77         return sb.toString();
78     }
79 }
80
Popular Tags