00001 /* 00002 * NameService.hpp 00003 * 00004 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_NAME_SERVICE_HPP 00017 #define COH_NAME_SERVICE_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/net/Service.hpp" 00022 00023 COH_OPEN_NAMESPACE2(coherence,net) 00024 00025 /** 00026 * A NameService is a clustered service that accepts connections from 00027 * external clients (e.g. Coherence*Extend) and provides a name lookup 00028 * service. 00029 * 00030 * @author Wei Lin 2012.06.18 00031 * 00032 * @since Coherence 12.1.2 00033 */ 00034 class COH_EXPORT NameService 00035 : public interface_spec<NameService, 00036 implements<Service> > 00037 { 00038 // ----- NameService interface ------------------------------------------ 00039 00040 public: 00041 /** 00042 * Binds a name to an object. 00043 * 00044 * @param vsName the name to bind; may not be empty 00045 * @param o the object to bind; possibly null 00046 */ 00047 virtual void bind(String::View vsName, Object::View o) = 0; 00048 00049 /** 00050 * Retrieves the named object. 00051 * 00052 * @param vsName the name of the object to look up 00053 * 00054 * @return the object bound to sName 00055 * 00056 * @throws NamingException if a naming exception is encountered 00057 */ 00058 virtual Object::View lookup(String::View vsName) = 0; 00059 00060 /** 00061 * Unbinds the named object. 00062 * 00063 * @param vsName the name to bind; may not be empty 00064 */ 00065 virtual void unbind(String::View vsName) = 0; 00066 }; 00067 00068 COH_CLOSE_NAMESPACE2 00069 00070 #endif // COH_NAME_SERVICE_HPP