1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/prims/jvmtiManageCapabilities.hpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,87 @@ 1.4 +/* 1.5 + * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef _JAVA_JVMTI_MANAGE_CAPABILITIES_H_ 1.29 +#define _JAVA_JVMTI_MANAGE_CAPABILITIES_H_ 1.30 + 1.31 + 1.32 + 1.33 +class JvmtiManageCapabilities : public AllStatic { 1.34 + 1.35 +private: 1.36 + 1.37 + // these four capabilities sets represent all potentially 1.38 + // available capabilities. They are disjoint, covering 1.39 + // the four cases: (OnLoad vs OnLoad+live phase) X 1.40 + // (one environment vs any environment). 1.41 + static jvmtiCapabilities always_capabilities; 1.42 + static jvmtiCapabilities onload_capabilities; 1.43 + static jvmtiCapabilities always_solo_capabilities; 1.44 + static jvmtiCapabilities onload_solo_capabilities; 1.45 + 1.46 + // solo capabilities that have not been grabbed 1.47 + static jvmtiCapabilities always_solo_remaining_capabilities; 1.48 + static jvmtiCapabilities onload_solo_remaining_capabilities; 1.49 + 1.50 + // all capabilities ever acquired 1.51 + static jvmtiCapabilities acquired_capabilities; 1.52 + 1.53 + // basic intenal operations 1.54 + static jvmtiCapabilities *either(const jvmtiCapabilities *a, const jvmtiCapabilities *b, jvmtiCapabilities *result); 1.55 + static jvmtiCapabilities *both(const jvmtiCapabilities *a, const jvmtiCapabilities *b, jvmtiCapabilities *result); 1.56 + static jvmtiCapabilities *exclude(const jvmtiCapabilities *a, const jvmtiCapabilities *b, jvmtiCapabilities *result); 1.57 + static bool has_some(const jvmtiCapabilities *a); 1.58 + static void update(); 1.59 + 1.60 + // init functions 1.61 + static jvmtiCapabilities init_always_capabilities(); 1.62 + static jvmtiCapabilities init_onload_capabilities(); 1.63 + static jvmtiCapabilities init_always_solo_capabilities(); 1.64 + static jvmtiCapabilities init_onload_solo_capabilities(); 1.65 + 1.66 +public: 1.67 + static void initialize(); 1.68 + 1.69 + // may have to adjust always capabilities when VM initialization has completed 1.70 + static void recompute_always_capabilities(); 1.71 + 1.72 + // queries and actions 1.73 + static void get_potential_capabilities(const jvmtiCapabilities *current, 1.74 + const jvmtiCapabilities *prohibited, 1.75 + jvmtiCapabilities *result); 1.76 + static jvmtiError add_capabilities(const jvmtiCapabilities *current, 1.77 + const jvmtiCapabilities *prohibited, 1.78 + const jvmtiCapabilities *desired, 1.79 + jvmtiCapabilities *result); 1.80 + static void relinquish_capabilities(const jvmtiCapabilities *current, 1.81 + const jvmtiCapabilities *unwanted, 1.82 + jvmtiCapabilities *result); 1.83 + static void copy_capabilities(const jvmtiCapabilities *from, jvmtiCapabilities *to); 1.84 + 1.85 +#ifndef PRODUCT 1.86 + static void print(const jvmtiCapabilities* caps); 1.87 +#endif 1.88 +}; 1.89 + 1.90 +#endif /* _JAVA_JVMTI_MANAGE_CAPABILITIES_H_ */