1 /* 2 * @(#)NamingContextDataStore.java 1.20 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package com.sun.corba.se.impl.naming.cosnaming; 9 10 // Import general CORBA classes 11 import org.omg.CORBA.Object; 12 13 // Import org.omg.CosNaming classes 14 import org.omg.CosNaming.BindingType; 15 import org.omg.CosNaming.BindingTypeHolder; 16 import org.omg.CosNaming.BindingListHolder; 17 import org.omg.CosNaming.BindingIteratorHolder; 18 import org.omg.CosNaming.NameComponent; 19 import org.omg.CosNaming.NamingContext; 20 import org.omg.PortableServer.POA; 21 22 /** 23 * This interface defines a set of methods that must be implemented by the 24 * "data store" associated with a NamingContext implementation. 25 * It allows for different implementations of naming contexts that 26 * support the same API but differ in storage mechanism. 27 */ 28 public interface NamingContextDataStore { 29 /** 30 * Method which implements binding a name to an object as 31 * the specified binding type. 32 * @param n a NameComponent which is the name under which the object 33 * will be bound. 34 * @param obj the object reference to be bound. 35 * @param bt Type of binding (as object or as context). 36 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 37 */ 38 void Bind(NameComponent n, org.omg.CORBA.Object obj, BindingType bt) 39 throws org.omg.CORBA.SystemException; 40 41 /** 42 * Method which implements resolving the specified name, 43 * returning the type of the binding and the bound object reference. 44 * If the id and kind of the NameComponent are both empty, the initial 45 * naming context (i.e., the local root) must be returned. 46 * @param n a NameComponent which is the name to be resolved. 47 * @param bth the BindingType as an out parameter. 48 * @return the object reference bound under the supplied name. 49 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 50 */ 51 org.omg.CORBA.Object Resolve(NameComponent n,BindingTypeHolder bth) 52 throws org.omg.CORBA.SystemException; 53 54 /** 55 * Method which implements unbinding a name. 56 * @return the object reference bound to the name, or null if not found. 57 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 58 */ 59 org.omg.CORBA.Object Unbind(NameComponent n) 60 throws org.omg.CORBA.SystemException; 61 62 /** 63 * Method which implements listing the contents of this 64 * NamingContext and return a binding list and a binding iterator. 65 * @param how_many The number of requested bindings in the BindingList. 66 * @param bl The BindingList as an out parameter. 67 * @param bi The BindingIterator as an out parameter. 68 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 69 */ 70 void List(int how_many, BindingListHolder bl, BindingIteratorHolder bi) 71 throws org.omg.CORBA.SystemException; 72 73 /** 74 * Method which implements creating a new NamingContext. 75 * @return an object reference for a new NamingContext object implemented 76 * by this Name Server. 77 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 78 */ 79 NamingContext NewContext() 80 throws org.omg.CORBA.SystemException; 81 82 /** 83 * Method which implements destroying this NamingContext. 84 * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. 85 */ 86 void Destroy() 87 throws org.omg.CORBA.SystemException; 88 89 /** 90 * Method which returns whether this NamingContext is empty 91 * or not. 92 * @return true if this NamingContext contains no bindings. 93 */ 94 boolean IsEmpty(); 95 96 POA getNSPOA( ); 97 } 98