Methods Summary |
---|
private void | appendByteArray(java.lang.StringBuffer result, byte[] data)
for ( int ctr=0; ctr<data.length; ctr++ ) {
result.append( Integer.toHexString( data[ctr] ) ) ;
}
|
public void | doRead(java.io.ObjectInputStream stream)
// read the IOR from the ObjectInputStream
int typeLength = stream.readInt();
typeData = new byte[typeLength];
stream.readFully(typeData);
int numProfiles = stream.readInt();
profileTags = new int[numProfiles];
profileData = new byte[numProfiles][];
for (int i = 0; i < numProfiles; i++) {
profileTags[i] = stream.readInt();
profileData[i] = new byte[stream.readInt()];
stream.readFully(profileData[i]);
}
|
public void | doWrite(java.io.ObjectOutputStream stream)
// write the IOR to the ObjectOutputStream
stream.writeInt(typeData.length);
stream.write(typeData);
stream.writeInt(profileTags.length);
for (int i = 0; i < profileTags.length; i++) {
stream.writeInt(profileTags[i]);
stream.writeInt(profileData[i].length);
stream.write(profileData[i]);
}
|
private boolean | equalArrays(byte[][] data1, byte[][] data2)
if (data1.length != data2.length)
return false ;
for (int ctr=0; ctr<data1.length; ctr++) {
if (!equalArrays( data1[ctr], data2[ctr] ))
return false ;
}
return true ;
|
private boolean | equalArrays(int[] data1, int[] data2)
if (data1.length != data2.length)
return false ;
for (int ctr=0; ctr<data1.length; ctr++) {
if (data1[ctr] != data2[ctr])
return false ;
}
return true ;
|
private boolean | equalArrays(byte[] data1, byte[] data2)
if (data1.length != data2.length)
return false ;
for (int ctr=0; ctr<data1.length; ctr++) {
if (data1[ctr] != data2[ctr])
return false ;
}
return true ;
|
public boolean | equals(java.lang.Object obj)
if (this == obj) {
return true;
}
if (!(obj instanceof StubIORImpl)) {
return false;
}
StubIORImpl other = (StubIORImpl) obj;
if (other.hashCode() != this.hashCode()) {
return false;
}
return equalArrays( typeData, other.typeData ) &&
equalArrays( profileTags, other.profileTags ) &&
equalArrays( profileData, other.profileData ) ;
|
public org.omg.CORBA.portable.Delegate | getDelegate(org.omg.CORBA.ORB orb)
// write the IOR components to an org.omg.CORBA.portable.OutputStream
OutputStream ostr = orb.create_output_stream();
ostr.write_long(typeData.length);
ostr.write_octet_array(typeData, 0, typeData.length);
ostr.write_long(profileTags.length);
for (int i = 0; i < profileTags.length; i++) {
ostr.write_long(profileTags[i]);
ostr.write_long(profileData[i].length);
ostr.write_octet_array(profileData[i], 0, profileData[i].length);
}
InputStream istr = ostr.create_input_stream() ;
// read the IOR back from the stream
org.omg.CORBA.Object obj = (org.omg.CORBA.Object)istr.read_Object();
return StubAdapter.getDelegate( obj ) ;
|
public java.lang.String | getRepositoryId()
if (typeData == null)
return null ;
return new String( typeData ) ;
|
public synchronized int | hashCode()Returns a hash code value for the object which is the same for all stubs
that represent the same remote object.
if (hashCode == 0) {
// compute the hash code
for (int i = 0; i < typeData.length; i++) {
hashCode = hashCode * 37 + typeData[i];
}
for (int i = 0; i < profileTags.length; i++) {
hashCode = hashCode * 37 + profileTags[i];
for (int j = 0; j < profileData[i].length; j++) {
hashCode = hashCode * 37 + profileData[i][j];
}
}
}
return hashCode;
|
public java.lang.String | toString()Returns a string representation of this stub. Returns the same string
for all stubs that represent the same remote object.
"SimpleIORImpl[,[]data, ...]"
StringBuffer result = new StringBuffer() ;
result.append( "SimpleIORImpl[" ) ;
String repositoryId = new String( typeData ) ;
result.append( repositoryId ) ;
for (int ctr=0; ctr<profileTags.length; ctr++) {
result.append( ",(" ) ;
result.append( profileTags[ctr] ) ;
result.append( ")" ) ;
appendByteArray( result, profileData[ctr] ) ;
}
result.append( "]" ) ;
return result.toString() ;
|