javax.naming
Class BinaryRefAddr

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.naming.RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr 
      extended by javax.naming.BinaryRefAddr
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class BinaryRefAddr
extends RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr

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.

Since:
1.3
See Also:
RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr , StringRefAddr sample code for javax.naming.StringRefAddr definition code for javax.naming.StringRefAddr , Serialized Form

Field Summary
 
Fields inherited from class javax.naming.RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
addrType sample code for javax.naming.RefAddr.addrType definition code for javax.naming.RefAddr.addrType
 
Constructor Summary
BinaryRefAddr sample code for javax.naming.BinaryRefAddr.BinaryRefAddr(java.lang.String, byte[]) definition code for javax.naming.BinaryRefAddr.BinaryRefAddr(java.lang.String, byte[]) (String sample code for java.lang.String definition code for java.lang.String  addrType, byte[] src)
          Constructs a new instance of BinaryRefAddr using its address type and a byte array for contents.
BinaryRefAddr sample code for javax.naming.BinaryRefAddr.BinaryRefAddr(java.lang.String, byte[], int, int) definition code for javax.naming.BinaryRefAddr.BinaryRefAddr(java.lang.String, byte[], int, int) (String sample code for java.lang.String definition code for java.lang.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.
 
Method Summary
 boolean equals sample code for javax.naming.BinaryRefAddr.equals(java.lang.Object) definition code for javax.naming.BinaryRefAddr.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Determines whether obj is equal to this address.
 Object sample code for java.lang.Object definition code for java.lang.Object getContent sample code for javax.naming.BinaryRefAddr.getContent() definition code for javax.naming.BinaryRefAddr.getContent() ()
          Retrieves the contents of this address as an Object.
 int hashCode sample code for javax.naming.BinaryRefAddr.hashCode() definition code for javax.naming.BinaryRefAddr.hashCode() ()
          Computes the hash code of this address using its address type and contents.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.naming.BinaryRefAddr.toString() definition code for javax.naming.BinaryRefAddr.toString() ()
          Generates the string representation of this address.
 
Methods inherited from class javax.naming.RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
getType sample code for javax.naming.RefAddr.getType() definition code for javax.naming.RefAddr.getType()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

BinaryRefAddr sample code for javax.naming.BinaryRefAddr(java.lang.String, byte[]) definition code for javax.naming.BinaryRefAddr(java.lang.String, byte[])

public BinaryRefAddr(String sample code for java.lang.String definition code for java.lang.String  addrType,
                     byte[] src)
Constructs a new instance of BinaryRefAddr using its address type and a byte array for contents.

Parameters:
addrType - A non-null string describing the type of the address.
src - The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.

BinaryRefAddr sample code for javax.naming.BinaryRefAddr(java.lang.String, byte[], int, int) definition code for javax.naming.BinaryRefAddr(java.lang.String, byte[], int, int)

public BinaryRefAddr(String sample code for java.lang.String definition code for java.lang.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 - A non-null string describing the type of the address.
src - The non-null contents of the address as a byte array. The contents of src is copied into the new BinaryRefAddr.
offset - The starting index in src to get the bytes. 0 <= offset <= src.length.
count - The number of bytes to extract from src. 0 <= count <= src.length-offset.
Method Detail

getContent sample code for javax.naming.BinaryRefAddr.getContent() definition code for javax.naming.BinaryRefAddr.getContent()

public Object sample code for java.lang.Object definition code for java.lang.Object  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.

Specified by:
getContent sample code for javax.naming.RefAddr.getContent() definition code for javax.naming.RefAddr.getContent() in class RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
Returns:
The non-null buffer containing this address's contents.

equals sample code for javax.naming.BinaryRefAddr.equals(java.lang.Object) definition code for javax.naming.BinaryRefAddr.equals(java.lang.Object)

public boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
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.

Overrides:
equals sample code for javax.naming.RefAddr.equals(java.lang.Object) definition code for javax.naming.RefAddr.equals(java.lang.Object) in class RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
Parameters:
obj - The possibly null object to check.
Returns:
true if the object is equal; false otherwise.
See Also:
RefAddr.getContent() sample code for javax.naming.RefAddr.getContent() definition code for javax.naming.RefAddr.getContent() , RefAddr.getType() sample code for javax.naming.RefAddr.getType() definition code for javax.naming.RefAddr.getType()

hashCode sample code for javax.naming.BinaryRefAddr.hashCode() definition code for javax.naming.BinaryRefAddr.hashCode()

public int 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.

Overrides:
hashCode sample code for javax.naming.RefAddr.hashCode() definition code for javax.naming.RefAddr.hashCode() in class RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
Returns:
The hash code of this address as an int.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode()

toString sample code for javax.naming.BinaryRefAddr.toString() definition code for javax.naming.BinaryRefAddr.toString()

public String sample code for java.lang.String definition code for java.lang.String  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.

Overrides:
toString sample code for javax.naming.RefAddr.toString() definition code for javax.naming.RefAddr.toString() in class RefAddr sample code for javax.naming.RefAddr definition code for javax.naming.RefAddr
Returns:
The non-null string representation of this address.