1 /*** 2 * Objectweb naming framework API 3 * Copyright (C) 2001-2002 France Telecom 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * 19 * Contact: architecture@objectweb.org 20 */ 21 22 package org.objectweb.naming; 23 24 /** 25 * A name designates an object or an object interface. A name may also provide 26 * access to the object or interface it designates. Such a name implements both 27 * the {@link Name} interface and the (or a) Java interface of the object 28 * it designates. 29 */ 30 31 public interface Name { 32 33 /** 34 * Returns the {@link NamingContext} that created this name. 35 * In order for a name to implement both the {@link Name} interface and 36 * the Java interface of the object it designates, the methods of these two 37 * interfaces must have distinct names. To increase the probability of this 38 * case, this method has been named "getNamingContext" instead of 39 * "getContext", since "getNamingContext" is less frequent than "getContext". 40 * 41 * @return the {@link NamingContext} that created this name. 42 */ 43 44 NamingContext getNamingContext (); 45 46 /** 47 * Encodes this name as an array of bytes. This method can be used to send 48 * names over a network, or to store them on disk. 49 * 50 * @return an encoded form of this name. 51 * @throws NamingException if this name can not be encoded (this is the case, 52 * for example, of names that are only valid inside a given Java Virtual 53 * Machine, and that can therefore not be sent over a network or stored 54 * on a disk). 55 */ 56 57 byte[] encode () throws NamingException; 58 } 59