41 |
import gnu.CORBA.CDR.cdrInput; |
import gnu.CORBA.CDR.cdrInput; |
42 |
import gnu.CORBA.CDR.cdrOutput; |
import gnu.CORBA.CDR.cdrOutput; |
43 |
|
|
|
|
|
44 |
import org.omg.CORBA.portable.IDLEntity; |
import org.omg.CORBA.portable.IDLEntity; |
45 |
|
|
46 |
/** |
/** |
49 |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
50 |
*/ |
*/ |
51 |
public abstract class RequestHeader |
public abstract class RequestHeader |
52 |
|
extends contextSupportingHeader |
53 |
implements IDLEntity |
implements IDLEntity |
54 |
{ |
{ |
55 |
/** |
/** |
56 |
* The currently free request id. This field is incremented |
* The currently free request id. This field is incremented each time the new |
57 |
* each time the new request header is constructed. To facilitate |
* request header is constructed. To facilitate error detection, the first |
58 |
* error detection, the first free id is equal to 0x01234567 |
* free id is equal to 0x01234567 (19088743). |
|
* (19088743). |
|
59 |
*/ |
*/ |
60 |
private static int freeId = 0x01234567; |
private static int freeId = 0x01234567; |
61 |
|
|
70 |
public byte[] object_key; |
public byte[] object_key; |
71 |
|
|
72 |
/** |
/** |
73 |
* A value identifying the requesting principal. |
* A value identifying the requesting principal. Initialised into a single |
74 |
* Initialised into a single zero byte. |
* zero byte. |
75 |
* |
* |
76 |
* @deprecated by CORBA 2.2. |
* @deprecated by CORBA 2.2. |
77 |
*/ |
*/ |
78 |
public byte[] requesting_principal; |
public byte[] requesting_principal; |
79 |
|
|
80 |
/** |
/** |
81 |
* Contains the ORB service data being passed. Initialised as the |
* This is used to associate the reply message with the previous request |
82 |
* zero size array by default. |
* message. Initialised each time by the different value, increasing form 1 to |
83 |
*/ |
* Integer.MAX_VALUE. |
|
public ServiceContext[] service_context = new ServiceContext[ 0 ]; |
|
|
|
|
|
/** |
|
|
* This is used to associate the reply message with the |
|
|
* previous request message. Initialised each time by the |
|
|
* different value, increasing form 1 to Integer.MAX_VALUE. |
|
84 |
*/ |
*/ |
85 |
public int request_id = getNextId(); |
public int request_id = getNextId(); |
86 |
|
|
90 |
protected boolean response_expected = true; |
protected boolean response_expected = true; |
91 |
|
|
92 |
/** |
/** |
93 |
* Get next free request id. The value of the free request |
* Get next free request id. The value of the free request id starts from |
94 |
* id starts from 0x02345678, it is incremented each time this |
* 0x02345678, it is incremented each time this function is called and is |
95 |
* function is called and is reset to 1 after reaching |
* reset to 1 after reaching Integer.MAX_VALUE. |
|
* Integer.MAX_VALUE. |
|
96 |
* |
* |
97 |
* @return the next free request id. |
* @return the next free request id. |
98 |
*/ |
*/ |
118 |
public abstract boolean isResponseExpected(); |
public abstract boolean isResponseExpected(); |
119 |
|
|
120 |
/** |
/** |
121 |
* Converts an byte array into hexadecimal string values. |
* Converts an byte array into hexadecimal string values. Used in various |
122 |
* Used in various toString() methods. |
* toString() methods. |
123 |
*/ |
*/ |
124 |
public String bytes(byte[] array) |
public String bytes(byte[] array) |
125 |
{ |
{ |
126 |
StringBuffer b = new StringBuffer(); |
StringBuffer b = new StringBuffer(); |
127 |
for (int i = 0; i < array.length; i++) |
for (int i = 0; i < array.length; i++) |
128 |
{ |
{ |
129 |
b.append(Integer.toHexString(array [ i ] & 0xFF)); |
b.append(Integer.toHexString(array[i] & 0xFF)); |
130 |
b.append(" "); |
b.append(" "); |
131 |
} |
} |
132 |
return b.toString(); |
return b.toString(); |
150 |
* @param out a stream to write into. |
* @param out a stream to write into. |
151 |
*/ |
*/ |
152 |
public abstract void write(cdrOutput out); |
public abstract void write(cdrOutput out); |
153 |
|
|
154 |
} |
} |