Java Doc for Reference.java in  » 6.0-JDK-Core » naming » javax » naming » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » naming » javax.naming 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.naming.Reference

All known Subclasses:   javax.naming.LinkRef,
Reference
public class Reference implements Cloneable,java.io.Serializable(Code)
This class represents a reference to an object that is found outside of the naming/directory system.

Reference provides a way of recording address information about objects which themselves are not directly bound to the naming/directory system.

A Reference consists of an ordered list of addresses and class information about the object being referenced. Each address in the list identifies a communications endpoint for the same conceptual object. The "communications endpoint" is information that indicates how to contact the object. It could be, for example, a network address, a location in memory on the local machine, another process on the same machine, etc. The order of the addresses in the list may be of significance to object factories that interpret the reference.

Multiple addresses may arise for various reasons, such as replication or the object offering interfaces over more than one communication mechanism. The addresses are indexed starting with zero.

A Reference also contains information to assist in creating an instance of the object to which this Reference refers. It contains the class name of that object, and the class name and location of the factory to be used to create the object. The class factory location is a space-separated list of URLs representing the class path used to load the factory. When the factory class (or any class or resource upon which it depends) needs to be loaded, each URL is used (in order) to attempt to load the class.

A Reference instance is not synchronized against concurrent access by multiple threads. Threads that need to access a single Reference concurrently should synchronize amongst themselves and provide the necessary locking.
author:
   Rosanna Lee
author:
   Scott Seligman
version:
   1.16 07/05/05
See Also:   RefAddr
See Also:   StringRefAddr
See Also:   BinaryRefAddr
since:
   1.3



Field Summary
protected  Vector<RefAddr>addrs
     Contains the addresses contained in this Reference.
protected  StringclassFactory
     Contains the name of the factory class for creating an instance of the object to which this Reference refers.
protected  StringclassFactoryLocation
     Contains the location of the factory class.
protected  StringclassName
     Contains the fully-qualified name of the class of the object to which this Reference refers.

Constructor Summary
public  Reference(String className)
     Constructs a new reference for an object with class name 'className'.
public  Reference(String className, RefAddr addr)
     Constructs a new reference for an object with class name 'className' and an address.
public  Reference(String className, String factory, String factoryLocation)
     Constructs a new reference for an object with class name 'className', and the class name and location of the object's factory.
Parameters:
  className - The non-null class name of the object to whichthis reference refers.
Parameters:
  factory - The possibly null class name of the object's factory.
Parameters:
  factoryLocation - The possibly null location from which to loadthe factory (e.g.
public  Reference(String className, RefAddr addr, String factory, String factoryLocation)
     Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.
Parameters:
  className - The non-null class name of the object towhich this reference refers.
Parameters:
  factory - The possibly null class name of the object's factory.
Parameters:
  factoryLocation - The possibly null location from whichto load the factory (e.g.

Method Summary
public  voidadd(RefAddr addr)
     Adds an address to the end of the list of addresses.
public  voidadd(int posn, RefAddr addr)
     Adds an address to the list of addresses at index posn.
public  voidclear()
     Deletes all addresses from this reference.
public  Objectclone()
     Makes a copy of this reference using its class name list of addresses, class factory name and class factory location.
public  booleanequals(Object obj)
     Determines whether obj is a reference with the same addresses (in same order) as this reference. The addresses are checked using RefAddr.equals(). In addition to having the same addresses, the Reference also needs to have the same class name as this reference. The class factory and class factory location are not checked. If obj is null or not an instance of Reference, null is returned.
Parameters:
  obj - The possibly null object to check.
public  RefAddrget(String addrType)
     Retrieves the first address that has the address type 'addrType'. String.compareTo() is used to test the equality of the address types.
Parameters:
  addrType - The non-null address type for which to find the address.
public  RefAddrget(int posn)
     Retrieves the address at index posn.
Parameters:
  posn - The index of the address to retrieve.
public  Enumeration<RefAddr>getAll()
     Retrieves an enumeration of the addresses in this reference.
public  StringgetClassName()
     Retrieves the class name of the object to which this reference refers. The non-null fully-qualified class name of the object.(e.g.
public  StringgetFactoryClassLocation()
     Retrieves the location of the factory of the object to which this reference refers. If it is a codebase, then it is an ordered list of URLs, separated by spaces, listing locations from where the factory class definition should be loaded. The possibly null string containing thelocation for loading in the factory's class.
public  StringgetFactoryClassName()
     Retrieves the class name of the factory of the object to which this reference refers. The possibly null fully-qualified class name of the factory.(e.g.
public  inthashCode()
     Computes the hash code of this reference.
public  Objectremove(int posn)
     Deletes the address at index posn from the list of addresses. All addresses at index greater than posn are shifted down the list by one (towards index 0).
Parameters:
  posn - The 0-based index of in address to delete.
public  intsize()
     Retrieves the number of addresses in this reference.
public  StringtoString()
     Generates the string representation of this reference.

Field Detail
addrs
protected Vector<RefAddr> addrs(Code)
Contains the addresses contained in this Reference. Initialized by constructor.



classFactory
protected String classFactory(Code)
Contains the name of the factory class for creating an instance of the object to which this Reference refers. Initialized to null.



classFactoryLocation
protected String classFactoryLocation(Code)
Contains the location of the factory class. Initialized to null.



className
protected String className(Code)
Contains the fully-qualified name of the class of the object to which this Reference refers.
See Also:   java.lang.Class.getName




Constructor Detail
Reference
public Reference(String className)(Code)
Constructs a new reference for an object with class name 'className'. Class factory and class factory location are set to null. The newly created reference contains zero addresses.
Parameters:
  className - The non-null class name of the object to whichthis reference refers.



Reference
public Reference(String className, RefAddr addr)(Code)
Constructs a new reference for an object with class name 'className' and an address. Class factory and class factory location are set to null.
Parameters:
  className - The non-null class name of the object towhich this reference refers.
Parameters:
  addr - The non-null address of the object.



Reference
public Reference(String className, String factory, String factoryLocation)(Code)
Constructs a new reference for an object with class name 'className', and the class name and location of the object's factory.
Parameters:
  className - The non-null class name of the object to whichthis reference refers.
Parameters:
  factory - The possibly null class name of the object's factory.
Parameters:
  factoryLocation - The possibly null location from which to loadthe factory (e.g. URL)
See Also:   javax.naming.spi.ObjectFactory
See Also:   javax.naming.spi.NamingManager.getObjectInstance



Reference
public Reference(String className, RefAddr addr, String factory, String factoryLocation)(Code)
Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.
Parameters:
  className - The non-null class name of the object towhich this reference refers.
Parameters:
  factory - The possibly null class name of the object's factory.
Parameters:
  factoryLocation - The possibly null location from whichto load the factory (e.g. URL)
Parameters:
  addr - The non-null address of the object.
See Also:   javax.naming.spi.ObjectFactory
See Also:   javax.naming.spi.NamingManager.getObjectInstance




Method Detail
add
public void add(RefAddr addr)(Code)
Adds an address to the end of the list of addresses.
Parameters:
  addr - The non-null address to add.



add
public void add(int posn, RefAddr addr)(Code)
Adds an address to the list of addresses at index posn. All addresses at index posn or greater are shifted up the list by one (away from index 0).
Parameters:
  posn - The 0-based index of the list to insert addr.
Parameters:
  addr - The non-null address to add.
exception:
  ArrayIndexOutOfBoundsException - If posn not in the specifiedrange.



clear
public void clear()(Code)
Deletes all addresses from this reference.



clone
public Object clone()(Code)
Makes a copy of this reference using its class name list of addresses, class factory name and class factory location. Changes to the newly created copy does not affect this Reference and vice versa.



equals
public boolean equals(Object obj)(Code)
Determines whether obj is a reference with the same addresses (in same order) as this reference. The addresses are checked using RefAddr.equals(). In addition to having the same addresses, the Reference also needs to have the same class name as this reference. The class factory and class factory location are not checked. If obj is null or not an instance of Reference, null is returned.
Parameters:
  obj - The possibly null object to check. true if obj is equal to this reference; false otherwise.



get
public RefAddr get(String addrType)(Code)
Retrieves the first address that has the address type 'addrType'. String.compareTo() is used to test the equality of the address types.
Parameters:
  addrType - The non-null address type for which to find the address. The address in this reference with address type 'addrType;null if no such address exist.



get
public RefAddr get(int posn)(Code)
Retrieves the address at index posn.
Parameters:
  posn - The index of the address to retrieve. The address at the 0-based index posn. It must be in therange [0,getAddressCount()).
exception:
  ArrayIndexOutOfBoundsException - If posn not in the specifiedrange.



getAll
public Enumeration<RefAddr> getAll()(Code)
Retrieves an enumeration of the addresses in this reference. When addresses are added, changed or removed from this reference, its effects on this enumeration are undefined. An non-null enumeration of the addresses(RefAddr) in this reference.If this reference has zero addresses, an enumeration withzero elements is returned.



getClassName
public String getClassName()(Code)
Retrieves the class name of the object to which this reference refers. The non-null fully-qualified class name of the object.(e.g. "java.lang.String")



getFactoryClassLocation
public String getFactoryClassLocation()(Code)
Retrieves the location of the factory of the object to which this reference refers. If it is a codebase, then it is an ordered list of URLs, separated by spaces, listing locations from where the factory class definition should be loaded. The possibly null string containing thelocation for loading in the factory's class.



getFactoryClassName
public String getFactoryClassName()(Code)
Retrieves the class name of the factory of the object to which this reference refers. The possibly null fully-qualified class name of the factory.(e.g. "java.lang.String")



hashCode
public int hashCode()(Code)
Computes the hash code of this reference. The hash code is the sum of the hash code of its addresses. A hash code of this reference as an int.



remove
public Object remove(int posn)(Code)
Deletes the address at index posn from the list of addresses. All addresses at index greater than posn are shifted down the list by one (towards index 0).
Parameters:
  posn - The 0-based index of in address to delete. The address removed.
exception:
  ArrayIndexOutOfBoundsException - If posn not in the specifiedrange.



size
public int size()(Code)
Retrieves the number of addresses in this reference. The nonnegative number of addresses in this reference.



toString
public String toString()(Code)
Generates the string representation of this reference. The string consists of the class name to which this reference refers, and the string representation of each of its addresses. This representation is intended for display only and not to be parsed. The non-null string representation of this reference.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.