00001 /* 00002 * Copyright (c) 2000, 2020, Oracle and/or its affiliates. 00003 * 00004 * Licensed under the Universal Permissive License v 1.0 as shown at 00005 * http://oss.oracle.com/licenses/upl. 00006 */ 00007 #ifndef COH_VALUE_UPDATER_HPP 00008 #define COH_VALUE_UPDATER_HPP 00009 00010 #include "coherence/lang.ns" 00011 00012 COH_OPEN_NAMESPACE2(coherence,util) 00013 00014 00015 /** 00016 * ValueUpdater is used to update an object's state. 00017 * 00018 * @author jh 2008.02.26 00019 */ 00020 class COH_EXPORT ValueUpdater 00021 : public interface_spec<ValueUpdater> 00022 { 00023 // ----- ValueUpdater interface --------------------------------------- 00024 00025 public: 00026 /** 00027 * Update the state of the passed target object using the passed 00028 * value. 00029 * 00030 * @param hTarget the Object to update the state of 00031 * @param ohValue the new value to update the state with 00032 * 00033 * @throws ClassCastException if this ValueUpdater is incompatible with 00034 * the passed target object or the value and the 00035 * implementation <b>requires</b> the passed object or the 00036 * value to be of a certain type 00037 * @throws Exception if this ValueUpdater encounters a checked 00038 * exception in the course of updating the target object 00039 * @throws IllegalArgumentException if this ValueUpdater cannot handle 00040 * the passed target object or value for any other reason; 00041 * an implementor should include a descriptive message 00042 */ 00043 virtual void update(Object::Handle hTarget, 00044 Object::Holder ohValue) const = 0; 00045 }; 00046 00047 COH_CLOSE_NAMESPACE2 00048 00049 #endif // COH_VALUE_UPDATER_HPP