src/share/classes/javax/naming/Reference.java

Print this page




 201 
 202     /**
 203       * Retrieves the location of the factory of the object
 204       * to which this reference refers.
 205       * If it is a codebase, then it is an ordered list of URLs,
 206       * separated by spaces, listing locations from where the factory
 207       * class definition should be loaded.
 208       *
 209       * @return The possibly null string containing the
 210       *                 location for loading in the factory's class.
 211       */
 212     public String getFactoryClassLocation() {
 213         return classFactoryLocation;
 214     }
 215 
 216     /**
 217       * Retrieves the first address that has the address type 'addrType'.
 218       * String.compareTo() is used to test the equality of the address types.
 219       *
 220       * @param addrType The non-null address type for which to find the address.
 221       * @return The address in this reference with address type 'addrType;
 222       *         null if no such address exist.
 223       */
 224     public RefAddr get(String addrType) {
 225         int len = addrs.size();
 226         RefAddr addr;
 227         for (int i = 0; i < len; i++) {
 228             addr = addrs.elementAt(i);
 229             if (addr.getType().compareTo(addrType) == 0)
 230                 return addr;
 231         }
 232         return null;
 233     }
 234 
 235     /**
 236       * Retrieves the address at index posn.
 237       * @param posn The index of the address to retrieve.
 238       * @return The address at the 0-based index posn. It must be in the
 239       *         range [0,getAddressCount()).
 240       * @exception ArrayIndexOutOfBoundsException If posn not in the specified
 241       *         range.
 242       */




 201 
 202     /**
 203       * Retrieves the location of the factory of the object
 204       * to which this reference refers.
 205       * If it is a codebase, then it is an ordered list of URLs,
 206       * separated by spaces, listing locations from where the factory
 207       * class definition should be loaded.
 208       *
 209       * @return The possibly null string containing the
 210       *                 location for loading in the factory's class.
 211       */
 212     public String getFactoryClassLocation() {
 213         return classFactoryLocation;
 214     }
 215 
 216     /**
 217       * Retrieves the first address that has the address type 'addrType'.
 218       * String.compareTo() is used to test the equality of the address types.
 219       *
 220       * @param addrType The non-null address type for which to find the address.
 221       * @return The address in this reference with address type 'addrType';
 222       *         null if no such address exists.
 223       */
 224     public RefAddr get(String addrType) {
 225         int len = addrs.size();
 226         RefAddr addr;
 227         for (int i = 0; i < len; i++) {
 228             addr = addrs.elementAt(i);
 229             if (addr.getType().compareTo(addrType) == 0)
 230                 return addr;
 231         }
 232         return null;
 233     }
 234 
 235     /**
 236       * Retrieves the address at index posn.
 237       * @param posn The index of the address to retrieve.
 238       * @return The address at the 0-based index posn. It must be in the
 239       *         range [0,getAddressCount()).
 240       * @exception ArrayIndexOutOfBoundsException If posn not in the specified
 241       *         range.
 242       */