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

F79659-03

coherence/net/ConfigurableAddressProviderFactory.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_CONFIGURABLE_ADDRESS_PROVIDER_FACTORY_HPP
00008 #define COH_CONFIGURABLE_ADDRESS_PROVIDER_FACTORY_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/net/AddressProvider.hpp"
00013 #include "coherence/net/AddressProviderFactory.hpp"
00014 #include "coherence/run/xml/XmlConfigurable.hpp"
00015 #include "coherence/run/xml/XmlElement.hpp"
00016 
00017 COH_OPEN_NAMESPACE2(coherence,net)
00018 
00019 using coherence::run::xml::XmlConfigurable;
00020 using coherence::run::xml::XmlElement;
00021 
00022 
00023 /**
00024 * An AddressProviderFactory implementation that creates instances of a
00025 * AddressProvider class configured using an XmlElement of the following structure:
00026 * <pre>
00027 *   &lt;!ELEMENT ... (socket-address+ | address-provider)&gt;
00028 *   &lt;!ELEMENT address-provider 
00029 *     (class-name | (class-factory-name, method-name), init-params?&gt;
00030 *   &lt;!ELEMENT socket-address (address, port)&gt;
00031 * </pre>
00032 *
00033 * @author wl  2012.04.04
00034 * @since Coherence 12.1.2
00035 */
00036 class COH_EXPORT ConfigurableAddressProviderFactory
00037     : public class_spec<ConfigurableAddressProviderFactory,
00038         extends<Object>,
00039         implements<AddressProviderFactory, XmlConfigurable> >
00040     {
00041     friend class factory<ConfigurableAddressProviderFactory>;
00042 
00043     // ----- constructors ---------------------------------------------------
00044 
00045     protected:
00046         /**
00047         * Create a new ConfigurableAddressProviderFactory instance.
00048         */
00049         ConfigurableAddressProviderFactory();
00050 
00051 
00052     // ----- ConfigurableAddressProviderFactory interface -------------------
00053 
00054     public:
00055         /**
00056         * Instantiate an AddressProvider configured according to the specified XML.
00057         * The passed XML has to conform to the following format:
00058         * <pre>
00059         *   &lt;!ELEMENT ... (socket-address+ | address-provider)&gt;
00060         *   &lt;!ELEMENT address-provider
00061         *     (class-name | (class-factory-name, method-name), init-params?&gt;
00062         *   &lt;!ELEMENT socket-address (address, port)&gt;
00063         * </pre>
00064         *
00065         * @param vLoader  the optional ClassLoader with which to configure the
00066         *                 new AddressProvider.
00067         *
00068         * @return an instance of the corresponding AddressProvider
00069         *         implementation.
00070         */
00071         virtual AddressProvider::Handle createAddressProvider(ClassLoader::View vLoader = NULL);
00072     
00073 
00074     // ----- XmlConfigurable interface---------------------------------------
00075 
00076     public:
00077         /**
00078         * {@inheritDoc}
00079         */
00080         virtual void setConfig(XmlElement::View xml);
00081 
00082         /**
00083         * {@inheritDoc}
00084         */
00085         virtual XmlElement::View getConfig() const;
00086 
00087 
00088     // ----- Object interface -----------------------------------------------
00089 
00090     public:
00091         /**
00092         * {@inheritDoc}
00093         */
00094         virtual TypedHandle<const String> toString() const;
00095 
00096 
00097     // ---- data members ----------------------------------------------------
00098 
00099     protected:
00100         /**
00101         * XML configuration for this ConfigurableAddressProviderFactory.
00102         */
00103         FinalView<XmlElement> f_vXmlConfig;
00104     };
00105 
00106 COH_CLOSE_NAMESPACE2
00107 
00108 #endif // COH_CONFIGURABLE_ADDRESS_PROVIDER_FACTORY_HPP
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.