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

E90870-01

coherence/net/AbstractInvocable.hpp

00001 /*
00002 * AbstractInvocable.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_ABSTRACT_INVOCABLE_HPP
00017 #define COH_ABSTRACT_INVOCABLE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/net/Invocable.hpp"
00022 #include "coherence/net/InvocationService.hpp"
00023 #include "coherence/net/PriorityTask.hpp"
00024 
00025 COH_OPEN_NAMESPACE2(coherence,net)
00026 
00027 /**
00028  * An abstract base for Invocable and PriorityTask implementations.
00029  *
00030  * For Invocables which only run within the Coherence cluster (most common case),
00031  * the C++ init, getResult and run methods can be left unimplemented.
00032  *
00033  * @author mf 2008.08.26
00034  */
00035 class COH_EXPORT AbstractInvocable
00036     : public abstract_spec<AbstractInvocable,
00037         extends<Object>,
00038         implements<Invocable, PriorityTask> >
00039     {
00040     // ----- Invocable interface --------------------------------------------
00041 
00042     public:
00043         /**
00044          * {@inheritDoc}
00045          *
00046          * This implementation throws an UnsupportedOperationException.
00047          */
00048         virtual void init(InvocationService::Handle hService);
00049 
00050         /**
00051          * {@inheritDoc}
00052          *
00053          * This implementation throws an UnsupportedOperationException.
00054          */
00055         virtual Object::Holder getResult() const;
00056 
00057         /**
00058          * {@inheritDoc}
00059          *
00060          * This implementation throws an UnsupportedOperationException.
00061          */
00062         virtual void run();
00063 
00064     // ----- PriorityTask interface -----------------------------------------
00065 
00066     public:
00067         /**
00068          * {@inheritDoc}
00069          *
00070          * This implementation returns schedule_standard.
00071          */
00072         virtual int32_t getSchedulingPriority() const;
00073 
00074         /**
00075          * {@inheritDoc}
00076          *
00077          * This implementation returns timeout_default.
00078          */
00079         virtual int64_t getExecutionTimeoutMillis() const;
00080 
00081         /**
00082          * {@inheritDoc}
00083          *
00084          * This implementation is a no-op.
00085          */
00086         virtual void runCanceled(bool fAbandoned);
00087 
00088         /**
00089          * {@inheritDoc}
00090          *
00091          * This implementation returns timeout_default.
00092          */
00093         virtual int64_t getRequestTimeoutMillis() const;
00094     };
00095 
00096 COH_CLOSE_NAMESPACE2
00097 
00098 #endif // COH_ABSTRACT_INVOCABLE_HPP
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.