APIdia Launch Partner
Top Description Fields Constructors Methods
javax.naming

public Class BinaryRefAddr

extends RefAddr
Class Inheritance

This class represents the binary form of the address of a communications end-point.

A BinaryRefAddr consists of a type that describes the communication mechanism and an opaque buffer containing the address description specific to that communication mechanism. The format and interpretation of the address type and the contents of the opaque buffer are based on the agreement of three parties: the client that uses the address, the object/server that can be reached using the address, and the administrator or program that creates the address.

An example of a binary reference address is an BER X.500 presentation address. Another example of a binary reference address is a serialized form of a service's object handle.

A binary reference address is immutable in the sense that its fields once created, cannot be replaced. However, it is possible to access the byte array used to hold the opaque buffer. Programs are strongly recommended against changing this byte array. Changes to this byte array need to be explicitly synchronized.

Authors
Rosanna Lee, Scott Seligman
Since
1.3
See Also
RefAddr, StringRefAddr

Field Summary

Modifier and TypeField and Description
private byte[]
buf

Contains the bytes of the address.

private static final long
serialVersionUID

Hides javax.naming.RefAddr.serialVersionUID.

Use serialVersionUID from JNDI 1.1.1 for interoperability
Inherited from javax.naming.RefAddr:
addrType

Constructor Summary

AccessConstructor and Description
public
BinaryRefAddr(String
A non-null string describing the type of the address.
addrType
,
byte[]
The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.
src
)

Constructs a new instance of BinaryRefAddr using its address type and a byte array for contents.

public
BinaryRefAddr(String
A non-null string describing the type of the address.
addrType
,
byte[]
The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.
src
,
int
The starting index in src to get the bytes. 0 <= offset <= src.length.
offset
,
int
The number of bytes to extract from src. 0 <= count <= src.length-offset.
count
)

Constructs a new instance of BinaryRefAddr using its address type and a region of a byte array for contents.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the object is equal; false otherwise.
equals
(Object
The possibly null object to check.
obj
)

Overrides javax.naming.RefAddr.equals.

Determines whether obj is equal to this address.

public Object

Returns:

The non-null buffer containing this address's contents.
getContent
()

Implements abstract javax.naming.RefAddr.getContent.

Retrieves the contents of this address as an Object.

public int

Returns:

The hash code of this address as an int.
hashCode
()

Overrides javax.naming.RefAddr.hashCode.

Computes the hash code of this address using its address type and contents.

public String

Returns:

The non-null string representation of this address.
toString
()

Overrides javax.naming.RefAddr.toString.

Generates the string representation of this address.

Inherited from javax.naming.RefAddr:
getType

Field Detail

bufback to summary
private byte[] buf

Contains the bytes of the address. This field is initialized by the constructor and returned using getAddressBytes() and getAddressContents().

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.naming.RefAddr.serialVersionUID.

Use serialVersionUID from JNDI 1.1.1 for interoperability

Constructor Detail

BinaryRefAddrback to summary
public BinaryRefAddr(String addrType, byte[] src)

Constructs a new instance of BinaryRefAddr using its address type and a byte array for contents.

Parameters
addrType:String

A non-null string describing the type of the address.

src:byte[]

The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.

BinaryRefAddrback to summary
public BinaryRefAddr(String addrType, byte[] src, int offset, int count)

Constructs a new instance of BinaryRefAddr using its address type and a region of a byte array for contents.

Parameters
addrType:String

A non-null string describing the type of the address.

src:byte[]

The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.

offset:int

The starting index in src to get the bytes. 0 <= offset <= src.length.

count:int

The number of bytes to extract from src. 0 <= count <= src.length-offset.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides javax.naming.RefAddr.equals.

Determines whether obj is equal to this address. It is equal if it contains the same address type and their contents are byte-wise equivalent.

Parameters
obj:Object

The possibly null object to check.

Returns:boolean

true if the object is equal; false otherwise.

getContentback to summary
public Object getContent()

Implements abstract javax.naming.RefAddr.getContent.

Retrieves the contents of this address as an Object. The result is a byte array. Changes to this array will affect this BinaryRefAddr's contents. Programs are recommended against changing this array's contents and to lock the buffer if they need to change it.

Returns:Object

The non-null buffer containing this address's contents.

hashCodeback to summary
public int hashCode()

Overrides javax.naming.RefAddr.hashCode.

Computes the hash code of this address using its address type and contents. Two BinaryRefAddrs have the same hash code if they have the same address type and the same contents. It is also possible for different BinaryRefAddrs to have the same hash code.

Returns:int

The hash code of this address as an int.

toStringback to summary
public String toString()

Overrides javax.naming.RefAddr.toString.

Generates the string representation of this address. The string consists of the address's type and contents with labels. The first 32 bytes of contents are displayed (in hexadecimal). If there are more than 32 bytes, "..." is used to indicate more. This string is meant to used for debugging purposes and not meant to be interpreted programmatically.

Returns:String

The non-null string representation of this address.