00001 /* 00002 * ExecutableClass.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_EXECUTABLE_CLASS_HPP 00017 #define COH_EXECUTABLE_CLASS_HPP 00018 00019 #include "coherence/lang/compatibility.hpp" 00020 00021 #include "coherence/lang/Class.hpp" 00022 00023 COH_OPEN_NAMESPACE2(coherence,lang) 00024 00025 /** 00026 * Interface specialization for Classes which are executable. 00027 * 00028 * An executable class includes a method compatible with the following 00029 * signature: 00030 * @code 00031 * public: static void main(ObjectArray::View vasArg); 00032 * @endcode 00033 * The class does not implement this interface, it however must be registered 00034 * with the SystemClassLoader via COH_REGISTER_EXECUTABLE_CLASS(class). 00035 * 00036 * As of Coherence 3.7.1 it is no longer necessary to register executable classes 00037 * via this interface. As an alternative the "main" method with the above 00038 * signature can be registered via any Class implementation and will be 00039 * resolved via reflection. 00040 * 00041 * @author mf 2008.10.02 00042 */ 00043 class ExecutableClass 00044 : public interface_spec<ExecutableClass> 00045 { 00046 // ----- ExecutableClass interface -------------------------------------- 00047 00048 public: 00049 /** 00050 * Execute the class. 00051 * 00052 * @param vasArg the executable argument String array 00053 */ 00054 virtual void execute(ObjectArray::View vasArg) const = 0; 00055 }; 00056 00057 COH_CLOSE_NAMESPACE2 00058 00059 #endif // COH_EXECUTABLE_CLASS_HPP