Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

coherence/util/Service.hpp

00001 /*
00002 * Service.hpp
00003 *
00004 * Copyright (c) 2000, 2013, 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_SERVICE_HPP
00017 #define COH_SERVICE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/Controllable.hpp"
00022 #include "coherence/util/ServiceListener.hpp"
00023 
00024 COH_OPEN_NAMESPACE2(coherence,util)
00025 
00026 
00027 /**
00028 * A Service is a Controllable that emits service lifecycle events.
00029 *
00030 * @see ServiceListener
00031 *
00032 * @author jh 2007.12.12
00033 */
00034 class COH_EXPORT Service
00035     : public interface_spec<Service,
00036         implements<Controllable> >
00037     {
00038     // ----- Service interface ----------------------------------------------
00039 
00040     public:
00041         /**
00042         * Register a ServiceListener that will receive events pertaining to
00043         * the lifecycle of this Service.
00044         *
00045         * @param hListener  the new ServiceListener to register; if the
00046         *                   listener has already been registered, this
00047         *                   method has no effect
00048         */
00049         virtual void addServiceListener(ServiceListener::Handle hListener) = 0;
00050 
00051         /**
00052         * Unregister a ServiceListener from this ConnectionManager.
00053         *
00054         * After a ServiceListener is removed, it will no longer receive
00055         * events pertaining to the lifecycle of this Service.
00056         *
00057         * @param hListener  the ServiceListener to deregister; if the
00058         *                   listener has not previously been registered,
00059         *                   this method has no effect
00060         */
00061         virtual void removeServiceListener(ServiceListener::Handle hListener) = 0;
00062     };
00063 
00064 COH_CLOSE_NAMESPACE2
00065 
00066 #endif // COH_SERVICE_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.