C++ Client API Reference for Oracle Coherence
14c (14.1.2.0.0)

F79659-03

coherence/net/SingleAddressProvider.hpp

00001 /*
00002  * Copyright (c) 2000, 2020, Oracle and/or its affiliates.
00003  *
00004  * Licensed under the Universal Permissive License v 1.0 as shown at
00005  * http://oss.oracle.com/licenses/upl.
00006  */
00007 #ifndef COH_SINGLE_ADDRESS_PROVIDER_HPP
00008 #define COH_SINGLE_ADDRESS_PROVIDER_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/net/AddressProvider.hpp"
00013 
00014 COH_OPEN_NAMESPACE2(coherence,net)
00015 
00016 /**
00017 * SocketAddressProvider wrapper for a single address dynamically added to
00018 * this provider.
00019 *
00020 * @author Wei Lin 2012.06.21
00021 *
00022 * @since Coherence 12.1.2
00023 */
00024 class COH_EXPORT  SingleAddressProvider
00025     : public class_spec<SingleAddressProvider,
00026         extends<Object>,
00027         implements<AddressProvider> >
00028     {
00029     friend class factory<SingleAddressProvider>;
00030 
00031     // ----- constructors ---------------------------------------------------
00032 
00033     protected:
00034         /**
00035         * Set the InetSocketAddress for this AddressProvider.
00036         *
00037         * @param address  the address which will be returned by this
00038         *                 InetSocketAddress
00039         */
00040         SingleAddressProvider(InetSocketAddress::View address);
00041 
00042     // ----- AddressProvider interface --------------------------------------
00043 
00044     public:
00045         /**
00046         * {@inheritDoc}
00047         */
00048         virtual void accept();
00049 
00050         /**
00051         * {@inheritDoc}
00052         */
00053         virtual InetSocketAddress::View getNextAddress();
00054 
00055         /**
00056         * {@inheritDoc}
00057         */
00058         virtual void reject(Exception::Holder oheCause);
00059 
00060     // ----- Object methods -------------------------------------------------
00061 
00062     public:
00063         /**
00064         * {@inheritDoc}
00065         */
00066         virtual TypedHandle<const String> toString() const;
00067 
00068     // ----- data members ---------------------------------------------------
00069 
00070     protected:
00071         /**
00072         * The InetSocketAddress returned by this AddressProvider.
00073         */
00074         MemberView<InetSocketAddress> m_vAddress;
00075 
00076         /**
00077          * Whether the InetSocketAddress has already been returned.
00078          */
00079         bool m_fAddressGiven;
00080     };
00081 
00082 COH_CLOSE_NAMESPACE2
00083 
00084 #endif // COH_SINGLE_ADDRESS_PROVIDER_HPP
00085 
Copyright © 2000, 2025, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.