00001 /* 00002 * AbstractInvocable.hpp 00003 * 00004 * Copyright (c) 2000, 2017, 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 /** 00029 * An abstract base for Invocable implementation. 00030 * 00031 * For Invocables which only run within the Coherence cluster (most common case), 00032 * the C++ init, getResult and run methods can be left unimplemented. 00033 * 00034 * @author mf 2008.08.26 00035 */ 00036 class COH_EXPORT AbstractInvocable 00037 : public abstract_spec<AbstractInvocable, 00038 extends<Object>, 00039 implements<Invocable> > 00040 { 00041 // ----- Invocable interface -------------------------------------------- 00042 00043 public: 00044 /** 00045 * {@inheritDoc} 00046 * 00047 * This implementation throws an UnsupportedOperationException. 00048 */ 00049 virtual void init(InvocationService::Handle hService); 00050 00051 /** 00052 * {@inheritDoc} 00053 * 00054 * This implementation throws an UnsupportedOperationException. 00055 */ 00056 virtual Object::Holder getResult() const; 00057 00058 /** 00059 * {@inheritDoc} 00060 * 00061 * This implementation throws an UnsupportedOperationException. 00062 */ 00063 virtual void run(); 00064 }; 00065 00066 COH_CLOSE_NAMESPACE2 00067 00068 #endif // COH_ABSTRACT_INVOCABLE_HPP