Oracle Coherence for C++ API
Release 3.6.1.0

E18813-01

coherence/net/Service.hpp

00001 /*
00002 * Service.hpp
00003 *
00004 * Copyright (c) 2000, 2010, 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_NET_SERVICE_HPP
00017 #define COH_NET_SERVICE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/io/Serializer.hpp"
00022 #include "coherence/net/MemberListener.hpp"
00023 #include "coherence/net/ServiceInfo.hpp"
00024 #include "coherence/security/IdentityAsserter.hpp"
00025 #include "coherence/security/IdentityTransformer.hpp"
00026 #include "coherence/util/Service.hpp"
00027 
00028 COH_OPEN_NAMESPACE2(coherence,net)
00029 
00030 using coherence::io::Serializer;
00031 using coherence::security::IdentityAsserter;
00032 using coherence::security::IdentityTransformer;
00033 
00034 
00035 /**
00036 * This Service interface represents a controllable service that operates in a
00037 * clustered network environment.
00038 *
00039 * @author jh  2007.12.20
00040 */
00041 class COH_EXPORT Service
00042     : public interface_spec<Service,
00043         implements<coherence::util::Service> >
00044     {
00045     // ----- Service interface ----------------------------------------------
00046 
00047     public:
00048         /**
00049         * Return the ServiceInfo object for this Service.
00050         *
00051         * @return the ServiceInfo object
00052         */
00053         virtual ServiceInfo::View getInfo() const = 0;
00054 
00055         /**
00056         * Add a Member listener.
00057         *
00058         * @param hListener  the {@link MemberListener} to add
00059         */
00060         virtual void addMemberListener(MemberListener::Handle hListener) = 0;
00061 
00062         /**
00063         * Remove a Member listener.
00064         *
00065         * @param hListener  the {@link MemberListener} to remove
00066         */
00067         virtual void removeMemberListener(MemberListener::Handle hListener) = 0;
00068 
00069         /**
00070         * Return the user context object associated with this Service.
00071         *
00072         * The data type and semantics of this context object are entirely
00073         * application specific and are opaque to the Service itself.
00074         *
00075         * @return an associated user contex object or NULL if a context
00076         *          has not been set
00077         */
00078         virtual Object::Holder getUserContext() const = 0;
00079 
00080         /**
00081         * Associate a user context object with this Service.
00082         *
00083         * @param ohCtx  a user context object
00084         */
00085         virtual void setUserContext(Object::Holder ohCtx) = 0;
00086 
00087         /**
00088         * Return a Serializer used by this Service.
00089         *
00090         * @return the Serializer object
00091         *
00092         * @since Coherence 3.4
00093         */
00094         virtual Serializer::View getSerializer() const = 0;
00095 
00096         /**
00097         * Specifies the ThreadGroup within which the Service thread will be
00098         * created. If not specified, the current Thread's ThreadGroup will be
00099         * used.
00100         *
00101         * This property can only be set at runtime, and must be configured
00102         * before start() is invoked to cause the Service thread to be created
00103         * within the specified ThreadGroup.
00104         *
00105         * @param hGroup  the group to use
00106         */
00107         virtual void setThreadGroup(ThreadGroup::Handle hGroup) = 0;
00108 
00109         /**
00110         * Return the ThreadGroup for the Daemon.
00111         *
00112         * @return the ThreadGroup for the Daemon.
00113         */
00114         virtual ThreadGroup::Handle getThreadGroup() = 0;
00115 
00116         /**
00117         * Return the ThreadGroup for the Daemon.
00118         *
00119         * @return the ThreadGroup for the Daemon.
00120         */
00121         virtual ThreadGroup::View getThreadGroup() const = 0;
00122 
00123         /**
00124         * Get the IdentityAsserter.
00125         */
00126         virtual IdentityAsserter::Handle getIdentityAsserter() const = 0;
00127 
00128         /**
00129         * Set the IdentityAsserter.
00130         *
00131         * @param hAsserter  the IdentityAsserter
00132         */
00133         virtual void setIdentityAsserter(IdentityAsserter::Handle hAsserter) = 0;
00134 
00135         /**
00136         * Get the IdentityTranformer.
00137         */
00138         virtual IdentityTransformer::Handle getIdentityTransformer() const = 0;
00139 
00140         /**
00141         * Set the IdentityTranformer.
00142         *
00143         * @param vTransformer  the IdentityTranformer
00144         */
00145         virtual void setIdentityTransformer(
00146                 IdentityTransformer::Handle hTransformer) = 0;
00147     };
00148 
00149 COH_CLOSE_NAMESPACE2
00150 
00151 #endif // COH_NET_SERVICE_HPP
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.