KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonathan > apis > binding > NamingContext


1 /***
2  * Jonathan: an Open Distributed Processing Environment
3  * Copyright (C) 1999 France Telecom R&D
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  * Release: 2.0
20  *
21  * Contact: jonathan@objectweb.org
22  *
23  * Author: Bruno Dumant
24  *
25  */

26
27
28 package org.objectweb.jonathan.apis.binding;
29
30 import org.objectweb.jonathan.apis.kernel.JonathanException;
31 import org.objectweb.jonathan.apis.kernel.Context;
32 import org.objectweb.jonathan.apis.presentation.UnMarshaller;
33
34 /**
35  * <code>NamingContext</code> is a specific sort of
36  * {@link org.objectweb.jonathan.model.naming_context naming context} used to
37  * create and manage names of type {@link Identifier Identifier}.
38  * <p>
39  * There is no generic
40  * {@link org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name) export}
41  * method defined on <code>NamingContext</code>, and the
42  * {@link org.objectweb.jonathan.model.naming_context#resolve(org.objectweb.jonathan.model.name) resolve}
43  * method is defined on {@link Identifier Identifier}.
44  */

45 public interface NamingContext {
46    
47    /**
48     * Creates a new identifier for the object interface designated by the
49     * <tt>itf</tt> parameter. Note that calling the
50     * {@link Identifier#resolve() resolve} method on the returned identifier should
51     * return tt>id</tt>.
52     *
53     * @param itf an interface reference
54     * @param hints additional information;
55     * @return an identifier managed by the target naming context.
56     * @exception ExportException if an error occurs in the export process;
57     * @exception JonathanException if something else goes wrong.
58     * @see org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name)
59     */

60    Identifier export(Object JavaDoc itf,Context hints)
61       throws ExportException, JonathanException ;
62
63    /**
64     * Decodes an identifier from a buffer portion.
65     * <p>
66     * Since identifiers are likely to be transmitted on the net, they may have to be
67     * encoded and decoded. The {@link Identifier#encode() encoding} method is borne
68     * by the {@link Identifier Identifier} interface, but the decoding methods must
69     * be borne by each naming context. This method creates an identifier (associated
70     * with the target naming context), from the <code>length</code> bytes of
71     * <code>data</code> starting at offset <code>offset</code>.
72     *
73     * @param data the byte array to read the encoded identifier from;
74     * @param offset offset of the first byte of the encoding;
75     * @param length length of the encoding;
76     * @return a decoded identifier;
77     * @exception JonathanException if something goes wrong.
78     */

79    Identifier decode(byte[] data,int offset,int length)
80       throws JonathanException;
81
82    /**
83     * Decodes an identifier from the provided unmarshaller.
84     *
85     * @param u an unmarhaller;
86     * @return an identifier managed by the target naming context;
87     * @exception JonathanException if something goes wrong.
88     */

89    Identifier decode(UnMarshaller u) throws JonathanException;
90 }
91
92
93
94
Popular Tags